Re: unload in ESQLC
Posted in 1997
Hari Muthuswamy wrote: > > I am trying to issue the unload statement from ESQLC. My ESQLC compiler > does not seem to like it. It says > esqlc: "preprocessor.ec", line 62: Error -33200: Invalid statement on > symbol 'unload'. > > The statement was > $unload to rptdly select * from rptdaily; > > My other Sql statements work fine. > > Can any one help me out on this. > > Thanks, > > Hari Hari, I thought somebody else would have posted this, but maybe because it's so obvious (and easy) it wasn't mentioned: :-) . . . strcpy( select_string, "SELECT field1, field2, ..." ); $PREPARE prep_sel FROM select_string; $DECLARE sel_curs CURSOR FOR prep_sel; while(1) { $FETCH sel_curs INTO var1, var2, ... if ( sqlca.sqlcode != 0 ) { $CLOSE sel_curs; $FREE sel_curs; break; } fprintf( stdout, "%s|%s|%s|\\n" var1, var2, var3 ) ; } A basic unload, and you can order the darn thing any which way you want... the details and final correct syntax are of course necessarily up to you... :-) -- Tim Schaefer \\\\|// tschaefe@mindspring.com (6 6) ------------------------oOOo---( )---o00o--------- http://www.inxutil.com