Dear Support Team,
Following code is not working in my environment.
Connect using SQLCA;
integer cmpnt_Id_var
DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA ;
PREPARE SQLSA FROM "SELECT cmpnt_Id FROM Component" ;
OPEN DYNAMIC my_cursor ;
IF SQLCA.SQLCode <> 0 THEN
MessageBox("Database Error", &
"Cannot connect to database " &
+ SQLCA.SQLErrText)
RETURN
END IF
FETCH FIRST my_cursor INTO :cmpnt_Id_var ;
CLOSE my_cursor ;
disconnect using SQLCA;
I cannot get the result value inside the variable "cmpnt_Id_var". Even it will not throw any kind of error and always I get the 0 in "cmpnt_Id_var" variable.
Could you help me what is wrong in this code?
And why case b cannot be implemented to a datastore? Why do you really need to use a cursor? What is the max number of rows this query may return?
Andreas.
I am not aware about the datastore. So I tried with Cursor. Query will return the maximum 3 rows.
Let me go with datastore to achieve my scenario.