Executing informix queries using isqlrf


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Executing informix queries using isqlrf
# 1  
Old 11-01-2010
Executing informix queries using isqlrf

Hi,
I have my informix queries in files named sql1.sql and sql2.sql.
I am executing these queries in a remote informix db server.The data got as a result of executing sql1.sql and sql2.sql is got in file1.dat and file2.dat respectively.

Code:
cmd= ssh "$USER_NAME"@"$HOST_NAME" "export INFORMIXDIR=/informix; export INFORMIXSERVER="$INFORMIX_SERVER" ;
export LD_LIBRARY_PATH=/informix/lib:/informix/lib/esql;
if [ -d "$REMOTE_DIR"/datafiles ]
then
rm -R "$REMOTE_DIR"/datafiles;
mkdir "$REMOTE_DIR"/datafiles;
chmod 777 "$REMOTE_DIR"/datafiles;
fi;
/informix/bin/isqlrf "$DB_ENGINE" - <<EOFSQL
unload to '"$REMOTE_DIR"/datafiles/file1.dat' `cat sqlfiles/sql1.sql`;
unload to '"$REMOTE_DIR"/datafiles/file2.dat' `cat sqlfiles/sql2.sql`;
EOFSQL"
`${cmd}`

Question 1: Is There any way to move the datafiles (file1.dat and file2.dat) to my local directory within this ssh session.
Question 2: How to print statements within isqlrf.Is there anything like "PROMPT" in sqlplus?
Thanks in advance

Last edited by Scott; 11-01-2010 at 08:25 AM.. Reason: Please use code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue on executing db2 queries through shell script

hi i am trying to execute db2 queries through shell script. it's working fine but for few queries is not working ( those queries are taking time so the script is not waiting to get the complete the execution of that query ) could you please any one help me on this is there any wait... (1 Reply)
Discussion started by: bhaskar v
1 Replies

2. Shell Programming and Scripting

Executing Multiple Queries in parallel in Shell

I have n number of SQL queries needs to executed in Shell. Result of this query need to assign in a variable. Once all the queries are executed script needs to exit. Sample Query: SQL 1: Select Count(*) from TABLE GROUP BY COL1,COL2 SQL 2: Select Count(*) from TABLE GROUP BY COL1,COL2 ... (2 Replies)
Discussion started by: Niranjancse
2 Replies

3. Red Hat

Reading csv and executing queries

hi all, i have a csv file in which some queries are there and through a shell script i am reading and trying to excute them but it is not working properly my csv file is like this Tid,table,query,values 1,PRD_FRG_FILE_JRNL,SELECT SWI_ID,FT_SWI 2,PRD_FRG_FILE_JRNL,SELECT COUNT(1),1 ... (2 Replies)
Discussion started by: ramsavi
2 Replies

4. Shell Programming and Scripting

Executing set of sql queries from shell script

Hi All, I tried executing set of queries from shell script but not able to capture the input query in the log file. The code looks something similar to below sqlplus user/pwd@dbname << EOF > output.log $(<inputfile.txt) EOF The above code is capturing the output of queries into... (9 Replies)
Discussion started by: loggedin.ksh
9 Replies

5. UNIX and Linux Applications

Scripts for Informix

Hello, I want to write a ksh script to connect to a remote Informix DB and insert rows. I understand from the various threads that isql is the most popular choice and that it can be done. I'm new to both scripting and Informix and have some questions - 1) Does isql have listener/ tnsnames files... (1 Reply)
Discussion started by: zcanji
1 Replies

6. UNIX for Dummies Questions & Answers

Sh Shell Script executing remote SQL queries

Hi there folks, I am trying to execute remote sql queries on an Oracle server. I would like to save the result of the executed sql queries on a text file, and send that text file as an attachment to an email address. Could anyone give me an idea on how the above could be achieved? Any help... (2 Replies)
Discussion started by: Javed
2 Replies

7. SCO

Media for Informix 4.1

HI ! I NEED A MEDIA TO INSTALLING INFORMIX 4.1 IN SCO UNIX. OUR MEDIA ARE LOST AND THE SERVER IS GOING BAD ! HELP ME PLEASE ! THANK YOU VERY MUCH ! (5 Replies)
Discussion started by: tomribeiro
5 Replies

8. Programming

Executing an .ec program in different informix versions

Hi all, I tried writing an .ec program connecting to informix database from solaris platform Sun 5.7 informix version that i had to used when i compiled the program was 9.21.UC3 the binary when i ported solaris box with informix version 9.40.UC5 i am unable to run that i am encountering... (0 Replies)
Discussion started by: matrixmadhan
0 Replies

9. UNIX for Dummies Questions & Answers

Informix

Hi there thanks for checking in. Would you know where i should go to find a Informix tutorial In html. Thanks in advance. (1 Reply)
Discussion started by: nemex
1 Replies

10. UNIX for Dummies Questions & Answers

Informix server

Hi, Just installed solaris Does anyone know where I can download Informix server for Unix thanks, (1 Reply)
Discussion started by: Mike1
1 Replies
Login or Register to Ask a Question