dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

[Info-Ingres] Why are procedures fussy about tids? - Ingres Database

This is a discussion on [Info-Ingres] Why are procedures fussy about tids? - Ingres Database ; Hi All, I have a procedure which is fairly simple: create procedure show_x(gtt set of (id int4 not null)) as declare my_tid int4 not null; id int4 not null; msg varchar(256) not null; begin SELECT FIRST 1 tid, id INTO ...


Home > Database Forum > Other Databases > Ingres Database > [Info-Ingres] Why are procedures fussy about tids?

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-11-2008, 11:06 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default [Info-Ingres] Why are procedures fussy about tids?

Hi All,



I have a procedure which is fairly simple:

create procedure show_x(gtt set of (id int4 not null))

as

declare

my_tid int4 not null;

id int4 not null;

msg varchar(256) not null;

begin

SELECT FIRST 1 tid, id INTO :my_tid, :id FROM GTT ;

msg = 'tid: ' + varchar(my_tid) + ', id: ' + varchar(id) ;

MESSAGE msg ;

end;



However, when I attempt to load that procedure I get: E_US0836 line 1,
Column 'tid' not found in any specified table.



Now here's the funny thing...both the following work...

1. Rewrite the procedure to use tid rather than my_tid.

create procedure show_x2(gtt set of (id int4 not null))

as

declare

tid int4 not null;

id int4 not null;

msg varchar(256) not null;

begin

SELECT FIRST 1 tid, id INTO :tid, :id FROM GTT ;

msg = 'tid2: ' + varchar(tid) + ', id: ' + varchar(id) ;

MESSAGE msg ;

end;

2. Rewrite the procedure to include an extra variable declaration for
'tid', but it is not used in the procedure.

create procedure show_x3(gtt set of (id int4 not null))

as

declare

my_tid int4 not null;

tid int4 not null; /* Dummy declaration, it is not
used */

id int4 not null;

msg varchar(256) not null;

begin

SELECT FIRST 1 tid, id INTO :my_tid, :id FROM GTT ;

msg = 'tid: ' + varchar(my_tid) + ', id: ' + varchar(id) ;

MESSAGE msg ;

end;



Anyone got an explanation for that behaviour?



I'm using II 9.0.4 (a64.lnx/105)NPTL +patch12707


Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 09:42 PM.