Computing.Net > Forums > OpenVMS > sql in command script???

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

sql in command script???

Reply to Message Icon

Name: geekhead83
Date: June 27, 2005 at 04:22:21 Pacific
OS: in 2000
CPU/Ram: p4, 256 mb
Comment:

Hi,

I'd like to run a SQL quey on the ingres database on openvms through a command script. So that I can un this command script as a job weekly and email the results file to specific users?

Is there any way to do this?
Please let me know.

thanks,
geek.




Sponsored Link
Ads by Google

Response Number 1
Name: Joseph.Huber
Date: June 27, 2005 at 05:06:25 Pacific
Reply:

i don't know specifically Ingres, but there should be something similar than in Oracle:
The "start somefile" or "@somefile" in Oracle SqlPlus executes sql statements in the file.
Together with a "spool filename" it produces an output file to be mailed then.

Probably Ingres Sql reads its input from sys$input, so in DCL commandfiles simply put all sql statements behind the sql command:

$ sql user/password
spool mylisting.lis
start somesqlfile
$ if f$search("mylisting.lis").nes.""
$ then
$ mail mylisying.lis addressee


0

Response Number 2
Name: geekhead83
Date: June 27, 2005 at 22:21:28 Pacific
Reply:

I usually run sql queries by going to isql in vax.
so now i want these queries to run via a job(i.e. a command script).
so how do i go about it.

also do you mean that mylisting.lis has the sql query?


0

Response Number 3
Name: Joseph.Huber
Date: June 27, 2005 at 23:42:15 Pacific
Reply:

As I told You, I have only experience with Oracle sql, the corresponding Ingres isql You should lookup in Ingres docu.
"spool file" in Oracle sql directs the standard output (i.e. query results) to the file.
In principle scripting sql should work by putting all sql statements behind the invoking isql command:

$ isql user/password
sql statement
select from ...
...
$! dollar next DCL command=EOF for isql

If it doesn't work (if isql still reads input from the terminal), put a
$ define/user sys$command sys$input
before the $ isql .

This is how Oracle sql works, I would wonder if Ingres does not work this way.


0

Response Number 4
Name: geekhead83
Date: July 2, 2005 at 04:30:10 Pacific
Reply:

Hi,

i tried to create a job, but this is what i got in the log after running it :

$ isql databasename
E_TD001C Cannot determine user's terminal type.
Either TERM_INGRES is not defined or it is defined to nothing. Please
check that TERM_INGRES is defined correctly and restart.

E_FI1FA4 Could not initialize terminal.

%DCL-W-SKPDAT, image data (records not beginning with "$") ignored


any suggestions??


0

Response Number 5
Name: Joseph.Huber
Date: July 2, 2005 at 10:02:01 Pacific
Reply:

Well then my assumption was wrong, apparently isql requires a terminal for I/O.

Did You consider to put Your question on a CA support forum ?
http://www.ingres.com


0

Related Posts

See More



Response Number 6
Name: geekhead83
Date: July 4, 2005 at 00:23:32 Pacific
Reply:

thanks for ur help though.

i'll try that forum as well.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to OpenVMS Forum Home


Sponsored links

Ads by Google


Results for: sql in command script???

DCL script with / as parameter www.computing.net/answers/openvms/dcl-script-with-as-parameter/443.html

f4search help in DCL Script www.computing.net/answers/openvms/f4search-help-in-dcl-script/261.html

Need help in VMS with COBOL www.computing.net/answers/openvms/need-help-in-vms-with-cobol/97.html