Change in the merger of insert and create a procedure for updating the records after

Hello

I have a table that contains about 50 M lines of partition, and every day I have an application that performs a merge to insert records statement about 100 k per day and it's 300 M updates a day.

Because I both update and insert the application performs a merge.
I need to make at least 500 M, updated day by day, and for this reason this solution doesn't have enough performance for what I'm asking.

I think another solution that I will try to implement now, and I just posted this in an attempt to get help on the option that I may have to do.

I want to start putting in place:
-Locations is updated 'last_record_date' using 'KEY1' and 'Key2' "KEY3";
-Change the application to only inserts into a temporary table.
-Have two procedures, one that takes the new records from the temporary table and inserts it into the final table, and another that selects records which is updated and perform an update.
-This two procedures will choose the records and delete them from the temporary table (or mark them as updated\inserted).

The volume is very large, so performance is a challenge! That's why I'm writing this, because a solution with enough performance for the intermediate stage will be difficult.
My final table is partitioned by date and the date is the area that I need to update (instead of create daily partitions in order to reduce the frequency of the movement of the line, I create monthly partitions)!
It is currently my table definition:
CREATE TABLE MY_TEST_TABLE
    (KEY1                           VARCHAR2(50 BYTE) ,
    KEY2                         VARCHAR2(50 BYTE) NOT NULL,
    KEY3                           VARCHAR2(50 BYTE) ,
    last_record_date                    VARCHAR2(50 BYTE) NOT NULL)
  PCTFREE     10
  INITRANS    1
  MAXTRANS    255
   STORAGE   (
    BUFFER_POOL DEFAULT
  )
  NOCACHE
  MONITORING
  ENABLE ROW MOVEMENT
  PARTITION BY RANGE (last_record_date)
  (
  PARTITION MY_TEST_TABLE_201112 VALUES LESS THAN ('20120101')
  PCTFREE     10
  INITRANS    1
  MAXTRANS    255
  NOLOGGING,
  PARTITION MY_TEST_TABLE_201201 VALUES LESS THAN ('20120201')
  PCTFREE     10
  INITRANS    1
  MAXTRANS    255
  NOLOGGING,
  PARTITION MY_TEST_TABLE_201202 VALUES LESS THAN ('20120301')
  PCTFREE     10
  INITRANS    1
  MAXTRANS    255
  NOLOGGING,
  PARTITION def VALUES LESS THAN (MAXVALUE)
  PCTFREE     10
  INITRANS    1
  MAXTRANS    255
  NOLOGGING
  )
  NOPARALLEL
/



-- Constraints for MY_TEST_TABLE

ALTER TABLE MY_TEST_TABLE
ADD CHECK ("KEY1" IS NOT NULL)
/

ALTER TABLE MY_TEST_TABLE
ADD CHECK ("KEY2" IS NOT NULL)
/

ALTER TABLE MY_TEST_TABLE
ADD CHECK ("KEY3" IS NOT NULL)
/
ALTER TABLE MY_TEST_TABLE
ADD CONSTRAINT pk_MY_TEST_TABLE PRIMARY KEY (KEY1, KEY2, KEY3)
USING INDEX
  PCTFREE     10
  INITRANS    2
  MAXTRANS    255
/
Thank you
Ricardo Tomas

naoseionome wrote:
Hello

My version is:
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

It's the DOF I used to create the database.

The merger is common during every day for about 10 M records.

