isql input file with multiple sql statements


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting isql input file with multiple sql statements
# 1  
Old 02-16-2009
isql input file with multiple sql statements

I've got:
isql -U $USERID -S $SERVER -D $DATABASE -i inputfile.sql -o outputfile.txt

in inputfile I have:
go
sql#1
go
sql#2
go
sql#3
go

I also tried without "go" and with";" instead which did not work
SQL statements will work if I paste them directly into the script and use EOF

Any ideas why they won't work as an input file?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regarding file input to SQL from command line

Hi friends, Need your help again to get a best approach for the below scenario. I am previously having one shell script which accepts request_id/s as the command line argument. single req_id arg= 1111 Multiple arg= 1111,2222,3333 which gets passed to the embedded sql inside to... (9 Replies)
Discussion started by: Showdown
9 Replies

2. Shell Programming and Scripting

Create SQL DML insert statements from file using AWK or similar

Hi all. This is my first post on this forum. I've previously found great help in the huge knowledgebase that is here, but this time I have not been able to find a solution to my problem. I have a large text file that looks like this: typedef struct ABC_struct_nbr1_ { char attr1; /*... (0 Replies)
Discussion started by: Yagi Uda
0 Replies

3. UNIX for Dummies Questions & Answers

SQL Script to use variable value from input file

Here is the requirement, When I run the "run file KSH (sql)", it should substitute '${pCW_Bgn_DT}' with 201120 and '${pCW_End_DT}' with 201124 Input File ---------- $ cat prevwk.dat 201124 20110711 run file KSH (sql) ------------------ In this file, I want to use the variables... (1 Reply)
Discussion started by: shanrice
1 Replies

4. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

5. Shell Programming and Scripting

Multiple if statements in script and unexpected end of file

Two things... 1) If I have an if statement that is true I want it to exit without running the rest of the file, but if it is false I want it to continue.. I just did if ; then exit else echo "" fi Can that work? I want it to exit if $1 is 0, and if not to continue running the rest of the... (1 Reply)
Discussion started by: glev2005
1 Replies

6. Shell Programming and Scripting

Remover Banner and SQL prompt from isql

Hi, I am using isql and putting the output in a file in a shell script in Linux. However in my output i am getting the banner and a SQL prompt(at the start and the end of query output) +---------------------------------------+ | Connected! | | ... (6 Replies)
Discussion started by: lifzgud
6 Replies

7. UNIX for Dummies Questions & Answers

store SQL statements and results in a file

Hello Guys... I want a small help from you guys. Actually in Oracle, we are having a utlity called spool through which can store whatever SQL statements executed and other queries and the output of those queries in a file So, similarly in Unix, if I start a session executing a number of Unix... (2 Replies)
Discussion started by: mraghunandanan
2 Replies

8. Shell Programming and Scripting

put value of multiple sql statements into unix variables

i want to use multple sql count statements and store these count values in unix variable but in one connection only i.e. in only 1 time database should be hit ,which is the main requirement. (1 Reply)
Discussion started by: sw@pnil
1 Replies

9. Solaris

bcp and isql for MS SQL Server on Solaris?

After dumping data from an Oracle database running on Solaris into a flat file, we need to run bcp and isql for MS SQL Server on the same Solaris box. Does Microsoft provide some tools that run on Unix? Thanks for your assistance. (2 Replies)
Discussion started by: tomstone_98
2 Replies

10. Solaris

Automate SQL statements

Hello, On unix side, I have written below script for taking oracle db backup. But when I tried to execute it - i could not execute the sql statements from unix. Please suggest ------------------------ $ more bkp.sh #!/bin/ksh # make sure database is shutdown cleanly sqlplus '/ as sysdba'... (3 Replies)
Discussion started by: panchpan
3 Replies
Login or Register to Ask a Question
cvm-sql(7)						 Miscellaneous Information Manual						cvm-sql(7)

NAME
cvm-sql - CVM SQL Framework QUERY SUBSTITUTION
$VAR and ${VAR} are replaced with the quoted value of the environment variable named VAR. Use the second form when VAR contains anything other than alpha-numeric or underscore (_) characters. Do not include quotes in the query. The variables account and domain contain the account and domain names given by the CVM client. $$ is replaced with a single dollar sign. QUERY RESULTS
The query must produce the following fields exactly in order. All required fields must not be null or empty. 1. Password, encrypted with crypt(3) (required) 2. Actual account name (required) 3. User ID (integer) (required) 4. Group ID (integer) (required) 5. Directory (required) 6. Real name (optional) 7. Login shell (optional) 8. Group name (optional) 9. Domain name (optional) 10. System account name (optional) 11. System account directory (optional) 12. Mailbox path (optional) DEFAULT QUERY
SELECT password, username, userid, groupid, directory, realname, shell, groupname, domain, sys_username, sys_directory FROM accounts WHERE username=$account AND domain=$domain SEE ALSO
cvm-mysql(8), cvm-pgsql(8), cvm-pwfile(8), cvm-qmail(8), cvm-unix(8), cvm-vmailmgr(8), cvm-benchclient(8), cvm-checkpassword(8), cvm-test- client(8) http://untroubled.org/cvm/cvm.html cvm-sql(7)