dbTalk Databases Forums  

Sqlplus in Batch file.

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Sqlplus in Batch file. in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PowerOne
 
Posts: n/a

Default Sqlplus in Batch file. - 03-07-2008 , 11:01 AM






Hi,

I need a batch file to lunch sqlplus and run a statement but the login
must be in .par file like this:

sqlplus @c:\mylogin.par START @c:\mystatement.sql
exit

when I run this .bat file in CMD prompt it open a new CMD logged in
Sqlplus but it does not the Statement specified.
What I'm doing wrong?

Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: Sqlplus in Batch file. - 03-07-2008 , 11:37 AM






PowerOne wrote:
Quote:
Hi,

I need a batch file to lunch sqlplus and run a statement but the login
must be in .par file like this:

sqlplus @c:\mylogin.par START @c:\mystatement.sql
exit

when I run this .bat file in CMD prompt it open a new CMD logged in
Sqlplus but it does not the Statement specified.
What I'm doing wrong?
You wrote: "I need to ...."

What are you going to do if you can't do that?
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #3  
Old   
DA Morgan
 
Posts: n/a

Default Re: Sqlplus in Batch file. - 03-07-2008 , 11:37 AM



PowerOne wrote:
Quote:
Hi,

I need a batch file to lunch sqlplus and run a statement but the login
must be in .par file like this:

sqlplus @c:\mylogin.par START @c:\mystatement.sql
exit

when I run this .bat file in CMD prompt it open a new CMD logged in
Sqlplus but it does not the Statement specified.
What I'm doing wrong?
You wrote: "I need to ...."

What are you going to do if you can't do that?
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #4  
Old   
DA Morgan
 
Posts: n/a

Default Re: Sqlplus in Batch file. - 03-07-2008 , 11:37 AM



PowerOne wrote:
Quote:
Hi,

I need a batch file to lunch sqlplus and run a statement but the login
must be in .par file like this:

sqlplus @c:\mylogin.par START @c:\mystatement.sql
exit

when I run this .bat file in CMD prompt it open a new CMD logged in
Sqlplus but it does not the Statement specified.
What I'm doing wrong?
You wrote: "I need to ...."

What are you going to do if you can't do that?
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #5  
Old   
DA Morgan
 
Posts: n/a

Default Re: Sqlplus in Batch file. - 03-07-2008 , 11:37 AM



PowerOne wrote:
Quote:
Hi,

I need a batch file to lunch sqlplus and run a statement but the login
must be in .par file like this:

sqlplus @c:\mylogin.par START @c:\mystatement.sql
exit

when I run this .bat file in CMD prompt it open a new CMD logged in
Sqlplus but it does not the Statement specified.
What I'm doing wrong?
You wrote: "I need to ...."

What are you going to do if you can't do that?
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #6  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: Sqlplus in Batch file. - 03-07-2008 , 11:42 AM



On Mar 7, 11:01*am, PowerOne <salazar.wi... (AT) gmail (DOT) com> wrote:
Quote:
Hi,

I need a batch file to lunch sqlplus and run a statement but the login
must be in .par file like this:

sqlplus @c:\mylogin.par *START @c:\mystatement.sql
exit

when I run this .bat file in CMD prompt it open a new CMD logged in
Sqlplus but it does not the Statement specified.
What I'm doing wrong?
Much.

You'll need to rewrite your .bat and your .par files to look like
these examples.

.BAT file:

sqlplus /nolog @mylogin.par

mylogin.par:

connect user/pass@server
@c:\mystatement

c:\mystatement.sql:
<query here>

exit -- To exit SQL*Plus and terminate the session

Once you have this done you should see success:

c:\>run_sqlplus_script

c:\>sqlplus /nolog @myconn.par

SQL*Plus: Release 10.2.0.3.0 - Production on Fri Mar 7 11:38:28 2008

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Connected.

<query output here>

Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 -
64bit Production
With the Partitioning option
JServer Release 8.1.7.4.0 - 64bit Production

c:\


David Fitzjarrell


Reply With Quote
  #7  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: Sqlplus in Batch file. - 03-07-2008 , 11:42 AM



