user3418935
user3418935

Reputation: 33

execute killsession('7','281') error

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

Answers (2)

AloneInTheDark
AloneInTheDark

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

Guntram Blohm
Guntram Blohm

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

Related Questions