Posted: Mon Jul 06, 2009 2:40 pm Post subject: пытаюсь не подключаться заново если соединение уже откр
хотелось бы не подключаться заново если соединение уже открыто
такой вариант не проходит, прошу помощи:
CONSTANTS dbs TYPE dbcon-con_name VALUE 'TEST'.
DATA dbtype TYPE dbcon_dbms.
SELECT SINGLE dbms FROM dbcon INTO dbtype WHERE con_name = dbs.
IF dbtype <> 'ORA'. EXIT.
EXEC SQL.SET CONNECTION :dbs ENDEXEC. " EXEC SQL.GET CONNECTION :dbs ENDEXEC. - тоже не идет
IF sy-subrc <> 0.
TRY.
EXEC SQL.
CONNECT TO :dbs
ENDEXEC.
IF sy-subrc <> 0. RAISE EXCEPTION TYPE cx_sy_native_sql_error. ENDIF.
ENDTRY.
ENDIF.
ENDIF.
TRY.
EXEC SQL.
SET CONNECTION :con_name
ENDEXEC.
IF SY-SUBRC <> 0. " not open
EXEC SQL.
CONNECT TO :con_name "opening
ENDEXEC.
IF SY-SUBRC <> 0.
subrc = 4.
RAISE EXCEPTION TYPE cx_sy_native_sql_error.
ENDIF.
ENDIF.
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.