Fetch only more than or equal to 10 million rows tables
Hi all,
How to fetch tables has more than 10 million rows with is plsql? i got this from some other site I couldn't remember.
Somebody can help me on this please. your help is greatly appreciated.
declare
counter number;
begin
for x in (select segment_name, owner
from dba_segments
where segment_type='TABLE'
and owner='KOMAKO') loop
execute immediate 'select count(*) from '||x.owner||'.'||x.segment_name into counter;
dbms_output.put_line(rpad(x.owner,30,' ') ||'.' ||rpad(x.segment_name,30,' ') ||' : ' || counter ||' row(s)');
end loop;
end;
Thank you,
gg
1) This code appears to work. Of course, there seems to be no need to select from DBA_SEGMENTS when DBA_TABLES would more straightforward. And, of course, you'd have to do something when the count exceeded 10 million.
2) If you are using the cost-based optimizer (CBO) and your statistics are reasonably accurate and you can tolerate a degree of staleness/ approximation in the row counts, you could just select the NUM_ROWS column from DBA_TABLES.
Justin
Similar Messages
-
Error during recover datafile - ORA-01422: exact fetch returns more than ..
Hi,
we have got actual a serious problem in our database. Some days ago we created a new datafile for a tablespace in the wrong directory:
ALTER TABLESPACE "ANZSIIDX" ADD DATAFILE '/oralunadata/anzora8/ANZSIIDX08.dbf' SIZE 500M
We recognized our mistake and generated the datafile with the same name in teh right directory:
ALTER TABLESPACE "ANZSIIDX" ADD DATAFILE '/oralunaindex/anzora8/ANZSIIDX08.dbf' SIZE 500M
We set the "wrong" datafile offline in order to rename and replace this in file in the right directory:
alter database datafile '/oralunadata/anzora8/ANZSIIDX08.dbf' offline;
ALTER TABLESPACE 'ANZSIIDX'
RENAME DATAFILE '/oralunadata/anzora8/ANZSIIDX08.dbf',
TO '/oralunaindex/anzora8/ANZSIIDX09.dbf';
After this we wanted to bring the datafile online again with a recovery but
this fails with teh strange error-message:
SQL> recover datafile 109;
ORA-00604: error occurred at recursive SQL level 1
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 20
ORA-00279: change 10322956311023 generated at 04/10/2013 18:51:23 needed for
thread 1
ORA-00289: suggestion : /oralunaarchiv/anzora8/anzora8_1_315326_636567403.arc
ORA-00280: change 10322956311023 for thread 1 is in sequence #315326
A similar thing happens with our RMAN backup from last weekend, which failed:
channel c4: backup set complete, elapsed time: 00:32:33
input datafile fno=00109 name=/oralunadata/anzora8/ANZSIIDX08.dbf
input datafile fno=00103 name=/oralunaindex/anzora8/ITOPROTOKOLLEIDX01.dbf
input datafile fno=00097 name=/oralunadata/anzora8/ITOPROTOKOLLE03.dbf
input datafile fno=00096 name=/oralunadata/anzora8/ITOPROTOKOLLE02.dbf
channel c4: specifying datafile(s) in backupset
channel c4: starting compressed incremental level 0 datafile backupset
continuing other job steps, job failed will not be re-run
ORA-00600: internal error code, arguments: [krbbfmx_notfound], [109], [12801], [], [], [], [], []
ORA-01422: exact fetch returns more than requested number of rows
ORA-00604: error occurred at recursive SQL level 1
Has anybody an idea, how can we bring back the datafile online in order to run succesfull an RMAN backup?
Actually we see just the workaraound to move the objects from the affected tablespace to new tablespace
and the drop the empty tablespace what would be quite time consuming and not really practicable for us.
kind regards,
MarcoHi,
actual we see this in v$datafile:
/oralunaindex/anzora8/ANZSIIDX01.dbf 15 ANZSIIDX 10737418240 1310720 AVAILABLE 15 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX02.dbf 46 ANZSIIDX 10737418240 1310720 AVAILABLE 46 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX03.dbf 58 ANZSIIDX 10737418240 1310720 AVAILABLE 58 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX04.dbf 65 ANZSIIDX 10737418240 1310720 AVAILABLE 65 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX05.dbf 78 ANZSIIDX 10737418240 1310720 AVAILABLE 78 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX06.dbf 85 ANZSIIDX 10737418240 1310720 AVAILABLE 85 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX07.dbf 88 ANZSIIDX 10737418240 1310720 AVAILABLE 88 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX09.dbf 109 ANZSIIDX AVAILABLE 109 RECOVER
/oralunaindex/anzora8/ANZSIIDX08.dbf 110 ANZSIIDX 10737418240 1310720 AVAILABLE 110 NO 0 0 0 10737352704 1310712 ONLINE
We dont use RMAN-Catalog for backup the information is only stored in the controlfile.
The recovery datafile command with full path including for the datafile failed with the same error message:
SQL> connect / as sysdba
Connected.
SQL> recover datafile '/oralunaindex/anzora8/ANZSIIDX09.dbf';
ORA-00604: error occurred at recursive SQL level 1
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 20
ORA-00279: change 10322956311023 generated at 04/10/2013 18:51:23 needed for
thread 1
ORA-00289: suggestion : /oralunaarchiv/anzora8/anzora8_1_315326_636567403.arc
ORA-00280: change 10322956311023 for thread 1 is in sequence #315326
I guess it is a bug of oracle which will sometimes occur when you give two datafiles the same name in different directories that this poduces errors as above in the RMAN inerface(packages)!?
Maybe we could force to set he tablespace offline, rename the new added datafiles and ry to bring the tablespace online but nobody knows if it works really and we get the tablespace online again?
Therefore at the moment maybe it's the best way to move the objects away from this tablespace and than drop them, isn't it?
regards,
Marco -
ORA-01422: exact fetch returns more than requested number of rows in R12
Hi All,
Getting the below error in custom report of purchasing.
REP-1401: 'afterpform': Fatal PL/SQL error occurred.
ORA-01422: exact fetch returns more than requested number of rows
To overcome this error I have added some exceptional handling as per below and the report is completed with Normal with output but the ouput is repeating in 150 pages in R12 but the same output in 11i showing only one page. Please advise.
when no_data_found then
:P_po_num_type := 'ALPHANUMERIC';
when too_many_rows then
:P_po_num_type := 'ALPHANUMERIC';
when others then
:P_po_num_type := 'ALPHANUMERIC';
Regards,
SushantYou need to rewrite your query for R12 based on new architecture as 11i report will not work as it is.
thanks -
Automated row fetch returns more than one row
Greetings All,
Does anyone know of a way to call a page if the automated row fetch returns more than one row. I have a form with a primary and secondary key. If I search only on the primary key and there is more than one row I would like to call a popup with the multiple list, is this possible?
Regards
MarkCreate a view on a table you want to update if you have more than two key values.
However, the automated row fetch does support two key values.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
Exact fetch returns more than requested number: Retrieve first row
I have this statement:
FOR l IN C1 LOOP
select amount,customer_id INTO F_AMT,I_custid from zerorize where doc_id = l.doc_id and trans_type = C_py;
END LOOP;I hit the this error:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 172I will like to amend my sql statement in such a way it will retrieve the first row. How am I suppose to add my where condition clause?gerd_99 wrote:
BluShadow wrote:
If you don't have a means of restricting your query to only return 1 row based on data you would have to use the row number...
e.g.
select data, data2, .....
from (
select data, data2, ....., rownum rn
from table
where rn = 1
In this case you even don´t need the inline view:I know, but if an "order by" is included in the inline view then it's necessary as rownum is assigned before the ordering is done, hence it is always safer to do it this way. ;) -
On LOGIN: 01422 exact fetch returns more than requested number of rows
hi -- When logging into an application (as any valid user) I get the above error message (01422 - exact fetch returns more than requested number of rows) on page submit. However, when I go into DEBUG mode (where there are also prompts for username and password) I don't get the error message --I'm logged into the app just fine.
Any idea what this is about? I don't know query APEX is trying to execute;
it certainly doesn't make sense to me that it works while in DEBUG mode.
Note: this is an app in development that's been sitting dormant for 6 months due
to lack of funding. The login worked 6 months ago, but now know. Don't know if
that's helpful information...
Thanks,
Carolhi Scott -- Your question made me think to examine not only the login process,
but other processes I'd added to the page -- and that's where the problem was!
(My brain is a bit rusty on the APEX re-entry process).
Thanks for the spark :)
Carol -
ORA-01422- exact fetch returns more than requested number of rows in D2K Report
Hi All,
Greetings.
I am using a report which is being called from the from in one of my application. The report is working fine from quiet a long time. I have an error with a particular record alone and it is working fine for all other records.
When I try to run the report, I am getting the error as Rep-1401- 'cf_vatformula' : Fatal pl/sql error occured.
ORA-01422- Exact fetch returns more than requested number of rows.
I opened the formula column and run the sql codes that are used in the formula column cf_vat and all of them are working fine. None of them are fetching more a single row. But, when I run the report, I am getting the same error as mentioned above.
Please help me resolve the issue ASAP. Thanks in Advance.
Regards,
Bhaskar.Hi InoL,
Thanks for your time.
I am sure that there is no other procedure used in cf_vatformula. It has select queries in and all of them are fetching the data not more than a single row.
I have tested each and every select query with every possible output.
Regards,
Bhaskar. -
PROCEDURE PROBLEM - Exact Fetch Returns More Than Requested Number of Rows
Here is my procedure:
CREATE OR REPLACE PROCEDURE question4
( cust_first IN customer.custfirstname%TYPE,
cust_last IN customer.custlastname%TYPE,
customer_no OUT customer.customerSsn%TYPE,
cust_address OUT customer.address%TYPE,
loanID OUT loan.loanNo%TYPE,
application_date OUT loan.appdate%TYPE,
remaining_payments OUT loan.remainingpaymentsdue%TYPE,
loan_amount OUT loan.loanamount%TYPE,
loan_term OUT loan.loanterm%TYPE,
interest_rate OUT loan.interestrate%TYPE,
monthly_payment OUT loan.monthlypayment%TYPE)
AS
BEGIN
SELECT customerssn, address INTO customer_no, cust_address FROM CUSTOMER WHERE custfirstname= cust_first AND custlastname = cust_last;
SELECT loanno, remainingpaymentsdue, loanamount, loanterm, interestrate, monthlypayment, appdate INTO loanID, remaining_payments, loan_amount, loan_term, interest_rate, monthly_payment, application_date FROM LOAN WHERE customerSsn = customer_no;
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;Here is the anonymous block showing the use of my procedure.
SET SERVEROUTPUT ON
DECLARE
customer_number customer.customerSsn%TYPE := NULL;
customer_address customer.address%TYPE := NULL;
loan_number loan.loanNo%TYPE := NULL;
app_date loan.appdate%TYPE := NULL;
rem_payment loan.remainingpaymentsdue%TYPE := NULL;
l_amount loan.loanamount%TYPE := NULL;
l_term loan.loanterm%TYPE := NULL;
i_rate loan.interestrate%TYPE := NULL;
m_payment loan.monthlypayment%TYPE := NULL;
view_customerSSN NUMBER;
view_address VARCHAR2(50);
view_loanID NUMBER;
view_date DATE;
view_remaining_payment NUMBER;
view_loan_amount NUMBER(8,2);
view_loan_term VARCHAR2(10);
view_interest_rate FLOAT(20);
view_monthly_payment NUMBER(8,2);
BEGIN
question4 ('Tim', 'Thompson', customer_number, customer_address, loan_number, app_date, rem_payment, l_amount, l_term, i_rate, m_payment);
IF (customer_number IS NULL OR customer_address IS NULL OR loan_number IS NULL OR app_date IS NULL
OR rem_payment IS NULL OR l_amount IS NULL OR l_term IS NULL OR i_rate IS NULL OR m_payment IS NULL) THEN
DBMS_OUTPUT.PUT_LINE ('NULL VALUE');
ELSE
view_customerSSN := customer_number;
view_address := customer_address;
view_loanID := loan_number;
view_date := app_date;
view_remaining_payment := rem_payment;
view_loan_amount := l_amount;
view_loan_term := l_term;
view_interest_rate := i_rate;
view_monthly_payment := m_payment;
DBMS_OUTPUT.PUT_LINE ('CUSTOMER NO : ' || view_customerSSN);
DBMS_OUTPUT.PUT_LINE ('CUSTOMER ADDRESS : ' || view_address);
DBMS_OUTPUT.PUT_LINE ('LOAN NO : ' || view_loanID);
DBMS_OUTPUT.PUT_LINE ('LOAN APPLICATION DATE : ' || view_date);
DBMS_OUTPUT.PUT_LINE ('REMAINING PAYMENTS : ' || view_remaining_payment);
DBMS_OUTPUT.PUT_LINE ('LOAN AMOUNT : ' || view_loan_amount);
DBMS_OUTPUT.PUT_LINE ('LOAN TERM : ' || view_loan_term);
DBMS_OUTPUT.PUT_LINE ('INTEREST RATE : ' || view_interest_rate);
DBMS_OUTPUT.PUT_LINE ('MONTHLY PAYMENT : ' || view_monthly_payment);
END IF;
END;
/Error Message:
Error report:
ORA-06550: line 21, column 3:
PLS-00306: wrong number or types of arguments in call to 'QUESTION4'
ORA-06550: line 21, column 3:
PL/SQL: Statement ignored
*06550. 00000 - "line %s, column %s:\n%s"*
**Cause: Usually a PL/SQL compilation error.*
**Action:*
What is the problem here? Could you anyone help me?
Thanks for your help from now on.
Have a beautiful day...
Edited by: RobertPires on May 1, 2011 5:13 PM
Edited by: RobertPires on May 1, 2011 8:19 PMThanks for your help, Sir. As you see it as above, I fixed the order of parameters, but since I would like to display multiple records, my procedure did not work properly and I got this error message:
Error report:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "S4048958.QUESTION4", line 20
ORA-06512: at line 21
*01422. 00000 - "exact fetch returns more than requested number of rows"*
**Cause: The number specified in exact fetch is less than the rows returned.*
**Action: Rewrite the query or change number of rows requested*
I guess I need to create a cursor in my procedure, but I dunno how. Could you give me some suggestion for this please?
Thanks again... -
ORA-01422 exact fetch returns more than requested number of rows on invoice
Hello developer,
Current I m facing problem ORA-01422 exact fetch returns more than requested number of rows in Invoce Standard form when we select PO_Default invoice type for some specific PO Number not for all. I m not able to handle the error bcoz im new in oracle apps. it's urgent for user requirement. Plz guide me how to take approch to handle the situation.........
select Po_Default invoice type=>enter po number=>press ok button=>got error ORA-01422
I got query from POST_QUERY TRIGEER like
function get_po_number (l_po_number varchar2,l_vendor_id OUT number) return number is
l_po_header_id number;
--Bug fix:1096002
--Removed the function call UPPER from the WHERE clause so that the query
--becomes case sensitive.
-- BUG 2519682 vendor_id added in the Select statement and futher in the fetch statement
cursor po_number_cursor is
SELECT po_header_id,vendor_id
FROM po_headers
WHERE type_lookup_code IN ('STANDARD', 'BLANKET', 'PLANNED')
AND approved_flag = 'Y'
AND segment1 = l_po_number
-- Bug 2289727. Enhanced Matching Controls to Finally Closed POs
AND (NVL(closed_code, 'X') <> 'FINALLY CLOSED'
OR :parameter.show_final_closed_po_flag = 'Y')
AND PCARD_ID IS NULL; --bug4627502
/* Commented out since this is not relevant even if executed.
AND (segment1 LIKE SUBSTR(l_po_number, 1, 2) || '%' OR
segment1 LIKE SUBSTR(l_po_number, 1, 1) ||
SUBSTR(l_po_number, 2, 1) || '%' OR
segment1 LIKE SUBSTR(l_po_number, 1, 1) ||
SUBSTR(l_po_number, 2, 1) || '%' OR
segment1 LIKE SUBSTR(l_po_number, 1, 2) || '%' );
begin
open po_number_cursor;
fetch po_number_cursor INTO l_po_header_id,l_vendor_id;
close po_number_cursor;
return(l_po_header_id);
end get_po_number;
plz help me how to resolved this issue it's urgent.
thanks in advance.........This bug is documented in the following note on metalink.oracle.com
APXINWKB - Creating PO Default Invoice Errors with ORA-01422 Exact Fetch Returns More Than Requested Number Of Rows [ID 946578.1]
The solution is to apply patch 8765847.
Hope this answers your question,
Sandeep Gandhi -
RACUST errors out - racina: ORA-01422: exact fetch returns more than reques
Hi,
We are using standard RACUST interface( r12, 12.0.0). All the records are successsfully validated however, the standard program errors out at run time with the following error
racina: ORA-01422: exact fetch returns more than requested number of rowsPl see if MOS Doc 802175.1 (Customer Interface Creates Duplicate Party Sites Used in Multi-Org (MOAC)) can help
HTH
Srini -
Stuck with Exact fetch returns more than requested number of rows!
Hi
I've written the following code where i want to insert an id number into a package to update a record.
declare myvar NUMBER; begin SELECT App.id into myvar FROM people_units pu LEFT OUTER JOIN(
SELECT pu.id,pu.record_date,pu.unit_instance_code,pu.person_code,pu.calocc_code,pu.record_date As received
FROM people_units pu) App ON pu.person_code = App.person_code AND Trunc(pu.record_date) = Trunc(App.record_date)
WHERE pu.id = 79474; ebs_units_pkg.AddProgressHistory(myvar,'AUTO');end;
when i run the query in SQL i get the error message ORA-01422 - Exact fetch returns more than expected number of rows.
Can anyone help me rseolve this error? The select statement may return more than one row which im guessing is the cause of the problem. If the select statement does return more than one value. 2 rows for example, i would like the package to update the 2 rows. Ive never really done any work with PL/SQL before so at a loss at where to begin!!Do the select and the update all in one step. It will be much easier then.
Example:
UPDATE people_units
SET yourColumn = calculatedValue
WHERE id = 79474 -
Error: exact fetch returns more than requested number of rows.
i need to do a count function in report builder, the sql works in sql developer.
but in reports i get an error:
ORA-01422: exact fetch returns more than requested number of rows.
function CF_SUB_DUE_TO_EXPIRE return number is
x_sub_due_to_expire number := NULL;
begin
select count(o.contract_number)
into x_sub_due_to_expire
from xxpub_calendar_plan_hdr_v h, OKS_AUTH_headers_V o, OKS_AUTH_lines_V l
where o.id = l.chr_id
and h.inventory_item_id =o.inv_organization_id
and o.end_date = h.issue_date
--AND ROWNUM = 1
group by h.publication_code, h.issue_number;Try to sum all the ccounts that you recieve from your privieous query. Like this:
select sum(count(o.contract_number))
into x_sub_due_to_expire
from xxpub_calendar_plan_hdr_v h,
OKS_AUTH_headers_V o,
OKS_AUTH_lines_V l
where o.id = l.chr_id
and h.inventory_item_id =o.inv_organization_id
and o.end_date = h.issue_date
group by h.publication_code, h.issue_number; Or simply remove the group by condition (the resulting count might be different).
select count(o.contract_number)
into x_sub_due_to_expire
from xxpub_calendar_plan_hdr_v h,
OKS_AUTH_headers_V o,
OKS_AUTH_lines_V l
where o.id = l.chr_id
and h.inventory_item_id =o.inv_organization_id
and o.end_date = h.issue_date; -
URGENT IN The PL/SQL code..ORA-01422: exact fetch returns more than request
Hi All,
I am using the Oracle Streams to replicate the data...
Below is the procedure
CREATE OR REPLACE PROCEDURE proc_test(in_any sys.anydata)IS
lcr sys.lcr$_row_record;
rc pls_integer;
v_type varchar2(20);
col_1 sys.anydata;
lcr_usercountry varchar2(20);
TRANS varchar2(20);
BEGIN
rc:=in_any.GetObject(lcr);
v_type:=lcr.get_command_type();
col_1:=lcr.get_value('NEW','USER_COUNTRY');
rc:=col_1.GetVarchar2(lcr_usercountry);
select user_country into TRANS from test.TESTREP where USER_COUNTRY=lcr_usercountry;
IF (TRANS=lcr_usercountry and TRANS='USA')
THEN
insert into strmadmin.history_row_lcrs VALUES (SYSDATE, lcr.GET_SOURCE_DATABASE_NAME(), lcr.GET_COMMAND_TYPE(),
lcr.GET_OBJECT_OWNER(), lcr.GET_OBJECT_NAME(), lcr.GET_TAG(), lcr.GET_TRANSACTION_ID(), lcr.GET_SCN(),
lcr.GET_COMMIT_SCN,lcr.GET_VALUES('old'), lcr.GET_VALUES('new', 'n'));
lcr.EXECUTE(true);
END IF;
END;
The procedure executed successfully, but the data is not replicating...
I get the below error ORA-01422: exact fetch returns more than request in the dba_apply_error view.... because the query in the above procedure which am using returns more than one value ...select user_country into TRANS from test.TESTREP where USER_COUNTRY=lcr_usercountry;
may be I need to use the cursor for this....
Can anyone Please advice me writing the cursor ...
Thanks in Advance..Got the solution ....
Thanks.. -
hi i am receiving "exact fetch returns more than requested number of rows oracle error". but i am not able to locate the error in the below code. Any help would be appreciated!!!
CREATE OR REPLACE PROCEDURE load_scene_collection_item (
--pdname VARCHAR2,
-- LOCATION TO ADD/CHANGE below!!!
pITEM_TYPE_ID INTEGER,
pSCENE_COLLECTION_ID INTEGER,
pCOLLECTION_ITEM_NAME VARCHAR2,
pCOLLECTION_ITEM_DESC VARCHAR2,
pDEFAULT_COORD_X NUMBER,
pDEFAULT_COORD_Y NUMBER,
pDEFAULT_COORD_Z NUMBER,
pDEFAULT_WIDTH NUMBER,
pDEFAULT_HEIGHT NUMBER,
pDEFAULT_ROTATION INTEGER,
pDEFAULT_ALPHA INTEGER,
pfname VARCHAR2) IS
src_file BFILE;
dst_file BLOB;
lgh_file BINARY_INTEGER;
BEGIN
src_file := bfilename('BUSINESSBLOBSIMAGES', pfname);
-- insert a NULL record to lock
Insert into SCENE_COLLECTION_ITEM
( ITEM_TYPE_ID,
SCENE_COLLECTION_ID,
COLLECTION_ITEM_NAME,
COLLECTION_ITEM_DESC,
COLLECTION_ITEM_IMAGE,
DEFAULT_COORD_X,
DEFAULT_COORD_Y,
DEFAULT_COORD_Z,
DEFAULT_WIDTH,
DEFAULT_HEIGHT,
DEFAULT_ROTATION,
DEFAULT_ALPHA,
CREATE_USER,
CREATE_DATE)
Values ( pITEM_TYPE_ID, pSCENE_COLLECTION_ID, pCOLLECTION_ITEM_NAME, pCOLLECTION_ITEM_DESC, EMPTY_BLOB(),
pDEFAULT_COORD_X,
pDEFAULT_COORD_Y,
pDEFAULT_COORD_Z,
pDEFAULT_WIDTH,
pDEFAULT_HEIGHT,
pDEFAULT_ROTATION,
pDEFAULT_ALPHA,
sys_context('USERENV', 'OS_USER'),
sys_extract_utc(systimestamp))
RETURNING COLLECTION_ITEM_IMAGE INTO dst_file;
-- LOCATIONs(2) TO ADD/CHANGE above!!!
-- lock record
SELECT COLLECTION_ITEM_IMAGE
INTO dst_file
FROM SCENE_COLLECTION_ITEM
WHERE ITEM_TYPE_ID = pITEM_TYPE_ID
AND SCENE_COLLECTION_ID = pSCENE_COLLECTION_ID
AND COLLECTION_ITEM_NAME= pCOLLECTION_ITEM_NAME
AND COLLECTION_ITEM_DESC= pCOLLECTION_ITEM_DESC
AND pDEFAULT_COORD_X = DEFAULT_COORD_X
AND pDEFAULT_COORD_Y = DEFAULT_COORD_Y
AND pDEFAULT_COORD_Z = DEFAULT_COORD_Z
AND pDEFAULT_WIDTH = DEFAULT_WIDTH
AND pDEFAULT_HEIGHT = DEFAULT_HEIGHT
AND pDEFAULT_ROTATION = DEFAULT_ROTATION
AND pDEFAULT_ALPHA = DEFAULT_ALPHA
FOR UPDATE;
-- LOCATION TO ADD/CHANGE above!!!
-- open the file
dbms_lob.fileopen(src_file, dbms_lob.file_readonly);
-- determine length
lgh_file := dbms_lob.getlength(src_file);
-- read the file
dbms_lob.loadfromfile(dst_file, src_file, lgh_file);
-- update the blob field
UPDATE SCENE_COLLECTION_ITEM
SET COLLECTION_ITEM_IMAGE = dst_file
WHERE ITEM_TYPE_ID = pITEM_TYPE_ID
AND SCENE_COLLECTION_ID = pSCENE_COLLECTION_ID
AND COLLECTION_ITEM_NAME= pCOLLECTION_ITEM_NAME
AND COLLECTION_ITEM_DESC= pCOLLECTION_ITEM_DESC
AND pDEFAULT_COORD_X = DEFAULT_COORD_X
AND pDEFAULT_COORD_Y = DEFAULT_COORD_Y
AND pDEFAULT_COORD_Z = DEFAULT_COORD_Z
AND pDEFAULT_WIDTH = DEFAULT_WIDTH
AND pDEFAULT_HEIGHT = DEFAULT_HEIGHT
AND pDEFAULT_ROTATION = DEFAULT_ROTATION
AND pDEFAULT_ALPHA = DEFAULT_ALPHA
-- LOCATION TO ADD/CHANGE above!!!
-- close file
dbms_lob.fileclose(src_file);
END load_scene_collection_item;
Thanks in advance!!!!Hi PaulHorth,
Thanks for the quick reply.
Actually, i am getting error while updating the records.
below is the error message:
Error starting at line 1 in command:
exec load_scene_collection_item(3,15,'2 Lane 4way Stop','4 Way Stop Intersection with 2 lanes in each direction',0,0,0,400,517,0,1,'2 Lane 4way Stop.PNG');
Error report:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "DP_OWNER.LOAD_SCENE_COLLECTION_ITEM", line 55
ORA-06512: at line 1
01422. 00000 - "exact fetch returns more than requested number of rows"
*Cause: The number specified in exact fetch is less than the rows returned.
*Action: Rewrite the query or change number of rows requested -
ORA- 01422: exact fetch returns more than..
Hello,
I am new to PL/SQL world. Could anyone help me solve this problem?
I am trying to run the following block and receive error.
DECLARE
v_name VARCHAR2(10);
BEGIN
SELECT ename INTO name
FROM emp;
END;
SQL>/
DECLARE
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 4
Thanks,
DonThe SQL statement
SELECT ename
FROM emp;will return, in general, a number of records. Your INTO clause is trying to assign an arbitrary number of enames to a single local VARCHAR2 variable. Thus, you get an error if the SELECT returns more than one row.
If you want to process the rows of the emp table one by one, you'd want to use a cursor, i.e.
BEGIN
for x in (SELECT * FROM emp)
loop
-- x.ename will be the ename for the current row of the cursor.
-- Do something with x.ename
end loop;
END;For performance reasons, though, it's always going to be better to do things in SQL rather than PL/SQL, operating on sets at a time rather than a row at a time.
Justin
Distributed Database Consulting, Inc.
www.ddbcinc.com
Maybe you are looking for
-
MacBook Air has a dark screen and works very slowly - what is happening?
I have a MacBook Air since July '10, and until a few weeks ago, it seemed to be working fine. A couple of weeks ago I wanted to update iTunes and GarageBand, but since I couldn't find my charger and I really needed to update my iTunes, I just let it
-
TOC from contents of text objects
Is there a way to make the TOC builder look in text objects when it is creating the TOC? There was one post with a workaround, but my document has text for the TOC (in a text object) on every page. I could hide the text, but I was hoping for a more d
-
Hi, I'm using the following technique inorder to parse the XML like this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;.... Just want to known if there is any way in Macromedia flash where in we can you element by names for parsing XML
-
Do I need to keep old versions of CS on my PC in order to have the most recent work properly?
I recently started a new position and plesently found my work station already set up with Creative Suite 5.5, but then saw CS 4 and CS 3 as well. When I asked IT why they were all there, the response was that upgrades build off of one another. If we
-
Automatic payment flow isnu00B4t working
Hi Team, I got the below requirement from my user. But i dont think if the customer is marked for deletion the automatic payment run will work. I need your advice and how to resolve this issue. Regards, Jana Can you please advice if a customer is mar