OPENXML, sp_xml_preparedocument and sp_xml_removedocument equivalent to Oracle

Hello

I've stored in MSSQL, that must be translated to Oracle.

MS in MSSQL

CREATE PROCEDURE [dbo]. [pptChnlGrpChnl_d_xml]

"@xmlOptinChannel nvarchar (max) - < TeamProfile > < UserProfile = companyTeamID" "userID =" "/ > < / TeamProfile >


AS

DECLARE @docid int

DECLARE table (@TableOptins)

OptinChannelGroupID int,

ChannelID int

)


EXEC Sp_xml_preparedocument @docid OUT, @xmlOptinChannel

-Populate a temporary table with records of user (s) for removal

INSERT INTO @TableOptins (OptinChannelGroupID, ChannelID)

SELECT tm. OptinChannelGroupID, tm. ChannelID

OF OPENXML (@docid, "/ GroupChannels/GroupProfile")

WITH (int OptinChannelGroupID,

Int ChannelID) tm

EXEC sp_xml_removedocument @docid

Return 0

Any suggestion?

Oracle uses an object of type "XMLTYPE" appointed to represent an instance of XML document (or fragment) in the database.

An instance of XMLType can be built on a file pointer (BFILE), a BLOB, a CLOB or VARCHAR2 variable or column using the corresponding XMLType constructor.

In recent versions, Oracle recommends to use the XMLParse SQL function when dealing with an input XML string.

If the nearest equivalent to the call to sp_xml_preparedocument and sp_xml_removedocument would simply use the XMLType constructor, or the above function.

OPEN_XML more close 'equivalent' in Oracle's SQL/XML XMLTABLE standard function, which offers many more rich because it is based on the XQuery language.

In your case:

select x.OptinChannelGroupID
     , x.ChannelID
from xmltable('/GroupChannels/GroupProfile'
       passing xmlparse(document p_input_xml)
       columns OptinChannelGroupID integer path '@OptinChannelGroupID'
             , ChannelID           integer path '@ChannelID'
     ) x
;

Tags: Database

