10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise.
Eg :
Select 'Query 1 output' from dual;
Select 'Query 2 output' from dual;
I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
2. UNIX for Advanced & Expert Users
Hi Guys,
i am having .sql script which inserts data from one table to another table based on date condition, i need to pass range on based on how many number of months, for e.g
set timing on;
whenever sqlerror exit failure;
spool myscript.log append
accept start_date... (7 Replies)
Discussion started by: rohit_shinez
7 Replies
3. Shell Programming and Scripting
HI,
I am calling a stored procedure to archieve records from the DB based on a date condition. The syntax for the same is as below:
shell script - xyz.sh
sqlcmd -s<servername> -U <username> -p<password> -I <embedded SQL input file>
The contents of the Embedded SQL INput file are... (10 Replies)
Discussion started by: Rahul Raj
10 Replies
4. Shell Programming and Scripting
Hi,
i wan't to pass a shellscript variable to a sql file.
a.sql
select $field from dual;
the way i am calling this is through sqlplus
field_name="sysdate"
sqlplus -s username/password@hostname:port/servicename <<EOF
@a.sql $field_name
EOF (4 Replies)
Discussion started by: reignangel2003
4 Replies
5. Shell Programming and Scripting
Hi Gurus,
I have a request which needs to pass string into sql.
dummy code as below:
sqlplus -s user/password@instance << EOF >>output.txt
set echo off head off feed off pagesize 0 trimspool on linesize 1000 colsep ,
select emp_no, emp_name from emp
where emp_no in ('a', 'b', 'c');
exit;... (4 Replies)
Discussion started by: ken6503
4 Replies
6. Programming
Hi All ,
I am trying to pass a value from sqlplus to korn shell .
There is a table tab1 in Oracle that has a column userdate.
I need to pass the userdate to the korn shell . This is what I am doing .
VALUE=`sqlplus -silent username/password << END
set pagesize 0 feedback off verify off... (14 Replies)
Discussion started by: megha2525
14 Replies
7. Red Hat
Hi all,
Hereby wish to have your advise for below:
Main concept is
I intend to get current directory of my script file.
This script file will be copied to /etc/init.d.
A string in this copy will be replaced with current directory value.
Below is original script file:
... (6 Replies)
Discussion started by: cielle
6 Replies
8. Shell Programming and Scripting
hi all,
i am experiencing an error which i think an incorrect syntax for the where clause passing a variable was given. under is my code.
sqlplus -s ${USERNAME}/${PASSWORD}@${SID} << END1 >> $LOGFILE
whenever sqlerror exit
set serveroutput on size 1000000
declare
l_rc ... (0 Replies)
Discussion started by: ryukishin_17
0 Replies
9. Shell Programming and Scripting
Hi Guys,
I like to pass a variable to a sql file in a unix script..
I tried a below code..
var=200903
db2 -vf test.sql 200903
test.sql is as below.
select * from db2.users where quarter = $1;
Please tell me where i go wrong..
Thanks in advance,
Magesh (2 Replies)
Discussion started by: mac4rfree
2 Replies
10. Shell Programming and Scripting
Hello,
I have a csh script that creates an environment variable. I want to pass the environment variable(CURR_TABLE_DATE) to an Informix sql script. Here is the csh:
#!/bin/csh -f
setenv INFORMIXSERVER market3_tcp
setenv CURR_TABLE_DATE 20090714
set DATABASE = gm_cdr
set SQL_DIR =... (0 Replies)
Discussion started by: jwoj
0 Replies