Subject | Newbie on SPs: HELP ON STORED PROCEDURE |
---|---|
Author | Carol Milius |
Post date | 2005-02-01T18:58:15Z |
Hi!
I am trying to make a SP to check if the record already exists.
The SP below is something I am trying but it is not working..
I am reading de IB manuals but can not get an clear exemple..
Any coments are welcome (links too)
Best Regards,
Carol
Input: IN_FIELDNAME, IN_TABLENAME, IN_FIELDVALUE
Output: OUT_EXISTS
Var: VAR_FIELDVALUE
begin
OUT_EXISTS = 'No';
For Execute Statement
'Select ' || IN_FIELDNAME ||
' From ' || IN_TABLENAME
Into :VAR_FIELDVALUE
Do
if (VAR_FIELDVALUE = IN_FIELDVALUE) Then
OUT_EXISTS = 'Yes';
suspend;
end
I am trying to make a SP to check if the record already exists.
The SP below is something I am trying but it is not working..
I am reading de IB manuals but can not get an clear exemple..
Any coments are welcome (links too)
Best Regards,
Carol
Input: IN_FIELDNAME, IN_TABLENAME, IN_FIELDVALUE
Output: OUT_EXISTS
Var: VAR_FIELDVALUE
begin
OUT_EXISTS = 'No';
For Execute Statement
'Select ' || IN_FIELDNAME ||
' From ' || IN_TABLENAME
Into :VAR_FIELDVALUE
Do
if (VAR_FIELDVALUE = IN_FIELDVALUE) Then
OUT_EXISTS = 'Yes';
suspend;
end