Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.
Moderators: chulett , rschirm , roy
prasson_ibm
Premium Member
Posts: 536 Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore
Post
by prasson_ibm » Fri Sep 13, 2013 2:15 am
Hi,
I am connecting to SQL Server using ODBC connection and i have requirement where i need to call package after job completes.
Code: Select all
EXEC msdb.dbo.sp_start_job @job_name = 'app.GetVisionCasaDailyExtract';
My question is can i run this in Stored Proc stage if not then which stage should i use to trigger this.
stephan.zahariev
Premium Member
Posts: 9 Joined: Sun Feb 12, 2012 11:05 am
Contact:
Post
by stephan.zahariev » Fri Sep 13, 2013 4:32 am
Hi,
You can create a sequence to invoke the job and afterwards use the "Execute Command" to run the stored procedure using the sqlcmd command.
Alternatively you can create after job subroutine to invoke the same stored procedure using the sqlcmd.
My personal preference goes to the first solution.
prasson_ibm
Premium Member
Posts: 536 Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore
Post
by prasson_ibm » Fri Sep 13, 2013 4:46 am
Hi,
Can you please tell me the full syntex to connect to seqserver from unix command prompt using sqlcmd.
When i am running this command it got failed.
Code: Select all
dsadm@ait-etl01dev:/inboundetl/dev $ sqlcmd
ksh: sqlcmd: not found.
prasson_ibm
Premium Member
Posts: 536 Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore
Post
by prasson_ibm » Fri Sep 13, 2013 5:01 am
Hi,
Can not i call it in stored procedure stage.
stephan.zahariev
Premium Member
Posts: 9 Joined: Sun Feb 12, 2012 11:05 am
Contact:
Post
by stephan.zahariev » Fri Sep 13, 2013 5:03 am
Sorry, did not noticed that you are running the job under Unix. The sqlcmd is a windows command.
Have no experience accessing the SQL Server from the Unix shell but this could work:
http://www.sqsh.org/
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Sep 13, 2013 7:14 am
prasson_ibm wrote: Can not i call it in stored procedure stage.
I would certainly think so, yes.
-craig
"You can never have too many knives" -- Logan Nine Fingers
prasson_ibm
Premium Member
Posts: 536 Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore
Post
by prasson_ibm » Fri Sep 13, 2013 1:05 pm
Hi Chullet,
Thanks I will test with stored proc stage and then post the result.
prasson_ibm
Premium Member
Posts: 536 Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore
Post
by prasson_ibm » Tue Sep 17, 2013 3:39 am
Hi Chullet,
You are right its working in SP stage but i will also try to execute it in After SQL of the ODBC stage.
I am making this topic as resolved.