Oracle 11g: engage inside the outer loop or loop

Hello

Could someone pls help in this regard.

My PLSQL program retrieves approximately 400 000 thousand records in cursor loop and cl, it takes more than 4 hours to complete IT.

I commit every transactions inside the cursor loop... This can affect the runtime performance?


Also, pls suggest, can we use commit 400 000 transactions once it will be faster? (or) the performance of baskets longer than the current situation.


My goal is to make the fastest program and expect to reduce the timing of execution of 4 hours to 1 hour...


Appreciate your help...


Program design: advice:

a. Select 400 000 thousand documents in the cursor.

b. inside cursor for loop to two new sql instructions written to get values and store it in the local variable (this value is used in the call to insert data), two sql statements are handled with no_data_found and too_may_rows logic implicit sql statements to intercept the errors of the company

c insert statement.

validation of d. inside the loop (batch mode: nowait)

management at the level of the procedure using raise_application_error exception e...

Do not use the PL/SQL for data processing. SQL is a powerful language. Get the best out of him.

Here is an example of using INSERT ALL. This is untested code and may contain syntax and semantic errors.

insert all
  into medicomread.aatable_permit_people
  (
        permitnum
      , lic_num
      , lic_type
      , bus_name
      , addr1
      , addr2
      , addr3
      , city
      , state
      , zip
      , ph1
      , ph2
      , fax
      , bus_lic
      , lic_original_issue_date
      , expiration_date
  )
  values
  (
        appt_ref_no
      , lic_num
      ,'Business License'
      , company_name
      , postal_address
      , null
      , null
      , null
      , emirate
      , po_box
      , telephone
      , null
      , fax
      , license_no
      , issue_date
      , expiry_date
  )
  log errors into err$_aatable_permit_people ('INSERT1: HEALTH CARD SPONSOR DETAILS') reject limit unlimited
  into medicomread.aatable_permit_people
  (
        permitnum
      , tt_contact_type
      , name
      , b1_contact_nbr
  )
  values
  (
        appt_ref_no
      , 'Applicant'
      , cname
      , userseqno
  )
  log errors into err$_aatable_permit_people ('INSERT2: HEALTH CARD BUSINESS USER DETAILS') reject limit unlimited
  into medicomread.aatable_permit_people
  (
        permitnum
      , tt_contact_type
      , B1_Contact_Nbr
      , Name
      , gender
  )
  values
  (
        appt_ref_no
      , 'Individual Health'
      , userseqno
      , patient_name
      , ***
  )
  log errors into err$_aatable_permit_people ('INSERT3: HEALTH CARD APPLICANT USER DETAILS') reject limit unlimited
with t1
as
(
 select mr.appt_ref_no
      , mr.sponsor_name
      , substr(mr.PATIENT_NAME,1,79) PATIENT_NAME
      , mr.***
   from medicomdata.mc_register mr
      , medicomdata.mc_process_type_register mptr
      , medicomdata.um_users uu
      , medicomdata.um_companies uc
  where mr.patient_id     = mptr.patient_id
    and mr.pro_id         = uu.user_id
    and mr.facility_id    = mptr.facility_id
    and mr.process_type   ='OH'
    and mr.regn_status    = 5
    and mr.sponsor_name   = uc.company_name
    and uu.type_id        = 3
    and (add_months( mptr.issued_date, 12 )-1) > sysdate
),
t2 as
(
 select decode(ucr.license_category_id,'DED','DED'||uuc.license_no,uuc.license_no) lic_num
      , uuc.company_name
      , ucr.postal_address
      , ucr.emirate
      , ucr.po_box
      , ucr.telephone
      , ucr.fax
      , uuc.LICENSE_NO
      , ucr.issue_date
      , ucr.expiry_date
   from medicomdata.um_companies uuc,medicomdata.company_registration ucr
  where uuc.license_no=ucr.business_license_number
    and uuc.inactive=0
    and upper(ucr.request_status)=upper('true')
),
t3 as
(
 select uu.company_name
      , cname
   from (
         select uu.first_name ||' '|| uu.last_name cname
              , row_number() over(partition by uu.company_name order by decode(usr.service, 'HCDC', 0, 1)) rno
           from medicomdata.um_users uu
              , medicomdata.user_service_request usr
          where uu.user_id      = usr.user_id
            and usr.service     = 'HCDC'
            and uu.type_id      = 2
            and uu.inactive     = 0
         )
  where rno = 1
)
select t1.appt_ref_no
     , t1.patient_name
     , t1.***
     , t2.lic_num
     ,'Business License'
     , t2.company_name
     , t2.postal_address
     , null
     , null
     , null
     , t2.emirate
     , t2.po_box
     , t2.telephone
     , null
     , t2.fax
     , t2.license_no
     , t2.issue_date
     , t2.expiry_date
     , t3.cname
     , companyuserseq.nextval userseqno
  from t1
  join t2
    on t1.sponsor_name = t2.company_name
  join t3
    on t1.sopnsor_name = t3.company_name;

