Thanks Eduard, that's really helped. I have now got it to work.
Graham
Thanks Eduard,
Your help is much appreciated.
The code generated by the wizard for this parameter is below:
s err=$zf(-5,%SQLGateway,62,QHandle,5,1,$s(%SQLGateway("-uv")&&$zbitget($zversion(0),1):-8,1:1),12,0,0,-2)
s err=$zf(-5,%SQLGateway,4,QHandle)
i err=99 s lerr=$zf(-5,%SQLGateway,55,QHandle) s err=$li(lerr)
i err=99 s err=$$setStream^%apiGTW(QHandle,RawData,0,1)
I then mapped the following:
s err=$zf(-5,%SQLGateway,62,QHandle,5,1,$s(%SQLGateway("-uv")&&$zbitget($zversion(0),1):-8,1:1),12,0,0,-2)
To in my revised code. I am not sure what the -2 or the "$s(%SQLGateway("-uv")&&$zbitget($zversion(0),1):-8,1:1)" means
I then noticed that this generated the following error:
(HY104) NativeError: [0] Message: [Microsoft][ODBC SQL Server Driver]Invalid precision value
I therefore revised it to the following as I am not sure what you need to pass for these parameters for a varchar(max) datatype:
I then tried this code:
set sc = gc.PutData(hstmt, "TEXT")
However this resulted in the following error:
(HY010) NativeError: [0] Message: [Microsoft][ODBC Driver Manager] Function sequence error
I then tried this code:
set sc = gc.SetParameter(hstmt,$LB("TEXT"),2)
This worked and the value TEXT was stored in the database.
However when I pass another line of text as below the value in the database gets overwritten instead of appended to:
Do you know why this could be? Is it to do with how I have used BindParameter and that I am using SetParameter instead of PutData?
Thanks for this - I located and fixed the typo.
Regards,
Graham