There are several methods to do the update, but they do sequencially to avoid deadlocks (because I can't control the source and each process can update the same keys.

The update uses "KEY1, KEY2, KEY3" to update the value 'LAST_RECORD_DATE' have impact by being date or varchar2?

I'm still waiting to receive permissions in order to follow up the matter, but in the meantime, in that I am trying to implement this work around in order to accelerate a development in the case where it would be necessary! Comments only I have at the moment, it is that he is not able to process the total amount of records timely (order book is generated).

Thank you
Ricardo

Well, the first thing we do is to change the type of data type varchar to a date. The main impact is that a date is not a string, it's a date. If you are adding data processes in different date formats (which is possible when you use a character to store information) you're going to be very sad (good luck converting back an effective date).

An example of how this can happen easily.

ME_TUBBZ?select to_char(sysdate) from dual;

TO_CHAR(SYSDATE)
-----------------------------
12-jan-2012 10 55:33

1 row selected.

Elapsed: 00:00:00.01
ME_TUBBZ?alter session set nls_date_format = 'yyyy-mon-dd';

Session altered.

Elapsed: 00:00:00.01
ME_TUBBZ?select to_char(sysdate) from dual;

TO_CHAR(SYSDATE)
--------------------
2012-jan-12

1 row selected.

Elapsed: 00:00:00.00

Assuming that the client passes the column as an Oracle DATE will make an (implicit) conversion to store the data as a string, which will be based on the current settings of the NLS for the session. This allows also for someone to completely non-jour the information in the column (super bad). It's just really bad form to use strings to store dates, numbers, anything that is not naturally a string.

Based on the description of your problem, I can't imagine how your partitioning scheme performs one action in another that require more work in order to process the updates (which are most of your needs). Partitioning does not equate to increase performance. It is a tool that, like every tool has its place, but I do not think that this is justified for what you do (certainly not how you currently use it anyway).

I say no partitioning can not be useful for you, but I don't think that on the column that you are currently using is 'good '.

Something I would like to personally study (must be able to compare this approach to your course, if you need parameters for comparison) if I were you would be using a Table Index organized for it. It will take more time to perform the operations insertion, but that is a small part of all the work that you do for this process. For updates, it should eliminate a lot of IO, assuming that you are doing an INDEX seek followed by a table access by ROWID to perform updates. This recommendation assumes that everything you said is true. You have 4 columns in your table, of which 3 are components of the primary key and the 4th is a date (note I did not string :)) and that you refresh mainly, not fit.) Also that you have no 'secondary' on this entity index (and none are needed).

I would investigate this approach before the solution of temporary table that you are currently studying.

See you soon,.

Tags: Database

