Skip to main content

[Migrated content. Thread originally posted on 21 November 2005]

I am trying to use I$IO and the EXECUTE function to run a MSSQL stored procedure. I have looked through ACUCORP'S documentation, and searched the forum, but I could not find a working example. The ACUCORP doc states that the EXECUTE function takes two params which are System and Command. Here is my code thus far:

MOVE "EXEC sp_stored_procedure" TO SQL-COMMAND.
SET EXECUTE-FUNCTION TO TRUE.
CALL "I$IO" USING IO-FUNCTION, "MSSQL", SQL-COMMAND.

Just in case it matters, I am running a 5.2.1 runtime.

[Migrated content. Thread originally posted on 21 November 2005]

I am trying to use I$IO and the EXECUTE function to run a MSSQL stored procedure. I have looked through ACUCORP'S documentation, and searched the forum, but I could not find a working example. The ACUCORP doc states that the EXECUTE function takes two params which are System and Command. Here is my code thus far:

MOVE "EXEC sp_stored_procedure" TO SQL-COMMAND.
SET EXECUTE-FUNCTION TO TRUE.
CALL "I$IO" USING IO-FUNCTION, "MSSQL", SQL-COMMAND.

Just in case it matters, I am running a 5.2.1 runtime.
have you tried to put a x"00" at the end of the command?
This because this string is passed "as is" to the Host Database, whish ofthen requires a NULL to terminate the string.

STRING "EXEC sp_stored_procedure;" delimited by size
x"00" delimited by size
INTO SQL-COMMAND.

let us know