[erlang-bugs] [Fwd: Re: odbc:param_query]

Anders Nygren anders.nygren@REDACTED
Mon May 5 15:01:36 CEST 2008


2008/5/5 Ingela Anderton Andin <ingela@REDACTED>:
>
>
> Hi!
>
>  As a part of bigger patch (for 64 bit-odbc) I got the following change to
> param-queries in odbcserver.c. This might help your case, it would
>  be great if you could try that out for me.  I am not very found of the ODBC
> API (or the implementations of it anyway) it does surprising things
>  at times.
>

Hi Ingela
After a quick test, it looks like it is working fine with the patch.
Thanks a lot.

/Anders

>  @@ -760,6 +758,7 @@ static db_result_msg db_param_query(byte *buffer,
> db_state *state)
>         switch (param_status.param_status_array[i]) {
>         case SQL_PARAM_SUCCESS:
>         case SQL_PARAM_SUCCESS_WITH_INFO:
>  +        case SQL_PARAM_DIAG_UNAVAILABLE:
>         break;
>         default:
>             diagnos =
>
>
>  Regards Ingela - OTP team
>
>  Anders Nygren wrote:
>
> > I am having a problem with parameterized queries
> > Erlang R12B-2 on Linux (SuSE 10.3)
> > MySQL 5.0.45
> > myodbc 3.51
> > unixODBC 2.2.12
> >
> >
> > Reply = odbc:param_query(State#state.cref,
> >                             "insert into Users (userId, password, "
> >                             "userType, name) values (?,?,?,?)",
> >                             [{{sql_varchar,20},[UserId]},
> >                              {{sql_varchar,20},[Passwd]},
> >                              {{sql_char,6},[Type]},
> >                              {{sql_varchar,100},[Name]}]),
> >
> >
> > Sometimes I get {updated, 1}, but most of the time I get the following
> error
> > {error,"No SQL-driver information available."} but the data has been
> inserted.
> >
> > The table is created with
> > CREATE  TABLE IF NOT EXISTS `npas`.`Users` (
> >  `userId` VARCHAR(20) NOT NULL ,
> >  `password` VARCHAR(20) NOT NULL ,
> >  `userType` ENUM('admin','normal','read') NOT NULL ,
> >  `name` VARCHAR(100) NOT NULL ,
> >  PRIMARY KEY (`userId`) )
> > ENGINE = InnoDB
> > PACK_KEYS = 0
> > ROW_FORMAT = DEFAULT;
> > _______________________________________________
> > erlang-bugs mailing list
> > erlang-bugs@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-bugs
> >
> >
> >
>
>
>
> _______________________________________________
>  erlang-bugs mailing list
>  erlang-bugs@REDACTED
>  http://www.erlang.org/mailman/listinfo/erlang-bugs
>



More information about the erlang-bugs mailing list