Thanks Scott, it was actually the DC AI and a few of the forums that appear to indicate that you could set "%String(MAXLEN = "")", but I have since updated the datatype to "%VarString" instead which I believe is the better choice.
I have now fixed my "Invalid precision value" error. Adding context below for anyone who runs into the same issue I did:
I'd started the debugging session by starting an ODBC trace, and then restarting the Business Operation. From the information I had seen online, the operation you need tracing must be restarted after the ODBC trace has been started, otherwise the trace won't be written to the ODBC .LOG file.
Once the trace had started and Business Operation restarted, I'd sent in a ORU^R01 result, processed it within my Business Operation and the same error "Invalid Precision Value" occurred.
The ODBC log file, contained the following output:
mgr" 610c-ed8 ENTER SQLBindParameter
HSTMT 0x0000020D973CB220
UWORD 8
SWORD 1 <SQL_PARAM_INPUT>
SWORD -8 <SQL_C_WCHAR>
SWORD 12 <SQL_VARCHAR>
SQLULEN 2147483647
SWORD 0
PTR 0x0000020D9AEFF5E0
SQLLEN 257
SQLLEN * 0x0000020D97055BD0
mgr" 610c-ed8 EXIT SQLBindParameter with return code -1 (SQL_ERROR)
HSTMT 0x0000020D973CB220
UWORD 8
SWORD 1 <SQL_PARAM_INPUT>
SWORD -8 <SQL_C_WCHAR>
SWORD 12 <SQL_VARCHAR>
SQLULEN 2147483647
SWORD 0
PTR 0x0000020D9AEFF5E0
SQLLEN 257
SQLLEN * 0x0000020D97055BD0With some assistance from ClaudeAI, I was able to interpret the "problematic" value was with the "SQLULEN" parameter and the ODBC driver not accepting an infinite fixed precision value for normal binding.
From reading similar posts on the forum, one suggestion was to treat the string as a LOB. To do that I'd updated my Business Operation logic so the observationtext was being written to a stream.
Set observationtextstream = ##class(%Stream.TmpCharacter).%New()
Do observationtextstream.Write(pRequest.observationtext)
Set params(8) = observationtextstream
....
Set status = ..Adapter.ExecuteProcedureParmArray(,,query,"iiiiiiiii",.params)
....
kill observationtextstream
Return statusBecause I have no need to interact with this property anywhere else, I've used the TmpCharacter stream class.
Once the logic was in place, I then restarted my BusinessOperation, resubmitted the ORU^R01 message, and the binding worked without any issue and successfully inserted the message into the table. I'm sure this approach is probably overkill, but it's the only way I've managed to get the ODBC/ObjectScript to play nicely together!
- Log in to post comments
.png)