Similar Questions

  • Picture disappears from the record after a reboot.

    Original title: WHAT CAUSES PICTURES TO MIGRATE

    Windows 7 Pro: make sure that the image is in the right file. Come back next day & I do a search because it is no longer in the original file. I'm the only person who uses this computer. I heard the complaint from others, but no solution.

    Hi Gardner,

    Thanks for posting your question in the Microsoft Community forums.

    I see from the description of the problem, as this image disappears from the record after a reboot.

    I imagine the inconvenience that you are experiencing. We are here to help and guide you in the right direction.

    To provide the proper resolution, that I would need more information on your side.

    Did you the latest changes on the computer before this problem?

    I suggest you to run the fixit and check if it helps.

    Diagnose and repair Windows files and folders problems automatically
    http://support.Microsoft.com/mats/windows_file_and_folder_diag/

    Let us know the status of the issue after you perform the troubleshooting steps. If you need help or information about the issue with the photo, I'll be happy to help you. We, at tender Microsoft to excellence.

  • Update my application. What is the proper procedure for updating an app/folio?

    I designed a folio in Indesign CS6 and created a folio application in adobe dps and downloaded successfully on the app store. Now, I want to update my application. What is the proper procedure for updating an app/folio?

    If it's a simple editing application, you will have to recreate the whole thing and

    submit an Apple update for approval.

  • Update in crippling conditions of the record after query

    Dear members
    I have a single block record and I want to disable conditionaly update of the files after that query has retrieved the data. Problem is that if I disable the update of the record after motion trigger then she checks the condition for the very first record recoveries and it the condition is true, then the update is disabled for all records pulled, even if future reviews do not meet the condition. I use Forms - 10 g. Can U give a better solution? thanx.

    Hello

    You can also use the trigger once - new - Record - Instance to assess the State

     If condition Then
       Set_Block_Property( '...', UPDATE_ALLOWED, PROPERTY_FALSE ) ;
     Else
       Set_Block_Property( '...', UPDATE_ALLOWED, PROPERTY_TRUE) ;
     End if ;
    

    François

  • Computation of factorial by creating a procedure for her

    Hello everyone
    I tried to create a procedure for the calculation of the factorail of a number
    but something's not right
    I hope that you guys can drive the correct path
    Here is my code
    create or replace procedure factorial(n in number)
    is 
               v number;
    begin
    
           for i in reverse n..1
     loop
                  v :=v*i;
    end loop;
    dbms_output.put_line(v);
    end;

    Why reverse?

    
     1   create or replace procedure factorial(n in number)
      2   is
      3              v number :=1;
      4   begin
      5          for i in  1..n
      6    loop
      7                 v :=v * i;
      8   end loop;
      9   dbms_output.put_line(v);
     10*  end;
    SQL> /
    
    Procedure created.
    
    SQL>
    SQL>  begin
      2   factorial(5);
      3   end;
      4  /
    120
    
    PL/SQL procedure successfully completed.
    
  • Inserting and removing memory stick for loading of pictures from the camera.

    I currently have a HP Envy23 all in one computer.  When you insert the Memory Stick PRO Duo for the loading of the pictures on the computer, I have to push the memory stick all the way to access and upload the photos.  The memory stick will completely into the slot and doesn't have a function to remove the memory stick.  In my view, what is of the size multi memory card slot.

    This doesn't seem fair.  To get the stick, I must use a pair of pliers tweezers in the opening to pick up the stick and take it out.  It takes some effort to seize the stick.  Y at - it a special procedure should I use to get out of the slot in the Memory Stick?

    Thanks for your help.

    Tahoeterry

    Hello tahoeterry,

    I understand that you are having problems getting your Memory Stick PRO Duo on your HP ENVY 23 and are looking for help. Have you tried to push the card until it clicks. This should release the memory card and let him out for easy removal. If this does not work as I said then I think it would be best if you contact HP Support for service options, as there may be something to physically hurt.

    I want to thank you for display on the HP Forums. Have a great day!

  • Changes to the police after WebHelp is generated in RH10

    I'm having a similar to this topic isssue: http://forums.adobe.com/message/4751049 however, my problem is with RoboHelp HTML, RoboHelp for Word.

    Recently, we downloaded the trial version of RoboHelp 10 to determine if our help files, that have been created in RoboHelp 2000 (maybe, that was before my time, and this is the last version that I could identify on a CD here) could be updated. Everything works great, except that when I generate WebHelp or HTML Help, some subjects appear in Times New Roman. Based on the CSS file that is applied and the way the project looks at in RoboHelp, everything should be in Arial.

    I reapplied the CSS file to all subjects, checked to make sure that the appropriate style has been applied to the text in the headings appearing incorrectly and tried to apply the value by default and other CSS files.

    I use Windows 7 and Internet Explorer 9 to display the WebHelp.

    There was a fairly significant paradigm from RH7 shift to switch to the standard HTML and CSS supported. This resulted in significant changes to the styles and also how you choose the styles to be applied to the paragraphs.

    For example, in RH6 the H1 style has been defined twice as follows:

    H1 {}

    do-family: Arial, Helvetica, without serif.

    }

    {LI.kadov - H1

    do-family: Arial, Helvetica, without serif.

    }

    RH7 changed as follows:

    H1 {}

    do-family: Arial, Helvetica, without serif.

    }

    LI. H1 {}

    do-family: Arial, Helvetica, without serif.

    }

    Maybe the kadov part has not been withdrawn from the style sheet. Or maybe he has been removed from the style sheet, but not the headings.

    There is also a topic on the site of Peter Grainge (www.grainge.org) dealing with lists, as these has caused a lot of problems on the upgrade, if you could read there for more information as well. I'm not sure if you're familiar with Robohelp, but thought that I would point out that, contrary to Word, the Style dropdown in the toolbar displays only styles of paragraph and character - to view all possible (as the list styles), you can use the Style Pod (unless this has changed recently - I must put at my disposal RH8).

    Another option is to create a brand new stylesheet so you can compare the stylesheet imported with the native stylesheet RH10 - beware of implementing all the differences, however, some of your choices will depend on the HTML in topics as well.

    I hope this will help you with your question though,

    Amber

  • Color changes during the recording of the PSD to JPEG (safe for the web) in PS CS5 working in sRGB

    As I secured it for the web a PSD file, jpeg version of the same file changes slightly color - I opened the two files in PS CS5 to compare.

    File initially processed in Lightroom 6 and converted to sRGB for export.

    I worked in the sRGB color space in Photoshop.

    When exporting I secured for the web. I tried both options checked including the color profile and convert to sRGB.

    I tried to save to the web as a PNG and color remained the same, she only moves for JPEG files.

    You can't really see the difference in color with a naked eye, but be specific. I don't understand why he would change when I work in the color space is sRBG. Please help this is driving me crazy!

    JPEG compression can change the values, even quite spectacular on single pixel level. You have the selector of color set to "sample point"?

  • REGISTRATION NO IS NOT INSERTED AND NO QUESTION THROWN FOR XML

    Hey Odie,

    Hope you answer this simple query for me. I am not able to find any question, but it doesn't load the data in the custom table. Please tell me where in fact it's bad for me.

    example of xml file
     <?xml version="1.0" encoding="UTF-8" ?> 
    - <GEBIZ_SUPPLIERS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <SUPPLIER>
      <CODE>200003048E</CODE> 
      <NAME>Safe2Travel Pte Ltd</NAME> 
      <TYPE>GTP</TYPE> 
      <GST_NUMBER>20-0003048-E</GST_NUMBER> 
      <ACTIVE_FLAG>Y</ACTIVE_FLAG> 
      <DELETE_FLAG>N</DELETE_FLAG> 
      <CREATE_TIMESTAMP>2004-02-29T04:01:51</CREATE_TIMESTAMP> 
    - <SITES>
    - <SITE>
      <ID>1</ID> 
      <NAME>Safe2Travel Pte Ltd</NAME> 
      <PHONE>68233013</PHONE> 
      <PHONE_EXTENSION xsi:nil="true" /> 
      <FAX>68221636</FAX> 
      <EMAIL>[email protected]</EMAIL> 
      <ADDRESS_LINE1>10 Eunos Road 8</ADDRESS_LINE1> 
      <ADDRESS_LINE2>#08-03 (North Lobby)</ADDRESS_LINE2> 
      <ADDRESS_LINE3>Singapore Post Centre</ADDRESS_LINE3> 
      <COUNTRY_CODE>SG</COUNTRY_CODE> 
      <PROVINCE xsi:nil="true" /> 
      <STATE xsi:nil="true" /> 
      <CITY xsi:nil="true" /> 
      <AREA_CODE xsi:nil="true" /> 
      <ZIP>408600</ZIP> 
      <REGION_CODE xsi:nil="true" /> 
      <DELETE_FLAG>N</DELETE_FLAG> 
      <CREATE_TIMESTAMP>2004-02-29T04:03:11</CREATE_TIMESTAMP> 
      <UNIQUE_PERSON_ID xsi:nil="true" /> 
      <UNIQUE_PERSON_NAME xsi:nil="true" /> 
      </SITE>
    - <SITE>
      <ID>2</ID> 
      <NAME>Safe2Travel Pte Ltd</NAME> 
      <PHONE>62208866</PHONE> 
      <PHONE_EXTENSION xsi:nil="true" /> 
      <FAX>62265578</FAX> 
      <EMAIL>[email protected]</EMAIL> 
      <ADDRESS_LINE1>3 Lim Teck Kim Road</ADDRESS_LINE1> 
      <ADDRESS_LINE2>#02-02</ADDRESS_LINE2> 
      <ADDRESS_LINE3>Singapore Technologies Building</ADDRESS_LINE3> 
      <COUNTRY_CODE>SG</COUNTRY_CODE> 
      <PROVINCE xsi:nil="true" /> 
      <STATE xsi:nil="true" /> 
      <CITY xsi:nil="true" /> 
      <AREA_CODE xsi:nil="true" /> 
      <ZIP>088934</ZIP> 
      <REGION_CODE xsi:nil="true" /> 
      <DELETE_FLAG>Y</DELETE_FLAG> 
      <CREATE_TIMESTAMP>2004-02-29T04:03:11</CREATE_TIMESTAMP> 
      <UNIQUE_PERSON_ID xsi:nil="true" /> 
      <UNIQUE_PERSON_NAME xsi:nil="true" /> 
      </SITE>
    - <SITE>
      <ID>3</ID> 
      <NAME>Safe2Travel Pte Ltd</NAME> 
      <PHONE>62208866</PHONE> 
      <PHONE_EXTENSION xsi:nil="true" /> 
      <FAX>62265578</FAX> 
      <EMAIL>[email protected]</EMAIL> 
      <ADDRESS_LINE1>3 Lim Teck Kim Road</ADDRESS_LINE1> 
      <ADDRESS_LINE2>#02-02</ADDRESS_LINE2> 
      <ADDRESS_LINE3>Singapore Technologies Building</ADDRESS_LINE3> 
      <COUNTRY_CODE>SG</COUNTRY_CODE> 
      <PROVINCE xsi:nil="true" /> 
      <STATE xsi:nil="true" /> 
      <CITY xsi:nil="true" /> 
      <AREA_CODE xsi:nil="true" /> 
      <ZIP>088934</ZIP> 
      <REGION_CODE xsi:nil="true" /> 
      <DELETE_FLAG>Y</DELETE_FLAG> 
      <CREATE_TIMESTAMP>2004-02-29T04:03:11</CREATE_TIMESTAMP> 
      <UNIQUE_PERSON_ID xsi:nil="true" /> 
      <UNIQUE_PERSON_NAME xsi:nil="true" /> 
      </SITE>
      </SITES>
      </SUPPLIER>
      </GEBIZ_SUPPLIERS>
    to do this, I wrote the below mentioned procedure that not give me any error or any insert the record into the custom table.
    CREATE OR REPLACE PROCEDURE XGBZPROD.test_SUPP_MAST_XMLTAG_PROC(P_XML_FILE IN VARCHAR2)
    IS
      v_supp_file xmltype;
    
    BEGIN
      v_supp_file  := xmltype( bfilename('XMLDIR',P_XML_FILE), nls_charset_id('AL32UTF8'));
      dbms_output.put_line('P_XML_FILE '||P_XML_FILE);
    
     --
     --Initially insert data into 11g table same table structure as exists in 8i. This
     -- is to read xml datafile
     --
    
    
      INSERT INTO XGBZ_FIN_STAGE_SMO
      (supp_code,
       supp_name,
       type,
       gst_regn_no,
       active_flag,
       delete_flag,
       create_timestamp,
       supp_site_id,
       supp_site_name,
       supp_phone,
       supp_phone_ext,
       supp_fax,
       supp_email,
       address_line1,
       address_line2,
       address_line3,
       country,
       province,
       state,
       city,
       area_code,
       zip,
       region_code,
       logical_delete_flag,
       site_create_timestamp,
       unique_person_id,
       unique_person_name,
       ministry_code,
       dept_code,
       ext_system_code,
       gebiz_timestamp
       )
        SELECT x1.supp_code,
               x1.supp_name,
               x1.type,
               x1.gst_regn_no,
               x1.active_flag,
               x1.delete_flag,
               x1.create_timestamp,
               x2.supp_site_id,
               x2.supp_site_name,
               x2.supp_phone,
               x2.supp_phone_ext,
               x2.supp_fax,
               x2.supp_email,
               x2.address_line1,
               x2.address_line2,
               x2.address_line3,
               x2.country,
               x2.province,
               x2.state,
               x2.city,
               x2.area_code,
               x2.zip,
               x2.region_code,
               x2.logical_delete_flag,
               x2.site_create_timestamp,
               x2.unique_person_id,
               x2.unique_person_name,
               'RPO' ministry_code,
               '000' dept_code,
               'E' ext_system_code,
                sysdate gebiz_timestamp
          FROM XMLTABLE (
               '/GEBIZ_SUPPLIERS'
               passing v_supp_file
               columns
               supp_code           VARCHAR2(10)  path   'SUPPLIER/CODE',
               supp_name           VARCHAR2(140) path   'SUPPLIER/NAME',
               type                VARCHAR2(3)   path   'SUPPLIER/TYPE',
               gst_regn_no         VARCHAR2(30)  path   'SUPPLIER/GST_NUMBER',
               active_flag         VARCHAR2(1)   path   'SUPPLIER/ACTIVE_FLAG',
               delete_flag         VARCHAR2(1)   path   'SUPPLIER/DELETE_FLAG',
               create_timestamp    VARCHAR2(24)  path   'SUPPLIER/CREATE_TIMESTAMP',
               sites               xmltype       path   'SITES'
               )x1,
               XMLTABLE('/SITES/SITE'
               passing x1.sites
               columns
               supp_site_id        NUMBER        path   'ID',
               supp_site_name      VARCHAR2(140) path   'NAME',
               supp_phone          VARCHAR2(23)  path   'PHONE',
               supp_phone_ext      VARCHAR2(4)   path   'PHONE_EXTENSION',
               supp_fax            VARCHAR2(40)  path   'FAX',
               supp_email          VARCHAR2(100) path   'EMAIL',
               address_line1       VARCHAR2(254) path   'ADDRESS_LINE1' ,
               address_line2       VARCHAR2(35)  path   'ADDRESS_LINE2' ,
               address_line3       VARCHAR2(35)  path   'ADDRESS_LINE3' ,
               country             VARCHAR2(2)   path   'COUNTRY_CODE' ,
               province            VARCHAR2(25)  path   'PROVINCE' ,
               state               VARCHAR2(25)  path   'STATE' ,
               city                VARCHAR2(25)  path   'CITY' ,
               area_code           VARCHAR2(10)  path   'AREA_CODE' ,
               zip                 VARCHAR2(20)  path   'ZIP',
               region_code         VARCHAR2(3)   path   'REGION_CODE',
               logical_delete_flag VARCHAR2(1)   path   'DELETE_FLAG',
               site_create_timestamp VARCHAR2(24) path  'CREATE_TIMESTAMP',
               unique_person_id    VARCHAR2(16)  path   'UNIQUE_PERSON_ID',
               unique_person_name  VARCHAR2(140) path   'UNIQUE_PERSON_NAME'
               )x2;
          COMMIT;
       exception
       when others then 
         dbms_output.put_line('error occurred '||sqlerrm);
       end;
    Gurus, help to verify the issue.

    Kind regards
    Mr. Nagendra

    You pass the bad XPaths.
    Please, try the following:

    ...
    XMLTABLE (
      '/GEBIZ_SUPPLIERS/SUPPLIER'
      passing t.v_supp_file
        columns
        supp_code           VARCHAR2(10)  path   'CODE',
        supp_name           VARCHAR2(140) path   'NAME',
        type                VARCHAR2(3)   path   'TYPE',
        gst_regn_no         VARCHAR2(30)  path   'GST_NUMBER',
        active_flag         VARCHAR2(1)   path   'ACTIVE_FLAG',
        delete_flag         VARCHAR2(1)   path   'DELETE_FLAG',
        create_timestamp    VARCHAR2(24)  path   'CREATE_TIMESTAMP',
        sites               xmltype       path   'SITES'
        )x1,
    ...
    
  • Unable to adapt "record level" for the sound recorder. Audio system works very well. Cannot find a software which allows the change to the record level of mic.

    I want to increase the logging level for my sound recorder and cannot find anything in the Windows 7 software that will allow me to do. I know that it's there somewhere because I put it at 50% during a recent troubleshooting session when he was at zero. Now, I find that the screen to increase it even more.

    Hello

    Welcome to Microsoft Windows 7 answers Forum!

    You can try the steps below and check if the problem is resolved.

    To adjust the record volume, follow these steps before you register:

    1. click on Start

    The collapse of this top this i, and then click Control Panel.

    2. click on hardware and sound.

    3. under his, click manage audio devices.

    4. click on the recording tab.

    5. click on the microphone device and then click Properties.

    6. click on the tab levels move the slider to increase or decrease the volume.

    If you find difficulties in following the above steps then you must follow the link below.

    The volume of the audio recorded by sound recorder in Windows Vista or in Windows 7 is lower than that of Windows XP.

    http://support.Microsoft.com/kb/973446

    Thank you, and in what concerns:

    Suresh Kumar-Microsoft Support.

    Visit our http://social.answers.microsoft.com/Forums/en-US/answersfeedback/threads/ Microsoft answers feedback Forum and let us know what you think.

  • How to create a procedure for REF CURSOR output with any WHERE clause?

    I have a requirement like this: I have a huge question that need to reuse in my code over 10 times. This SQL has about 50 lines. Here for these 10 odd times sometimes changes in WHERE clause (columns are the same). So I can't create a view as SQL is not static.

    I thought to write a procedure with a para of WHERE_CLAUSE entry. I pulled out a refcursor sys by adding where clause. But I can't do it because you cannot add a clause like this where clause.

    i.e.
    PROCEDURE dynamyic_query (p_where_clause IN VARCHAR2, p_out_query OUT SYS_REFCURSOR ) IS
    BEGIN
    
      OPEN p_out_query FOR SELECT ......... FROM table WHERE || ' ' || p_where_clause;
    
    END;
    The foregoing gives an error.

    How to handle such a situation? Any help would be greatly appreciated.

    Hello

    Channa wrote:
    ... However, when I change the procedure like this:

    PROCEDURE FORMS_TEXT_DYN_SQL_TEST(p_where_cluase IN VARCHAR2, p_out_cursor OUT SYS_REFCURSOR) IS
    v_stmt VARCHAR2(1000);
    BEGIN
    v_stmt := 'SELECT tname FROM tab_test WHERE tname LIKE ''%ABS_V4%'' AND :y';
    
    OPEN p_out_cursor FOR v_stmt using p_where_cluase;
    
    END;
    

    And run this block of code:

    declare
    v_tname varchar2(200);
    out_cursor sys_refcursor;
    begin
    forms_text_dyn_sql_test(' 1 = 1 ', out_cursor );
    LOOP
    fetch out_cursor INTO v_tname;
    exit when out_cursor%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(v_tname);
    END LOOP;
    end;
    /
    

    I get the error:

    [1]: (Error): ORA-00920: invalid relational operator ORA-06512: at "ABS.FORMS_TEXT_DYN_SQL_TEST", line 6 ORA-06512: at line 5
    

    Looks like you can only set column_name =: z, column_name =: values of type y. You can not it seems to replace it with no WHERE CLAUSE?

    A bind variable, such as: it, represents a single value.
    If: is the VARCHAR2 '1 = 1', then

    SELECT tname FROM tab_test WHERE tname LIKE '%ABS_V4%' AND :y
    

    takes the value

    SELECT tname FROM tab_test WHERE tname LIKE '%ABS_V4%' AND '1 = 1'
    

    I think you want something like this:

    CREATE OR REPLACE PROCEDURE FORMS_TEXT_DYN_SQL_TEST
    (     p_where_clause      IN      VARCHAR2
    ,      p_out_cursor      OUT      SYS_REFCURSOR
    ) IS
      v_stmt VARCHAR2(1000);
    BEGIN
      v_stmt := 'SELECT ename FROM scott.emp WHERE ename LIKE ''%A%'' AND '
              || p_where_clause;
    
      OPEN p_out_cursor FOR v_stmt;
    
    END;
    /
    show errors
    
    SET  SERVEROUTPUT  ON
    
    declare
      v_tname varchar2(200);
      out_cursor sys_refcursor;
    begin
      forms_text_dyn_sql_test(' 1 = 1 ', out_cursor );
      LOOP
        fetch out_cursor INTO v_tname;
        exit when out_cursor%NOTFOUND;
        DBMS_OUTPUT.PUT_LINE(v_tname);
      END LOOP;
    end;
    / 
    

    Output:

    ALLEN
    WARD
    MARTIN
    BLAKE
    CLARK
    ADAMS
    JAMES
    
  • Impossible to access the records after you have reinstalled windows 7

    I recently upgraded my pc with a new cpu, mobo and ssd.  I have re-installed windows 7 on the new ssd (earlier it was installed on my hard drive). My hard drive with windows is still a primary with windows installed on it, partition even if I am unable to boot with it.  I didn't fit I want to backup my data once I have windows running on my new ssd.
    The problem that I face is now that I'm unable to access some files on my secondary drive. I tried to change the permissions for these folders using my admin account, but when I apply the new permissions, I get access denied error.
    The problem is limited to only a few files and I am able to access the others.
    Please help me with this
    The problem is limited to only a few files and I am able to access the others.
    You may need to take possession of the records problem - see here:
    http://social.answers.Microsoft.com/forums/en-us/w7network/thread/24bdf172-2DBC-43b8-995d-a99b6a81413c/
  • Reject the records after Validation

    I wanted to know how I can apply rejects (Apply #missing) to documents once the validation is complete?

    I know I have to use "AftValidate". However, I'm not sure how to access the "strRecord" and apply reject / #missing to the record.

    Any help or pointer is greatly appreciated!

    But if you change your AftValidate, you are not matching file import... and information disappears between import and validate instead of disappear between Validate and export. This was one of the reasons why I prefer to kill importation because it gets into the system. In addition, if you keep the import log file that shows the details of each line and its outcome, you can see that the line was not imported. (i.e. a "paper trail")

  • call sub procedure for updating the table - need help

    Hi all

    I have a scneario wherein I get three values 0,2.5 and 57.
    For each value, I'll call another procedure that updates a table "sample_dest".
    The "sample_dest" table has a column "dest_nbr."

    Now, for each three values I get,
    I want to update only one record in the table 'sample_dest '.

    for example, I want to update the column "dest_nbr" with a value of 59.5 (0 + 2.5 + 57).

    I am unable to do this, because every time the procedure is called,
    the previous values are not stored. 57 is the last value I get,
    I am able to store only 57. But I want 59.5 to be updated in the table.

    How can I achieve this.
    Help, please.

    Concerning
    Rambeau.

    This should be done in a single sql statement, not in a loop of cursor (which is what it looks like you're doing). If sample_desc already contains records for samples, so it should look like:

    UPDATE sample_desc sdesc
    SET desc = (SELECT AVG(code) FROM sample_dest sdest
                WHERE sdesc.sample = sdest.sample)
    WHERE EXISTS (SELECT 1 FROM sample_dest sdest
                  WHERE sdesc.sample = sdest.sample)
    

    If sample_desc does not already contain records (unknown from your description), then it would be an insert as:

    INSERT INTO sample_desc
    SELECT sample, AVG(code)
    FROM sample_dest sdest
    GROUP BY sample
    

    John

  • Help in the merging of data and create mailing labels

    I have a CSV file with three field ("name, envelope" "" = address"and"City ST Zip") and 245 records.

    I have the labels that correspond to seven on a page.

    I have the designed document. I am able to get the fields inserted, but... when I merge, I get the first page with seven the first record labels, the second page with seven second record labels, page 3 with seven third record labels. You get the photos. I want seven different addresses on each page. So... instead of having more to 35 245 pages.

    Is this possible or should I find a way to make my drawing in Word? * sigh *.

    Everyone made the same mistake; you set seven (records) to your InDesign document, are not.

    Create the first instance (upper-left)

    Go to control panel to merge the data and choose multiple records per page.

    It helps to have put guidelines in place for the Visual presentation and I try to keep the total area of my equal fields the number of hole - exactly 2 inches of width, for example.

    Data merge multiple records per page will need the values for spacing from room to room. Integers and guides make easier.

Maybe you are looking for

  • Photos: 0 images, Photos library: 3.98 GB

    Hello, I have a terrible time understand why [pictures > photo library] says that its size is 3.98 GB but there are 0 photos in the Photos app. I am trying to clear up some space on my laptop. How does less in order to find these "ghost" images and r

  • Create account registry W520

    Hello I created an account on the Lenovo support site to register my new W520 and received an email to confirm the creation of accounts of Lenovo. I disconnected and then connected to check it was ok, and he was. Now, I can not connect, it just says:

  • mouse control, LCD Brightness and sound volume

    Hi, I am designing a VI that allows people with disabilities (with no hands) to use the PC-control with the mouse, the brightness of the LCD screen and the sound volume through several sensors. I found how to do to control the mouse but still cannot

  • Yellow shield in the system tray

    Last night, I just downloaded the latest updates three which included KB890830, the malicious software removal tool.  The other two were (KB2880513) and (KB2878233).  The yellow shield shows that KB890830 is always available.  I am using XP - Pro SP3

  • Accidentally deleted a folder of important emails can I recover?

    These documents were all in a subfolder in my email.  I had several other subfolders and they are all gone.  Canthey be restored.