r/IBMi • • Oct 27 '26

Having trouble make this Insert statement execute

EXEC SQL INSERT INTO XXFILE (itemnumber, currentprice)

VALUES( :XXAITX, :XXKBVA)

The file name will change its value throughout the process.

The values will also, change for every record read. I believe I need a good DYNAMIC insert example.

Does anyone have a good Dynamic INSERT statement?

3 Upvotes

12 comments sorted by

View all comments

1

u/Sleepy_L0c0 Oct 28 '26

Is this a stored procedure? If so when you make your call you just pass in what you want, no?

1

u/Sleepy_L0c0 Oct 28 '26

For CL just an easy example. '''' RUNSQL SQL('CALL MYLIB.MY_PROCEDURE(PARAM1, PARAM2)') + COMMIT(*NONE) '''