PL/SQL (MOSC)

MOSC Banner

Newbie: need to declare variable?

edited Apr 21, 2015 10:01AM in PL/SQL (MOSC) 5 commentsAnswered ✓

Hi,

Im trying to get this code to work that I have written, but when I execute I get that var_sid is not declared, what have I missed (it complains about a missing declaration on this line: if rec.var_sid is not null then?

declare

var_sid number(6);

var_sid2 number(6);

var_sid3 number(6);

var_serial number(6);

var_event varchar(20);

   begin

   for rec in (select sid into var_sid from v$session_wait where event = 'SQL*Net message from client')

   loop

   if rec.var_sid is not null then

   begin

   select l1.sid, l2.sid 

   into var_sid2

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center