SET in procedures (take 2)

Bart Pietercil bart.pietercil at gmail.com
Fri Sep 28 06:49:41 CDT 2007


I repost this since I pasted two times the same procedure. SORRYYYY!

Hi List,

please explain this:

this sp

create or replace procedure sp_php_setConnectionVariables(IN  
long_userid Long)
begin
	set @user_id = long_userid;
exception
	when others THEN
	call cm_CoreErrorHandler();
end


gives when called like this

call sp_php_setConnectionVariables(15);
select @user_id;

null in the cursor---< unexpected result

while this sp


create or replace procedure sp_php_setConnectionVariables(IN  
long_userid Long)
begin
	@user_id = long_userid;
exception
	when others THEN
	call cm_CoreErrorHandler();
end

gives when called like this in VStudio

call sp_php_setConnectionVariables(15);
select @user_id;

15 in the cursor--> expected result

TIA

Bart Pietercil



More information about the Valentina mailing list