When I code my SQL like -
STRING 'SELECT PHYS_CYCLE, DATA_RQST_ID, QUE_CONTRL_ID
'FROM DBA$DSY.DSY_PHYSIC_EXTRACT
'WHERE PHYS_CYCLE = ? FOR FETCH ONLY'
DELIMITED BY SIZE INTO WS-SQL-STATEMENT-TEXT
WITH POINTER WS-SQL-STATEMENT-LEN
END-STRING.
and then prepare the statement, it works fine.
But when I code it like
MOVE 1 TO WS-TEST-STRING-LEN
WS-SQL-STATEMENT-LEN.
MOVE SPACES TO WS-TEST-STRING-TEXT
WS-SQL-STATEMENT-TEXT
MOVE 'SELECT PHYS_CYCLE, DATA_RQST_ID, QUE_CONTRL_ID
'FROM DBA$DSY.DSY_PHYSIC_EXTRACT WHERE PHYS_CYCLE = ?
' FOR FETCH ONLY' TO WS-TEST-STRING.
STRING WS-TEST-STRING DELIMITED BY SIZE
INTO WS-SQL-STATEMENT-TEXT
WITH POINTER WS-SQL-STATEMENT-LEN
I get a -104. I need to code my program the second way because I will not know all the column names right away. I am building my select statement. Any help on how to correct this problem would be appreciated.
STRING 'SELECT PHYS_CYCLE, DATA_RQST_ID, QUE_CONTRL_ID
'FROM DBA$DSY.DSY_PHYSIC_EXTRACT
'WHERE PHYS_CYCLE = ? FOR FETCH ONLY'
DELIMITED BY SIZE INTO WS-SQL-STATEMENT-TEXT
WITH POINTER WS-SQL-STATEMENT-LEN
END-STRING.
and then prepare the statement, it works fine.
But when I code it like
MOVE 1 TO WS-TEST-STRING-LEN
WS-SQL-STATEMENT-LEN.
MOVE SPACES TO WS-TEST-STRING-TEXT
WS-SQL-STATEMENT-TEXT
MOVE 'SELECT PHYS_CYCLE, DATA_RQST_ID, QUE_CONTRL_ID
'FROM DBA$DSY.DSY_PHYSIC_EXTRACT WHERE PHYS_CYCLE = ?
' FOR FETCH ONLY' TO WS-TEST-STRING.
STRING WS-TEST-STRING DELIMITED BY SIZE
INTO WS-SQL-STATEMENT-TEXT
WITH POINTER WS-SQL-STATEMENT-LEN
I get a -104. I need to code my program the second way because I will not know all the column names right away. I am building my select statement. Any help on how to correct this problem would be appreciated.