I work with IBExpert. I want to increase column STIP by IND percent in update clause in my stored procedure PR_INDEXSTIP. For example, if input parameter will be 0.25, I need to increase my field STIP by 25%. And I think that in set clause I should to write: STIP = 1.25*STIP. So, I have this code (don’t pay attention to returns clause):
CREATE PROCEDURE PR_INDEXSTIP (IND DECIMAL (8,2)) RETURNS (RESULT INT) AS BEGIN UPDATE STUDENTS SET STIP = :STIP*(1+IND); END
I have an error in this code:
Column does not belong to referenced table. Dynamic SQL Error. SQL error code = -206. Column unknown. STIP. At line 7, column 13. ------------------------------------------- SQLCODE: -206 GDSCODE: 335544569
I can’t resolve this error. I tried to write many different code variations and I still have the error that column STIP is unknown.
Advertisement
Answer
I resolved this problem.
Code:
CREATE PROCEDURE PR_INDEXSTIP (IND DECIMAL (8,2)) RETURNS (RESULT INT) AS BEGIN UPDATE STUDENTS SET STIP = STIP*(1+:IND); END