On Mar 7, 11:01*am, PowerOne <salazar.wi... (AT) gmail (DOT) com> wrote:
Quote:
Hi,

I need a batch file to lunch sqlplus and run a statement but the login
must be in .par file like this:

sqlplus @c:\mylogin.par *START @c:\mystatement.sql
exit

when I run this .bat file in CMD prompt it open a new CMD logged in
Sqlplus but it does not the Statement specified.
What I'm doing wrong?
Much.

You'll need to rewrite your .bat and your .par files to look like
these examples.

.BAT file:

sqlplus /nolog @mylogin.par

mylogin.par:

connect user/pass@server
@c:\mystatement

c:\mystatement.sql:
<query here>

exit -- To exit SQL*Plus and terminate the session

Once you have this done you should see success:

c:\>run_sqlplus_script

c:\>sqlplus /nolog @myconn.par

SQL*Plus: Release 10.2.0.3.0 - Production on Fri Mar 7 11:38:28 2008

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Connected.

<query output here>

Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 -
64bit Production
With the Partitioning option
JServer Release 8.1.7.4.0 - 64bit Production

c:\


David Fitzjarrell


Reply With Quote
  #8  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: Sqlplus in Batch file. - 03-07-2008 , 11:42 AM



On Mar 7, 11:01*am, PowerOne <salazar.wi... (AT) gmail (DOT) com> wrote:
Quote:
Hi,

I need a batch file to lunch sqlplus and run a statement but the login
must be in .par file like this:

sqlplus @c:\mylogin.par *START @c:\mystatement.sql
exit

when I run this .bat file in CMD prompt it open a new CMD logged in
Sqlplus but it does not the Statement specified.
What I'm doing wrong?
Much.

You'll need to rewrite your .bat and your .par files to look like
these examples.

.BAT file:

sqlplus /nolog @mylogin.par

mylogin.par:

connect user/pass@server
@c:\mystatement

c:\mystatement.sql:
<query here>

exit -- To exit SQL*Plus and terminate the session

Once you have this done you should see success:

c:\>run_sqlplus_script

c:\>sqlplus /nolog @myconn.par

SQL*Plus: Release 10.2.0.3.0 - Production on Fri Mar 7 11:38:28 2008

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Connected.

<query output here>

Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 -
64bit Production
With the Partitioning option
JServer Release 8.1.7.4.0 - 64bit Production

c:\


David Fitzjarrell


Reply With Quote
  #9  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: Sqlplus in Batch file. - 03-07-2008 , 11:42 AM



On Mar 7, 11:01*am, PowerOne <salazar.wi... (AT) gmail (DOT) com> wrote:
Quote:
Hi,

I need a batch file to lunch sqlplus and run a statement but the login
must be in .par file like this:

sqlplus @c:\mylogin.par *START @c:\mystatement.sql
exit

when I run this .bat file in CMD prompt it open a new CMD logged in
Sqlplus but it does not the Statement specified.
What I'm doing wrong?
Much.

You'll need to rewrite your .bat and your .par files to look like
these examples.

.BAT file:

sqlplus /nolog @mylogin.par

mylogin.par:

connect user/pass@server
@c:\mystatement

c:\mystatement.sql:
<query here>

exit -- To exit SQL*Plus and terminate the session

Once you have this done you should see success:

c:\>run_sqlplus_script

c:\>sqlplus /nolog @myconn.par

SQL*Plus: Release 10.2.0.3.0 - Production on Fri Mar 7 11:38:28 2008

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Connected.

<query output here>

Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 -
64bit Production
With the Partitioning option
JServer Release 8.1.7.4.0 - 64bit Production

c:\


David Fitzjarrell


Reply With Quote
  #10  
Old   
PowerOne
 
Posts: n/a

Default Re: Sqlplus in Batch file. - 03-07-2008 , 01:17 PM



On Mar 7, 12:42*pm, "fitzjarr... (AT) cox (DOT) net" <fitzjarr... (AT) cox (DOT) net> wrote:
Quote:
David Fitzjarrell
I tested and worked fine.

Thank you very much.





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.