cant execute sqlplus from tcshell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cant execute sqlplus from tcshell
# 1  
Old 01-24-2011
cant execute sqlplus from tcshell

Hi,
I'm having issues with executing sqlplus (silent mode) through the tcsh. (trying to save a value into a parameter...)
I assume that the issue is that there are new lines:

I tried the followings and got those errors:
Code:
set RESULT=`sqlplus -s USER/PASS@//localhost:1521/ABCD <<BLA
select * from dual;
BLA`

the result is: Unmatched `.

trying to do the command in one line doesn't work as well...

More than 10 people tried it already... but we are still left with no answer Smilie

Thanks for the help,
Ori

Last edited by Franklin52; 01-24-2011 at 04:58 AM.. Reason: Please use code tags
# 2  
Old 01-24-2011
Don't know tcshell (Csh Programming Considered Harmful) but shouldn't it be something like?
Code:
set RESULT=`sqlplus -s USER/PASS@//localhost:1521/ABCD <<BLA\
select * from dual;\
BLA`

# 3  
Old 01-24-2011
that was my assumptation as well in the beginning...
but, I got the following errors when trying to do so:

BLA: Command not found.
set: No match.
# 4  
Old 01-24-2011
Sorry, but why and what for tcsh?!
With the brillant ksh this is a way I'd do that,
but which should work with your shell too

Code:
DBRESULT=`sqlplus -s "$SQLLOGIN" << EOF
select * from dual
/
EOF
`

(whereas SQLLOGIN contains your username/passwd@db)

Quote:
BLA: Command not found.
set: No match.
whatis BLA?
whatfor is it necessary to use set?

Quote:
the result is: Unmatched `.
if this your csh 's feedback, I could imagine command-substitution is done differently than you do with putting into `blablabla` .. did that everworked with other substitutions of sqlplus..??

the original shell error message including whole terminal in-/out-put would help further interpretation..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to use for loop to execute multiple .sql files while using SQLPLUS for db connection.?

Hello , Im calling every single file inside my script like 1.sql,2.sql so on it looks so tedious. I want to replace with for loop where every file gets executed. When i use for loop im getting errorUnexpected EOF] , can anyone please help me out in this.. How i can use for loop to invoke my... (6 Replies)
Discussion started by: preethi87
6 Replies

2. Shell Programming and Scripting

How to execute 10 sql files from a folder through sqlplus in shell script?

I am new to shell scripting and i want to know how to execute the *.sql files from a folder through sqlplus in shell script and files should be execute in sequentially one by one while execution if any ORA error it has to exit from sqlplus session 1) scripts from external folder 2) logs has... (1 Reply)
Discussion started by: sreekanth Reddy
1 Replies

3. UNIX and Linux Applications

Problem on SQLplus command ""bash: sqlplus: command not found""

Hi all, i face an error related to my server ""it's running server"" when i use sqlplus command $ sqlplus bash: sqlplus: command not found the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup. i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies

4. Shell Programming and Scripting

Sqlplus error - sqlplus -s <login/password@dbname> : No such file or directory

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

5. Solaris

cannot execute sqlplus in shell script under cron

Hi, I have a bourne shell script that needs to login into sqlplus and execute a stored procedure. I need this shell script to be run under a user crontab. It works fine if run under normal shell prompt. But it gave error message in my log file when run under crontab: SQL*Plus: Release... (4 Replies)
Discussion started by: joe_x
4 Replies

6. Shell Programming and Scripting

sqlplus: cannot execute

Hi, This is the content in my .profile on a unix server, MAIL=/usr/mail/${LOGNAME:?} umask 027 #added by enRole Agent PATH=${PATH}:/opt/app/p1crm1c3/informatica/oracle/product/10.2.0 export PATH PATH=$PATH:/opt/app/p1crm1c3/informatica/oracle/product/10.2.0/network/admin/sqlnet.ora;export... (2 Replies)
Discussion started by: yohasini
2 Replies

7. UNIX and Linux Applications

how to execute multiple .sql scripts from within a shell script using sqlplus

using sqlplus I want to execute a .sql script that has dbms_output statments in rhe script. I want to write the dbms_output statements from .sql file to a log file. is this possible. thanks any help would be appreciated :wall: (1 Reply)
Discussion started by: TRS80
1 Replies

8. AIX

how can i install sqlplus and execute some sql commands

hi everybody, i am Talip, a begginner at unix based systems and i have a problem (actually, we may think myself as the problem, in this situation). i am not sure if this is the correct platform for my questions. if it is not please forgive me about this inappropriate mail. what i have: *... (2 Replies)
Discussion started by: talipk
2 Replies

9. Shell Programming and Scripting

Need to execute 2 scripts, wait, execute 2 more wait, till end of file

:cool: I need to execute a shell script to do the following: cat a file run two back ground processes using the first two values from the file wait till those background processes finish run two more background processes using the next two values from the file wait till those background... (1 Reply)
Discussion started by: halo98
1 Replies

10. Programming

crontab ..sqlplus cannot execute

i have shell script. when i run in normail mode..it run ok but when i use crontab command to set that program run in certain time it give an error. error 'SQLPLUS cannot execute' what the problem.i already set all the correct path and use both root and normal id but still cannot execute properly. (1 Reply)
Discussion started by: zikronz
1 Replies
Login or Register to Ask a Question