Check below example,
Exec Sql Declare cursor c1 for
Select fld1, fld2 from tempfile;
Exec Sql Open c1
Dow Sqlcod = 0;
Exec Sql Fetch c1 into :Outfile; // clob file
Enddo;
Problem when there are no records, the file is still created with null. Please suggest how better to handle this stop creating the file when there are no records.
Exec Sql Declare cursor c1 for
Select fld1, fld2 from tempfile;
Exec Sql Open c1
Dow Sqlcod = 0;
Exec Sql Fetch c1 into :Outfile; // clob file
Enddo;
Problem when there are no records, the file is still created with null. Please suggest how better to handle this stop creating the file when there are no records.
Comment