B4J Question [SOLVED] JRDC2 unique identifiers insert

makis_best

Well-Known Member
Licensed User
Hi

I have a client with one sqlite database who transfer data to one MSSQL Server using direct connection with #AdditionalJar: jtds-1.3.1.jar.
Inside sqlite database I have a table with values of unique identifiers in TEXT fields.
I know that if I use a command like
B4X:
Dim Qry As String
Qry = $"INSERT INTO EGM_SALES
(OrderCode, Gid, InsDate,.... ) VALUES
('${Curs1.GetString("OrderCode")}', CONVERT(UNIQUEIDENTIFIER, '${Curs1.GetString("Gid")}, '${Curs1.GetString("InsDate")}',......)
my job is done.

Now it try to do the same with JRDC2.
So my new command is like
B4X:
sql.insert_ORDER_HEADER=INSERT INTO EGM_SALES_ESFIDOCUMENTTRADE (OrderCode, Gid, InsDate, ...) \
VALUES (?, CONVERT(UNIQUEIDENTIFIER, ?), ?,...)
But I keep getting one error like
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
ResponseError. Reason: com.microsoft.sqlserver.jdbc.SQLServerException: The index 32 is out of range., Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 com.microsoft.sqlserver.jdbc.SQLServerException: The index 32 is out of range.</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /rdc. Reason:
<pre> com.microsoft.sqlserver.jdbc.SQLServerException: The index 32 is out of range.</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
</body>
</html>
Inserted Unsuccessfully!!!
Completed. Success: false
What I do wrong?
 
Last edited:

OliverA

Expert
Licensed User
You have only 31 ? in the query, but 32+ parameters that you are passing to the query
 
Top