dbTalk Databases Forums  

Running embedded SQL scripts

comp.databases.postgresql comp.databases.postgresql


Discuss Running embedded SQL scripts in the comp.databases.postgresql forum.



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

Default Running embedded SQL scripts - 04-27-2009 , 07:51 AM






When I used to use Oracle's SQL*Plus, it was possible to run SQL
scripts using the @ symbol, for example:-
@myscript.sql
and if that script referred to other embedded SQL scripts then it was
necessary to use a double @ symbol, such as:-
@@embeddedmyscript.sql
within the original script.

When I'm using the pgAdmin Query tool I would like to do something
similar.

Is that possible in pgAdmin and if so how?



Reply With Quote
  #2  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Running embedded SQL scripts - 05-05-2009 , 03:43 AM






gargoyle47 wrote:
Quote:
When I used to use Oracle's SQL*Plus, it was possible to run SQL
scripts using the @ symbol, for example:-
@myscript.sql
and if that script referred to other embedded SQL scripts then it was
necessary to use a double @ symbol, such as:-
@@embeddedmyscript.sql
within the original script.

When I'm using the pgAdmin Query tool I would like to do something
similar.

Is that possible in pgAdmin and if so how?
I know that this is not a direct answer to your question, but
I'm encouraged anyway because you mentioned SQL*Plus.

SQL*Plus is a command line interface, and its PostgreSQL
equivalent would be psql. In psql you can use the \i
command to run scripts, and you can use \i in scripts
to call other scripts.

Usually command line interfaces are more powerful with
scripts. Would it be acceptable for you to use psql?

The direct answer to your question is "I don't know" :^)

Yours,
Laurenz Albe




Reply With Quote
  #3  
Old   
gargoyle47
 
Posts: n/a

Default Re: Running embedded SQL scripts - 05-08-2009 , 02:31 AM



On May 5, 9:43*am, "Laurenz Albe" <inv... (AT) spam (DOT) to.invalid> wrote:

Quote:
Usually command line interfaces are more powerful with
...Would it be acceptable for you to use psql?
Yes, I am now using psql to run scripts, although I find the interface
a little old-fashioned.
Nevertheless, it works and I will try your suggestion.

Thanks for the update.


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.