EXEC SQL
EXECUTE PROCEDURE proc1 ( IN :x, OUT :y )
ENDEXEC.
Из ноты 44977 - EXEC SQL: New features
Quote:
Procedure call
When you call a procedure, you specify whether the parameters are output (OUT), input (IN), or input and output (INOUT).
Syntax (in EXEC SQL - ENDEXEC brackets):
When you call a procedure, note that
the ABAP type of the actual parameter is compatible with the database type of the formal parameter.
The same rules apply here as with
the type mapping of other EXEC SQL statements (see the online documentation).
However, more complex parameter types (from some databases
for example, structures or tables in Oracle) are not supported.
If several records should be returned, some database systems (for example Informix) offer cursor processing of the result.
Syntax:
<proc_cursor> = OPEN <cursor_name> FOR <procedure>
<fetch_cursor> = FETCH NEXT <cursor_name>
<close_cursor> = CLOSE <cursor_name>
Example (here in Oracle PL/SQL syntax):
Code:
REPORT STOREDPROC_VERITAB.
DATA Y TYPE I VALUE 300.
DATA Z TYPE I.
EXEC SQL.
INSERT INTO AVERI_CLNT (CLIENT, ARG1, ARG2, ARG3)
VALUES ('000', 9, 2, 47)
ENDEXEC.
EXEC SQL.
CREATE OR REPLACE PROCEDURE PROC1 (X IN NUMBER) IS
BEGIN
UPDATE AVERI_CLNT SET ARG3 = ARG3 + X;
END;
ENDEXEC.
EXEC SQL.
CREATE OR REPLACE PROCEDURE PROC2 (X IN NUMBER, Y OUT NUMBER) IS
BEGIN
SELECT ARG3 INTO Y
FROM AVERI_CLNT
WHERE CLIENT = '000' AND ARG1 = 9 AND ARG2 = 2;
UPDATE AVERI_CLNT SET ARG3 = ARG3 - X;
END;
ENDEXEC.
EXEC SQL.
EXECUTE PROCEDURE PROC1 ( IN :Y )
ENDEXEC.
EXEC SQL.
EXECUTE PROCEDURE PROC2 ( IN :Y, OUT :Z )
ENDEXEC.
IF SY-SUBRC <> 0 OR Z <> 347.
WRITE: / 'Wrong result for EXECUTE PROCEDURE:', Z.
ENDIF.
EXEC SQL.
DROP PROCEDURE PROC1
ENDEXEC.
EXEC SQL.
DROP PROCEDURE PROC2
ENDEXEC.
Спасибо большое, буду пробовать...я когда в хелпе рылся понял что надо через Native SQL, но как это делается конкретно не нашел...возможно из-за старой версии SAPа(4.0b) или просто кривые руки
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.