var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: pro*c bind variables
i'm required to optimize some previously written pro*c code. i'm new to pro*c, but very fluent in c. this segment kinda confuses me:
notice that my_int is conditionally assigned <after> it is used in the my_cursor declaration. if blah is true, will it affect results of the fetch?
int my_int = 0;
EXEC SQL DECLARE my_cursor FOR
WHERE my_col = :my_int;
my_int = 1;
EXEC SQL OPEN my_cursor;
EXEC SQL FETCH my_cursor into :blahblah;
thanks for the help.
No, you can put any value into the variables and every time you use the FETCH statement it will be changed to the database field value, ie:
i = 10; /* i value is 10 */
fetch cursor into :i; /* it changes i to the field dabase value */
printf("%d", i); /* print the value of the database field */
i = 11; /* now i = 11 */
printf("%d", i); /* print 11 */
I hope this help you.
i am afriad you completely misunderstood my question.
please review the code i posted. notice at the time of the "declare cursor" statement, my_int is 0. but at the time of the "open" and "fetch" statements, my_int could be 1. will this affect the results of the fetch?