02-05-2007
Unix-Sql Loop error
Hi,
I am getting the error "No matching <<", when i run the below. Is it that we can't execute SQL in a Unix loop. I am executing a SQL in a loop. Is it the EOF is written wrongly.
. /opt/app/wlsconfigv61/domains/profiles/oracleV901.profile
export DBUSER=ecdb01
set -A DBINSTANCE ECDBP01P ECDBP02P ECDBP03P ECDBP04P ECDBP05P ECDBP09P ECDBP10P ECDBP11P ECDBP12P ECDBP13P ECDBP14P ECDBP15P
SQLPLUS=${ORACLE_HOME}/bin/sqlplus
SQL_func()
{
filename=${3}
${SQLPLUS} -s $2/$3@$4 <<EOF
spool /export/home/mpdwwcz/sqlOutput/${filename}
set trimspool on
set heading off
set feedback off
set linesize 2000
set arraysize 4000
set pagesize 0
@/export/home/mpdwwcz/IICP_SH/sqlQuery.sql
spool off
exit
!EOF
exit $?
}
if [ ! -x ${SQLPLUS} ]
then
echo "ERROR: Cannot find ${SQLPLUS}. Set the environment variables ORACLE_HOME etc..."
exit -1
fi
i=0
while [ i -lt 11 ]
do
PASSWD=`/opt/app/cbs/CBSDBSecurity/Scripts/ksh/CBSGetPw ${DBINSTANCE[i]} $DBUSER`
echo "DBINSTANCE Is : ${DBINSTANCE[i]}"
echo "DBUSER Is : $DBUSER"
rm /export/home/mpdwwcz/sqlOutput/${filename}
SQL_func $SQLPLUS $DBUSER $PASSWD $DBINSTANCE[i]
i=`expr i + 1`
done
exit $?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi ,
I tried running a PL/SQL script through unix shell script.
But am getting the following error.
"Message file sp1<lang>.msb not found
Error 6 initializing SQL*Plus "
Kindly suggest.
Regards,
Samit (5 Replies)
Discussion started by: dharmesht
5 Replies
2. UNIX for Advanced & Expert Users
Hi All,
I am getting coredump error, when I try to execute Oracle SQL*Loader from Shell script in Unix environment. But SQL*Loader from local machine runs fine with same database.
SQL*Loader: Release 9.2.0.6.0 - Production on Mon Apr 23 05:23:47 2007
Copyright (c) 1982, 2002, Oracle... (3 Replies)
Discussion started by: srinivas_paluku
3 Replies
3. UNIX for Dummies Questions & Answers
Connected to oracle database
sqlplus << EOF
$CONNECTSTR
set heading off
set trimspool on
set feedback off
select ID,DATE from sysadm.TEST where VALUE = 'A' order by ID;
value_id = ID
value_date = DATE
EOF
1. Is it possible to reference the values, ID,DATE in unix shell script.
2.... (20 Replies)
Discussion started by: nandajk
20 Replies
4. UNIX for Advanced & Expert Users
When i try to run a job in unix, i am getting
sqlload error as,
sqlload : file not found.
Can any one please let me know whats the reason for this..
The PATH & ORACLE_HOME paths names are correct...
thanks
here is the script : plz hv a look
TABLE_NAME= tablename... (1 Reply)
Discussion started by: abhi_123
1 Replies
5. Shell Programming and Scripting
How do I dynamically assign the below output to unix shell variables
so I can build a menu in a shell script?
Example:
var1 = 1 var2= SYSTEM
var3 = 2 var4= UNDOTBS1
and so on, then in the shell script I can use the variables to build a menu.
set serveroutput on
declare... (2 Replies)
Discussion started by: djehres
2 Replies
6. UNIX for Dummies Questions & Answers
Hi guys,
I am new on here, I have a function in oracle that returns a specific value:
create or replace
PACKAGE BODY "CTC_ASDGET_SCHED" AS
FUNCTION FN_ASDSCHEDULE_GET
RETURN VARCHAR2
AS
BEGIN
DECLARE
ASDSchedule varchar2(6);
ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies
7. 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
8. Shell Programming and Scripting
I want to spool files from unix using a sql script that would
take values from another sql query within the KSH script..
unix loop
select order_date from date_tbl
for each order_Date i need to call this spool script with the value
sqlplus scott/tiger@order_db @/ordspool/order_date.sql... (2 Replies)
Discussion started by: vr23
2 Replies
9. Shell Programming and Scripting
Hi Gurus,
I am very new in Unix,
I have 1 script, in which I am truncating the table , then BCP the data in Sybase table, and then loading the data from sybase table to sybase table.
every thing is working fine, but the problem is with Error.
I made some hanges in my insert statement so... (1 Reply)
Discussion started by: aksar
1 Replies
10. Shell Programming and Scripting
Hi
I've gotten a plugin script that won't run. I keeps throwing an error at the following line.
for BARCODE_LINE in `cat ${TSP_FILEPATH_BARCODE_TXT} | grep "^barcode"`
do
#something
done
The error reads
... (3 Replies)
Discussion started by: jdilts
3 Replies
fcp(7D) Devices fcp(7D)
NAME
fcp - Fibre Channel protocol driver
DESCRIPTION
The fcp driver is the upper layer protocol that supports mechanisms for transporting SCSI-3 commands over Fibre Channel. The fcp driver,
which interfaces with the Sun Fibre Channel transport library fctl(7D), supports the standard functions provided by the SCSA interface.
FILES
/kernel/drv/fcp
32-bit ELF kernel driver (x86)
/kernel/drv/amd64/fcp
64-bit ELF kernel driver (x86)
/kernel/drv/sparcv9/fcp
64-bit ELF kernel driver (SPARC)
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Architecture |SPARC |
+-----------------------------+-----------------------------+
|Interface stability |Unknown |
+-----------------------------+-----------------------------+
|Availability |SUNWfcp |
+-----------------------------+-----------------------------+
SEE ALSO
prtconf(1M), driver.conf(4), fctl(7D), fp(7D), usoc(7D)
Writing Device Drivers
Fibre Channel Physical and Signaling Interface (FC-PH) ANSI X3.230: 1994
Fibre Channel Generic Services (FC-GS-2) Project 1134-D
Fibre Channel Arbitrated Loop (FC-AL) ANSI X3.272-1996
Fibre Channel Protocol for SCSI (FCP) ANSI X3.269-1996
SCSI-3 Architecture Model (SAM) Fibre Channel Private Loop SCSI Direct Attach (FC-PLDA) ANSI X3.270-1996
Fabric Loop Attachment (FC-FLA), NCITS TR-20:1998
SunOS 5.10 20 Oct 2004 fcp(7D)