‎2017 Jan 21 4:28 AM - edited ‎2024 Jan 21 10:05 PM
In the Standard SAP documentation for the EXEC SQL - EXECUTE it clearly states that:-
For actual parameters, you can use literals or host variables identified by a colon (:), which could also be internal tables in this case. When internal tables are used they must be standard tables without secondary table keys.
However whatever syntax I try to use I get an error when trying to call the stored procedure. this is a stored procedure in an MS SQL database.
The syntax I am using is:-
EXEC SQL.
EXECUTE PROCEDURE dbo.UpdateDeliveries ( IN :it_output )
ENDEXEC.
(IT_OUTPUT is of course a standard internal table)
That gives no syntax error but an SQL exception is raised at runtime.
My collegaue suggested I try:-
EXECUTE dbo.UpdateDelives @TblDeliveries = :it_output
Which does give a syntax error, saying that IT_OUTPUT cannot be a table.
What is the correct way to call a stored procedure with a table parameter on a MS SQL database from inside ABAP using native SQL?
Cheersy Cheers
Paul
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Well, yes, host variables can also be internal tables, but you cannot use them. The possibility of internal tables was introduced for special internal purposes. The next version of that documentation will not mention internal tables any more.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First of all thank you for getting back to me so fast. I thought you might and as always, I am very grateful for the rapid response.
I suspected that internal tables were not supported as stored parameter procedures, based on the code behaviour, despite the documentation saying otherwise.
Often the biggest difference between cultures is the sense of humour. What seems funny to one person is often meaningless to someone from another country.
I am in Australia, though from the UK by birth. We had a meeting of all the programmers today, and for light relief I put your answer above on the projector. The whole room fell about laughing, and one person almost died, he was laughing so hard he could not breathe.
As I said, you might not see what we found so funny, hopefully you will!
Cheersy Cheers
Paul
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.