[erlang-bugs] odbc:param_query

Anders Nygren anders.nygren@REDACTED
Sun May 4 21:02:15 CEST 2008


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;



More information about the erlang-bugs mailing list