snowdej
03-17-2010, 04:44 PM
Hi
I have tried (in vain) to create a file maintenance program and it never works, the SQL precompile fails saying
SQL0312 30 253 Position 10 Variable SINGLERECORD not defined or not usable.
The code snippet is shown here , D spec first
0029.00 d singleRecord e ds extname(CLIENTS)
The sub procedure.....
p LoadRecordsToArray...
p b
d pi
/free
BuildSQLStatement(RECORDDATA);
Exec SQL prepare alldata from :stmt;
if sqlstt<>STOP;
Exec SQL declare csr001 scroll cursor for alldata;
Exec SQL open csr001;
if post_Start<>0;
Exec sql fetch relative :post_Start from csr001 into :singleRecord;
endif;
Exec sql fetch next from csr001 into :singleRecord;
dow sqlcod=0 and count<post_Limit;
count+=1;
recordArray(count)=singleRecord;
Exec sql fetch next from csr001 into :singleRecord;
enddo;
endif;
return;
/end-free
p e
Any ideas?
I have tried (in vain) to create a file maintenance program and it never works, the SQL precompile fails saying
SQL0312 30 253 Position 10 Variable SINGLERECORD not defined or not usable.
The code snippet is shown here , D spec first
0029.00 d singleRecord e ds extname(CLIENTS)
The sub procedure.....
p LoadRecordsToArray...
p b
d pi
/free
BuildSQLStatement(RECORDDATA);
Exec SQL prepare alldata from :stmt;
if sqlstt<>STOP;
Exec SQL declare csr001 scroll cursor for alldata;
Exec SQL open csr001;
if post_Start<>0;
Exec sql fetch relative :post_Start from csr001 into :singleRecord;
endif;
Exec sql fetch next from csr001 into :singleRecord;
dow sqlcod=0 and count<post_Limit;
count+=1;
recordArray(count)=singleRecord;
Exec sql fetch next from csr001 into :singleRecord;
enddo;
endif;
return;
/end-free
p e
Any ideas?