I was wondering if anyone has information on calling SQL stored procedures from within X3 code?

SOLVED

I have a stored procedure I would like to call to populate a work table as a preprocessor to an SQL client requester. Syntax would be helpful. Thanks

SQL stored procedure call from X3

Parents
  • +1
    verified answer
    #you can check more info in the help manual on Execsql

    Local Char REQUEST(255)(2)
    Local Char BASE(1)
    BASE = '5' #for sql server
    REQUEST(0) = "DECLARE @stofcydeb NVARCHAR(5)" #any parameters that you have
    REQUEST(1) = "EXEC sp_Upd_ABC_CLASS @stofcydeb='”+ [M] VALEUR1(0) +”'"
    Execsql From BASE Sql REQUEST

    Infbox "DONE"
    Endif
    End
Reply
  • +1
    verified answer
    #you can check more info in the help manual on Execsql

    Local Char REQUEST(255)(2)
    Local Char BASE(1)
    BASE = '5' #for sql server
    REQUEST(0) = "DECLARE @stofcydeb NVARCHAR(5)" #any parameters that you have
    REQUEST(1) = "EXEC sp_Upd_ABC_CLASS @stofcydeb='”+ [M] VALEUR1(0) +”'"
    Execsql From BASE Sql REQUEST

    Infbox "DONE"
    Endif
    End
Children