How do I speed up this bulk collect
Edited... Sorry for the wasted post...
As soon as I posted this I figured out the problem so I removed the post. The problem was in the select section in the get_segment_length function and had nothing to do with the table() functions... After re-writing that this select actually works fast now...
-- Join everything back together using the reduced segements tab.
select sms.eval_rec(
accd.accident_id,
accd.accd_dte,
accd.accd_catg,
accd.accd_catg_description,
accd.accd_rt_seq_num,
accd.dmv_accd_clsf,
sms.pa_pies_equations.get_segment_length(r_beg.rt_num, r_beg.rt_seq_num, r_end.rt_seq_num),
r_beg.segment_region,
r_beg.route_refmkr_id,
r_end.route_refmkr_id,
r_beg.refmkr,
r_beg.rt_seq_num,
r_end.refmkr,
r_end.rt_seq_num,
s.rt_num,
p.construction_start_date,
p.construction_end_date,
p.investigation_id,
p.maj_proj_num,
p.proj_legacy_id,
s.euac,
s.est_severe_accident_reduction,
s.est_total_accident_reduction,
s.pseudo_segment_id)
BULK COLLECT INTO v_final_tab
from table(v_proj_tab) p, table(v_begin_route_tab) r_beg, table(v_end_route_tab) r_end, table(v_accd_tab) accd, table(v_segment_tab_reduced) s
where ((p.investigation_id = s.investigation_id) or (p.investigation_id is null and s.investigation_id is null))
and ((p.maj_proj_num = s.maj_proj_num) or (p.maj_proj_num is null and s.maj_proj_num is null))
and ((p.proj_legacy_id = s.proj_legacy_id) or (p.proj_legacy_id is null and s.proj_legacy_id is null))
and s.rt_num = r_beg.rt_num
and s.begin_rt_seq_num = r_beg.rt_seq_num
and s.rt_num = r_end.rt_num
and s.end_rt_seq_num = r_end.rt_seq_num
and s.rt_num = accd.rt_num
and (accd.accd_rt_seq_num between r_beg.rt_seq_num and r_end.rt_seq_num or
accd.accd_rt_seq_num between r_end.rt_seq_num and r_beg.rt_seq_num);
Similar Messages
-
I just created a slideshow dvd in imovie, and when I hit finalize it said that it would take 7 hours to finalize. I've only had my macbook pro for 6 months, and this is the first imovie I've done...is this normal? If not how can I speed up this process? Thanks in advance for all of your help!
Hi
Time needed can depend on several things.
• less than 5 GB free space on Start-up (Mac OS) hard disk = Redicolous long times AND a DVD that most probably will not work OK
Medicine - I never go under 25GB free space
• Use of strange file formats into iDVD - can force it to de-code first then re-encode - this can take long long times
I use
Video - StreamingDV as from miniDV tape Cameras - or QuickTime Movies Converted to StreamingDV
Audio - .aiff 16-bit 48 kHz - (no .mp3, .wma etc)
• Use of old Mac - My G4 600MHz took about 24 hour per hour movie. my dG5 - about 2 hours per hour (I use Pro Quality encoding)
• Pro Quality encoding - takes about x2 to process a movie
Yours Bengt W -
How to use table type in bulk collect
Hi experts,
How to use table type in bulk collect see the procedure used( oracle 10g)
and error is
PLS-00597: expression 'REQ_REC' in the INTO list is of wrong type
CREATE OR REPLACE PROCEDURE SAMPLE_SP IS
TYPE TYP_A AS OBJECT
( COLMN1 TABLE1.COLM1%TYPE,
COLMN2 TABLE1.COLM2%TYPE,
COLMN3 TABLE1.COLM3%TYPE
TYPE REC_A IS TABLE OF TYP_A;
REQ_REC A_REC;
CURSOR REQ_CUR IS SELECT COLM1,COLM2,COLM3 FROM TABLE1 WHERE <CONDITION>;
BEGIN
OPEN REQ_REC;
LOOP
EXIT WHEN REQ_REC%NOTFOUND;
FETCH REQ_REC BULK COLLECT INTO REQ_REC LIMIT 1000;
FOR I IN 1..REQ_REC.COUNT
LOOP
<insert statement>
END LOOP;
COMMIT;
END LOOP;
END SAMPLE_SP;
Many thanks,
Kalingaok but that is not an issue..
Hi experts,
How to use table type in bulk collect see the procedure used( oracle 10g)
and error is
PLS-00597: expression 'REQ_REC' in the INTO list is of wrong type
CREATE OR REPLACE PROCEDURE SAMPLE_SP IS
TYPE TYP_A AS OBJECT
( COLMN1 TABLE1.COLM1%TYPE,
COLMN2 TABLE1.COLM2%TYPE,
COLMN3 TABLE1.COLM3%TYPE
TYPE REC_A IS TABLE OF TYP_A;
REQ_REC A_REC;
CURSOR REQ_CUR IS SELECT COLM1,COLM2,COLM3 FROM TABLE1 WHERE <CONDITION>;
BEGIN
OPEN REQ_CUR;
LOOP
EXIT WHEN REQ_REC%NOTFOUND;
FETCH REQ_REC BULK COLLECT INTO REQ_REC LIMIT 1000;
FOR I IN 1..REQ_REC.COUNT
LOOP
<insert statement>
END LOOP;
COMMIT;
END LOOP;
END SAMPLE_SP;
Many thanks,
Kalinga
Message was edited by:
Kalinga -
How to decide the limit in bulk collect clause
Hi,
we have got a pl/sql application which is performing mass DML including bulk insert,update and merge over millions of data.Now i am little bit confused in deciding the LIMIT in bulk collect clause.is there any way from which i can decide the optimal limit for my bulk collect clause.and i want to know what are the key factors that affects the limit in bulk collect.
eargerly waiting for ur reply...
thanx
somyHello,
Check this example out and it might help you. All depends how much memory you want to allocate to do this job, you have to experiment to find optimal value (see memory consumption, speed of pl/sql block). There is no formula for finding optimal value as every system is configured differently, so once you have to see how is your oracle parameter (memory related ) configured and monitor system while this is running. I had used 500 for aroun 2.8 million rows.
DECLARE
TYPE array
IS
TABLE OF my_objects%ROWTYPE
INDEX BY BINARY_INTEGER;
data array;
errors NUMBER;
dml_errors exception;
error_count NUMBER := 0;
PRAGMA EXCEPTION_INIT (dml_errors, -24381);
CURSOR mycur
IS
SELECT *
FROM t;
BEGIN
OPEN mycur;
LOOP
FETCH mycur BULK COLLECT INTO data LIMIT 100;
BEGIN
FORALL i IN 1 .. data.COUNT
SAVE EXCEPTIONS
INSERT INTO my_new_objects
VALUES data (i);
EXCEPTION
WHEN dml_errors
THEN
errors := sql%BULK_EXCEPTIONS.COUNT;
error_count := error_count + errors;
FOR i IN 1 .. errors
LOOP
DBMS_OUTPUT.put_line( 'Error occurred during iteration '
|| sql%BULK_EXCEPTIONS(i).ERROR_INDEX
|| ' Oracle error is '
|| sql%BULK_EXCEPTIONS(i).ERROR_CODE);
END LOOP;
END;
EXIT WHEN c%NOTFOUND;
END LOOP;
CLOSE mycur;
DBMS_OUTPUT.put_line (error_count || ' total errors');
END;Regards
OrionNet
Edited by: OrionNet on Dec 17, 2008 12:55 AM -
How to handle multiple save exceptions (Bulk Collect)
Hi
How to handle Multiple Save exceptions? Is it possible to rollback to first deletion(of child table) took place in the procedure.
There are 3 tables
txn_header_interface(Grand Parent)
orders(parent)
order_items (Child)
One transaction can have one or multiple orders in it.
and one orders can have one or multiple order_items in it.
We need to delete the data from child table first then its parent and then from the grand parent table.if some error occurs anywhere I need to rollback to child record deletion. Since there is flag in child table which tells us when to delete data from database.
Is it possible to give name to Save exceptions?
e.g.
FORALL i IN ABC.FIRST..ABC.LAST SAVE EXCEPTIONS A
FORALL i IN abc.FIRST..ABC.LAST SAVE EXCEPTIONS B
if some error occurs then
ROLLBACK A; OR ROLLBACK B;
Please find the procedure attached
How to handle the errors with Save exception and rollback upto child table deletion.
CREATE OR REPLACE
PROCEDURE DELETE_CONFIRMED_DATA IS
TYPE TXN_HDR_INFC_ID IS TABLE OF TXN_HEADER_INTERFACE.ID%TYPE;
TXN_HDR_INFC_ID_ARRAY TXN_HDR_INFC_ID;
ERROR_COUNT NUMBER;
BULK_ERRORS EXCEPTION;
PRAGMA exception_init(bulk_errors, -24381);
BEGIN
SELECT THI.ID BULK COLLECT
INTO TXN_HDR_INFC_ID_ARRAY
FROM TXN_HEADER_INTERFACE THI,ORDERS OS,ORDER_ITEMS OI
WHERE THI.ID = OS.TXN_HDR_INFC_ID
AND OS.ID = OI.ORDERS_ID
AND OI.POSTING_ITEM_ID = VPI.ID
OI.DW_STATUS_FLAG =4 --data is moved to Datawarehouse
MINUS
(SELECT THI.ID FROM TXN_HEADER_INTERFACE THI,ORDERS OS,ORDER_ITEMS OI
WHERE THI.ID = OS.TXN_HDR_INFC_ID
AND OS.ID = OI.ORDERS_ID
OI.DW_STATUS_FLAG !=4);
IF SQL%NOTFOUND
THEN
EXIT;
END IF;
FORALL i IN TXN_HDR_INFC_ID_ARRAY.FIRST..TXN_HDR_INFC_ID_ARRAY.LAST SAVE
EXCEPTIONS
DELETE FROM ORDER_ITEMS OI
WHERE OI.ID IN (SELECT OI.ID FROM ORDER_ITEMS OI,ORDERS
OS,TXN_HEADER_INTERFACE THI
WHERE OS.ID = OI.ORDERS_ID
AND OS.TXN_HDR_INFC_ID = THI.ID
AND THI.ID = TXN_HDR_INFC_ID_ARRAY(i));
FORALL i IN TXN_HDR_INFC_ID_ARRAY.FIRST..TXN_HDR_INFC_ID_ARRAY.LAST SAVE
EXCEPTIONS
DELETE FROM ORDERS OS
WHERE OS.ID IN (SELECT OS.ID FROM ORDERS OS,TXN_HEADER_INTERFACE THI
WHERE OS.TXN_HDR_INFC_ID = THI.ID
AND THI.ID = TXN_HDR_INFC_ID_ARRAY(i));
FORALL i IN TXN_HDR_INFC_ID_ARRAY.FIRST..TXN_HDR_INFC_ID_ARRAY.LAST SAVE
EXCEPTIONS
DELETE FROM TXN_HEADER_INTERFACE THI
WHERE THI.ID = TXN_HDR_INFC_ID_ARRAY(i);
COMMIT;
DBMS_OUTPUT.PUT_LINE(TO_CHAR(SYSDATE, 'DD-MON-YY HH:MIPM')||':
DELETE_CONFIRMED_DATA: INFO:DELETION SUCCESSFUL');
EXCEPTION
WHEN OTHERS THEN
ERROR_COUNT := SQL%BULK_EXCEPTIONS.COUNT;
DBMS_OUTPUT.PUT_LINE(TO_CHAR(SYSDATE, 'DD-MON-YY HH:MIPM')||':
DELETE_CONFIRMED_DATA: ERROR:Number of errors is ' ||ERROR_COUNT);
FOR indx IN 1..ERROR_COUNT LOOP
DBMS_OUTPUT.PUT_LINE('Error ' || indx || 'occurred during
'||'iteration'||SQL%BULK_EXCEPTIONS(indx).ERROR_INDEX);
DBMS_OUTPUT.PUT_LINE('Error is '
||SQLERRM(-SQL%BULK_EXCEPTIONS(indx).ERROR_CODE));
END LOOP;
END DELETE_CONFIRMED_DATA;
Any suggestion would be of great help.
Thanks in advance
AnuIf you have one or two places in your code that need multiple exceptions, just do it with multiple catch statements. Unless you are trying to write the most compact Programming 101 homework program, inventing tricks to remove two lines of code is not good use of your time.
If you have multiple catches all over your code it could be a code smell. You may have too much stuff happening inside one try statement. It becomes hard to know what method call throws one of those exceptions, and you end up handling an exception from some else piece of code than what you intended. E.g. you mention NumberFormatException -- only process one user input inside that try/catch so it is easy to see what error message is given if that particular input is gunk. The next step of processing goes inside its own try/catch.
In my case, the ArrayIndexOutOfBoundsException and
NumberFormatException should be handled by the same way.Why?
I don't think I have ever seen an ArrayIndexOutOfBoundsException that didn't indicate a bug in the code. Instead of an AIOOBE perhaps there should be an if statement somewhere that prevents it, or the algorithm logic should prevent it automatically. -
How to install sccm client on bulk collections using push installation
Unfortunately I did something and received the following description:-
How to know/reproduce the following scenario by installing sccm client on bulk collections in SCCM 2012R2?
"User ***** requested that the CCRs will be generated for collection “All Windows Client Systems (P0100015), The SMS Provider did not generate CCRs for all the system resources in this collection.
Possible cause: some system resources are not assigned to the current site, and you chose to insta
Il clients only on system resources that are
assigned to current site.
Another possible cause: Some system resources do not have Microsoft Windows NT operating system
or above installed.
Message ID: 30110"Ok. Some of your clients are not covered under any site assignment boundary, hence you are getting that error. Would recommend you to select "Install the client from a specified site" and select the Primary site. If your boundary groups for content
are configured fine then the client will be installed from the appropriate site for each machine you are pushing the client to.
-RG -
HELP!!! How to print out details in BULK COLLECT?
I have a
select line#, item, price ...
BULK COLLECT into v_line_table
from table_1, table_2
where ....
How can I do dbms_output.put_line from v_line_table, so I can see what value I got?
Please help! Thank youdoesn't seems to recognize the word "COLLECTION"
dbms_output.put_line(COLLECTION.my_column);
I aslo tried FOR LOOP, no luck
FOR x IN 1 .. v_line_table.COUNT
LOOP
dbms_output.put_line('v_line_table.line_discount '|| v_line_table(x).line_discount); */
END LOOP;
please advise -
How do I speed up this query by ignoring computers off the network faster?
Good afternoon,
I am running the below script to query the entire domain for local admins. Could anyone reccomend a way to speed this up by more quickly skipping computers that aren't on the network? Currently, every time it reaches a computer that is not on the network
it hangs for up to 20 seconds (computers on the network return the data in less than a second). If I could decrease the ping time-out time, I could speed up this query tenfold.
Script pasted below - Thank you!!!
$Searcher = New-Object DirectoryServices.DirectorySearcher([ADSI]"")
$Searcher.Filter = "(objectClass=computer)"
$Computers = ($Searcher.Findall())
md C:\Reports\IBX_Local_Admins_ALL
Foreach ($Computer in $Computers)
$Path=$Computer.Path
$Name=([ADSI]"$Path").Name
write-host $Name
$members =[ADSI]"WinNT://$Name/Administrators"
$members = @($members.psbase.Invoke("Members"))
$members | foreach {$_.GetType().InvokeMember("Name", 'GetProperty',
$null, $_, $null) | out-file -append C:\Reports\IBX_Local_Admins_ALL\$name.txtThis version will not fail no matter what is in the group.
function Get-LocalAdmins{
[CmdLetBinding()]
Param(
[Parameter(
Mandatory=$true,
ValueFromPipeline=$true,
Position=0
)]$computer
Process{
Write-Verbose "Polling system: $computer"
if(Test-Connection $Computer -quiet -count 1){
$group=[ADSI]"WinNT://$computer/Administrators"
$group.Invoke("Members") |
ForEach-Object{
New-Object PsObject -Property @{
Computer=$Computer
aDSPath=$_.GetType().InvokeMember('aDSPath', 'GetProperty',$null, $_, $null)
#UserID=$_.GetType().InvokeMember('Name', 'GetProperty',$null, $_, $null)
}else{
Write-Warning "System not found: $computer"
$computers=([adsisearcher]'(objectClass=computer)').FindAll() |%{$_.Properties['name']}
$computers | Get-LocalAdmins -verbose
¯\_(ツ)_/¯
Hi JRV,
Thank you for your help so far! When I ran the above version, it seemed to be going fine but it stopped at a certain point saying the script was "successful", but it only queried 148 computers. I should note that it is also the same 148 computers each time
I run it. No errors, it just stops and says successful. Any ideas?
TY! -
How can I speed up this VI? It only checks 6 channels, but updates only 20/sec
I am measuring 6 channels of current in this VI. It will only update about 20 times per second.
The VI is quite simple. It measures current on 6 channels, performs a running average using shift registers, and performs some math on the current to convert it to loads. It also writes all values to a file once per iteration. I ran a similar VI that only checked 4 channels and did not write to the file, but it is not much faster. I also tried to make sure all coercion dots were eliminated, but that did not help much either.
Can anyone take a quick look and see if there is something obvious I am doing that is slowing it down? Or is this a reasonable update rate for this VI?
The top-l
evel VI is the one called "RunTestBed 24v loop loop.vi".
Thanks!
Mike
Attachments:
RunTestBed_24v_loop_loop.llb 349 KBYou are using high lvel VI to do you I/O inside the loop.
Take a look at the shipped example that demonstrates how to start a do a continuous acquisition.
The example is title something like
Continuous double buffered acquisition.
The High VI's you are using are configuring the I/O and allocating buffers durring each iteration. THe eaxample I mentioned will do all of this one up front and then just re-use everything inside the loop.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
Brochure template I created myself is responding terribly to editing and manipulation. I'm thinking it could have been a problem with the amount of layers I added on PS elements 12, but I compressed the file and I'm still was having this extremely slow response. I went through the re-installation process and troubleshooting with updates and whatnot but they proved to be unsuccessful.
Sidenote*
Brand new desktop PC
All other Adobe products have been running just perfectly until Acrobat Pro
I have worked with Acrobat 8 before and I never experienced these same problems
Any tips to help my productivity increase tenfold?
Thanks in advance!
-MMMSo what OS and what version of Acrobat? There may be an issue in the combination.
-
HOW can i speed up this database search
SelectCommand="SELECT ADDR1_HSE, DISCO_DTE_SBB, DISCO_RSN_SBB, FMA_SBB, HOME_PHONE_SBB, RES_NAME_SBB, TAG_FIELD1_HSE, TAG_FIELD2_HSE, TAG_FIELD3_HSE, ZIPCODE5, SYS_SBB FROM SBB_HSE_HSL WHERE (SYS_SBB = 8773) AND upper(ADDR1_HSE) LIKE '%'|| upper(:ADDR1_HSE) || '%' AND upper(RES_STATE_HSE) = upper(:RES_STATE_HSE) AND upper(RES_CITY_HSE) LIKE upper(:RES_CITY_HSE)">
<SelectParameters>
<asp:ControlParameter ControlID="txtSearch" Name="ADDR1_HSE" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="state" Name="RES_STATE_HSE" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="city" Name="RES_CITY_HSE" PropertyName="Text" Type="String" />
</SelectParameters>Find out how many distinct values for SYS_SBB exist.
select count(distinct(SYS_SBB)) from SBB_HSE_HSL;
select SYS_SBB, count(*) from SBB_HSE_HSL group by SYS_SBB order by SYS_SBB;If you have a large number of distinct values with a small number of rows for each value (or for most values) you could index the table on SYS_SBB
create index AN_APPOPRIATE_INDEX_NAME on SBB_HSE_HSL(SYS_SBB) nologging;
alter index AN_APPROPRIATE_INDEX_NAME logging;(substitute a name for "AN_APPROPRIATE_INDEX_NAME" per the Index Naming Conventions in the database / in your organisation. -
This is my first time joining the Apple Support Communities Help Line.
Please refer to the subject line for my discussion/Question!Try here:
iOS: Troubleshooting backup issues in iTunes
Does the backup complete? -
How to use BULK COLLECT in oracle forms
hi gurus,
I am using oracle forms
Forms [32 Bit] Version 10.1.2.0.2 (Production)
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionI wanna use bulk collect from database table lets say <employees>
while working on database level with collections and records it's working very well for me, but when I try to use that technique on oracle forms it hits me error
error 591 this feature is not supported in client side programmingI know I can use cursors to loop through the records of oracle tables ,
but I'm convenient while using collections and arrays
for example
Set Serveroutput On
Declare
Type Rec_T Is Record (
Empid Number ,
Empname Varchar2(100)
Type V_R Is Table Of Rec_T Index By Binary_Integer;
V_Array V_R;
Begin
Select Employee_Id , First_Name
Bulk Collect
Into V_Array
From Employees;
For Indx In V_Array.First..V_Array.Last Loop
Dbms_Output.Put_Line('employees id '||V_Array(Indx).Empid ||'and the name is '||V_Array(Indx).Empname);
End Loop;
End;I wanna use this same way on oracle forms , for certain purposes , please guide me how can I use ...
thanks...For information, you can use and populate a collection within the Forms application without using the BULK COLLECT
Francoisactually I want to work with arrays , index tables ,
like
record_type (variable , variable2);
type type_name <record_type> index by binary_integer
type_variable type_name;
and in main body of program
select something
bulk collect into type_variable
from any_table;
loop
type_variable(indx).variable , type_variable(indx).variable2;
end loop;
this is very useful for my logic on which I am working
like
type_variable(indx).variable || type_variable(indx-1);
if it's possible with cursors then how can I use cursor that can fullfill my this logic@Francois
if it's possible then how can i populate without using bulk collect?
thanks
and for others replies: if I can use stored procedures please give me any example..
thanks -
I want to share the link and post the:
Tell Congress:
It’s Time to Stop Mass Surveillance
Mass surveillance threatens people’s privacy and security online.
Tell Congress to stop bulk collection of our personal information.
there is no easy way to post this or forward without sending the entire page link and nobody will touch those if something like a preview doesn't show up, just looks like a bunch of unsafe links to most people, you need to have a share button on this if you really want us to share itHeres the link to "Take action" http://mzl.la/1CgTnKg. In the future if you want to copy links, right click the address bar, and the whole link should be selected, then click "Copy" in the menu that comes up.
Have a great day!!
Jon -
How to view errors if bulk collect has thrown errors
Hi,
I have few questions.
1.How to view error whether bulk collect is successful or not
2.What is identified & unidentified relationships in ERWIN
3.How to see the errors whether the sql loder is successful or not
and how to open the log file.Is there any specific command in UNIX
which tells loader is successful or thrown error
4.When executing the pl/sql procedure from UNIX.how to check for errors.
Please provide the answers for this
ThanksUse SAVE EXCEPTIONS clause in your FORALL loop.
Is this for homework/test?
Maybe you are looking for
-
HotSpot Virtual Machine Error, Internal Error
HI , When i am starting my weblogic server instance it displays following error . Pls. advice me. thanks HotSpot Virtual Machine Error, Internal Error Please report this error at http://java.sun.com/cgi-bin/bugreport.cgi Java VM: Java HotSpot(TM) Cli
-
How do I get rid of"Index of file:///C:/" as the opening page?
Every time Mozilla is opened, the following file is displayed: Index of file:///C:/ How can I get rid of it and set up a different homepage?
-
Preview app is too slow to open PDF from Server Snow Leopard
Hi After the Lion update into a MacBook Clients the app Preview has become too slow to open PDF files from Mac server OS Snow Leopard. Preview app isn't not slow to open PDF present into local system hard disk. Can you help me to solve this?
-
How to Hide Report Background Engine
Hi, can you help me on my problem. What should I do, to hide the Report Background Engine when the report is running. Thanks in advance! Eric null
-
Perhaps this is a question for Michael Girdley. When will the 1.3.1 JVM be supported for WLS 5.1 on Solaris 2.7? We are in the process of moving from 1.2.2 to 1.3.0 (supported). However, HotSpot's garbage collector is crashing the VM in certain repea