Why? : ORA-06532: Subscript outside of limit
I want to read a number of rows into an array of records.
I keep getting this error (any ideas?):
ERROR at line 1:
ORA-06532: Subscript outside of limit
here is the procedure:
CURSOR get_all_locations (type IN VARCHAR2) IS
SELECT
FROM group
WHERE type = type;
PROCEDURE fetchAllServerLocations IS
i BINARY_INTEGER := 0;
erec egroup%ROWTYPE;
BEGIN
dbms_output.enable;
dbms_output.put_line('BEGIN: fetchAllServerLocations()');
FOR erec IN get_all_locations('s')
LOOP
-- dbms_output.put_line('i=[' || i || ']');
dbms_output.put_line('server location: [' || erec.group_id || erec.name || ']');
allServerLocations(i) := erec;
i := i + 1;
END LOOP;
dbms_output.put_line('END: fetchAllServerLocations()');
END fetchAllServerLocations;
---
You have a (poor) solution in search of a problem.
PL/SQL will never be faster than plain SQL to access data within Oracle DB.You do not know what the problem is and you do not know the solution.
The only thing you know is a syntax error that I am having with a very small piece of code that is trying to do a very specific thing.
You have tried to reach too far and are blinded by trying to solve a big problem when there is really a small problem to solve.
<ranton>
I (we) have a well thought out solution and algorithm that will solve our problem. I am attempting to implement the solution that has already been analyzed over several weeks now by someone that has 10+ years of knowledge of what data we need to move around and where. The problem is unknown to you. The solution is unknown to you, yet you are making statements about both.
I cannot write procedures, functions and have them called in the order that I need with plain SQL. Also after the implementation is complete in PL/SQL it will be fast enough for what we need to do. The requirement I have is not to have the one time script run as blazingly fast as it possibly can at all costs to providing an implementation. If I were to spend ten weeks writing this in assembly, it would be much faster than SQL but "faster" is not always better nor what is wanted here.
This plane:
http://en.wikipedia.org/wiki/Concorde
is faster than this plane
http://en.wikipedia.org/wiki/Concorde
and is far superior in many, many ways, but there is a reason you have never flown one and a reason all airports everywhere do not have them coming and going every minute AND a big reason they were grounded to never fly again. I am not sure why I have to have this same discussion every now and then when someone comes to me and says "this would be faster".
Right now in another area I am having an unbelievable battle: Do we write our own messaging system that would be much faster than JMS, AMQP or anything we could simply pull off the shelf - I mean it will be faster but only cost $200K in its first year of writing and maintenance.
Please go home with comments like this and if you are not going to help contribute to the solution do not log on cheez.
"Fast" is not a requirement nor is it a concern with this problem and solution. It is completely beside the point.
</rantoff>
Similar Messages
-
Hi all,
i have a big problem with oracle tuning set. I'm using this script for tune some query when the EM is unusable, but for the first time i have this error: ORA-06532: Subscript outside of limit.
I have not found any solutions from google to metalink... can you help me? you need others informations?
these are the steps:
1) login with system
2) launching the script sqltune.sql
spool M:\tuning\sql_tune_TSQ.log
set long 100000
SET LONGCHUNKSIZE 100000
SET LINESIZE 200
execute DBMS_SQLTUNE.DROP_TUNING_TASK('sqltuning_request_fromuser');
DECLARE my_task_name VARCHAR2(100);
tune_sqltext CLOB;
BEGIN
tune_sqltext := q'#Select row_ticket from abc.ticket_kasdeww_export#';
my_task_name := dbms_sqltune.create_tuning_task(user_name=>'abc',sql_text=>tune_sqltext, task_name=>'sqltuning_request_fromuser', time_limit=>1800);
dbms_sqltune.execute_tuning_task(task_name=>'sqltuning_request_fromuser');
END;
SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'sqltuning_request_fromuser') FROM DUAL;
spool off
3) when trying accept new sql profile:
execute dbms_sqltune.accept_sql_profile(task_name => 'sqltuning_request_fromuser', replace => TRUE);
ERROR at line 1:
ORA-06532: Subscript outside of limit
ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 7087
ORA-06512: at "SYS.DBMS_SQLTUNE", line 5559
ORA-06512: at "SYS.DBMS_SQLTUNE", line 5586
ORA-06512: at line 1
N.b. A Generic error from EM is returned when trying accept sql profile, this is the reason for using the command line method
N.b.2 This query return approximately 40.000 rows and is a select from a view that is created from the union of two type of selectuser9523366 wrote:
thanks!
no one for this unusual problem please?I think I had some time ago a similar issue. You can try to check if the SQL profile generated contains an unusual large number of hints, by querying for your tuning task here:
USER_TUNING_TASKS
And then query an underlying table called SYS.WRI$_ADV_RATIONALE like that:
select
from
sys.WRI$_ADV_RATIONALE
where
task_id = <your_task_id from USER_TUNING_TASKS>;If this query shows hundreds of rows with hints in the ATTR1 column then this might be the reason for the error. You might want to open an SR with Oracle then, because I can't remember if I found a way back then to make the "ACCEPT_SQL_PROFILE" work and I think I remember I solved the issue otherwise.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Varray ORA-06533: Subscript beyond count
Hi all
In my package body i've declared
create or replace package body mng_res_pack
is
TYPE rest_ans_type IS VARRAY(5) OF NUMBER(1);
rest_ans rest_ans_type:=rest_ans_type();
PROCEDURE fetch_rest_data
IS
rest_rec restore_users%ROWTYPE;
MONE NUMBER :=0;
BEGIN
FOR I IN 1..5
LOOP
DBMS_OUTPUT.PUT_LINE ('HERE'||' '||rest_ans(i));
END LOOP;
end fetch_rest_data;
end mng_res_pack;when i'm running the procedure i'm getting the error
ERROR at line 1:
ORA-06533: Subscript beyond count
ORA-06512: at "MNG_RES_PACK", line 46
why ?
the varray size is 5 , and i've also initialized it ?
please Help
Thanks In Advanced
Naama>
even though i didn't initialize the varray with numbers , i stil i declare it as a size of 5 .
i still don't understand why it write that it out of limit. null is only the value , not the size of the varray.
It should have looped 5 times and display null , no ?
>
No - the VARRAY itself is NULL - meaning there are no entries to access. You can't loop through the entries because there aren't any.
The declared size of 5 is simply the maximum number of entries the VARRAY can ever have - but it does not create any entries; you have to do that.
See Varrays in the PL/SQL language doc
http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/composites.htm#CHDEIJHD
>
An uninitialized varray variable is a null collection. You must initialize it, either by making it empty or by assigning a non-NULL value to it. For details, see "Collection Constructors" and "Assigning Values to Collection Variables". -
ORA-27078: unable to determine limit for open files
I installed Oracle XE on my Gengoooraclexe@ghost ~ $ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-JUN-2011 16:51:29
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 25-JUN-2011 10:03:30
Uptime 0 days 6 hr. 48 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora
Listener Log File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ghost.emacs.com)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
Poraclexe@ghost ~ $ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jun 25 07:19:58 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> show user
USER is "SYS"
SQL> startup
ORA-27078: unable to determine limit for open files
Linux Error: 1: Operation not permitted
Additional information: 1
Additional information: 1
Additional information: -2958340
SQL> startup force
ORA-27078: unable to determine limit for open files
Linux Error: 1: Operation not permitted
Additional information: 1
Additional information: 1
Additional information: -3378372
SQL> startup
ORA-03113: end-of-file on communication channel
SQL> exit
Disconnectedunable to determine limit for open filessee http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25144/toc.htm#BABJFAIA
Is that a debian flavored distro? -
ORA-06533: Subscript beyond count.
Hi ,
I am getting an error ORA-06533: Subscript beyond count.
I read a few post and tried extending the collections as suggested in various post but it doesnt seem to be helping.
Can anyone suggest where i am going wrong. below is my piece of code.
PROCEDURE validate_records ( p_retcode OUT VARCHAR2
, p_errbuf OUT VARCHAR2
IS
g_ret_success CONSTANT VARCHAR2(1) := '0';
g_ret_exception CONSTANT VARCHAR2(1) := '2';
g_procedure VARCHAR2(30) := g_validate_rec;
l_batch_name ra_batch_sources_all.name%TYPE;
l_supplier_payee_code hz_cust_accounts_all.cust_account_id%TYPE;
l_supplier_code hz_cust_accounts_all.cust_account_id%TYPE;
l_term_name ra_terms.name%TYPE;
l_term ra_terms.name%TYPE;
l_receipt_method fnd_lookup_values.meaning%TYPE;
l_func_seg fnd_flex_values_vl.attribute1%TYPE;
l_tax_inc_flag fnd_flex_values_vl.attribute3%TYPE;
l_set_of_books_id gl_ledgers.ledger_id%TYPE;
l_cust_bill_to_add_ref hz_cust_acct_sites.orig_system_reference%TYPE;
l_cust_ship_to_add_ref hz_cust_acct_sites.orig_system_reference%TYPE;
l_costcenter fnd_flex_values_vl.attribute1%TYPE;
l_company fnd_flex_values_vl.attribute2%TYPE;
l_account fnd_flex_values_vl.attribute1%TYPE;
l_function fnd_flex_values_vl.attribute2%TYPE;
l_cust_trx_type_name fnd_flex_values_vl.attribute4%TYPE;
l_bill_sku fnd_flex_values_vl.attribute5%TYPE;
l_ship_from fnd_flex_values_vl.attribute6%TYPE;
l_inventory_id NUMBER;
l_warehouse_id NUMBER;
l_date DATE;
l_date_term DATE;
l_combination_check VARCHAR2(10);
l_location_ship VARCHAR2(10);
l_location_bill VARCHAR2(10);
l_line_type VARCHAR2(10);
l_error_message VARCHAR2(4000);
l_err_stage VARCHAR2(4000);
l_return_status VARCHAR2(1);
l_errbuf VARCHAR2(4000);
l_retcode VARCHAR2(10);
l_cnt NUMBER;
l_update_tax VARCHAR2(1);
l_error_count NUMBER;
ex_dml_errors EXCEPTION;
PRAGMA EXCEPTION_INIT(ex_dml_errors, -24381);
CURSOR c_get_bill_data
IS
SELECT program_type
, dc
, CONCAT(supplier_code,'SMF') supplier_code1
, CONCAT(substr(supplier_payee_code,0,4),'SMF')supplier_payee_code1
, supplier_code
, supplier_payee_code
, line_type
, payment_type
, sfm_bill_number
, due_date
, ROUND(total_inv_recv_amt,2) invoice_amount
, record_status
, ROWID
FROM xxom_ar_sfs03_bill_info_stg
WHERE record_status = g_new_rec_status
AND conc_request_id = fnd_global.conc_request_id;
CURSOR c_new_rec_count
IS
SELECT COUNT(*)
FROM xxom_ar_sfs03_bill_info_stg
WHERE record_status = g_new_rec_status
AND conc_request_id = fnd_global.conc_request_id;
-- to fetch total invoice lines for an invoice
CURSOR c_get_invoice_no(p_bill in varchar2)
IS
SELECT sfm_bill_number
FROM xxom_ar_sfs03_bill_info_stg
WHERE sfm_bill_number = p_bill
AND conc_request_id = fnd_global.conc_request_id;
-- to fetch total err lines for an invoice
CURSOR c_get_err_line
IS
SELECT sfm_bill_number
FROM xxom_ar_sfs03_bill_info_stg
WHERE record_status = 'E'
AND conc_request_id = fnd_global.conc_request_id;
CURSOR c_batch_src_exist
IS
SELECT name
FROM ra_batch_sources
WHERE name = g_batch_source_name
AND batch_source_type = 'FOREIGN'
AND status = 'A';
CURSOR c_set_book_id_exist
IS
SELECT gl.ledger_id
FROM gl_ledgers gl
, hr_operating_units hru
WHERE gl.ledger_id = hru.set_of_books_id
AND hru.organization_id = g_org_id
AND gl.name = g_ledger_name;
CURSOR c_cust_num_exist( p_cust_no IN hz_cust_accounts.orig_system_reference%TYPE
IS
SELECT cust_account_id
FROM hz_parties HP
, hz_cust_accounts HCC
WHERE HP.party_id = HCC.party_id
AND HP.status = 'A'
AND HCC.status = 'A'
AND HCC.orig_system_reference LIKE p_cust_no;
CURSOR c_cust_payee_exist( p_cust_no IN hz_cust_accounts.attribute2%TYPE)
IS
SELECT cust_account_id
FROM hz_parties HP
, hz_cust_accounts HCC
WHERE HP.party_id = HCC.party_id
AND HP.status = 'A'
AND HCC.status = 'A'
AND HCC.orig_system_reference = p_cust_no;
CURSOR c_pgm_type_exist(p_pgm_type IN VARCHAR)
IS
SELECT FFVV.attribute1
, FFVV.attribute2
, FFVV.attribute3
, FFVV.attribute4
, FFVV.attribute5
, FFVV.attribute6
FROM fnd_flex_value_sets FFVS
, fnd_flex_values_vl FFVV
WHERE flex_value_set_name = g_pgm_valueset
AND FFVV.flex_value_set_id = FFVS.flex_value_set_id
AND FFVV.flex_value = p_pgm_type
AND enabled_flag = 'Y'
AND TRUNC(SYSDATE) BETWEEN NVL(start_date_active,TRUNC(SYSDATE))
AND NVL(end_date_active,TRUNC(SYSDATE));
CURSOR c_validate_dc(p_dc IN fnd_flex_values_vl.flex_value%TYPE)
IS
SELECT FFVV.attribute1
, FFVV.attribute2
FROM fnd_flex_value_sets FFVS
, fnd_flex_values_vl FFVV
WHERE flex_value_set_name = 'OM_LEGACY_DC'
AND FFVV.flex_value_set_id = FFVS.flex_value_set_id
AND FFVV.flex_value = p_dc
AND enabled_flag = 'Y';
CURSOR c_get_location( p_cust_id IN hz_cust_accounts.cust_account_id%TYPE
, p_location_use IN VARCHAR2
IS
SELECT HCAS.orig_system_reference
FROM hz_cust_acct_sites HCAS
, hz_cust_site_uses HCSU
WHERE cust_account_id = p_cust_id
AND HCAS.cust_acct_site_id = HCSU.cust_acct_site_id
AND HCAS.status = 'A'
AND primary_flag = 'Y'
AND HCSU.site_use_code = p_location_use;
CURSOR c_validate_line_type(p_line_type IN VARCHAR2)
IS
SELECT flv.lookup_code
FROM fnd_lookup_values flv
WHERE flv.lookup_type = g_line_typ_lookup
AND flv.lookup_code = p_line_type
AND flv.enabled_flag = 'Y'
AND TRUNC(SYSDATE) BETWEEN NVL(flv.start_date_active,TRUNC(SYSDATE))
AND NVL(flv.end_date_active,TRUNC(SYSDATE));
CURSOR c_validate_receipt_type(p_receipt_method IN VARCHAR2)
IS
SELECT flv.meaning
FROM fnd_lookup_values flv
WHERE flv.lookup_type = g_receipt_lookup
AND flv.lookup_code = p_receipt_method
AND flv.enabled_flag = 'Y'
AND TRUNC(SYSDATE) BETWEEN NVL(flv.start_date_active,TRUNC(SYSDATE))
AND NVL(flv.end_date_active,TRUNC(SYSDATE));
CURSOR c_validate_term_name (p_term_name IN ra_terms.name%TYPE)
IS
SELECT name
FROM ra_terms
WHERE name = p_term_name
AND TRUNC(SYSDATE) BETWEEN NVL(start_date_active,TRUNC(SYSDATE))
AND TRUNC(SYSDATE);
CURSOR c_check_combination( p_attribute IN ra_customer_trx_all.attribute1%TYPE
IS
SELECT 1
FROM ra_customer_trx_all
WHERE attribute1 = p_attribute
AND attribute_category = 'SFM';
CURSOR c_get_inventory_item_id (p_org_code IN VARCHAR2
,p_item_description IN VARCHAR2)
IS
SELECT msi.inventory_item_id
, msi.organization_id warehouse_id
FROM mtl_system_items_b msi
, hr_all_organization_units haou
, org_organization_definitions ood
WHERE haou.organization_id = msi.organization_id
AND haou.organization_id = ood.organization_id
AND ood.disable_date IS NULL
AND msi.enabled_flag = 'Y'
AND ood.organization_code = p_org_code
AND segment1 = p_item_description
AND TRUNC(SYSDATE) BETWEEN NVL(msi.start_date_active,TRUNC(SYSDATE))
AND NVL(msi.end_date_active,TRUNC(SYSDATE));
TYPE type_bill_dtl_update_tbl IS RECORD
ledger_id gl_ledgers.ledger_id%TYPE
, cust_ship_to_add_ref hz_cust_acct_sites_all.orig_system_reference%TYPE
, pay_term_name ra_terms.name%TYPE
, receipt_method fnd_lookup_values.meaning%TYPE
, cust_bill_to_add_ref hz_cust_acct_sites_all.orig_system_reference%TYPE
, company_seg gl_code_combinations.segment1%TYPE
, costcenter_seg gl_code_combinations.segment2%TYPE
, function_seg gl_code_combinations.segment3%TYPE
, account_seg gl_code_combinations.segment4%TYPE
, cust_trx_type fnd_flex_values_vl.attribute4%TYPE
, inventory_item_id fnd_flex_values_vl.attribute5%TYPE
, warehouse_id fnd_flex_values_vl.attribute6%TYPE
, tax_flag VARCHAR2(1)
, invoice_amount NUMBER
, record_status VARCHAR2(1)
, error_message VARCHAR2(1000)
, row_id ROWID
TYPE t_get_bill_data IS TABLE OF c_get_bill_data%ROWTYPE;
l_get_bill_data t_get_bill_data:= t_get_bill_data() ;
TYPE t_bill_dtl_update_tbl IS TABLE OF type_bill_dtl_update_tbl;-- INDEX BY BINARY_INTEGER;
l_bill_dtl_update_rec t_bill_dtl_update_tbl:= t_bill_dtl_update_tbl() ;
TYPE t_bill_no IS TABLE OF c_get_invoice_no%ROWTYPE;
l_bill_no t_bill_no;
TYPE t_bill_err_lines IS TABLE OF c_get_err_line%ROWTYPE;
l_bill_err_lines t_bill_err_lines;
BEGIN
p_retcode := g_ret_success;
p_errbuf := NULL;
g_procedure := g_validate_rec;
l_set_of_books_id := NULL;
l_cnt := 1;
OPEN c_new_rec_count;
FETCH c_new_rec_count INTO g_new_rec_count;
CLOSE c_new_rec_count;
OPEN c_get_bill_data;
FETCH c_get_bill_data BULK COLLECT INTO l_get_bill_data;
CLOSE c_get_bill_data;
FOR i IN 1..l_get_bill_data.COUNT LOOP
FND_FILE.PUT_LINE (FND_FILE.LOG,'count'||i);
l_get_bill_data.EXTEND;
l_return_status := NULL;
l_batch_name := NULL;
l_supplier_code := NULL;
l_supplier_payee_code := NULL;
l_cust_bill_to_add_ref := NULL;
l_cust_ship_to_add_ref := NULL;
l_line_type := NULL;
l_combination_check := NULL;
l_term_name := NULL;
l_receipt_method := NULL;
l_tax_inc_flag := NULL;
l_update_tax := NULL;
l_date_term := NULL;
l_date := NULL;
l_term := NULL;
l_cust_trx_type_name := NULL;
l_bill_sku := NULL;
l_ship_from := NULL;
l_inventory_id := NULL;
l_warehouse_id := NULL;
l_location_ship := 'SHIP_TO';
l_location_bill := 'BILL_TO';
l_err_stage := NULL;
l_error_message := NULL;
l_costcenter := NULL;
l_company := NULL;
l_account := NULL;
l_function := NULL;
-- Validation for set_of_books and org_id
l_err_stage := 'Validation for Set_of_books_id and org_id .' ;
IF (g_ledger_name IS NOT NULL) AND (g_org_id IS NOT NULL) THEN
OPEN c_set_book_id_exist;
FETCH c_set_book_id_exist into l_set_of_books_id;
CLOSE c_set_book_id_exist;
IF l_set_of_books_id IS NULL THEN
p_errbuf := 'Please check the setup for set_of_books name'||g_ledger_name;
p_retcode := g_ret_exception;
xxom_int_common.post_record_msg( p_message => 'Please check the setup for set_of_books name :'||g_ledger_name
, p_severity => xxom_int_common.c_level_error
END IF;--set of books
ELSE
p_errbuf := 'Please check the setup for set_of_books name'||g_ledger_name||'and org_id '||g_org_id||'cannot be null';
p_retcode := g_ret_exception;
xxom_int_common.post_record_msg( p_message => 'Please check the setup for set_of_books name'||g_ledger_name||'and org_id '||g_org_id||'cannot be null'
, p_severity => xxom_int_common.c_level_error
END IF;--Validation for set_of_books and org_id
--Validation for batch name
l_err_stage := 'Validation for batch name.' ;
IF g_batch_source_name IS NOT NULL THEN
OPEN c_batch_src_exist;
FETCH c_batch_src_exist INTO l_batch_name ;
CLOSE c_batch_src_exist;
IF l_batch_name IS NULL THEN
p_errbuf := 'Please check the setup for batch_source_name'||g_batch_source_name;
p_retcode := g_ret_exception;
xxom_int_common.post_record_msg( p_message => 'Please check the setup for batch_source_name'||g_batch_source_name
, p_severity => xxom_int_common.c_level_error
END IF;
END IF ;--l_get_bill_data(i).batch_source_name IS NOT NULL
--Validation for supplier code
l_err_stage := 'Validation for Supplier Code.';
IF l_get_bill_data(i).supplier_code IS NOT NULL THEN
OPEN c_cust_num_exist( p_cust_no => l_get_bill_data(i).supplier_code1
FETCH c_cust_num_exist INTO l_supplier_code;
CLOSE c_cust_num_exist;
IF l_supplier_code IS NULL THEN
l_error_message := l_error_message||'Supplier Code ('||l_get_bill_data(i).supplier_code||' ) is not valid.';
xxom_int_common.post_record_msg( p_message => 'Supplier Code is not valid : '||l_get_bill_data(i).supplier_code||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
ELSE
OPEN c_get_location( p_cust_id => l_supplier_code
, p_location_use => l_location_ship);
FETCH c_get_location INTO l_cust_ship_to_add_ref;
CLOSE c_get_location;
IF l_cust_ship_to_add_ref IS NULL THEN
l_error_message := l_error_message||'Customer ship to location is null.';
xxom_int_common.post_record_msg( p_message => 'Customer ship to location is null. '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF;
END IF ;
END IF;-- l_get_bill_data(i).supplier_code IS NOT NULL
--Validation for Supplier payee code
l_err_stage := 'Validation for Supplier payee code.';
IF l_get_bill_data(i).supplier_payee_code IS NOT NULL THEN
OPEN c_cust_payee_exist ( p_cust_no => l_get_bill_data(i).supplier_payee_code1);
FETCH c_cust_payee_exist INTO l_supplier_payee_code;
CLOSE c_cust_payee_exist;
IF l_supplier_payee_code IS NULL THEN
l_error_message := l_error_message||'Supplier Payee Code ('||l_get_bill_data(i).supplier_payee_code||' ) is not valid.';
xxom_int_common.post_record_msg( p_message => 'Supplier Payee Code is not valid: '||l_get_bill_data(i).supplier_payee_code||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
ELSE
OPEN c_get_location( p_cust_id => l_supplier_payee_code
, p_location_use => l_location_bill);
FETCH c_get_location INTO l_cust_bill_to_add_ref;
CLOSE c_get_location;
IF l_cust_bill_to_add_ref IS NULL THEN
l_error_message := l_error_message||'Customer bill to location is null.';
xxom_int_common.post_record_msg( p_message => 'Customer bill to location is null. '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF;
END IF;
ELSE
l_error_message := l_error_message ||' Supplier Payee code is null';
xxom_int_common.post_record_msg( p_message => 'Supplier Payee code is null. '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF ;--supplier_payee_code IS NOT NULL
--Validation for DC
l_err_stage := 'Validation for DC.';
IF l_get_bill_data(i).dc IS NOT NULL THEN
OPEN c_validate_dc(p_dc => l_get_bill_data(i).dc);
FETCH c_validate_dc INTO l_costcenter
, l_company;
CLOSE c_validate_dc;
IF l_costcenter IS NULL THEN
l_error_message := l_error_message||'DC ('||l_get_bill_data(i).dc||' ) is not valid.';
xxom_int_common.post_record_msg( p_message => 'DC is not valid : '||l_get_bill_data(i).dc||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF;
ELSE
l_error_message := l_error_message||'DC is null';
xxom_int_common.post_record_msg( p_message => 'DC is null. '||l_get_bill_data(i).dc||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF;
--Validation for program type
l_err_stage := 'Validation for program type.';
IF l_get_bill_data(i).program_type IS NOT NULL THEN
OPEN c_pgm_type_exist(p_pgm_type => l_get_bill_data(i).program_type);
FETCH c_pgm_type_exist INTO l_account
, l_function
, l_tax_inc_flag
, l_cust_trx_type_name
, l_bill_sku
, l_ship_from;
CLOSE c_pgm_type_exist;
--to fetch warehouse_id and inventory_id
OPEN c_get_inventory_item_id(p_org_code => l_ship_from
,p_item_description =>l_bill_sku );
FETCH c_get_inventory_item_id INTO l_inventory_id
,l_warehouse_id;
CLOSE c_get_inventory_item_id;
IF l_tax_inc_flag IS NULL THEN
l_error_message := l_error_message||'Program type ('||l_get_bill_data(i).program_type||' ) is not valid.';
xxom_int_common.post_record_msg( p_message => 'Program type is not valid : '||l_get_bill_data(i).program_type||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
ELSIF l_tax_inc_flag ='No' THEN
l_update_tax := 'N';
ELSE
l_update_tax := 'Y';
END IF;
ELSE
l_error_message := l_error_message||'Program type is null';
xxom_int_common.post_record_msg( p_message => 'Program type is null. '||l_get_bill_data(i).program_type||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF; --IF l_get_bill_data.program_type IS NOT NULL
--Validation for Line type
l_err_stage := 'Validation for Line type.';
IF l_get_bill_data(i).line_type IS NOT NULL THEN
OPEN c_validate_line_type(p_line_type => l_get_bill_data(i).line_type);
FETCH c_validate_line_type INTO l_line_type;
CLOSE c_validate_line_type;
IF l_line_type IS NULL THEN
l_error_message := l_error_message||'Line type ('||l_get_bill_data(i).line_type||' ) is not valid.';
xxom_int_common.post_record_msg( p_message => 'Line type is not valid : '||l_get_bill_data(i).line_type||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF;
ELSE
l_error_message := l_error_message ||' Line type is null';
xxom_int_common.post_record_msg( p_message => 'Line type is null '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF;--l_get_bill_data(i).line_type IS NOT NULL
--Validation for Payment Type
l_err_stage := 'Validation for Payment Type.';
IF l_get_bill_data(i).payment_type IS NOT NULL AND l_get_bill_data(i).payment_type IN ('D') THEN
debug_print('Receipt'||i||l_get_bill_data(i).payment_type);
OPEN c_validate_receipt_type(p_receipt_method => l_get_bill_data(i).payment_type);
FETCH c_validate_receipt_type INTO l_receipt_method;
CLOSE c_validate_receipt_type;
IF l_receipt_method IS NULL THEN
l_error_message := l_error_message||'Payment type ('||l_get_bill_data(i).payment_type||' ) is not valid.';
xxom_int_common.post_record_msg( p_message => 'Payment type is not valid : '||l_get_bill_data(i).payment_type||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF ;
END IF;--l_get_bill_data(i).payment_type NOT NULL
--Validation for term name
IF l_get_bill_data(i).due_date IS NOT NULL THEN
IF l_get_bill_data(i).due_date <= 0 THEN
l_term_name:='IMMEDIATE';
ELSIF l_get_bill_data(i).due_date BETWEEN 1 AND 30 THEN
l_term_name:='NET30';
ELSIF l_get_bill_data(i).due_date BETWEEN 31 AND 60 THEN
l_term_name:='NET60';
ELSIF l_get_bill_data(i).due_date BETWEEN 61 AND 90 THEN
l_term_name:='NET90';
ELSIF l_get_bill_data(i).due_date BETWEEN 91 AND 120 THEN
l_term_name:='NET120';
ELSIF l_get_bill_data(i).due_date BETWEEN 121 AND 150 THEN
l_term_name:='NET150';
ELSIF l_get_bill_data(i).due_date BETWEEN 151 AND 180 THEN
l_term_name:='NET180';
ELSIF l_get_bill_data(i).due_date BETWEEN 181 AND 210 THEN
l_term_name:='NET210';
ELSIF l_get_bill_data(i).due_date BETWEEN 211 AND 240 THEN
l_term_name:='NET240';
ELSE
l_term_name:='NET365';
END IF;
IF l_term_name IS NOT NULL THEN
OPEN c_validate_term_name(p_term_name =>l_term_name);
FETCH c_validate_term_name INTO l_term;
CLOSE c_validate_term_name;
IF l_term IS NULL THEN
l_error_message := l_error_message ||'The term name is not a valid term';
xxom_int_common.post_record_msg( p_message => 'The term name is not a valid term '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF;
END IF;--l_term_name IS NOT NULL THEN
ELSE
l_error_message := l_error_message ||'The data provided for term name is null';
xxom_int_common.post_record_msg( p_message => 'The data provided for term name is null '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF; --l_get_bill_data(i).due_date IS NOT NULL */
--Validation for unique interface_line_context and interface_line_attribute1 combination AND Amount
IF l_get_bill_data(i).invoice_amount IS NOT NULL THEN
OPEN c_check_combination( p_attribute=> l_get_bill_data(i).sfm_bill_number
FETCH c_check_combination INTO l_combination_check;
CLOSE c_check_combination;
IF l_combination_check IS NOT NULL THEN
l_error_message := l_error_message||'The interface_line_context and interface_header_attribute1 combination ('||l_get_bill_data(i).sfm_bill_number||' and '|| ' SFM' ||' ) already exist .Please provide different combination';
xxom_int_common.post_record_msg( p_message => 'The interface_line_context and interface_header_attribute1 combination already exist .Please provide different combination ' ||l_get_bill_data(i).sfm_bill_number ||' and '||'SFM'
, p_severity => xxom_int_common.c_level_warning
END IF;
ELSE
l_error_message := l_error_message||'Amount cannot be null';
xxom_int_common.post_record_msg( p_message => 'Amount cannot be null '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
, p_severity => xxom_int_common.c_level_warning
END IF; --l_get_bill_data(i).total_inv_recv_amt IS NOT NULL
/* end of validation*/
l_bill_dtl_update_rec.EXTEND;
l_bill_dtl_update_rec(l_cnt).ledger_id := l_set_of_books_id;
l_bill_dtl_update_rec(l_cnt).cust_ship_to_add_ref := l_cust_ship_to_add_ref;
l_bill_dtl_update_rec(l_cnt).cust_bill_to_add_ref := l_cust_bill_to_add_ref;
l_bill_dtl_update_rec(l_cnt).receipt_method := l_receipt_method;
l_bill_dtl_update_rec(l_cnt).company_seg := l_company;
l_bill_dtl_update_rec(l_cnt).account_seg := l_account;
l_bill_dtl_update_rec(l_cnt).costcenter_seg := l_costcenter;
l_bill_dtl_update_rec(l_cnt).function_seg := l_function;
l_bill_dtl_update_rec(l_cnt).tax_flag := l_update_tax;
l_bill_dtl_update_rec(l_cnt).pay_term_name := l_term;
l_bill_dtl_update_rec(l_cnt).cust_trx_type := l_cust_trx_type_name;
l_bill_dtl_update_rec(l_cnt).inventory_item_id := l_inventory_id;
l_bill_dtl_update_rec(l_cnt).warehouse_id := l_warehouse_id;
l_bill_dtl_update_rec(l_cnt).invoice_amount := l_get_bill_data(i).invoice_amount;
l_bill_dtl_update_rec(l_cnt).row_id := l_get_bill_data(i).rowid;
IF l_error_message IS NULL THEN
l_bill_dtl_update_rec(l_cnt).record_status := g_valid_status;
l_bill_dtl_update_rec(l_cnt).error_message := NULL;
ELSE
l_bill_dtl_update_rec(l_cnt).record_status := g_err_status;
l_bill_dtl_update_rec(l_cnt).error_message := l_error_message;
END IF;
l_cnt := l_cnt + 1;
END LOOP;
FORALL i in 1..l_bill_dtl_update_rec.COUNT SAVE EXCEPTIONS
UPDATE xxom_ar_sfs03_bill_info_stg
SET cust_bill_to_add_ref = l_bill_dtl_update_rec(i).cust_bill_to_add_ref
, cust_ship_to_add_ref = l_bill_dtl_update_rec(i).cust_ship_to_add_ref
, term_name = l_bill_dtl_update_rec(i).pay_term_name
, receipt_method = l_bill_dtl_update_rec(i).receipt_method
, set_of_books_id = l_bill_dtl_update_rec(i).ledger_id
, company_seg = l_bill_dtl_update_rec(i).company_seg
, account_seg = l_bill_dtl_update_rec(i).account_seg
, costcenter_seg = l_bill_dtl_update_rec(i).costcenter_seg
, function_seg = l_bill_dtl_update_rec(i).function_seg
, cust_trx_type = l_bill_dtl_update_rec(i).cust_trx_type
, inventory_item_id = l_bill_dtl_update_rec(i).inventory_item_id
, warehouse_id = l_bill_dtl_update_rec(i).warehouse_id
, tax_flag = l_bill_dtl_update_rec(i).tax_flag
, total_inv_recv_amt = l_bill_dtl_update_rec(i).invoice_amount
, record_status = l_bill_dtl_update_rec(i).record_status
, error_message = l_bill_dtl_update_rec(i).error_message
, conc_request_id = fnd_global.conc_request_id
, last_update_date = SYSDATE
, last_updated_by = FND_GLOBAL.USER_ID
WHERE ROWID = l_bill_dtl_update_rec(i).row_id;
COMMIT;
-- Submitting the invoice_error procedure at end of validate procedure.
debug_print('Submitting the invoice_error procedure at end of validate_records procedure. ');
--reject all line of an invoice with a single error line
OPEN c_get_err_line;
FETCH c_get_err_line BULK COLLECT INTO l_bill_err_lines;
CLOSE c_get_err_line;
FOR i IN 1..l_bill_err_lines.COUNT LOOP
OPEN c_get_invoice_no(p_bill =>l_bill_err_lines(i).sfm_bill_number );
FETCH c_get_invoice_no BULK COLLECT INTO l_bill_no;
CLOSE c_get_invoice_no;
FOR j IN 1..l_bill_no.COUNT LOOP
UPDATE xxom_ar_sfs03_bill_info_stg
SET error_message = NULL
, record_status ='E'
, last_update_date = SYSDATE
WHERE record_status = 'V'
AND sfm_bill_number = l_bill_no(i).sfm_bill_number;
COMMIT;
END LOOP;
END LOOP;
EXCEPTION
WHEN ex_dml_errors THEN
l_error_count := SQL%BULK_EXCEPTIONS.count;
FOR i IN 1 .. l_error_count LOOP
l_error_message := l_error_message||SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE);
END LOOP;--OR i IN 1 .. l_error_count LOOP
WHEN OTHERS THEN
IF c_get_bill_data%ISOPEN THEN
CLOSE c_get_bill_data;
END IF;
IF c_batch_src_exist%ISOPEN THEN
CLOSE c_batch_src_exist;
END IF;
IF c_set_book_id_exist%ISOPEN THEN
CLOSE c_set_book_id_exist;
END IF;
IF c_get_location%ISOPEN THEN
CLOSE c_get_location;
END IF;
IF c_validate_line_type%ISOPEN THEN
CLOSE c_validate_line_type;
END IF;
IF c_validate_receipt_type%ISOPEN THEN
CLOSE c_validate_receipt_type;
END IF;
IF c_check_combination%ISOPEN THEN
CLOSE c_check_combination;
END IF;
IF c_validate_receipt_type%ISOPEN THEN
CLOSE c_validate_receipt_type;
END IF;
IF c_pgm_type_exist%ISOPEN THEN
CLOSE c_pgm_type_exist;
END IF;
IF c_validate_term_name%ISOPEN THEN
CLOSE c_validate_term_name;
END IF;
IF c_new_rec_count%ISOPEN THEN
CLOSE c_new_rec_count;
END IF;
IF c_cust_payee_exist%ISOPEN THEN
CLOSE c_cust_payee_exist;
END IF;
IF c_get_invoice_no%ISOPEN THEN
CLOSE c_get_invoice_no;
END IF;
IF c_get_err_line%ISOPEN THEN
CLOSE c_get_err_line;
END IF;
p_retcode := g_ret_exception;
p_errbuf := 'The Error at XXOM_SFS_03_BILL_INFO_PKG.validate_records ' || l_err_stage|| '-'|| SUBSTR ( SQLERRM ,1,240 );
END validate_records;
Thanks in advance.Another version
SET SERVEROUTPUT ON
DECLARE
TYPE empno_nt IS TABLE OF VARCHAR2 (40);
l_empno_nt empno_nt;
BEGIN
l_empno_nt := empno_nt ('Suri');
dbms_output.put_line(l_empno_nt(1));
END;
Enhanced version:
DECLARE
TYPE empno_nt IS TABLE OF VARCHAR2 (40);
l_empno_nt empno_nt;
BEGIN
l_empno_nt := empno_nt ('Suri', 'Test','Ranit');
FOR rec IN l_empno_nt.FIRST .. l_empno_nt.LAST
LOOP
DBMS_OUTPUT.put_line (l_empno_nt (rec));
END LOOP;
END;
Simplified version :
select * from table( sys.odcivarchar2list('Suri','Test','Ranit') ) ;
Cheers,
Manik.
Message was edited by: Manik -
SDO_TUNE.EXTENT_OF returns ORA-06533: Subscript beyond count
Hi,
I'm trying to get the MBR of a dataset I've just loaded via an Oracle dump file from another source. I am using sdo_tune.extent_of to get the information, but the following error message is returned:
select sdo_tune.extent_of('LR_PRM_IACS','GEOM') from dual
ERROR at line 1:
ORA-06533: Subscript beyond count
ORA-06512: at "MDSYS.SDO_TUNE", line 1410
I've looked up the meaning of the error and am none the wiser. There are just over 790000 records in the table. This shouldn't be too big to be handled, or is this possible? How else can I get the MBR for the dataset?
Many thanks
SharonHi Andriy
I am Jorge Barba
The author of the note you are following to setup the NCI demo.
1. Regarding errors in sql*loader: Total logical records rejected: 55844
We are aware of that and we just ignored those errors as this was done just for demo purposes.
2. Regarding the second error
Can you try the procedure in the tutorial, Use this link to go to the tutorial, build_patients sections:
http://www.oracle.com/technology/obe/11gr1_db/datamgmt/nci_semantic_network/nci_semantics_les01.htm#t3
If this still gives error, try the query alone to see if still gives the same error
Regards!
Jorge -
Error: ORA-06533: Subscript beyond count
when i run the below command;
ERROR at line 1:
ORA-06533: Subscript beyond count
ORA-06512: at line 10
sp_table will be like
SPLITID DELIMITERLENGTH
1 1
2 1
3 1
4 1
declare strx varchar2(4000) :='11111111111111111111111111111111111111111111111111111111111111111111111111111111';
delarray np_type:=np_type(1,2,3,4,5);
execstr varchar2(4000);
cn cn_type :=cn_type();
cxn cxn_type :=cxn_type();
xpos number:=1;
begin
for i in 1..5 loop
select Delimiterlength into cn(i) from sp_table where Splitid = delarray(i);
select substr(strx,xpos,cn(i)) into cxn(i) from dual;
execstr:='insert into test values(' || cxn(i) || ',';
xpos:=length(cxn(i));
end loop;
execstr:=substr(execstr,1,length(execstr)-1);
execstr:=execstr || ')';
dbms_output.put_line(execstr);
--execute immediate execstr;
end;
/Something like this?
SET SERVEROUTPUT ON
DROP TABLE sp_table;
CREATE TABLE sp_table(splitid NUMBER,delimiterlength NUMBER);
INSERT INTO sp_table values(1,4);
INSERT INTO sp_table values(2,7);
INSERT INTO sp_table values(3,9);
INSERT INTO sp_table values(4,1);
INSERT INTO sp_table values(5,2);
INSERT INTO sp_table values(6,6);
COMMIT;
DECLARE
TYPE varchar2_table IS TABLE OF VARCHAR2(120)
INDEX BY BINARY_INTEGER;
TYPE number_table IS TABLE OF NUMBER
INDEX BY BINARY_INTEGER;
delarray number_table;
cn number_table;
cxn varchar2_table;
xpos NUMBER :=1;
strx VARCHAR2(4000) :='11111111111111111111111111111111111111111111111111111111111111111111111111111111';
execstr VARCHAR2(4000);
BEGIN
delarray(1) := 1;
delarray(2) := 2;
delarray(3) := 3;
delarray(4) := 4;
delarray(5) := 5;
execstr := 'insert into test values(';
FOR i IN 1..delarray.COUNT LOOP
SELECT delimiterlength
INTO cn(i)
FROM sp_table
WHERE splitid = delarray(i);
cxn(i) := SUBSTR(strx,xpos,cn(i));
execstr :=execstr || cxn(i) || ',';
xpos :=LENGTH(cxn(i));
END LOOP;
execstr := RTRIM(execstr,',')|| ')';
dbms_output.put_line(execstr);
--execute immediate execstr;
END;
insert into test values(1111,1111111,111111111,1,11)I used associative arrays, so I don't have to extend them.
Edited by: Marwim on 25.10.2012 10:17 -
Dear Experts
I have a workspace on apex.oracle.com
I tried to copy an application. It gives me
GET_STMT error. ORA-56720: I/O data limit exceeded - call aborted:281:0
ORA-56720: I/O data limit exceeded - call aborted
How to solve this?
Best Regards
Mahmoudmahmoudrabie wrote:
Dear fac586
I found the solution in the following steps
1) Export (Backup) your report queries and report layouts
2) Delete them from the shared components
3) Copy the application
4) Import them again to both applicationsThis may provide a workaround in your immediate situation, but the error message is indicative of an underlying problem in APEX 4.2 (as described in Joel's post). Please edit the Subject line of your original post to include "APEX 4.2" to help to bring this to Oracle's attention. -
Error ORA-06533: Subscript beyond count - Please help
Hi All,
Please help me on below error
I Created two Objects and two Type like below
CREATE OR REPLACE TYPE P_IN_OBJ AS OBJECT
A1 VARCHAR2(5),
A2 VARCHAR2(5),
A3 VARCHAR2(30));
CREATE OR REPLACE TYPE P_IN AS TABLE OF P_IN_OBJ;
CREATE OR REPLACE TYPE P_OUT_OBJ AS OBJECT
(B1 VARCHAR2(1),
B2 VARCHAR2(100),
B3 NUMBER,
B4 VARCHAR2(100));
CREATE OR REPLACE TYPE P_OUT AS TABLE OF P_OUT_OBJ;
CREATE OR REPLACE PACKAGE PKG_P1 AS
PROCEDURE PRC_P1(P_IN_VALUE IN P_IN ,
P_OUT_VALUE OUT P_OUT);
END PKG_P1;
CREATE OR REPLACE PACKAGE BODY PKG_SEG_QS AS
PROCEDURE PRC_SEG_QS(P_IN_VALUE IN P_IN ,
P_OUT_VALUE OUT P_OUT ) AS
P_OUT_VAL P_OUT := P_OUT();
element INTEGER := 1;
BEGIN
IF P_IN_VALUE.EXISTS(1) = TRUE THEN
FOR I IN 1..P_IN_VALUE.COUNT
LOOP
FOR ALL_QS IN
(SELECT E1, E2, E3, E4
FROM MV_SEG_QS MVSQ
WHERE MVSQ.Z1 = P_IN_VALUE.A1
AND MVSQ.Z2 = P_IN_VALUE.A2
AND MVSQ.Z3 = P_IN_VALUE.A3
LOOP
P_OUT_VAL(element).B1 := ALL_QS.E1;
P_OUT_VAL(element).B2 := ALL_QS.E2;
P_OUT_VAL(element).B3 := ALL_QS.E3;
P_OUT_VAL(element).B4 := ALL_QS.E4;
element := element+1;
END LOOP;
END LOOP;
END IF;
P_OUT_VALUE:= P_SEG_OUT;
END PRC_P1;
END PKG_P1;
When I call this Package I am getting the below Error
ORA-06533: Subscript beyond count
Please somebody help me in this issue its very urgent for me.
Thanks,
Anu.Anu wrote:
Hi All,
Please help me on below error
I Created two Objects and two Type like below
CREATE OR REPLACE TYPE P_IN_OBJ AS OBJECT
A1 VARCHAR2(5),
A2 VARCHAR2(5),
A3 VARCHAR2(30));
CREATE OR REPLACE TYPE P_IN AS TABLE OF P_IN_OBJ;
CREATE OR REPLACE TYPE P_OUT_OBJ AS OBJECT
(B1 VARCHAR2(1),
B2 VARCHAR2(100),
B3 NUMBER,
B4 VARCHAR2(100));
CREATE OR REPLACE TYPE P_OUT AS TABLE OF P_OUT_OBJ;
CREATE OR REPLACE PACKAGE PKG_P1 AS
PROCEDURE PRC_P1(P_IN_VALUE IN P_IN ,
P_OUT_VALUE OUT P_OUT);
END PKG_P1;
CREATE OR REPLACE PACKAGE BODY PKG_SEG_QS AS
PROCEDURE PRC_SEG_QS(P_IN_VALUE IN P_IN ,
P_OUT_VALUE OUT P_OUT ) AS
P_OUT_VAL P_OUT := P_OUT();
element INTEGER := 1;
BEGIN
IF P_IN_VALUE.EXISTS(1) = TRUE THEN
FOR I IN 1..P_IN_VALUE.COUNT
LOOP
FOR ALL_QS IN
(SELECT E1, E2, E3, E4
FROM MV_SEG_QS MVSQ
WHERE MVSQ.Z1 = P_IN_VALUE.A1
AND MVSQ.Z2 = P_IN_VALUE.A2
AND MVSQ.Z3 = P_IN_VALUE.A3
LOOP
P_OUT_VAL(element).B1 := ALL_QS.E1;
P_OUT_VAL(element).B2 := ALL_QS.E2;
P_OUT_VAL(element).B3 := ALL_QS.E3;
P_OUT_VAL(element).B4 := ALL_QS.E4;
element := element+1;
END LOOP;
END LOOP;
END IF;
P_OUT_VALUE:= P_SEG_OUT;
END PRC_P1;
END PKG_P1;
When I call this Package I am getting the below Error
ORA-06533: Subscript beyond count
Please somebody help me in this issue its very urgent for me.
Thanks,
Anu.Anu,
Correct your package code, its not working.
Cheers,
Manik. -
ORA -06533 Subscript beyond control
Hi folks,
I got ORA -06533 Subscript beyond control .Please help me out.
create or replace procedure p_mon_ext is
type p_mon_type is varray(25) of varchar2(25);
p_mon p_mon_type;
idx number := 1;
begin
p_mon := p_mon_type();
for i in 1..12
loop
select to_char(SYSDATE, 'MONTH') into p_mon(i) from Dual;
p_mon.extend;
end loop;
forall i in 1..p_mon.count
insert into t1 values (p_mon(i));
commit;
end;EXTEND has to precede any operations with elements:
SQL> edit
Wrote file afiedt.buf
1 create or replace procedure p_mon_ext is
2 type p_mon_type is varray(25) of varchar2(25);
3 p_mon p_mon_type;
4 idx number := 1;
5 begin
6 p_mon := p_mon_type();
7 for i in 1..12
8 loop
9 select to_char(SYSDATE, 'MONTH') into p_mon(i) from Dual;
10 p_mon.extend;
11 end loop;
12* end;
SQL> /
Procedure created.
SQL> exec p_mon_ext
BEGIN p_mon_ext; END;
ERROR at line 1:
ORA-06533: Subscript beyond count
ORA-06512: at "SCOTT.P_MON_EXT", line 9
ORA-06512: at line 1
SQL> edit
Wrote file afiedt.buf
1 create or replace procedure p_mon_ext is
2 type p_mon_type is varray(25) of varchar2(25);
3 p_mon p_mon_type;
4 idx number := 1;
5 begin
6 p_mon := p_mon_type();
7 for i in 1..12
8 loop
9 p_mon.extend;
10 select to_char(SYSDATE, 'MONTH') into p_mon(i) from Dual;
11 end loop;
12* end;
SQL> /
Procedure created.
SQL> exec p_mon_ext
PL/SQL procedure successfully completed.
SQL> edit
Wrote file afiedt.buf
1 create or replace procedure p_mon_ext is
2 type p_mon_type is varray(25) of varchar2(25);
3 p_mon p_mon_type;
4 idx number := 1;
5 begin
6 p_mon := p_mon_type();
7 p_mon.extend(12);
8 for i in 1..12
9 loop
10 select to_char(SYSDATE, 'MONTH') into p_mon(i) from Dual;
11 end loop;
12* end;
SQL> /
Procedure created.
SQL> exec p_mon_ext
PL/SQL procedure successfully completed.Rgds. -
Any benefit to free subscriptions outside of Newsstand?
Situation: We have a client who will publish free folios to a free multi-viewer app. The client wants the app to live outside of Newsstand.
What we know: Free folios show up in the app as soon as they're published. But, Apple offers the ability to configure free subscriptions.
Our question: What's the benefit in configuring free subscription for non-Newsstand apps? Or, does Apple simply require free subscriptions for free-folio/free-multi-issue apps to live in Newsstand?
Thanks, as always.
Josh PenrodApple created the Free Subscriptions option specifically to enable apps with free content to work in Newsstand. I see no benefit in setting up free subscriptions outside of Newsstand, and I don't even know if it's possible.
-
Why is my subscription not working it is not recognizine it as a paid account
Hi Wilson1299,
I checked your account with your email([email protected]@xxadxxxxer.com) however i can see you tried to place the order on 30th May and 1st June but your order was not completed.
Please check your account if the payment was deducted from your account or not?
I'll wait for your response,
Regards,
~Pranav -
Why has my subscription ended?
Why has my subscription ended? I did not cancel it and if it goes up to regular price I still want it! Do I need another credit card? Please advise, Ed Klostermann
Hi Ed,
Did you get it straightened out Ed? I looked at your account and your membership appears active?
-Dave -
Cannot figure out why "ORA-01000 Maximum open cursors" is shown...
Hello there ...
I am programming a PL/SQL Code that is throwing 0RA-01000 Maximum Open Cursors Exceeded.
Having already read quite a lot about ORA-01000 errors, I know I should be closing cursors, and have already tried setting OPEN_CURSORS parameter to a high number (1000).
I declared a lot of procedures in my pl/sql, each of which uses one cursor since i am working with a non-Oracle table linked by ODBC ... and each procedure sometimes does thousands of inserts -- but all WITHIN the explicit cursors. The explicit cursors are not declared within each loop.
I already checked the code many times, and made sure all open cursors are closed. In addition, I also verified the numberopen cursors generated by the PL/SQL by running the following SQL after every procedure i run... and outputting it... and it appears the value just keeps on increasing, even though I had explicitly closed all the cursors in all the earlier procedures.
What is funny is that the most number of cursors reported by the code below only hits 150+ cursors. Nowhere near the 1000 open_cursors limit per session.
select a.value into strtxt --, b.name
from v$mystat a, v$statname b
where a.statistic# = b.statistic#
and a.statistic#= 3;When I run the procedures separately though, all the procedures run smoothly (even when I had not yet updated the open_cursors parameter).
I was thinking of the following, but maybe you have some other ideas?
Does this have anything to do with my procedures not being stored procedures?
Or should i be committing records within my procedures instead of out of it?
I really have run into a wall and would really appreciate any tips or helps on this. Thanks in advance!
My basic pl/sql code looks like below. I did not give the actual details cause it will be too long (up to 5000 lines).
DECLARE
PROCEDURE proc1
IS
CURSOR cur_hca
is
select ...from..where;
TYPE cur_hca_fetch
Is TABLE OF cur_hca%ROWTYPE
INDEX BY PLS_INTEGER;
temp_collect cur_hca_fetch;
BEGIN
open cur_hca; --cur_hca is the cursor name.
--i use exactly the same cursor name in the other procedures
loop
fetch cur_hca bulk collect into temp_collect LIMIT 1000;
exit when temp_collect.count=0
for indx in 1 .. temp_collect.count
loop
...run some sql
end loop;
end loop;
close cur_hca;
END proc1;
PROCEDURE proc2 --almost the same as above the only changes are the query for the
-- cursor and the sql that happens for each record
IS
BEGIN
open cur_hca; --cur_hca is my cursor name
loop
end loop;
close cur_hca;
END proc2;
... up to 40 other very similar procedures
BEGIN
proc1;
commit;
select a.value into strtxt
from v$mystat a, v$statname b
where a.statistic# = b.statistic#
and a.statistic#= 3;
DBMS_OUTPUT.PUT_LINE('Number of Cursors After STATUSproc1: ' || strtxt);
proc2;
commit;
select a.value into strtxt
from v$mystat a, v$statname b
where a.statistic# = b.statistic#
and a.statistic#= 3;
DBMS_OUTPUT.PUT_LINE('Number of Cursors After STATUSproc2: ' || strtxt);
... 40 other procedures
END;Edited by: user4872285 on May 6, 2013 6:49 PM
Edited by: user4872285 on May 6, 2013 7:01 PM
Edited by: user4872285 on May 6, 2013 8:02 PM
Edited by: user4872285 on May 6, 2013 8:03 PMPL/SQL code usually leaks reference cursors and DBMS_SQL cursors - as the ref cursor/DBMS_SQL interface used has a global (session static) scope.
PL/SQL has an intelligent garbage collector that will close local implicit and explicit cursors, when the cursor variable goes out of scope.
If you define an explicit cursor globally (package interface), then it can only be opened once. The 2nd attempt results in a ORA-06511: PL/SQL: cursor already open exception. So code cannot leak explicit cursors as code cannot reopen an existing opened explicit cursor.
I have never seen Oracle leaking cursors internally. So I would be hesitant to call what you are seeing, a bug. If your code is using explicit cursors (even static/global ones), your code cannot leak these cursors, even if your code does not close them. Worse case - the cursor remains open, however new copies cannot be created while it is open.
So I think your are looking at the wrong thing - explicit cursors. These are not the cursors that are leaking in my view (simply because code cannot reuse and open an already opened explicit cursor). Here is an example:
SQL> show parameter cursors
NAME TYPE VALUE
open_cursors integer 300
session_cached_cursors integer 50
// procedure that seems to "leak" an explicit cursor handle
// as it does not explicitly closes the handle
SQL> create or replace procedure CursorUse is
2 cursor c is select e.* from emp e;
3 empRow emp%RowType;
4 begin
5 open c;
6 fetch c into empRow;
7 --// not closing explicit cursor handle
8 --// and going out-of-scope
9 end;
10 /
Procedure created.
// current session stats
SQL> select b.name, a.value from v$mystat a, v$statname b where a.statistic# = b.statistic# and b.name like '%open%cursor%';
NAME VALUE
opened cursors cumulative 91
opened cursors current 2
// execute proc that "leaks" a cursor, 10000 times
SQL> begin
2 for i in 1..10000 loop
3 CursorUse;
4 end loop;
5 end;
6 /
PL/SQL procedure successfully completed.
// no errors due to cursor leakage
// session stats: no cursor leakage occurred as
// PL/SQL's garbage collector cleaned (and closed)
// cursor handles when these became out-of-scope
SQL> select b.name, a.value from v$mystat a, v$statname b where a.statistic# = b.statistic# and b.name like '%open%cursor%';
NAME VALUE
opened cursors cumulative 10,095
opened cursors current 2
SQL> So the cursor leakage you are seeing is caused by something else... so what else is part of the code, or the session, that you have not yet mentioned? -
Why are calendar subscriptions not up to date?
When I select Subscriptions from within iCal, the available options are dated 2010 and 2011, even in the Most recent list.
Why are more current calendars not available?
Also, I have downloaded the US Holiday calendar before. It updates the holidays every year except Easter. However, the site does not
offer a Christian holiday calendar except a link that is way out of date. What gives?Thanks for the input. I had been searching the wrong words. I never thought to search for subscriptions.
Thanks again.
Maybe you are looking for
-
I used Internet explorer but was having difficulties reading "sky's" e-mails, I was recommended by Sky to use Firefox. I can now read the e-mails but when I send an e-mail and an attachment, to 4 addressees (which I have done every week for about 5 y
-
Video imported as only one clip on iMovie 08
I imported video from a Canon Elura 100 that consisted of many clips(100+) that showed up as only one long clip. I found info that suggested that it could be that the camera's date and time wasn't set. I tried another DV tape (camera's date & time is
-
I need to change countries but the system won't allow because of an outstanding 7 cents credit balance. What do I need to do?
-
Flash player and excessive popups
Yes, I was once plagued by flash player based ads opening tons of popups so I set flash player to ask for activation, solved my problem.... BUT, I managed to press "Allow and remember" instead of just "Allow now", so my question is, where to do I fin
-
Conflict with Outlook 2007: "Outlook did not close properly"
I started getting this message "Outlook did not close properly" with the last update of I-Tunes. I searched the web and tried everything (e.g., SCANPST, etc. etc.) and even called Microsoft and created a new profile. It immediately started again. The