10 More Discussions You Might Find Interesting
1. Programming
Hello gurus,
I have data in one of the oracle tables as as below:
Column 1 Column 2
1 NY,NJ,CA
2 US,UK,
3 AS,EU,NA
fyi, Column 2 above has data delimited with a comma as shown.
I need a sql query the produce the below output in two columns... (5 Replies)
Discussion started by: calredd
5 Replies
2. Shell Programming and Scripting
Hi All,
In this path /home/all_files
we have follwing files and direcotries
proc_edf_sot.sql
proc_ssc_sot.sql
func_dfg_sot.sql
sot
unic
cmr
sdc
under sot directory we have other directories
sql
pas
ref
under sql directory we have
sql_sot
sql_mat (6 Replies)
Discussion started by: ROCK_PLSQL
6 Replies
3. Shell Programming and Scripting
Hi All,
How to pass date variable to a query?
I have tried the below one , but it's not working.
ost.ksh
#!/bin/ksh
v_date=$1
var=$(sqlplus -s $ORACON <<ENDOFSQL
SELECT TO_DATE('$v_date','DD-MON-YYYY'),-1) FROM DUAL;
exit;
ENDOFSQL
)
#End
I have executed as below. (7 Replies)
Discussion started by: ROCK_PLSQL
7 Replies
4. UNIX for Dummies Questions & Answers
Hi all ,
I want to pass contents from a file say f1 as arguments to a sql query which has In statement using a script
example
select * from table_1 where login in ( `cat f1`) ;
will this work or is there any other way to do it. (1 Reply)
Discussion started by: zozoo
1 Replies
5. Shell Programming and Scripting
Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database.
I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :(
What should I do? I'm not sure that... (2 Replies)
Discussion started by: Kapom
2 Replies
6. Programming
Below i have the sample code. i need to pass the entire query from file or as parameter and read the results and write into a output file.
here the number of columns are unknown. some times it may be 2,3 or entire columns from the table.
read all the column results and write into a comma... (0 Replies)
Discussion started by: laknar
0 Replies
7. 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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
Please help. I got these error. I'm try to pass variable extract from data-file.txt to sql file(select.sql).
cat: cannot open select
cat: cannot open *
cat: cannot open from
cat: cannot open user
cat: cannot open where
cat: cannot open name=$list;
#!/bin/bash
list=`sed q... (3 Replies)
Discussion started by: killboy
3 Replies
10. Shell Programming and Scripting
Can any one help me how to pass the value of result of one query to another query.
I to pass the value of result of 'select max(id) from a' into another query
like
update table
set col =<value from last query>
where ....;
updatestaging()
{
xx=`$ORACLE_HOME/bin/sqlplus -s... (1 Reply)
Discussion started by: u263066
1 Replies