Tags: Database

Similar Questions

  • Slow loop inside the quick loop

    It's my first week of work with LabView so perhaps the answer is very simple.

    Here's my question:

    How can I include a slow loop (event B) inside a quick loop (event A)?

    What I would like is for event B run every 1000 milliseconds, and the event has every 100 milliseconds.

    Where event is a position control loop and event B a simple write to a file of any measure.

    Any recommendations on how I should do this?

    You can use an Express VI of time spent inside the quick loop to see if it is time to perform the slow loop.  I took the liberty to not use a loop for your "event B" because it sounded like you want just the rhythm with the event.  Place B events in the real case of the box Structure. The design of producer/consumer model is the way to go if you are developing a complex application. This will make if your problem is relatively simple.

  • loop nested using iteration of the outer loop as counter

    Hello world.  I have a moment where I perform calculations at each iteration of the loop and display on the front panel.  Then, in a loop iteration randomly (referred to here as I = 9 to test) it fires an event where that performs calculations on x number of iterations (iterations of the outer loop while) the result of external calculations, while performing at the same time and the view from the outside so that the calculations of the loop.  Is that two mathematics algorithms are synchronized in iterations.  After x iteration the program returns then to only calculate and display the while loop calculations using the value from the shift register, updated until another event is triggered (I do not show an another event trigger in the code example) I can just find a way to trigger an event , and at the same time to make two calculations with the same loop iterations.  Any suggestions?

    The VI of the sample in the previous post of crossrulz should provide the functionality you are looking for. The while loop acts to go through ten operations you want to perform and records time difference will allow him to record these values, as you understand. I think that crossrulz refers to shift registers on the while loop that surrounds the case structure that records the shift are unusable on a structure of the case, as you pointed out.

  • How to add the unique element (inside the while loop) to itself

    I have only digital output element that is in the while loop. Its value changes in each time the loop iteration. If lets say I want to adds the values of the ten first in iterations of the loop of this variable.  How can I do that.

    See attach image for more precision.

    Thank you

    JK

    Hi Joseph,.

    THINK THE STREAM!

    As the values are stored in the son and the shift registers (and NOT in any kind of variables), you must use these fundamentals of LabVIEW:

  • Sequence structure flat inside the timed loop and execution order

    I have some problems trying to implement a flat sequence structure when you use a loop timed on a target of cRio VI

    I tried with or without the while loop around the structure of sequence flat, and I also tried to replace the 'Non-deterministic loop' with a timed loop

    The problem is that the program seems to run only once, then get stuck somewhere

    I am writing a program that performs the following operations as soon as possible:
    1. read the Pos_MC of entry on the FPGA
    2 send the value of Pos_MC to the VI target (on cRio CPU)
    3. calculate a value of output based on Pos_MC with a PID block ("exit PID')
    4. send 'PID output' to the FPGA
    5 write "PID output" analog output "MOOG".

    In addition, I want the program to return the measured value "Pos_MC" to a host VI for the recording of data

    So that the output of PID is calculated and sent to the FPGA as quickly as possible, I placed a flat sequence structure to ensure that it happens before you send the output to the nondeterministic loop for recording data

    Also, I want the digital input 'Stop' to be able to stop the loop deterministic (the timed loop)

    I read much more entries than that and the help of several PID and exit, but I rewrote the code for a single entry and exit to make it easier to illustrate

    Screenshot of the code is shown in 'target code.png' and 'fpga code.png.

    The VI themselves are attached in the next post (cannot attach files of more than 3)

    Question 1:
    Any advice on how to get this race? Thank you!

    Question 2:
    Is also my correct understanding in that, using this structure, each 0.9ms (fpga loop time) comes the following:
    1. the input ("Pos_MOOG") is read on the fpga
    2. the production of PID is calculated on the cRio with some delay to computation (for example 0.1ms)
    3. the output of PID is then written for analog output "MOOG" in all about 0, 1 - 0.2ms
    4. the FPGA program then waits until 0.9ms spent and repeat the process

    As opposed to the next pass whenever performing a loop is started on the FPGA:

    1. the FPGA reads the input and written on the output (the output of the execution of the previous loop PID)

    2. then the entry is sent the cRio, PID output is calculated and sent to the FPGA

    3. the new release of PID is maintained until the next time through the loop

    Thank you!

    PHG wrote:

    Thanks for the input guys, any advice as to how I could get the feature in scenario 1?

    I still say that the best route is just putting all the logic of the control in the FPGA.

    Other alternatives include 1) the use of DMA FIFO sedn data back or 2) use interruptions so that the FPGA code can not read the output level until the RT.

    DMA FIFOs are usually very limited, and I would not use them in this situation since I belive said it this code to do for the many outputs.

  • Oracle 11G - access to the table problem

    Hello
    New on Oracle IAM... After you create a database, I created a connection and SYSDBA role...
    And then I create a table called Table1. And then I create a new USER and I Connect with the same SID of the database, but the role has the DEFAULT value for this new USER...

    01. but the problem is that I can't find the Table1 table for this new user... so how acess as Table1...?

    02. I came to know in Oracle, also we can design forms for the frontend and can generate EXE... Is this true?

    03. in SQL Server - Sql Port with static IP - we have access to the database for remote users... Is it possible for Oracle?


    Thanks for the directions...

    997497 wrote:
    Hello
    New on Oracle IAM... After you create a database, I created a connection and SYSDBA role...

    What the user did you use to connect? I'm guessing that you logged in as SYS

    And then I create a table called Table1. And then I create a new USER and I Connect with the same SID of the database, but the role has the DEFAULT value for this new USER...

    So I guess that you have created the table in the SYS schema. You should never, ever create user objects in the SYS schema. If you have created the table in the SYS schema, you really need to drop and create in a more appropriate scheme.

    You indicate that you come from SQL Server, so there may be a question of terminology. Which refers to SQL Server as a "database" is roughly equivalent to what Oracle designates as a "scheme." An Oracle database contains many schemas. A schema is the set of objects owned by a particular user.

    01. but the problem is that I can't find the Table1 table for this new user... so how acess as Table1...?

    As I said above, you really, really should not create objects in the SYS schema. If you really want, however, you need to log the SYS schema and grant access on the table to your new user

    GRANT SELECT ON sys.table1 TO your_new_user
    

    You will then need to fully qualify the table name in your SELECT (or create a synonym or the current_schema)

    SELECT *
      FROM sys.table1
    

    02. I came to know in Oracle, also we can design forms for the frontend and can generate EXE... Is this true?

    Older versions of Oracle Forms would create server executables. The modern versions are used to create three-tier applications. You can also use APEX to build web applications. Of course, you can also generate executables by writing code in another language (often .net).

    03. in SQL Server - Sql Port with static IP - we have access to the database for remote users... Is it possible for Oracle?

    Is this possible? Sure. Depending on what means "remote users", however, it may be poorly advised - you would never open a database to the internet directly, for example, you want to ensure that the remote users are connected to your network (via a virtual private network).

    Justin

  • Oracle 11g and then the database export import in oracle 10g

    Hello! There everyone...

    Please tell me the way to export the data and my data structures i.e. the comprehensive database of Oracle 11 g to the old version (oracle 10g) and how he import it...

    I move the database from one computer to another without lan, preferably via the storage device...

    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28319/dp_overview.htm#CEGFCFFI

    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28319/dp_export.htm#i1009711

  • How to get the value selected inside the forEach loop

    Hello
    I have foreach loop with a link inside command. It looks like in below:

    * < af:forEach items = "#{PagingBean.pages}" var = "item" > * "
    * < text af:commandLink = ' #{point} "id ="cl1. "
    * actionListener = "#{PagingBean.pageLinkClicked}" / > * "
    * < af:spacer width = "10" height = "10" id = "s1" / > *.
    * < / af:forEach > *.

    where PagingBean.pages is an array of integers.
    Now the links look like this * 1 2 3 4 5 * I want to get the value of the clicked link.
    Anyone please help me to get the value of commandlinks clicked in the bean

    Hello

    How about the text in the actionListener for the clicked commandLink and process accordingly?

    Ex:

     
                           
                           
    
    
        public void pageLinkClicked(ActionEvent actionEvent) {
            // Add event code here...
            System.out.println(((RichCommandLink)actionEvent.getSource()).getText());
        }
    

    Arun-

  • Oracle 11G - configuration of the Service CARS

    Hello
    I read a lot of documentation about oracle services and I have ok understand how they work. However, I have a general question about using Oracle RAC configuration services. For example, if I have a 2 node RAC 11 GR 2 on a Linux Redhat Server oracle. I have an application that connects to a service that I created. I create the following service.

    srvctl add service d ORCL_RAC s app_service - ORCL_RAC1, ORCL_RAC2 r

    The tnsnames contains:

    APP_OLTP =
    (DESCRIPTION =
    (LOAD_BALANCE = ON)
    (FAILOVER = ON)
    (ADDRESS = (PROTOCOL = TCP)(HOST = server01) (PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = server02) (PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = APP_SERVICE)
    (FAILOVER_MODE =
    (TYPE = SELECT)
    (METHOD = BASIC)
    (RETRIES = 20)
    (TIME = 1)
    )
    )
    )

    My questions are the following:

    (1) when I do a "srvctl status service d ORCL_RAC", I see the service that is running on both nodes of the RAC? Or he runs only a single node, and then it will switch to the other if necessary?
    (2) if I have a RAC environment where I see two services created (RAC_SRV1 and RAC_SRV2). I see that RAC_SRV1 runs only on node1 and RAC_SRV2 is only running on Node2. There are two applications that share the same database, an application uses RAC_SRV1 and the other application is the use of RAC_SRV2. Am I right to think that there is no failover available here? If node1 goes down, the connection to RAC_SRV1 application will be not able to connect to the right of node2?
    (3) in the case of the scenario in question 2 above, it would be better practice to simply create a service and have the two applications connecting to a service? Could configure NEB service to point connections of an application with the Node1 and node2 another application?

    (1) when I do a "srvctl status service d ORCL_RAC", I see the service that is running on both nodes of the RAC? Or he runs only a single node, and then it will switch to the other if necessary?

    You can see how it works on both nodes.
    Use a option in srvctl (a list of available instances to which the service switch when the database's administrator managed).

    http://docs.Oracle.com/CD/E11882_01/RAC.112/e16795/srvctladmin.htm#i1008562

    (2) if I have a RAC environment where I see two services created (RAC_SRV1 and RAC_SRV2). I see that RAC_SRV1 runs only on node1 and is RAC_SRV2 > only running on Node2. There are two applications that share the same database, an application uses RAC_SRV1 and the other application is the use of RAC_SRV2. Am > reason to think that there is no failover available here? If node1 goes down, the connection to RAC_SRV1 application won't be able to connect to node2 > right?

    It depends on the configuration of your service. Check it out by srvctl config

    (3) in the case of the scenario in question 2 above, it would be best practices simply create a service and have the two applications connecting to that > service? Could configure NEB service to point connections of an application with the Node1 and node2 another application?

    better create two services, one for each application with specific and other nodes in the available list.

  • Cannot use median filter inside the While loop

    Hello

    I try to use the filter median insade loop some time. This seems to be a problem. I have attached the VI. Help, please.

    This entry is a number of sample as 1,1.1,1.05. This output is zero.

    Thank you

    Vincent

    Since you get only one value per iteration, you can use the point-by-point version of the median filter.

  • Insert in oracle 11g postgresql using the database link

    Hey all,.

    an I have a problem when I try to insert into the table postgre

    copy of sa/sa@xe insert "ora". "TAB0"@orapos3 using select * from tabel0;

    SP2-0498: lack of column between parentheses or USING keyword list

    to 'ora '. "TAB0"@orapos3, data type of are all text columns

    tabel0 taype data of the whole column is varchar2...

    What is the cause?

    kgronau,

    Thanks for your help

    I found the solution to this problem, this is not caused by the configuration...

    I use the pl/sql like this:

    DECLARE

    CURSOR remote_insert IS SELECT * FROM sa.tabel0;

    START for rec IN remote_insert LOOP

    INSERT INTO "ora". ' Values of TAB0"@orapos3 (rec.kolom000, rec.kolom001, rec.kolom002, rec.kolom003, rec.kolom004, rec.kolom005, rec.kolom006, rec.kolom007, rec.kolom008, rec.kolom009, rec.kolom010);

    END loop;

    END;

    /

    Thank you

    Daniel

  • Oracle 11g R2, CREATE THE TABLE and QUOTAS

    Hi all
    I need some insight on a strange behavior, that I discovered in Oracle 11 g 2. Don't know if I'm missing something or if I just discovered a security issue with Oracle.

    Oracle Version: 11.2.0.1.0

    The problem is with the CREATE TABLE and the QUOTA on the specific tablespace privilege.

    Please, try this on your system (if you have some free time and care to confirm the "bug").

    Create a user, grant privileges than two, CREATE THE SESSION and CREATE TABLE.

    Grant NO quota on any tablespace.

    Try to create a table on any tablespace (except SYSTEM) and everybody say if it worked or not.

    The oracle documentation provides the following:

    To create a relational table in your own schema, you must have the CREATE TABLE system privilege. To create a table in the schema of another user, you must have the CREATE ANY TABLE system privilege. In addition, the owner of the schema containing the table must have a quota of space on the tablespace contains the table or the UNLIMITED TABLESPACE system privilege.

    [http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_7002.htm#SQLRF01402]

    The fact is, so far, on two different instances of Oracle 11 g 2, my users are not limited in the creation of the tables only when they have quotas, but where they want to, except the STRING.

    The behavior correct would be to deny the creation of the table the tablespace where there is no quota, but it does not work.

    My instance of Oracle 10 g behave properly and therefore the creation of the table is denied the tablespace with no quota.

    P.s1 sorry if this a well known "bug/problem/question". I've been ridiculous on a well-known forum for the same question. I don't need to be "filled spoon" as shown on this famous site! I have read the documentation! I googled a lot!

    P.s2 even if the creative work of table on tablespace with no quota, you cannot insert data into it. Yes, big picture, the user cannot not filled space with irrelevant data tables, but it can create thousands of tables...!

    Did I miss something?
    Is there a 'default' option I have to mark to prevent the creation of the table where it shouldn't?
    ? (?)

    Please read http://tkyte.blogspot.com/2011/02/deferred-segment-creation.html.

  • How to put a line inside the foreach loop number

    Hello

    I work in a nutshell, model, and I have a foreach loop. For each row of data, I would like to put a line at the beginning of the line number, i.e., 1,2,3,4, etc.

    How can I do this in Word?

    Thank you

    use

    
    
    
  • control flash movieClips from inside the repeat loop

    Hi guys

    I have a flash sprite in my partition that contains 20 movieClips named button1 to button20.
    I'm trying to rewind the movieClips touch to their executives 1 go in a loop of repetition, I tried a few different methods, but may not know!

    This code works: sprite (11).button1.goToAndStop (1)

    Does anyone at - he had success this?


    Thank you very much

    Hi guys, I thought about it.
    I ended up setting a benchmark for the clips using getVariable()

    Posted the code, might be useful!
    -------------------------------------------------------------------------------
    pFlashButton property

    Repeat with i = 1 to 20
    pFlashButton = getvariable (sprite (11), #button & i, False)
    pFlashButton.goToAndStop (1)
    end repeat
    -------------------------------------------------------------------------------

    See you soon

  • get the structure of the event inside the while loop to wait for event occurs before the execution

    Hello

    I have a small problem, when I raise an event using a value change button, which works very well.  The problem is that the VI does not wait for me raise an event and instead runs the same event again, even if I have not pressed the button to start again.  The mechanical action of the button switch is released is.

    I was wondering how you get the structure of the event to wait for a user event, after that he executed the first time.

    James.Morris wrote:

    There is no reason that the event should be raised twice as much that the only way that it fires in your code is by the user by clicking on 'Hall measure only'.

    Oh yes, there is, and I deserve a kudo for this one.  Mechanical action on the button is set on the switch until published, so click to generate an event, on the bottom and on the square, attached is an example.

    My boy has my students hate this question, and to be honest, I hated it.  When never would you do that intentionally?  Honestly?  Anyway to change the button back to normal (as default latch when released) and move the terminal button in the structure of the event where it is managed and it will work as usual.

Maybe you are looking for

  • Satellite L650-11-fan constantly at 90% after fashion constantly 0%

    HelloI have a Toshiba L650-11F with aIntel i5 M430 to 2.3 GHz4 GB of Ramlatest version of the BIOS version 2.4 And I tried to clean the fan with or without adapter restart, change the power setting.But no success fan stil maintains 90% all the time.

  • Update 0x8024400A error how to fix this bad

    I reinstalled windows xp. cannot get updates.

  • Aspire drivers VN7-791

    Hello I have an acer aspire laptop VN7 - 791. When I open acer care and access updates don't seem to update. But when I go to acer.com and choose drivers for VN7 - 791 G there are new drivers available. First of all, I want to know what should I down

  • Cannot create a group in windows mail.

    I'm unable to create a group mailing list.   I checked help and it is said to look for the new Contact Group on the toolbar, and I did not have this option and can't find it anywhere.

  • Compatibility upgrade CPU Dell T3600

    I am looking to buy a Dell T3600 and want to upgrade the processor. It is an upgrade of the Bios that will allow me to install an E5 2670 - v3 ES 12 core cpu. The current specs say that it accepts up to 8 core processors Thank you for your time.