chetana bhargav wrote:
Sorry that I put my question wrongly, actually my question was, if before a step function is called, can I change the value that is bounded as many times as possible, and will the Step function only consider the value that was bounded last.

Chetana,

Yes, that will work. Each call to bind replaces the value set by the previous call.

s = prepare("insert into t values (?, ?, ?)")
bind_int(s, 1, 0)
bind_int(s, 2, -1)
bind_text(s, 1, "test")
rc = step(s)
reset(s)
bind_text(s, 1, "more")
rc = step(s)

This will do two inserts. The first with values ('test', -1, NULL) and the second with values ('more', -1, NULL). The value of the first parameter is set to an integer 0 and then to a string. The third bind call replaces the 0 value. The value of the second parameter is maintained after the statement is reset, but the first parameter's value is changed. The third parameter was never bound with a value, so NULL is inserted in both rows.

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to