09-21-2008
write this in your script...
Quote:
sqlplus username/password <<EOF
select employid, name, age from tablename;
exit
EOF
if you wanna take that output in some variable..
Quote:
var=`sqlplus username/password <<EOF
select employid, name, age from tablename;
exit
EOF`
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
hi fellows,
can any body tell me how to pass unix variables to oracle
code is...
#! /bin/ksh
echo ENTER DATE VALUE's
read START_DATE END_DATE
sqlplus xyx/abc@oracle
select * from table1 where coloumn1 between $START_DATE and $END_DATE;
is this is correct way...........
Thanks in... (1 Reply)
Discussion started by: chiru
1 Replies
2. UNIX for Advanced & Expert Users
Hi to all,
I have a endday.sh file. And I execute this like "sh endday.sh" from command prompt. In endday.sh file it writes:
sqlplus temp/temp@data @run.sql&
echo $!>>pid.txt
However my aim is not to put the pid into pid.txt but I need to insert the pid into an oracle table using sqlplus.... (1 Reply)
Discussion started by: maverick1234
1 Replies
3. Shell Programming and Scripting
Hi to all,
I have a endday.sh file. And I execute this like "sh endday.sh" from command prompt. In endday.sh file it writes:
sqlplus temp/temp@data @run.sql&
echo $!>>pid.txt
However my aim is not to put the pid into pid.txt but I need to insert the pid into an oracle table using sqlplus.... (1 Reply)
Discussion started by: maverick1234
1 Replies
4. Shell Programming and Scripting
Hi
I am new to unix .I need a example program to connect oracle10g DB from shell script.The task is to connect sql from shellscript and to write a query inside to retieve some fiels.The reseult should be stored in a seperate .dat file(by using spool).
Thanks
Bala. (1 Reply)
Discussion started by: tobalajia
1 Replies
5. UNIX for Dummies Questions & Answers
hi,
I have this basic query.
I have created a new user on unix.
I have given home directory and permission through chmod to create directory stucture.
Now need to connect sqlplus. What permissions should we give, so that this works?
Any help is appreciated.
Thanks,
Neha (1 Reply)
Discussion started by: nehak
1 Replies
6. Shell Programming and Scripting
We had a requirement like we should find the user whoever logged into sqlplus through UNIX automatically.
For that we should write a script and store the result in file.
we will get that user manually by using WHO command.
can anybody help me how to trigger?
I tried many commands beyond... (1 Reply)
Discussion started by: siri_886
1 Replies
7. UNIX for Advanced & Expert Users
Hi,
I have been trying to connect to sqlplus the same way I used to do in my earlier company but I get these error messages , please suggest way out -
user name - xyzuser
schema name - xyzschema
$ sqlplus xyzuser@xyzschema
ksh: sqlplus: not found.
$ sqlplus -s xyzuser@xyzschema... (5 Replies)
Discussion started by: dhirajdsharma
5 Replies
8. Shell Programming and Scripting
I have a unix shell script that calls two Select Queries using sqlplus as shown below.
more extract.sh
result=$(sqlplus -s usr/swd@myhost_sid @/tmp/SELECT_QUERY.run)
more @/tmp/SELECT_QUERY.run
SELECT PROBLEM_TYPE, COUNT (*) FROM BATCH WHERE UPPER (STATUS) = 'NEW' AND PROB_TYPE... (1 Reply)
Discussion started by: mohtashims
1 Replies
9. Shell Programming and Scripting
i am using bash shell
Whenever i declare an array, and then using sqlplus, i am getting sqlplus error and return code 127.
IFS=","
declare -a Arr=($Variable1);
SQLPLUS=sqlplus -s "${DBUSER}"/"${DBPASS}"@"${DBASE}
echo "set head off ; " > ${SQLCMD}
echo "set PAGESIZE 0 ;" >> ${SQLCMD}... (6 Replies)
Discussion started by: arghadeep adity
6 Replies
10. UNIX for Beginners Questions & Answers
hi guys
i have a sqlplus :
sqlplus -s username/password << EOF
@mysql.sql
EOF
in mysql.sql there is a count of a table, i want to write in a variabile unix.
how can i do?
Thanks a lot
Regards
Francesco. (3 Replies)
Discussion started by: Francesco_IT
3 Replies