Operating System - HP-UX
1748270 Members
3749 Online
108760 Solutions
New Discussion юеВ

Re: SP2-0552 error in oracle 8.1.7

 
SOLVED
Go to solution
dngaya
Advisor

SP2-0552 error in oracle 8.1.7

hello at all,
After having to create a named table my_dual, with the following order:
create table my_dual (dummy varchar2(1) primary key) organization index;
insert into my_dual been worth (' X'); by wanting to execute the order below:
select sys_context(:b2,:b1) from my_dual;
i received the follow error :
SP2-0552: Variable de lien "B1" non d├Г clar├Г e.
how i can to resolve it ?
thank for your assistan
3 REPLIES 3
Graham Cameron_1
Honored Contributor

Re: SP2-0552 error in oracle 8.1.7

You need to declare 2 pl/sql variables before you nca pass them to a function, and what you put into them depends what you are trying to pass into sys_context.

You need a pl/sql block. Create a file containing the following, and run from sqlplus:
--
set serveroutput on size 1000000
declare
b1 varchar2(32) := 'USERENV' ;
b2 varchar2(32) := 'DB_NAME' ;
c1 varchar2(64) ;
begin
select sys_context (b1, b2)
into c1
from dual ;
dbms_output.put_line(c1) ;
end ;
/
--
Hopefully that shows the principle of operation.

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Sanjay Kumar Suri
Honored Contributor

Re: SP2-0552 error in oracle 8.1.7

Can also refer the following site for more details on bind variables.
http://download-west.oracle.com/docs/cd/A91202_01/901_doc/server.901/a88827/ch35.htm#1009984

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Yogeeraj_1
Honored Contributor
Solution

Re: SP2-0552 error in oracle 8.1.7

hi,

you should define the bind variables (variable de lien) first using:
e.g.

variable b1 varchar2(10);
variable b2 varchar2(10);

before doing:
select sys_context(:b2,:b1) from my_dual;

hope this helps!

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)