Stored Procedures Informix SPL (status-var ?)
Posted in 1999
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
Hi, Does somebody have any information concerning Informix-SPL. I have only one question: i want to check in a stored procedure if a SQL-Select has returned rows or not ! the informix-hotline couldn`t help me. is there a status-var which i can evaluate. In ESQL/C or 4GL there are SQLCODE and STATUS or something like that. please email to :mailto:ingo@strauss-in.com i will later post a solution. thanxs to all
Ingo Trapphagen wrote: > > Hi, > > Does somebody have any information concerning Informix-SPL. > I have only one question: > > i want to check in a stored procedure if a SQL-Select has returned rows > or not ! > the informix-hotline couldn`t help me. is there a status-var which i can > evaluate. > In ESQL/C or 4GL there are SQLCODE and STATUS or something like that. Do you mean you want to know if a query executed by the procedure itself has returned any rows? How about: LET count=0; FOREACH SELECT ......; LET count = count + 1; ..... RETURN .... WITH RESUME; END FOREACH; IF (count == 0) THEN ..... ELSE ..... END IF; RETURN .....; END PROCEDURE Art S. Kagel
Ingo Trapphagen <ingo@strauss-in.com> schrieb in im Newsbeitrag: 38560835.D8818EBE@strauss-in.com... > Hi, > > Does somebody have any information concerning Informix-SPL. > I have only one question: > > i want to check in a stored procedure if a SQL-Select has returned rows > or not ! > the informix-hotline couldn`t help me. is there a status-var which i can > evaluate. > In ESQL/C or 4GL there are SQLCODE and STATUS or something like that. > > please email to :mailto:ingo@strauss-in.com > > i will later post a solution. > I am interested in this, too. Had the same problem a few days ago. It helped me to do a count(*) select before. If that select returns zero rows it is like sqlca.sqlcode == 100. I tried with "on exception write the errorcode to a variable", then asking the value of this variable. But the value was zero always. Please post to c.d.i, too TIA Reinhard