Lots of INSERT in oracle 10g

Hello,
I have a table with 10 columns, with PK on first column.
I have a script with 3000 lines only INSERTs e.g. :
Line1: INSERT INTO table VALUES(...);
Line2: INSERT INTO table VALUES(...);
Line n: ...
Line 3000: INSERT INTO table VALUES(...);
I get this problem now: First 200th-300th INSERTs are made very quickly, but from 300th to the end (3000'th insert) it become more slower.
How do i solve this problem in order that every INSERT line will take the same time ?
Thank you.

You can do this way
Example
SQL> create table ins_Demo (col1 number, col2 varchar2(10) );
Table created.
SQL>
SQL> insert all
  2          into ins_demo values ( 1, 'One')
  3          into ins_demo values ( 2, 'Two')
  4          into ins_demo values ( 3, 'Three')
  5  select * from dual ;
3 rows created.
SQL>
SQL> select * from ins_demo ;
      COL1 COL2
         1 One
         2 Two
         3 ThreeSS

Similar Messages

  • I create trigger but not display massage after insert in oracle 10g

    I create trigger but not display massage after insert in oracle 10g
    **CREATE OR REPLACE TRIGGER TableName**
    **AFTER INSERT OR DELETE OR UPDATE ON test**
    **BEGIN**
    **if inserting then**
    **dbms_output.put('Message');**
    **end if;**
    **END;**

    What user interface are you using?
    If the tool doesn't support the SQL*Plus syntax (set serveroutput on), it probably has an option somewhere to enable DBMS Output. Not even knowing what tool you're using, it's impossible for us to guess where that option might be configured.
    As others have suggested, using DBMS Output to test code is less than ideal because you're dependent on the application you're using to display it to you and not every application can or will do that. If you want to use DBMS_Output, you may need to switch to a different GUI (SQL Developer or SQL*Plus are both free utilities from Oracle). Otherwise, you'd probably be better off having the trigger do something that you can subsequently query (i.e. write a row to a log table).
    Justin

  • BLOB insertion in Oracle 10g database using ojdbc14 (10g drivers)

    Hello!
    I have a situation where I am trying to insert a blob data into oracle 10g database using oracle thin
    10g drivers, <b>ojdbc14.jar</b> in <b>weblogic 8.1 sp2</b>. I have the following error happening very intermittently.
    <u><b>java.sql.SQLException: OALL8 is in an inconsistent state.</b></u>
    And this is leading to the <u><b>"No more data to read from socket"</b></u> error when I am trying to
    insert the BLOB into the database. I have gone through the bug list of SP2 and have realised there is the
    following issue fixed in SP3.
    <b>CR124933</b>
    <b>An Oracle BLOB sometimes used a pooled connection after the connection pool determined that
    the connection was available for reassignment.
    Code was added to ensure the BLOB is completely processed before closing the pool connection or
    ending the transaction.</b>
    I believe the problem arises when we try to insert BLOB into database using a refreshed connection
    from the pool.We have upgraded weblogic 8.1 from SP2 to SP4 service pack inorder to come over the above problem.
    But this still continues to behave intermittently.
    We put ojdbc14.jar in our classpath and Weblogic startup classpath looks like the following :-
    WLS_CLASSPATH=${WLS_DOMAIN_DIR}/appslib/server.jar:$PRE_CLASSPATH:${WLS_WEBLOGIC_HOME}/server/lib/weblogic.jar:
    ${WLS_WEBLOGIC_HOME}/server/lib/ojdbc14.jar:${WLS_WEBLOGIC_HOME}/server/lib:${WLS_JAVA_HOME}/lib/tools.jar:
    ${WLS_JAVA_HOME}/jre/lib/rt.jar:${WLS_WEBLOGIC_HOME}/server/lib/webservices.jar:${WLS_CONFIG_DIR}:
    ${WLS_CUSTLIB_DIR}:${WLS_BIN_DIR}:$POST_CLASSPATH
    export WLS_CLASSPATH
    CLASSPATH=${WLS_CLASSPATH}:${APP_CLASSPATH}
    export CLASSPATH
    After upgrade to SP4, there are new ojdbc14_g.jar(debug jar) and orai18n.jar jars in the ${WLS_WEBLOGIC_HOME}/server/ext/jdbc/oracle/10g directory added.
    Please let me know if I need to update classpath with the new 10g jars in the ext/lib directory or any suggestions
    to insert BLOB using the ojdbc14 10G drivers, Weblogic 8.1 environment would be appreciated.
    Following is the stack trace of the errors that I recieve:
    <Oct 6, 2005 1:29:36 PM EDT> <Error> <JDBC> <BEA-001112> <Test "select count(*) from DUAL" set up for pool
    "MHUBPoolStage" failed with exception: "java.sql.SQLException: OALL8 is in an inconsistent state".>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001128> <Connection for pool "MHUBPoolStage" closed.>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001067> <Connection for pool "MHUBPoolStage" refreshed.>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <EJB> <BEA-010051>
    java.rmi.RemoteException: TransactionRequestManager.requestTransaction():
    Caught PersistnceException com.mortgagehub.busobj.PersistenceException: -5258: No more data to read from socket
    Please let me know if there is anything that I am missing.
    Thanks
    Pradeep G

    pradeep g wrote:
    Hello!
    I have a situation where I am trying to insert a blob data into oracle 10g database using oracle thin
    10g drivers, <b>ojdbc14.jar</b> in <b>weblogic 8.1 sp2</b>. I have the following error happening very intermittently.
    > <u><b>java.sql.SQLException: OALL8 is in an inconsistent state.</b></u>
    And this is leading to the <u><b>"No more data to read from socket"</b></u> error when I am trying to
    insert the BLOB into the database. I have gone through the bug list of SP2 and have realised there is the
    following issue fixed in SP3.
    > <b>CR124933</b>
    <b>An Oracle BLOB sometimes used a pooled connection after the connection pool determined that
    the connection was available for reassignment.
    Code was added to ensure the BLOB is completely processed before closing the pool connection or
    ending the transaction.</b>
    > I believe the problem arises when we try to insert BLOB into database using a refreshed connection
    from the pool.We have upgraded weblogic 8.1 from SP2 to SP4 service pack inorder to come over the above problem.
    But this still continues to behave intermittently.
    We put ojdbc14.jar in our classpath and Weblogic startup classpath looks like the following :-
    > WLS_CLASSPATH=${WLS_DOMAIN_DIR}/appslib/server.jar:$PRE_CLASSPATH:${WLS_WEBLOGIC_HOME}/server/lib/weblogic.jar:
    ${WLS_WEBLOGIC_HOME}/server/lib/ojdbc14.jar:${WLS_WEBLOGIC_HOME}/server/lib:${WLS_JAVA_HOME}/lib/tools.jar:
    ${WLS_JAVA_HOME}/jre/lib/rt.jar:${WLS_WEBLOGIC_HOME}/server/lib/webservices.jar:${WLS_CONFIG_DIR}:
    ${WLS_CUSTLIB_DIR}:${WLS_BIN_DIR}:$POST_CLASSPATH
    export WLS_CLASSPATH
    CLASSPATH=${WLS_CLASSPATH}:${APP_CLASSPATH}
    export CLASSPATH
    > After upgrade to SP4, there are new ojdbc14_g.jar(debug jar) and orai18n.jar jars in the ${WLS_WEBLOGIC_HOME}/server/ext/jdbc/oracle/10g directory added.
    > Please let me know if I need to update classpath with the new 10g jars in the ext/lib directory or any suggestions
    to insert BLOB using the ojdbc14 10G drivers, Weblogic 8.1 environment would be appreciated.
    > Following is the stack trace of the errors that I recieve:
    > <Oct 6, 2005 1:29:36 PM EDT> <Error> <JDBC> <BEA-001112> <Test "select count(*) from DUAL" set up for pool
    "MHUBPoolStage" failed with exception: "java.sql.SQLException: OALL8 is in an inconsistent state".>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001128> <Connection for pool "MHUBPoolStage" closed.>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001067> <Connection for pool "MHUBPoolStage" refreshed.>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <EJB> <BEA-010051>
    java.rmi.RemoteException: TransactionRequestManager.requestTransaction():
    Caught PersistnceException com.mortgagehub.busobj.PersistenceException: -5258: No more data to read from socket
    Please let me know if there is anything that I am missing.
    > Thanks
    > Pradeep GHi. This is something we'd like to diagnose. How is your application
    getting using and closing pool connections? The initial symptom
    seems to be an internal oracle problem... Are you using standard
    JDBC or oracle-specific calls?
    Joe

  • Problem with XML doc inserting into oracle 10g

    Hi Guys, I have some knowledge in oracle 10g.
    We are doing an application, when we were trying to insert XML document (I was trying to insert XML as un-structured way.) into oracle 10g as a datatype called XMLTYPE column.
    My XML is having namespace attributes(Target namespaces) in that. So when i was trying to insert that into database , it is giving some error ,and not letting me to push that into database.
    So Can any body please help me in this. My constraint is that I have to insert the document as un-structured way.
    You help would be appriciated.
    Vish
    Message was edited by:
    user567405
    Message was edited by:
    user567405
    Message was edited by:
    user567405
    Message was edited by:
    user567405
    Message was edited by:
    user567405

    , it is giving some error Hmmm, six attempts and you still didn't manage to tell us what the actuall error message and number was. Oracle has thousands of error messages. If you would like us to help you, make it easy for us to figure out what's going on. Don't make us guess.
    Regards, APC

  • Oracle 10g unable to insert yet prompt no error

    Hi all,
    I bumped into this strange case. I have my web app connect to oracle 10g. I got all driver and JDBC setup and coded correctly. Somehow, it won't insert into table when i execute insert statement. No exceptions thrown and yet no error. I'm still finding a way to overcome this strange problem. In the mean time, appreciate if anyone out there able to help me to figure out.
    I suspect the driver class is causing problem. But to me, it's just a standard bunch of code:
    Connection con = null;
    try {
    // Load the JDBC driver
    String driverName = "oracle.jdbc.driver.OracleDriver";
    Class.forName(driverName);
    // Create a connection to the database
    String serverName = "127.0.0.1";
    String portNumber = "1521";
    String sid = "orcl";
    String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
    String username = "ivan";
    String password = "admin123";
    con = DriverManager.getConnection(url, username, password);
    } catch (ClassNotFoundException e) {
    // Could not find the database driver
    } catch (SQLException e) {
    // Could not connect to the database
    return con;
    Thanks!
    Ivan Brogalis

    1 - The code posted, creates an SQL connection and returns it. There is no insert query ! Plz post the whole code.
    2 - Append this the catch block :
    catch (Exception e){
        e.printStackTrace();////////////////// USE THIS FOR THE OTHER CATCH BLOCKS TO HELPS U IDENTIFY THE PROBLEM
    }3 - Check whether the connection created is good : make s simple select like the following : String select = "Select sysdate from dual";4 - Check whether the user(name=ivan, password=admin123) has the SELECT/UPDATE rights.

  • Performance: Bulk Insert Oracle 10g

    Following Situation: We have a VISUAL BASIC 6 Application (I know ... VB6 ... ), an XML-File with data and an Oracle 10g database. The XML-File has to be imported in the database.
    Up to now the Application (Via ADO) analyses the XML-File and creates INSERT and UPDATE Stmts and sends them to the DB. The Stmts will be handled within one Transaction and the application sends each INSERT, UPDATE separate to the database.
    But this is a performance desaster... as expected ... :-) The import takes several hours ...
    Now, my task is to increase the performance, but how .....
    I tried several things, but without the real success, e.g. ...
    I performed some tests with the SQl*Loader. The Insert is really fast, but I can't make an Update, so I had to delete the existing data first. But I can't proceed the two steps in one transaction, because of the SQL*Loader.
    I tried to write a stored procedure which accepts an ADO.Recordset as input param and then creates the Insert and Update statements within the DB to reduce network traffic, but I didn't find a way to handle a ADO.Recordset as a input parameter for a stored procedure.
    Has someone an idea how I can import the XML file in a fast way into the existing DB (and maybe make an Replace of existing records during the import ...) within one transaction without changing the structure of the DB ??? (Oracle packages?? interface in C++ integrated in VB6....) Is there an way to import the XML-File directly to the DB?
    Thanks in advance for any idea :-))

    I tried to write a stored procedure which accepts an ADO.Recordset as input param ...., but I didn't find a way to handle a ADO.Recordset as a input parameter
    for a stored procedure.Use SYS_REFCURSOR as the parameter type. Bulk collect it into a PL/SQL collection. Use FORALL to soup up the INSERT and UPDATE statements.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Problem while inserting data for some datatypes in Oracle 10g

    Hi
    I was trying to insert data in database for all the data types defined in Oracle 10g.
    I was successful in maximum cases.
    I was not able to insert data for following datatypes:
    1 Long varraw
    2 string
    3 varraw
    4 varnum
    5 charz
    6 unsigned int
    7 native double
    8 native float
    Please put some light on it.
    Thanks,
    Gyanendra

    Hi Subin,
    You can try couple of things.
    If your data is less than 32767, you can pass it to stored procedure and change it to clob type like
    PROCEDURE CLOBQUERY
         Param     IN     CLOB,
    and you can call Procedure
    EXECUTE CLOBQUERY '[Param.1]'
    If your data is around than 1000000(32767*32), you can break the data in length of 32767 and pass it to param 1 to 32 like
    EXECUTE CLOBQUERY '[Param.1][Param.2][Param.3]..[Param.32]'
    Finally you can try to update jdbc drive.
    check the link Link: [JDBC Limitation|http://confluence.atlassian.com/display/JIRA/UsingOracle10gdriverstosolvethe4000character+limitation]

  • Lots of Inactive perl sessions in Oracle 10g r2 on Debian Linux 64 bit

    Hi,
    There are lots of Inactive perl session in Oracle 10g release 2 10.2.0.3.0 on Debian Linux 64 bit, is it normal
    ps aux|grep oracle is showing following in processes of perl
    /home/u01/app/oracle/product/10.2.0/database1/perl/bin/perl /home/u01/app/oracle/product/10.2.0/database1 /sysman/admin/scripts/db/dbarchfull.pl

    Hi,
    There are lots of Inactive perl session in Oracle 10g release 2 10.2.0.3.0 on Debian Linux 64 bit, is it normal
    ps aux|grep oracle is showing following in processes of perl
    /home/u01/app/oracle/product/10.2.0/database1/perl/bin/perl /home/u01/app/oracle/product/10.2.0/database1 /sysman/admin/scripts/db/dbarchfull.pl

  • Insert statement taking time on oracle 10g

    Hi,
    My procedure taking time in following statement while database upgrading from oracle 9i to oracle 10g.
    I m using oracle version 10.2.0.4.0.
    cust_item is matiralize view in procedure and it is refreshing in the procedure
    Index is dropping before inserting data into cust_item_tbl TABLE and after inserting data index is created.
    There are almost 6 lac records into MV which are going to insert into TABLE.
    In 9i below insert statement is taking 1 hr time to insert while in 10g it is taking 2.30 hrs.
    EXECUTE IMMEDIATE 'ALTER SESSION ENABLE PARALLEL QUERY';
    EXECUTE IMMEDIATE 'ALTER SESSION ENABLE PARALLEL DML';
    INSERT INTO /*+ APPEND PARALLEL */ cust_item_tbl  NOLOGGING
             (SELECT /*+ PARALLEL */
                     ctry_code, co_code, srce_loc_nbr, srce_loc_type_code,
                     cust_nbr, item_nbr, lu_eff_dt,
                     0, 0, 0, lu_end_dt,
                     bus_seg_code, 0, rt_nbr, 0, '', 0, '', SYSDATE, '', SYSDATE,
                     '', 0, ' ',
                                   case
                                 when cust_nbr in (select distinct cust_nbr from aml.log_t where CTRY_CODE = p_country_code and co_code = p_company_code)
                                 THEN
                                         case
                                            when trunc(sysdate) NOT BETWEEN trunc(lu_eff_dt) AND trunc(lu_end_dt)
                                            then NVL((select cases_per_pallet from cust_item c where c.ctry_code = a.ctry_code and c.co_code = a.co_code
                                                          and c.cust_nbr = a.cust_nbr and c.GTIN_CO_PREFX = a.GTIN_CO_PREFX and c.GTIN_ITEM_REF_NBR = a.GTIN_ITEM_REF_NBR
                                                          and c.GTIN_CK_DIGIT = a.GTIN_CK_DIGIT and trunc(sysdate) BETWEEN trunc(c.lu_eff_dt) AND trunc(c.lu_end_dt) and rownum = 1),
                                                          a.cases_per_pallet)
                                      else cases_per_pallet
                                  end
                          else cases_per_pallet
                     END cases_per_pallet,
                     cases_per_layer
                FROM cust_item a
               WHERE a.ctry_code = p_country_code ----varible passing by procedure
                 AND a.co_code = p_company_code   ----varible passing by procedure
                 AND a.ROWID =
                        (SELECT MAX (b.ROWID)
                           FROM cust_item b
                          WHERE b.ctry_code = a.ctry_code
                            AND b.co_code = a.co_code
                            AND b.ctry_code = p_country_code ----varible passing by procedure
                            AND b.co_code = p_company_code   ----varible passing by procedure
                            AND b.srce_loc_nbr = a.srce_loc_nbr
                            AND b.srce_loc_type_code = a.srce_loc_type_code
                            AND b.cust_nbr = a.cust_nbr
                            AND b.item_nbr = a.item_nbr
                            AND b.lu_eff_dt = a.lu_eff_dt));explain plan of oracle 10g
    Plan
    INSERT STATEMENT  CHOOSECost: 133,310  Bytes: 248  Cardinality: 1                      
         5 FILTER                 
              4 HASH GROUP BY  Cost: 133,310  Bytes: 248  Cardinality: 1            
                   3 HASH JOIN  Cost: 132,424  Bytes: 1,273,090,640  Cardinality: 5,133,430       
                        1 INDEX FAST FULL SCAN INDEX MFIPROCESS.INDX_TEMP_CUST_AUTH_PERF_MV Cost: 10,026  Bytes: 554,410,440  Cardinality: 5,133,430 
                        2 MAT_VIEW ACCESS FULL MAT_VIEW MFIPROCESS.TEMP_CUST_AUTH_PERF_MV Cost: 24,570  Bytes: 718,680,200  Cardinality: 5,133,430  can you please look into the issue?
    Thanks.

    According to the execution plan you posted parallelism is not taking place - no parallel operations listed
    Check the hint syntax. In particular, "PARALLEL" does not look right.
    Running queries in parallel can either help performance, hurt performance, or do nothing for performance. In your case a parallel index scan on MFIPROCESS.INDX_TEMP_CUST_AUTH_PERF_MV using the PARALLEL_INDEX hint and the PARALLEL hint specifying the table for MAT_VIEW MFIPROCESS.TEMP_CUST_AUTH_PERF_MV Cost might help, something like (untested)
    select /*+ PARALLEL_INDEX(INDX_TEMP_CST_AUTH_PERF_MV) PARALLEL(TEMP_CUST_AUTHPERF_MV) */Is query rewrite causing the MVs to be read? If so hinting the query will be tricky

  • Simple insert, delete and update not working after oracle 10g installation

    Hello,
    I made a new installation of Oracle 10g (10.2.0.1.0) and created a schema . Now i try to insert or update data using simple queries, but unfortunately nothing happens. I tried inserting or updating data even via sqlplus, but unfortunately the same result. Query takes infinite time to end, so i had to manually end it every time... No errors... No warnings... but takes long time... I have given all the required permissions to the schema but the same result. Can somebody help me figure out the problem?
    Tried creating a new table and the insert and delete are working fine... think the problem is with this table... Imported the rows of the table from another online database. I dont understand how this might be a problem.
    Edited by: user13333704 on Mar 15, 2011 1:26 AM

    However how do you generate awr reports and how to find the session wait?TO generate the AWR report
    sql> ?/rdbms/admin/awrrpt
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/autostat.htm#BABDHAGF
    The event column in v$session , in v$active_session_wait will show you the session wait event.What the session was actually waiting for.
    HTH
    Anand

  • What mechanism Oracle 10g use for write (Insert/ Update) and Read (Select)?

    Hi
    What mechanism Oracle 10g use for write (Insert/ Update) and Read (Select)?
    Thank you

    Aren't the answers given in PL/SQL forum sufficient enough?Well, as the first answer in that forum directed the OP to this forum you can hardly blame them for the repost.
    There is some high-level stuff in the Concepts Guide. If that is insufficient the OP will need to tell us what more details they need to know (and perhaps why).
    Cheers, APC

  • Oracle 10g AQ - Required Insert Rates  of atleast 8000+ inserts per second

    Hey Guys,
    I am setting up a AQ in oracle 10g and I require atleast 8000+ insert rates per second, is it possible if so How do i implement it.
    Any help would be helpful.
    Thanks
    Stan

    Can you Give me some examples :
    I am trying to use AQ Messaging : How do I use perl scripts for the AQ messaging.
    In any case if you can give me some examples; detailed on how you have coded
    to attain the insert rates of 8000 messages per second
    I would appreciate that
    Thanks
    stan kumar

  • Oracle 10g consumes a lot of ram

    hello everyone,
    i'm a newbie to oracle,
    can someone solve my problem
    when oracle database is running , i can't run any other applications (on windows)
    task manager shows around 100 mb memory usage for oracle
    is there any solution to this problem...

    one solution can be:
    -add more memory to your XP Pro: 2GB and more
    -install a blank Virtual Machine [vmware.com] on your XP as a host
    -on the Virtual Machine install the guest OS: say Win Server 2003 [u can get it free from MSoft site], configure the Virtual Server as Active Directory, DNS, Server, DHCP Server. Use Static IP for the server.
    -install Oracle 10g on the Virtual server
    I did the same on my XP Pro system and Oracle 10g EE runs OK on it. My CPU is 2 GHz.

  • How to avoid of application running on Oracle 10g to be copied?

    I am a newbie to the security issues, so I need your help, please, where to start / what to read:
    I have an application running across many customers on Oracle 10g. I have faced lately that our users
    can use their daily backups to establish a totaly new database on a same / different server
    and point our application to use it as well.
    Is there any way to avoid it? F.e. I thought to use SELECT * FROM v$instance; to get the server instance details, and
    in result with some other function to obtain, let say, local server's (WIN2003) details,
    such as HD Serial Number, MAC number or so and then to check these values each time user runs the application.
    Is it the correct way? What are the basics here at all?
    Many thanks in advance to all!

    A lot of enterprises, however, actively avoid systems which are locked down to a particular server for very legitimate reasons. If my data center dies in the middle of the night, I sure don't want to have to call your mobile phone so that you can get to a computer, log in to the office network, and get me a new key so that I can finish my emergency failover. If I've got dozens of applications, I absolutely don't want to do that with dozens of different vendors.
    It sounds like your problem, though, isn't that users are installing your software on multiple computers it's that they are accessing functionality they haven't licensed. That is generally a much easier problem to solve and doesn't require you to lock anything down to a particular machine. You can create a table LICENSED_CONTENT, for example,
    CREATE TABLE licensed_content (
      client_id    NUMBER,
      content_type VARCHAR2(30),
      key          RAW(128)
    )In this case, KEY is, say, a hash (using the DBMS_CRYPTO or DBMS_OBFUSCATION_TOOLKIT packages if you'd like) of the client_id, content_type, and a bit of salt (i.e. a fixed string that only you know). When you sell a license to manage diamond content, you provide a script that inserts the appropriate row in the LICENSED_CONTENT table. When your application starts up, it reads the LICENSED_CONTENT table and verifies the hash before allowing users to access that type of content. This allows legitimate customers to move the software from one system to another but prevents them from accessing new functionality without a new license.
    Justin

  • Oracle 10g trigger to pass variable to xmltype.existsnode() function

    Hi all,
    Could anyone please help me on this? It is kind of urgent.
    I created a trigger below, it compiled successfully, but when I tried to insert a xml document into oracle 10g db, I got error message says:
    550- Error Response
    ORA-00604: error occurred at recursive SQL level 1
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    ORA-06512: at "CONTENTDB.VALIDATE_LINK", line 11
    ORA-04088: error during execution of trigger 'CONTENTDB.VALIDATE_LINK'
    550 End Error Response
    My trigger is:
    CREATE OR REPLACE TRIGGER VALIDATE_LINK
    BEFORE insert on TABLE_LINK
    FOR each row
    DECLARE
    v_key VARCHAR2(1000);
    v_count NUMBER(5);
    xmldata XMLType;
    begin
    xmldata := :new.sys_nc_rowinfo$;
    IF xmldata.existsnode('/link/key') = 1 THEN
    v_key := xmldata.extract('/link/@key').getStringVal();
    select count(*) into v_count from table_link WHERE (existsNode(object_value,'/link[key=v_key]') = 1 )
    and (existsNode(object_value,'/link/publishingElements[TestingFlag="true"]') = 1);
    if (v_count >= 1) then
    raise_application_error (-20001, 'TestingFlag can only have one true value.');
    end if;
    end if;
    end;
    I have questions regarding above trigger:
    1) it seems extract() doesn't work in statement below: v_key := xmldata.extract('/link/@key').getStringVal();
    2) can I pass a variable v_key into xmltype.existsnode() function? if yes, what is the right format to do so?
    Thanks a lot.
    Honson

    Hi Mark,
    Thanks for your comments, I have added checking for xmltype object is not null logic. and my initial problem was fixed, the only last problem I am having now is xmltype.extract().
    CREATE OR REPLACE TRIGGER VALIDATE_LINK
    BEFORE insert on table_LINK
    FOR each row
    DECLARE
    v_key VARCHAR2(4000);
    v_count NUMBER(5);
    xmldata XMLType;
    v_tmp VARCHAR2(4000);
    begin
    xmldata := :new.sys_nc_rowinfo$;
    if (xmldata is not null) then
    IF xmldata.existsnode('/link/key') = 1 THEN
    v_key := xmldata.extract('/link/key').getStringVal();
    v_tmp := '/link[key=' || v_key || ']';
    select count(*) into v_count from cibc_link WHERE (existsNode(object_value,v_tmp) = 1 )
    and (existsNode(object_value,'/link/publishingElements[TestingFlag="true"]') = 1);
    if (v_count >= 1) then
    raise_application_error (-20001, 'TestingFlag can only have one true value.');
    end if;
    end if;
    end if;
    end;
    I am expecting this statement:
    v_key := xmldata.extract('/link/key').getStringVal();
    return v_key := content.link.viewPrintableVISACreditCard
    but now it always returns like this:
    v_key := <key>content.link.viewPrintableVISACreditCard</key>
    I don't want the xml tag <key></key> returned by extract().getStringVal() function.
    Could you or anyone please help?
    Thanks.
    Honson

Maybe you are looking for

  • Document numbering in SAP B1

    Dear All, I am getting error 'Numeric value deviates from legal range (ODBC -1015)  [131-183]' while adding new series, Series have 10 digit numbers. If number starts with '2' its accepting but if starts with 3 or 4 giving above mentioned error. Vers

  • Is it ok to turn off my macbook pro 2011

    I would like to know if its ok to turn off my macbook pro 2011 every time its not in use , and its not connect to a power source .

  • Error no WBS billing element found while substituting WBS element 00050923

    Hi, Please give me some quick solution to overcome this error in my IDES. I have seen the note, sap help and othe rsuggession . could not get rid of this error. Quick response is requested.The earlier thread was also unanswered. Zinni

  • Dynamically create Table partition

    Hi all, Anybody having script to add partition to a table using plsql.My requirment is to create partition for every month ( time_id , from time attribute table ) dynamically. Thanks in Advance Ramesh K C R

  • How on EARTH to parameters work in AppleScript Automator Actions for SL?

    Prior to Snow Leopard, creating a new AppleScript Automator Action would create a template something like... on run{input, parameters} but now, on Snow Leopard, I get: on runWithInputfromAction_error(input, anAction, errorRef) where to I get the 'par