Re: ODBC SQLBindParameter for string array

2014-01-28 Thread Andre
On Monday, 27 January 2014 at 14:18:17 UTC, Regan Heath wrote: Try this: // SQLCHAR is defined as ubyte SQLCHAR*[] charArr = new SQLCHAR*[](stringArr.length); foreach(i, str;stringArr){ charArr[i] = cast(SQLCHAR*) toStringz(str); // import std.string lengIndArr[i] = SQL_NTS; // Null

Re: ODBC SQLBindParameter for string array

2014-01-27 Thread Regan Heath
On Sat, 25 Jan 2014 11:05:11 -, Andre wrote: // CREATE TABLE demo(name VARCHAR(1)) // INSERT INTO demo (name) VALUES (?) string[] stringArr = ["A","B","C"]; SQLSetStmtAttr(hStmt, SQL_ATTR_PARAMSET_SIZE, cast(SQLPOINTER) stringArr.length, 0); SQLSetStmtAttr(hStmt, SQL_ATTR_PARAM_BIND_TY

ODBC SQLBindParameter for string array

2014-01-25 Thread Andre
Hi, I have some issues with the ODBC SQLBindParameter. I already achieved to add an array of integers but the scenario of writting a string array is not working. While doing the INSERT statement 3 rows are added to the database. The first row has the correct value "A". The second row has not valu