Home > Archive > ASE Database forum > October 2005 > Running sql command from text file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Running sql command from text file
sam

2005-10-31, 1:23 pm

Hi Guys,
In Oracle, I could run sql command from text files
using the commnad start <filename>. I was reading the isql
docs, it has a -i option to specify the filename which works
fine but is there any other way to execute the command from
a file AFTER logging inside the sql interface. With isql, I
have to specify the filename before I login inside the DB
and suppose I run a mixture of commands from a file and
directly within isql, I have to login/logoff all each time.
Maybe there is a better way to do it that Iam not aware of.
Iam using ASE 12.5

Thanks
Bret Halford

2005-10-31, 1:23 pm

Using the ISQL client, you can use the ":r <filename>" command to read
in a file.
You can also envoke the editor "vi" and read in a script file and then
execute it.

However, unlike when you are using "-i", scripts read in with :r or vi
should not include "go" statements - they bypass the isql preparser.


There are also other clients such as SQSH that handle it a bit better.
http://www.isug.com/Sybase_FAQ/ASE/section9.html

-bret


sam wrote:

> Hi Guys,
> In Oracle, I could run sql command from text files
> using the commnad start <filename>. I was reading the isql
> docs, it has a -i option to specify the filename which works
> fine but is there any other way to execute the command from
> a file AFTER logging inside the sql interface. With isql, I
> have to specify the filename before I login inside the DB
> and suppose I run a mixture of commands from a file and
> directly within isql, I have to login/logoff all each time.
> Maybe there is a better way to do it that Iam not aware of.
> Iam using ASE 12.5
>
> Thanks


Sam

2005-10-31, 8:24 pm

Thanks, :r <filename> is what I was looking for.

> Using the ISQL client, you can use the ":r <filename>"
> command to read in a file.
> You can also envoke the editor "vi" and read in a script
> file and then execute it.
>
> However, unlike when you are using "-i", scripts read in
> with :r or vi should not include "go" statements - they
> bypass the isql preparser.
>
>
> There are also other clients such as SQSH that handle it a
> bit better.
> http://www.isug.com/Sybase_FAQ/ASE/section9.html
>
> -bret
>
>
> sam wrote:
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com