Re: unload in esql
Posted in 1993
Dave Snyder writes: |> 1) If memory serves me, the unload/load commands can be handled by the |> back-end. Therefore, the following should work: |> |> main() |> { |> $char *scratch; |> |> scratch = "unload to xxtmp.unl select * from xxtmp"; |> $prepare xx_stmt from $scratch; |> $execute xx_stmt; |> } |> This is wrong. Load/unload are actually front-end library routines (which is why they are not in esql/c). The functions themselves are _ffload() and _ffunload(), which are found in the library libnforms.a (which does not come with esql/c). Now, should you happen to have libnforms.a lying about, you could always just link it in and make the call to _ffload() and _ffunload() yourself. Their usage (as anyone could derive from looking at the .ec file generated when you c4gl a 4gl program containing a load or unload stmt) is: _ffload(filename, delimiter, insert_stmt) char *filename; char *delimiter; char *insert_stmt; _ffunload(filename, delimiter, slct_stmt) char *filename; char *delimiter; char *slct_stmt; If you want to use DBDELIMITER or the default delimiter, you can supply (char *)0 for the delimiter argument. Needless to say, using these functions is completely unsupported so if you have any problems don't bother calling for support. And don't mention where you heard about them ;-). Dave Disclaimer: These opinions are not those of Informix Software, Inc. ************************************************************************** "I look back with some satisfaction on what an idiot I was when I was 25, but when I do that, I'm assuming I'm no longer an idiot." - Andy Rooney