Hi again,
I'm sorry but I'm facing more issues with the parameters replacement in the SQL JDBC.
This is what I'm doing:
This is the Prepared SQL:
INSERT INTO S10A4EBB.XD1492BFDV.Z1OSHVLG
(SLUSER, SLDATE, SLTIME, SLSHPA, SLSHDE, SLDCID, SLDESC, SLZ1DOCN, SLFRDT, SLTODT, SLACCS, SLVALI, SLLRDE)
SELECT 'PROTELO',
(SELECT DIGITS(DECIMAL(CURRENT DATE, 8, 0)) FROM SYSIBM.SYSDUMMY1), (SELECT DIGITS(DECIMAL(CURRENT TIME, 6, 0)) FROM SYSIBM.SYSDUMMY1),
SDSHPA,
(SELECT shdesc FROM S10A4EBB.XD1492BFDV.srosha
WHERE shshpa = {{ ShipAgent_Collection.selectedItem.shipcode }}),
SDDCID, SDDESC, SDZ1DOCN, SDFRDT, SDTODT, 'IN', 'N', {{ ShipAgentInOut_NotesTextInput.value }}
FROM S10A4EBB.XD1492BFDV.z1oshd
WHERE sdshpa = {{ ShipAgent_Collection.selectedItem.shipcode }}
And this is the prepared SQL with the variables replaced:
INSERT INTO S10A4EBB.XD1492BFDV.Z1OSHVLG
(SLUSER, SLDATE, SLTIME, SLSHPA, SLSHDE, SLDCID, SLDESC, SLZ1DOCN, SLFRDT, SLTODT, SLACCS, SLVALI, SLLRDE)
SELECT 'PROTELO',
(SELECT DIGITS(DECIMAL(CURRENT DATE, 8, 0)) FROM SYSIBM.SYSDUMMY1), (SELECT DIGITS(DECIMAL(CURRENT TIME, 6, 0)) FROM SYSIBM.SYSDUMMY1),
SDSHPA,
(SELECT shdesc FROM S10A4EBB.XD1492BFDV.srosha
WHERE shshpa = D842),
SDDCID, SDDESC, SDZ1DOCN, SDFRDT, SDTODT, 'IN', 'N', Notes
FROM S10A4EBB.XD1492BFDV.z1oshd
WHERE sdshpa = D842
Son in Retool all is looking correct but then when it runs on the server it throws the following error: Use of parameter marker or NULL not valid.
I am unsure about why the variable replacement is not working.
I have replaced the variable in this statement: WHERE sdshpa = {{ ShipAgent_Collection.selectedItem.shipcode }} and the SQL still doesn't work.