B4J Question [SOLVED] JRDC2 index counting

makis_best

Well-Known Member
Licensed User
Longtime User
Hi

JRDC2 server return the error
<pre> com.microsoft.sqlserver.jdbc.SQLServerException: The index 5 is out of range.</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

The index counting is like 0,1,2,3,4 or 1,2,3,4,5?

I try to run the command
B4X:
Dim cmd As DBCommand = CreateCommand("Select_Eites_ReplaseInto", Array(Main.SalesmanGID, "27FE0F2C-C765-4C3A-A1A6-97C24CF36DB4", "ΕΔΡΑ", _
    Main.SalesmanGID, Dt1, Dt1, Dt1, Dt1))

But I keep getting the same error.

My sql is
B4X:
sql.Select_Eites_ReplaseInto=SELECT * FROM (SELECT DISTINCT * FROM EGM_ANDROID_ADDRESSES \
WHERE fSalesPersonGID = ? \
UNION ALL \
SELECT DISTINCT * FROM EGM_ANDROID_ADDRESSES \
WHERE ESFITradeAccountGID = ? AND fSiteTypeCode = ? \
UNION ALL \
SELECT DISTINCT EGM_ANDROID_ADDRESSES.* FROM EGM_ANDROID_ADDRESSES \
LEFT JOIN ESFITradeDeliveryData ON ESFITradeDeliveryData.fPersonSiteGID = EGM_ANDROID_ADDRESSES.GID \
WHERE ESFITradeDeliveryData.fSalesPersonGID = ?) TFS1
WHERE (CONVERT(DATETIME, ESFITradeAccountESDModified, 101) >= CONVERT(DATETIME, ?, 101)
OR CONVERT(DateTime, ESFITradeAccountESDCreated, 101) >= CONVERT(DATETIME, ?, 101))
OR (CONVERT(DATETIME, ESDModified, 101) >= CONVERT(DATETIME, ?, 101)
OR CONVERT(DateTime, ESDCreated, 101) >= CONVERT(DATETIME, ?, 101))
 
Last edited:

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Index begins in 0
your error happens because you have a different number of "?" than the number of parameters you are actually passing.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Indexes start at 0 in b4a, b4j. I guess in all b4x products.
 
Upvote 0
Top