Executing a procedure from the cammand line

This is a discussion on Executing a procedure from the cammand line within the PHP Language forums, part of the PHP Programming Forums category; I have a SQL command procedure, myproc.sql, containing sql statements. After I login to MySQL, how do I execute ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-14-2003
Bruce A. Julseth
 
Posts: n/a
Default Executing a procedure from the cammand line

I have a SQL command procedure, myproc.sql, containing sql statements. After
I login to MySQL, how do I execute this procedure?

mysql> ?????? what goes here???

Thanks...

Bruce


Reply With Quote
  #2 (permalink)  
Old 10-14-2003
s a n j a y
 
Posts: n/a
Default Re: Executing a procedure from the cammand line

mysql -u USERNAME -p < myproc.sql

sanjay


"Bruce A. Julseth" <bruceaj@attglobal.net> wrote in message
news:3f8b58f8_3@news1.prserv.net...
| I have a SQL command procedure, myproc.sql, containing sql statements.
After
| I login to MySQL, how do I execute this procedure?
|
| mysql> ?????? what goes here???
|
| Thanks...
|
| Bruce
|
|


Reply With Quote
  #3 (permalink)  
Old 10-14-2003
Bruce A. Julseth
 
Posts: n/a
Default Re: Executing a procedure from the cammand line

Is

mysql -u USERNAME -p < myproc.sql

the only way.

If so, then if I have two procs to execute, I would execute one of them,
then I would have to "quit" and login a second time.

I was trying to avoid this.. I was hoping I could:

Login...

C:>mysql -u abc -p

Execute the two procs from the command line

mysql>Something MyProc1.sql;
mysql>Something MyProc2.sql;

Thanks....

Bruce


"s a n j a y" <someone@somewhere.com> wrote in message
news:ujJib.1683$8x2.879303@newssrv26.news.prodigy. com...
> >

> sanjay
>
>
> "Bruce A. Julseth" <bruceaj@attglobal.net> wrote in message
> news:3f8b58f8_3@news1.prserv.net...
> | I have a SQL command procedure, myproc.sql, containing sql statements.
> After
> | I login to MySQL, how do I execute this procedure?
> |
> | mysql> ?????? what goes here???
> |
> | Thanks...
> |
> | Bruce
> |
> |
>
>



Reply With Quote
  #4 (permalink)  
Old 10-14-2003
s a n j a y
 
Posts: n/a
Default Re: Executing a procedure from the cammand line

I dont know how to do it after you go to mysql shell. But you dont relly
need to do that way. If multiple files is your problem, then you have two
options,

1. concatenate files manually and run as a single sql. or

2. do something like -
cat sql1.sql sql2.sql | mysql -u USERNAME -p

haven't tested second one, but should work.

sanjay




"Bruce A. Julseth" <bruceaj@attglobal.net> wrote in message
news:3f8b6c68_3@news1.prserv.net...
| Is
|
| mysql -u USERNAME -p < myproc.sql
|
| the only way.
|
| If so, then if I have two procs to execute, I would execute one of them,
| then I would have to "quit" and login a second time.
|
| I was trying to avoid this.. I was hoping I could:
|
| Login...
|
| C:>mysql -u abc -p
|
| Execute the two procs from the command line
|
| mysql>Something MyProc1.sql;
| mysql>Something MyProc2.sql;
|
| Thanks....
|
| Bruce
|
|
| "s a n j a y" <someone@somewhere.com> wrote in message
| news:ujJib.1683$8x2.879303@newssrv26.news.prodigy. com...
| > >
| > sanjay
| >
| >
| > "Bruce A. Julseth" <bruceaj@attglobal.net> wrote in message
| > news:3f8b58f8_3@news1.prserv.net...
| > | I have a SQL command procedure, myproc.sql, containing sql statements.
| > After
| > | I login to MySQL, how do I execute this procedure?
| > |
| > | mysql> ?????? what goes here???
| > |
| > | Thanks...
| > |
| > | Bruce
| > |
| > |
| >
| >
|
|


Reply With Quote
  #5 (permalink)  
Old 10-14-2003
Bruce A. Julseth
 
Posts: n/a
Default Re: Executing a procedure from the cammand line

Thank you..

Bruce

"s a n j a y" <someone@somewhere.com> wrote in message
news:hOLib.1731$8x2.918746@newssrv26.news.prodigy. com...
> I dont know how to do it after you go to mysql shell. But you dont relly
> need to do that way. If multiple files is your problem, then you have two
> options,
>
> 1. concatenate files manually and run as a single sql. or
>
> 2. do something like -
> cat sql1.sql sql2.sql | mysql -u USERNAME -p
>
> haven't tested second one, but should work.
>
> sanjay
>
>
>
>
> "Bruce A. Julseth" <bruceaj@attglobal.net> wrote in message
> news:3f8b6c68_3@news1.prserv.net...
> | Is
> |
> | mysql -u USERNAME -p < myproc.sql
> |
> | the only way.
> |
> | If so, then if I have two procs to execute, I would execute one of them,
> | then I would have to "quit" and login a second time.
> |
> | I was trying to avoid this.. I was hoping I could:
> |
> | Login...
> |
> | C:>mysql -u abc -p
> |
> | Execute the two procs from the command line
> |
> | mysql>Something MyProc1.sql;
> | mysql>Something MyProc2.sql;
> |
> | Thanks....
> |
> | Bruce
> |
> |
> | "s a n j a y" <someone@somewhere.com> wrote in message
> | news:ujJib.1683$8x2.879303@newssrv26.news.prodigy. com...
> | > >
> | > sanjay
> | >
> | >
> | > "Bruce A. Julseth" <bruceaj@attglobal.net> wrote in message
> | > news:3f8b58f8_3@news1.prserv.net...
> | > | I have a SQL command procedure, myproc.sql, containing sql

statements.
> | > After
> | > | I login to MySQL, how do I execute this procedure?
> | > |
> | > | mysql> ?????? what goes here???
> | > |
> | > | Thanks...
> | > |
> | > | Bruce
> | > |
> | > |
> | >
> | >
> |
> |
>
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:28 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0