I have the Oracle query below, but when it is executed I get an error message shown at the very bottom of this post.
I believe that the error occurs when no data for GLD is returned from the select, and then that empty/null value is attempted to be stored in TmpGLD. Is there a way to assign TmpGLD an empty string value '' if the select statement does not return a value? See line 4 below.
1 - TmpGLD is 40 characters long
2 - GLD is 36 characters long
3 sqlString := 'select GLD from (select GLD from DETAIL_INFO) where ROWNUM <= 1;
4 EXECUTE IMMEDIATE sqlString INTO TmpGLD; -- Error will occur here on this line
Error message : No data found. Cause: No data was found from the objects. There was no data from the objects which may be due to end of fetch.