I am using dynamic sql method 4 to write a program that will take sql*commands from the command line. I am then embedding this file in C*shell scripts. I (like a foolish newbie) wrote over my copy of sample10.pc, the pro*c program that shows an example of using dynmic sql method 4. I think I understand method 4, but I cannot get my output formatted. I know the output comes out wrong because the embedded sql does not null terminate strings. I could null terminate the strings by mallocing one extra space and putting a null character in it, or I could use sprintf("%-*.*s ", (int)select_dp->L[i],(int)select_dp->L[i], select_dp->V[i]) to print the string into another string. But both of these still treat all data as string, which includes the spaces. I could then use sscanf to get data out of the strings, but there is know way to tell if the string will contain an integer, one word, or multiple words seperated by blanks.
Does anyone have a program that already does this?
Is there a better way to do this without using method 4?
Does anyone know where I can get another copy of sample10.pc?
If you can answer any of these questions please post or email to me.
Mike
msbaer_at_cast.msstate.edu