Reputation: 33
Here is my command:
set serveroutput on execute killsession('7','281');
Output:
returns sh:syntax error: '(' is not expected
the execute kill session statement return this error.Why this is happening?the syntax is correct.
Upvotes: 0
Views: 36
Reputation: 938
I guess you're trying to execute a command that you should run inside sqlplus
.
In your script, write something like that:
executeMe(){
sqlplus -s "/ as sysdba" <<EOF
SET HEADING ON
SET FEEDBACK OFF
SET LINESIZE 3800
SET TRIMSPOOL ON
SET TERMOUT OFF
SET SPACE 0
SET PAGESIZE 0
set serveroutput on execute killsession('7','281');
EOF
}
#do stuff
executeMe
#do stuff
Upvotes: 0
Reputation: 9819
This might be an oracle statement that you need sqlplus to execute, not the unix shell. This isn't shell syntax.
Upvotes: 2