Re: Table substitution with PRO*C Dynamic SQL
From: Joe Fulson-Woytek <joefw_at_eosdev1.gsfc.nasa.gov>
Date: 9 Jun 1993 18:09:12 GMT
Message-ID: <1v5908$j4f_at_skates.gsfc.nasa.gov>
Date: 9 Jun 1993 18:09:12 GMT
Message-ID: <1v5908$j4f_at_skates.gsfc.nasa.gov>
In article <930608181325_at_dlpc030.dlogics.com> dlm_at_dlogics.com writes:
>Good guess :) ! You can NOT substitute a bind variable for a table name.
>However, you are creating a dynamic SQL string, so why not let the C runtimes
>do the job for you:
>
> x.len = sprintf(x.arr, "select y from %s where z=430", tablename);
Good suggestion!
That's exactly what I needed to do - I got so hooked up with the bind variables and dynamic sql that I didn't consider the simple C solution.
Thanks for all who responded.
Joe Fulson-Woytek
Code 902/Goddard DAAC
NASA/Goddard Space Flight Center
joefw_at_eosdev1.gsfc.nasa.gov
Received on Wed Jun 09 1993 - 20:09:12 CEST