Page 1 of 1

Executing Two dos commands in Execute Command Activity

Posted: Thu Sep 07, 2006 3:45 am
by Xpert
Hi,

Pls anyone tell me, how to execute two DOS commands in Execute Command. One command is to move the file from one directory to another and another command is to rename that moved file by adding current date with that file name. And also i have to pass the file name by parameter.


My Scenario is,

Once the file is processed sucessfully then i have to move that file to another directory by adding processed date with that file name. Pls help me, Thnx in Advance.

Posted: Thu Sep 07, 2006 3:53 am
by ArndW
You mean something like "cd c:\temp | dir"?[/b]

Posted: Thu Sep 07, 2006 3:58 am
by kumar_s
move #Old_Pdath#\#Old_Filename# #New_Path#\#New_Filename##Date_parameter#

Posted: Thu Sep 07, 2006 4:25 am
by Xpert
kumar_s wrote:move #Old_Pdath#\#Old_Filename# #New_Path#\#New_Filename##Date_parameter# ...
Hi Kumar,

Thanx a lot......

Posted: Thu Sep 07, 2006 5:01 am
by Xpert
Xpert wrote:
kumar_s wrote:move #Old_Pdath#\#Old_Filename# #New_Path#\#New_Filename##Date_parameter# ...
Here we are hardcoding the date value by passing parameter. how to use DSJobStartDate in this condition.

Posted: Thu Sep 07, 2006 5:12 am
by kumar_s
DSJobStartDate of what? If its the for the job that produce the file, you can use UserVariable Activity or Routine activity and use the same command DSJobStartDate and pass as UserStatus.

Posted: Thu Sep 14, 2006 10:30 am
by ersunnys
kumar_s wrote:move #Old_Pdath#\#Old_Filename# #New_Path#\#New_Filename##Date_parameter# ...
I am trying to give my JOBS parameters to connect to sqlplus, but it is not connecting... can anyone help me in this...

i am using...

print "select * from tab;" | sqlplus -s #userid#/#passwd#@#domain#


please correct me if this command is wrong and tell me how to do the same.

Posted: Thu Sep 14, 2006 10:41 am
by kris007
Try this
In the Command box

Code: Select all

 sqlplus -s 
and in the Parameters box

Code: Select all

#userid#/#passwd#@#domain# && select * from tab;

Posted: Thu Sep 14, 2006 11:39 am
by ersunnys

Posted: Thu Sep 14, 2006 11:39 am
by ersunnys
kris007 wrote:Try this
In the Command box

Code: Select all

 sqlplus -s 
and in the Parameters box

Code: Select all

#userid#/#passwd#@#domain# && select * from tab;
This is not working, output is
Executed: sqlplus -s userid/passwd@domain && select * from tab;
Reply=0
Output from command ====>

SQL*Plus: Release 8.1.7.0.0 - Production on Thu Sep 14 18:27:39 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

Enter user-name:
the command is getting genrated but its not showing the output. If i hardcode the values of userid, passwd and domain, its working fine...

wht is the problem i m not getting

Posted: Thu Sep 14, 2006 12:03 pm
by kris007
sqlplus -s userid/passwd@domain && select * from tab;
I don't think you can even execute this complete statement from the command line too. What exactly are you trying to do from the execute command stage? Do you want to run a script or run some sql commands?

Posted: Thu Sep 14, 2006 12:10 pm
by ersunnys
kris007 wrote:
sqlplus -s userid/passwd@domain && select * from tab;
I don't think you can even execute this complete statement from the command line too. What exactly are you trying to do from the execute command stage? Do you want to run a script or run some sql commands?

I am able to run
print "select * from tab;" | sqlplus -s #userid#/#passwd#@#domain#
from command line...

i want to execute a single statement in the stage...

Posted: Thu Sep 14, 2006 3:02 pm
by ray.wurlod
That IS a single statement.