Similar Questions

  • DbDataAdapter and stored procedures with Oracle cursors,

    Because of the problems I've mentioned here ([PL/SQL stored procedure causes OracleException.. .but only sometimes | https://forums.oracle.com/forums/thread.jspa?threadID=2267290]), I am trying to replace a specific layer of data ODP.NET with the code that uses the related classes, independent provider and DbProviderFactory. Things seemed to go right up to the point where I'm trying to use a DbDataAdapter object to fill a DataSet. The stored procedure, I call looks like this...

    /* - - - - - - - - - - - - - - - - - - - - */
    PROCEDURE GET_SOME_DATA)
    IN_PARAM1 IN VARCHAR2,
    O_RESULTS TO SYS_REFCURSOR);
    /* - - - - - - - - - - - - - - - - - - - - */

    Normally, I could do something like this...

    /* - - - - - - - - - - - - - - - - - - - - */
    var adapter = new OracleDataAdapter (cmd);
    adapter. Fill (ds, cmd (OracleRefCursor). Parameters [1]. (Value);
    /* - - - - - - - - - - - - - - - - - - - - */

    .. .but that is not possible when you use DbProviderFactories since there is no equivalent of the Ref Cursor. I can use a DbDataAdapter instead of an OracleDataAdapter object, but I can't understand how to fill it with the cursor. All the examples I've seen (even the specific Oracle ones) seem to assume one is writing queries like "SELECT FOO FROM BAR" or something like that.

    Am I going about this all wrong? Or is it simply not possible to use a DbDataAdapter to fill a DataSet like this? I was really hoping to be able to use the provider-independent code I could use the System.Data.OracleClient provider with my 9i database and then switch to the Oracle. DataAccess.Client once we have upgrade to 11g. Looks like I'll have to completely replace the data layer code and references. I knew that the former was necessary, but I hope this could be managed by interfaces of independent provider with concrete implementation changed via the config and/or my IoC container.

    NOTE: I found this thread in the forums, but the posters to stop before the point at which they return the sliders and make use of them: [ODP.Net Ref Cursor and DbProviderFactory | https://forums.oracle.com/forums/thread.jspa?messageID=1278007]

    Thank you!

    I did yesterday a similar thing.

    The code was specific ODP.NET (that always, it is and should be), but I didn't rely on a reference to Oracle.DataAccess directly in my particular case:

    The code I ended up with is not very pretty, but it works.

    var refCursorType = Enum.Parse (((dynamic) plant.)) CreateParameter()). OracleDbType.GetType (), "RefCursor");
    dynamic oracleParameter4 = factory. CreateParameter();
    oracleParameter4.Direction = ParameterDirection.Output;
    var piInstance = oracleParameter4.GetType (). GetProperty ("OracleDbType");
    piInstance.SetValue (oracleParameter4, refCursorType, null);

  • Procedure of ODI with slow performance (SOURCE and TARGET are different Oracle databases)

    Hi experts,

    I have an ODI procedure but its market with slow performance (SOURCE and TARGET are different Oracle databases), you can see below.

    My question is:

    It is possible write Oracle BULK COLLECT at the 'command on the target' (below)? or

    There is a KM of ODI that perform this task below in a quick way? If so, what KM can you guys suggest me?

    I found 'Oracle Append (DBLINK) control' but I try to avoid creating the dblink database.

    ===============================================================================

    * COMMAND ON the SOURCE (* technology: ORACLE * logic diagram: ORACLE_DB_SOURCE):

    SELECT NUM_AGENCIA, NUM_CPF_CNPJ, NOM_PESSOA

    < % = OdiRef.getSchemaName ("D") % >. < % = odiRef.getOption ("P_TABELA") % >

    ===============================================================================

    *ON the COMMAND TARGET (* technology: ORACLE * logic diagram: ORACLE_DB_TARGET):

    BEGIN

    INSERT INTO DISTSOB_OWNER. DISTSOB_PESSOA (NOM_PESSOA, NUM_CPF_CNPJ, FLG_ATIVO)

    VALUES ('#NOM_PESSOA', '#NUM_CPF_CNPJ', THE FROM ');

    EXCEPTION WHEN DUP_VAL_ON_INDEX THEN

    NULL;

    END;

    ===============================================================================


    Thank you guys!

    Please use SQL for SQL command Append KM... You can delete the unnecessary steps in the KM.E.g. fi you won't create I$ table, control flow etc, then you can remove related steps.

    Please try with that.

  • Remove all lines and insert them into Oracle can make performance worse?

    I m working in a project that I need to make a batch update regularly (every 4 months) of excel files. These files have doesn´t excellent key in their ranks.

    The development of a code that deletes all lines and inserts the entire base again is easier than one who checks in all the ranks of its primary key and if necessary update. (sometimes may be a key to 5 columns).

    My question is: if I delete all the rows in the tables of the insert it again, it will cause tablespace fragmentation and in a future loss of performance?

    Is there a way to avoid this?

    Thanks in advance

    Alexander

    This response helped me a lot.

    Thank you all

    Remove all lines and insert them into Oracle can make performance worse? -Stack overflow

  • difference between the incremental update of the IKM oracle and incremental update IKM oracle (PL - SQL)

    Hello

    What is the difference between the incremental update of the IKM oracle and updated incremental IKM oracle (PL - SQL) and incremental update IKM oracle (line by line).

    Thank you

    Papai

    The only difference is that the second using plsql for incremental update. He also to manage clob issues well enough.

    If you need to know more you can read the description of each KM section.

    Incremental update IKM Oracle (PL-SQL)

    -------

    Description:

    -Knowledge integration module

    -Integrates data into an Oracle table from target in incremental update mode using PL/SQL.

    -Non-existent rows are inserted. already existing lines are updated.

    -Data can be controlled. Data invalid are isolated in the error Table and can be recycled.

    -This KM uses PL/SQL to perform the inserts and updates until and blob columns are supported. Please see the restrictions.

    -When you use this module with a source table logged, it is possible to synchronize the deletions.

    Restrictions:

    -When working with the logged data, if the "synchronize destruction of the newspaper" are executed, the lines deleted on the target are engaged

    -The data are updated even if not changed (upgrade from any (e)

    -The number of lines (number of inserts/changes) is not available because the transactions are performed using PL/SQL

    -Comparison of the data is performed using the key to update defined in the interface. It must be set.

    -L'option TRUNCATE does not work if the target table is referenced by another table (foreign key)

    -Options FLOW_CONTROL, and STATIC_CONTROL call the Module knowledge check to isolate invalid data (if no CKM is defined, an error occurs). These two options should be set to NO in the case where an integration Interface meets a TEMPORARY target data store.

    -L' FLOW_TABLE_OPTION option is set by default to NOLOGGING. Set it to a space if the interface is running on an Oracle 7 database

    -Deletions are committed regardless of the VALIDATION option

    Incremental update of the IKM Oracle

    -------------

    DESCRIPTION:

    -Integrates data into an Oracle table from target in incremental update mode.

    -Non-existent rows are inserted. already existing lines are updated.

    -Data can be controlled. Data invalid are isolated in the error Table and can be recycled.

    -When you use this module with a source table logged, it is possible to synchronize the deletions.

    REQUIREMENTS:

    -The update key defined in the interface is required.

    RESTRICTIONS:

    -When working with the logged data, if the "synchronize destruction of the newspaper" are executed, the lines deleted on the target are engaged

    -L'option TRUNCATE does not work if the target table is referenced by another table (foreign key)

    -Options FLOW_CONTROL, and STATIC_CONTROL call the Module knowledge check to isolate invalid data (if no CKM is defined, an error occurs).

    These two options should be set to NO in the case where an integration Interface meets a TEMPORARY target data store.

    -L' FLOW_TABLE_OPTION option is set by default to NOLOGGING. Set it to a space if the interface is running on an Oracle 7 database

    -Deletions are committed regardless of the VALIDATION option

    -L' ANALYZE_TARGET option will allow to assess correct statistics only if the VALIDATION is set to Yes. Otherwise, the IKM gather statistics based on old data.

    -Default UPDATE option is TRUE, which means by default it is assumed that there is at least one column nonkey specified in a target data store.

  • Primary and standby database: same Oracle version?

    Hello

    We need to create a database of pending in our new data center. The database primary is version Oracle 9.2.0.8 - but only Oracle version 9.2.0.5.0 is installed on the server for the backup site.

    Is supported by Oracle anyway? No need to say that in the version 9.2.0.5.0 can be some bugs and other problems which are already fixed in 9.2.0.8.

    Would be great if someone could provide the use with a response and a link to Oracle documentation which States: must be the same version or not.

    Any help will be appreciated!

    Rgds

    Jan

    Hello again;

    I'm sure that this note covers:

    9i Data Guard FAQ [ID 233509.1]

    I can't post the note because of my support contract.

    Best regards

    mseberg

  • How to connect Forms 6i and reports 6i with oracle 10g R2?

    Hey everybody,

    I need your help in linking the two Forms 6i and reports 6i with Oracle 10 g Release 2 db, MS Access(2003, 2007) and SQL database (Microsoft Visual Studio 2008). I am a newbie. I installed all the on my laptop HP with Windows 7 installed Ultimate(32 bit OS). I want to generate reports and forms by accessing data from databases mentioned above. Please provide me with the configuration steps.

    Thanks in advance...!

    Being new to the forum, I encourage you to consider the following before you post much more:

    http://blogs.Oracle.com/Shay/entry/10_commandments_for_the_otn_fo

    As for your question, I hope that you read my posts.

    As I mentioned, form/reports 6 is very old and operating systems, you suggested that you will use are very new. This version of F/R is obsolete and expected that it works on a new operating system is not realistic. Why are spending you time with such an old version? Even if you're just trying to learn the product, learning with an old version is probably not a good idea.

    The tnsnames.ora file, you need to update is this: c:\orant\net80\admin

    If you want to learn how to use the product in detail, you probably won't be able to do it in a forum. It is not as if we were trying to learn MS Notepad. Forms/States (and all Oracle products) are enterprise-level products. All products Oracle would require that you spend time to review documentation and in many cases attend some courses to always be effective using them. You can find documents and training in countless places, including within the site of the Oracle. I recommend that you consider that your place of departure.

    Here are some examples:

    Forms of technical documents for most of the versions:
    http://www.Oracle.com/technetwork/Developer-Tools/Forms/Overview/index.html

    11.1.2 of Documentation Forms Library:
    http://docs.Oracle.com/CD/E24269_01/index.htm

    Archived forms documentation:
    http://www.Oracle.com/technetwork/documentation/dev-arch-093406.html

    Oracle Forms - Oracle Education
    http://education.Oracle.com/pls/web_prod-PLQ-dad/db_pages.GetPage?page_id=501

    The forms and the report generator online help is also a good place for more information that in some cases, the sample code is provided.

  • How to stop and start the CEP oracle server?

    I want to start and stop the CEP oracle server without using the eclipse IDE. How can I do?

    you first need to know where the field is and then go into the directory of the server, run startwlevs.sh or stopwlevs.sh.

    for example, assuming you are using example helloworld, you are to $FMW_HOME/ocep_11.1/samples/domains/helloworld_domain and then go to the defaultserver directory to run the startwlevs.sh script

  • Roles and responsibilities of dba oracle in the development team

    What should be the role and responsibilities of dba oracle in the development team?

    Application dba should have identification information of the oracle db box on user?

    Hi, working as a Application DBA as production s/n, while the resolution of problem ALS would not apply to them. Apart from this change in the pressure of the team will be there.

    These are points to remember.
    Test Db creation for the environmental testing,
    Replication of schema of POC
    replication of the DB for the installation of the interface.
    User, space management.
    Roles and security management
    Space of prediction - this will be useful when you estimate for storage
    you will need to give application implemented for the Production DBA with correct specification.
    store schema changes
    Ensure that shas good script to provide the DBA of Production team.
    Deployment of the application.
    performance optimization...

    All the environment memory /CPU statistisc need to check at regular intervals. If issues to escalte the INFRASTRUCTURE team

    HTC

    Tippu

  • LKM and serving IKM of ORACLE and ORACLE target Source

    Hi gurus,

    My source and target is same oracle10g IE...

    I created two schemas in oracle 10g SAY schemaA and SchemaB... in the two schemas, I created a table...


    Topology Manager - physical structure - technical - oracle-, I have mentioned the two schemas and tested the connection and works fine...


    The components of knowledge that I need to use to move the data from schemaA table schemaB table...


    It is an example of data... There is not in bulk or incremental data...



    Thank you

    Deva

    Published by: user2053325 on August 30, 2010 03:08

    LKM SQL FOR ORACLE (ideal for any source of Oracle database, works very well for Oracle also)

    IKM SQL COMMAND APPEND (for the inserts only) (OR) IKM ORACLE INCREMENTAL UPDATE (Insert and Update)

    CKM ORACLE [if flow control is set to Yes in revenge for check constraints, non-Null]

  • Any attempt to create 2nd instance and links for Ingres Oracle conversion

    I have an oracle instance called ORCL which has been implemented with a DB link to the Ingres database and it market. I want to create
    a second instance using the same binaries so that am not a developer. Using DBCA I created CONVERT.

    Here was my memory is faulty as to how the first case has been implemented. I have create a db link and also the entries in the
    ORACLE_HOME\hs directory for the init.ora I have a listener clocked at it lists two instances in the sid_list...
    then, when I try to query the ingres database I get

    ORA-28500: connection between ORACLE and a non-Oracle system returned this message: name [Microsoft] [ODBC Driver Manager] Data Source is not found and no driver specified default.
    ORA-02063: preceding 2 of SDFA_INGRES lines


    My oracle database is on Windows. This is Oracle 11

    ORACLE_HOME is ORCL and CONVERT F:\apps\oracle\product\11.1.0\db_1\

    Db_2 is set up for the 2nd instance to only the redo logs and control files...

    db_1\hs has two files init... one for ORCL and CONVERT

    initsdfa_odbc.ora

    # HS init parameters

    HS_FSD_CONNECT_INFO = sdfa_odbc
    HS_FDS_TRACE_LEVEL = off


    TNSNAMES. ORA

    SDFA_ODBC = < < < this is my 2nd entry... the other is still different name... > > > > > >
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = tcp) (HOST = localhost) (PORT = 1521))
    (CONNECT_DATA =
    (SID = sdfa_odbc)
    )
    (HS = OK)
    )



    LISTENING PORT. ORA


    Under the SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = sdfa_odbc)
    (ORACLE_HOME=F:\apps\oracle\product\11.1.0\db_1) < < < binary for both... I have a db_2 for file locations
    (program = dg4odbc)
    )



    My link is public

    Create the database link public "SDFA_INGRES" connect "DBA" identified by "*".
    using 'SDFA_ODBC ';


    My pick is the instance to CONVERT as SYS...

    Select count (*) in test_table@SDFA_INGRES;

    and then I get the above error.

    What I'm missing or wrong? Can I have 2 HS services defined in a listener or a need to separate the listeners?

    Appreciate any assistance. Excuse my typos... I am on another system and can't cut and paste. So I might have
    a few typos... thank you.

    I don't know that it's a specific thing to Ingres. Maybe this helps:

    http://community.Ingres.com/wiki/How_to_Create_an_Ingres_ODBC_Data_Source_Definition

    -Andy

  • Equivalent to Oracle OBJECTPROPERTY

    Hi friends,
    I want the equivalent oracle for the following sql code,
    Select @Command = 'IF OBJECTPROPERTY(object_id('''+ @TableName + '''), ''TableHasForeignRef'') = 1
                              DELETE FROM ' + @TableName + '
                          ELSE
                              TRUNCATE TABLE ' + @TableName
    EXEC sp_MSForEachTable @Command
    I tried to find out, but no use. Please help me.
    Thank you
    RAM.

    S.Nayef wrote:
    In any case, I guess that you need like this block:

    Not really:

       SELECT COUNT ( * )
         INTO l_count
         FROM user_constraints
        WHERE table_name = l_table_name AND constraint_type = 'R' AND ROWNUM <= 1;
    

    checks if the l_table_name table has FK. We need is to find out if any other table does reference constraint on the l_table_name table. Therefore, SQL above should be replaced by something like:

    select  count(*)
      from  dba_constraints c1,
            dba_constraints c2
      where c1.owner = 
        and c1.table_name = 
        and c2.r_owner = 
    and c2.r_constraint_name = c1.constraint_name and rownum = 1 /

    SY.

  • Equivalent of Oracle DB record Simple of Transaction in SQL Server mode?

    G ' Day Experts!

    I was wondering not if Oracle DB has the functional equivalent of the 'simple' operation logging available in SQL Server?

    It would be available at the level of the schema, or it should be the entirety of an instance?

    I ask because the WebCenter Interaction portal and related services has no practical use for point-in-time restores. The Portal uses the discrete event borders which unfortunately do not map in the relational world.

    Thank you!
    Rob in Vermont

    Plumtree says:
    G ' Day Experts!

    I was wondering not if Oracle DB has the functional equivalent of the 'simple' operation logging available in SQL Server?

    It would be available at the level of the schema, or it should be the entirety of an instance?

    I ask because the WebCenter Interaction portal and related services has no practical use for point-in-time restores. The Portal uses the discrete event borders which unfortunately do not map in the relational world.

    Thank you!
    Rob in Vermont

    Hi Rob

    I guess that you are referring to the model simple recovery , IE lose everything since the last backup. Oracle, which is equivalent to running a database in NOARCHIVELOG mode. It applies to the database rather than the instance, even if you were intending probably to database when you said instance.

    Niall Litchfield
    http://www.orawin.info/

  • How to add validation to go and to date in Oracle MAF?

    Hello

    I'm trying to add validation for FROM and to this day. In the ADF, I saw the tag something like af:validateDateTimeRange . Through this block, it can be implemented in application of the ADF. But I could ' t find such label in Oracle MAF. Can you please suggest me to get this functionality?

    Kind regards

    Indana Blackburn

    Hi all

    Please note, as suggested by Amey, this can be achieved using valueChangeListener...! Click here for more details.

    Kind regards

    Indana Blackburn

  • How check today of size of rman and export size in oracle

    I need to check the sizes of rman and exports todays and length... .in Linux environment list us files with sizes .but we see oracle point of you...

    You can check the size of the last day rman backups status:

    Select DB_NAME, TO_CHAR (START_TIME, "mm/dd/yy HH24 '") start_time, TO_CHAR (END_TIME, ' Mm/dd/yy HH24') end_time, time_taken_display, STATUS,

    Round (OUTPUT_BYTES/1024/1024) BACKUP_SZ

    OF e RC_RMAN_BACKUP_JOB_DETAILS

    where start_time between sysdate-1 and sysdate

    order by 1, DB_NAME;

  • Maybe you are looking for