[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: back-sql writes binding improperly



hey

i can't sleep and i eventually found an invocation of SQLBindParameter that works. is this a bug somewhere in the odbc stuff? without this change, we get an empty string every time out of the binding. with the change, the value makes it in properly. argh.

diff -u -r1.8 add.c
--- add.c       25 Aug 2004 08:41:13 -0000      1.8
+++ add.c       25 Sep 2004 07:17:10 -0000
@@ -416,7 +416,7 @@
                                SQLBindParameter( sth, pno + 2 - po,
                                        SQL_PARAM_INPUT,
                                        SQL_C_CHAR, SQL_CHAR,
-                                       0, 0, at_val->bv_val,
+                                       at_val->bv_len, 0, at_val->bv_val,
                                        at_val->bv_len, 0 );

                                Debug( LDAP_DEBUG_TRACE,

brad

Brad Midgley wrote:
Hi

I'm trying to allow updates through back-sql. I have add_proc for
telephoneNumber defined as:

'update utahlink..educator set phone=? where teacher_id=convert(integer,?)'

Does that look ok with the parameters? param_order is 3 by the way. I have to convert(integer,?) numbers because all numbers are getting bound as varchars by freetds. (yes, it's a pain.) The update looks like:

$ ldapmodify -H ldap://iceman.uen.org -D uid=admin,dc=my,dc=uen,dc=org
-x -W -f ~/mid
modifying entry "uid=bmidgley,dc=my,dc=uen,dc=org"

$ cat mid
dn: uid=bmidgley,dc=my,dc=uen,dc=org
telephoneNumber: 801-555-5555

But then the freetds log shows that it is being executed as:

update utahlink..educator set phone='' where
teacher_id=convert(integer,'74032')

The value of the phone number is nowhere to be found in what's being executed. Any idea what happened? Which part of add.c should I look at?

Brad