sql >> Database teknologi >  >> RDS >> Oracle

Erstat eller fjern flere tekstlinjer i Oracle Stored Procedure

Hvis det er almindelig tekst og ikke XML , så kan du blot bruge REPLACE .

For eksempel,

SQL> WITH DATA AS
  2    (SELECT '
  3  <COLLECT_PARALLELGRAMMAR1>global.grxml</COLLECT_PARALLELGRAMMAR1>
  4  <COLLECT_INPUTMODES>voice dtmf</COLLECT_INPUTMODES>
  5  <CONF_INPUTMODES>dtmf</CONF_INPUTMODES>
  6  </ROW>
  7  </properties>
  8  <?xml version="1.0"?>
  9  <properties>
 10  <ROW>
 11  <MODULE_NAME>main_menu_phone</MODULE_NAME>
 12  <MODULE_DESCRIPTION>Main Menu for Customers with silver membership</MODULE_DESCRIPTION>
 13  <MODULE_TYPE>phone</MODULE_TYPE>' str
 14    FROM dual
 15    )
 16  SELECT REPLACE(str, '</properties>
 17  <?xml version="1.0"?>
 18  <properties>', '') new_str
 19  FROM data;

NEW_STR
--------------------------------------------------------------------------------------------

<COLLECT_PARALLELGRAMMAR1>global.grxml</COLLECT_PARALLELGRAMMAR1>
<COLLECT_INPUTMODES>voice dtmf</COLLECT_INPUTMODES>
<CONF_INPUTMODES>dtmf</CONF_INPUTMODES>
</ROW>

<ROW>
<MODULE_NAME>main_menu_phone</MODULE_NAME>
<MODULE_DESCRIPTION>Main Menu for Customers with silver membership</MODULE_DESCRIPTION>
<MODULE_TYPE>phone</MODULE_TYPE>



  1. MySQL:Hvordan vælger man UTC offset og sommertid for alle tidszoner?

  2. Sådan løses fejlen system.data.sqlclient.sqlexception (0x80131904)

  3. SQLite JSON_OBJECT()

  4. Bedste måde at fejlfange INDLEDE DATA LOKAL INFIL?