SQL & PL/SQL :: To Get Rid Of Looping

Aug 17, 2010

The below sql is executed by reading the flat file row by row which is having more than 2 million rows.

SELECT CUST_SEQ_R, BANK_BRANCH_C INTO v_CustNo, v_BrnachCode
FROM TABLE1
WHERE ACCOUNT_NO = v_Acc_No
AND VIST_NO = v_VistnO
AND CUST_JOIN_DATE = to_Date(v_Cust_Date,'yyyymmdd');

The procedure opens the file, reads one record, parses it, then it executes few select statements then it loops back to the top where it reads one more record and runs through each activity again. How to read batch of records rather than one record at a time. Is something like creating staging table or by using bulk collect.

v_Acc_No,v_VistnO,v_Cust_Date are variables that read from below file.

test data:
BNC192363A1291197OQ6HA0H05557004559020080528
BNC194566A1280615VT8FA0H05917004016020080530
BNC192588A1263301VB2LE0G11065005707020080519
BNC178369A1295822MM4XB0G11820006839020080512

View 9 Replies


ADVERTISEMENT

SQL & PL/SQL :: Looping Through A Ref Cursor

Feb 16, 2008

I have a procedure which has an out value of a ref cursor (made up of different columns from different tables). I would like to call that procedure from another procedure and loop through each row.

I know how to call my stored procedure but I don't know how to loop through it.

View 5 Replies View Related

SQL & PL/SQL :: Straight Insert Instead Of Looping

Sep 24, 2012

I have a table with these rows,

Name No
one1
two2

Without using plsql looping constructs, how to achieve this in a simple sql statement?

View 5 Replies View Related

SQL & PL/SQL :: Looping External Tables?

Jul 31, 2012

I am using an external table with numbers and joining the external table to fetch data and Insert into another table.I am altering the table within procedure to pass csv file name as parameter as It'll change each time. It's working fine but in case if my grouping id is having two gids, then Header from csv file is also inserted as row in to coupon_personlization_members.

I gave skip 1 in external table but for second GID, header is inserted as row.I don't want header to be inserted as row but header will be there on csv file.

Here is my procedure :
CREATE OR REPLACE
PROCEDURE proc_coupon_load(
p_grouping_id NUMBER,
p_file_name VARCHAR2)

[code]..

View 4 Replies View Related

Forms :: Looping Records With Checkbox Value

Jun 17, 2013

I am Using the Check Box in the Detailed Block & I Have Assigned values 'Y' and 'N' when Checked & Unchecked If there are 3 Values Retrieved in the Detailed Block, Among that 2 Values are Checked the Cursor is Directly going the 2nd Value and Displaying the 2nd Value 2 Times rather than Displaying the 1st Value.

Below Attached is the Code Which i am Using.

GO_BLOCK ('ITEM_RESULT');
L_ITEM_CODE := :ITEM_RESULT.ITEM_CODE;--71720;--
first_record;
loop
message (' item id is '|| L_ITEM_CODE || '-' || :ITEM_RESULT.CHECKBOX);
if L_ITEM_CODE is not null and :ITEM_RESULT.CHECKBOX = 'Y' then
begin
[code]....

View 6 Replies View Related

Application Express :: Looping Checkboxes

Jun 15, 2012

How can I loop through unchecked checkboxes using this construction: FOR i IN 1 .. apex_application.g_f01.COUNT (its for checked)

View 5 Replies View Related

Forms :: Looping Multiple Records In Blocks

Jul 31, 2012

I have two blocks, both are multi record block. 1st block is control block and second is database block. Both the blocks have same fields(Example: Location,Location_name,Location_Type). In the first block(Control Block) I have check box. My goal is when I check the checkbox and click on add button all the records which are selected in first block should go to second block.

View 3 Replies View Related

SQL & PL/SQL :: Improve Procedure Which Is Looping Through Query To Make Inserts

Oct 10, 2013

I am trying to improve a procedure which is looping through a query to make inserts.

FOR P IN (
SELECT O.TYPEID
,o.KEY
,O.ID
,O.NAME
,O.LGNUM
,O.LGNAME
[code]....

View 12 Replies View Related

JDeveloper, Java & XML :: Looping And Querying Data From XML Clob

Oct 14, 2013

Our company database is Oracle based and we use SQL Developer to pull out needed data.Using a snippet borrowed from a co-worker, I have put together a query that, among other things, pulls a list value out of an xml clob field and displays it in the query results. My query as it stands right now is below, followed by an example snippet of the xml clob that I am pulling from. The reason for the "query within a query" is because the base query could return multiple entries and I only want the one with the most recent date.

select * from
(Select Wtr_Service_Tag, Wtr_Tran_Origin, Wtr_Send_Date, Wtr_Receive_Date,
to_char(substr(wtr_req_xml,instr(substr(wtr_req_xml,1,8000),'SID')+8,12)) Asset_Tag
from ws_transactions
Where Wtr_Service_Tag In ('20458749610')
And Wtr_Req_Xml Like ('%CSM%')
Order By Wtr_Receive_Date Desc)
where rownum = 1;
[code]....

This query is only able to pull the first value in the list.How can I edit this query to pull all of the list items when there are more than 1 (preferably concatenated into one column in the query results)? I have another field, in a separate table, that I can pull from to get the number of list items.

This one may be more complex. As currently written, the query pulls a fixed number of characters from the xml clob and either returns not enough data, or too much because the values I need to pull could be of varying lengths. I have no way to query what those lengths might be.

View 28 Replies View Related

Application Express :: Looping Through Row Selector Exponentially Duplicating

Jul 15, 2013

Using Apex 4.2

 BackgroundCreated a Tabular Form based on a view. Removed all the default multi-row updates and deletions, buttons and processes.I am using a tabular form because of the fact that I can gain access to a row selector.The row data itself is all read only so in effect this is a report with a row selector.This is because I can't find a way to select a row an interactive report, well I can and did but this was a work around. ProblemI have created a button to process the selector to run the below code:

begin
kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'Selected Check Boxes:'||wwv_flow.g_f01(1)) ;
kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'Selected Check Boxes:'||wwv_flow.g_f02(1)) ;
   for i in 1..wwv_flow.g_f01.count
   loop
   kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'i:'||i) ;
      kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'WF ID:'|| wwv_flow.g_f02 (wwv_flow.g_f01.count)) ;
   end loop;
end;

I just wanted to see what would be output. For one row this works fantastically and I can find the ID based on the rowWhen I select more than one row the loop run's through for the number of rows but then also runs for the number of rows selected.So if I selected threee rows this above procedure would run three times, each times looping three times.I have set the execution scope to: For Created and Modified Rows in the button condition that appears.RequiredI only want to loop through the selected rows once per button clickORKnow which row I am currently looping through. 

View 3 Replies View Related

SQL & PL/SQL :: View Created With Compilation Errors / ORA-01775 - Looping Chain Of Synonyms

Jun 21, 2011

I created a view in DB2 .I copied the code of view from DB3 and created in DB1. The view got created but with compilation errors.

SQL>
SQL> CREATE OR REPLACE FORCE VIEW bala.cee_efacts_pie_order_v (cenumber,
2 installationid,
3 areanumber,
4 clli,
5 servicedate,
6 forecasttype,
7 jobid,
8 shippriority,
[code]....

I checked the status of view in user_objects , it was invalid.How to make it valid ?

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved