Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: sql in command script???

Original Message
Name: geekhead83
Date: June 27, 2005 at 04:22:21 Pacific
Subject: sql in command script???
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.



Report Offensive Message For Removal

Response Number 1
Name: Joseph.Huber
Date: June 27, 2005 at 05:06:25 Pacific
Subject: sql in command script???
Reply: (edit)
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


Report Offensive Follow Up For Removal

Response Number 2
Name: geekhead83
Date: June 27, 2005 at 22:21:28 Pacific
Subject: sql in command script???
Reply: (edit)
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?


Report Offensive Follow Up For Removal

Response Number 3
Name: Joseph.Huber
Date: June 27, 2005 at 23:42:15 Pacific
Subject: sql in command script???
Reply: (edit)
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.


Report Offensive Follow Up For Removal

Response Number 4
Name: geekhead83
Date: July 2, 2005 at 04:30:10 Pacific
Subject: sql in command script???
Reply: (edit)
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??


Report Offensive Follow Up For Removal

Response Number 5
Name: Joseph.Huber
Date: July 2, 2005 at 10:02:01 Pacific
Subject: sql in command script???
Reply: (edit)
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


Report Offensive Follow Up For Removal

Response Number 6
Name: geekhead83
Date: July 4, 2005 at 00:23:32 Pacific
Subject: sql in command script???
Reply: (edit)
thanks for ur help though.

i'll try that forum as well.


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: sql in command script???

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC