Shuttle Demo Throws Error ORA-06502: PL/SQL: Character buffer too small
Hello All.
I am using Carl Backstrom's wonderful shuttle demo in my APEX 2.2 application and am running into this Oracle error "Character string buffer too small". My plsql code is:
DHTML_SHUTTLE (
'select func,func_id from phone_functions where rownum < 676 order by func',
'select a.func,a.func_id from phone_functions a, function_phones b where a.func_id = b.func_id and b.phone_id = 2010 order by func',
'1',
'2',
'Y',
'Y',
'N',
'150',
'350',
v('WORKSPACE_IMAGES'),
'first.png',
'previous.png',
'next.png',
'last.png',
'refresh.png',
'shuttleRightAll.png',
'shuttleRight.png',
'shuttleLeft.png',
'shuttleLeftAll.png'
I put in the rownum < 676 ti test out how many rows of data it will allow me to
output into the first select list box. I can go only upto 675 rows. After this I always get the error. The column FUNC is defined as varchar2(255). However,
it's largest value is about 60 bytes.
Does anyone know how to overcome this error. I have over 1000 rows I need to display in the list box.
Thank you.
Elie
Hello,
What is the limit on the number of
bytes/characters one may use in your
shuttle list boxes.Not sure but it's probably the hard 32k limit in which case try the solution that Scott posted above and see if that helps/
Also, is it possible to create multiple shuttle 2-box
combinations in different
regions on the same APEX page? Would not the
underlying plsql arrays
become "confused" as to what data is in what array?
Yes you can have more that one set of shuttle on a page. If you look here
http://apex.oracle.com/pls/otn/f?p=9655:7
all you have to do is change the pID_1 and pID_2 to a unique integer per each shuttle.
pID_1 = Form element name. For example, 1 equals F01 and 2 equals F02.
pID_2 = Form element name. For example, 1 equals F01 and 2 equals F02.
Here's an example of two shuttles in a page, you can see the client side works fine though I didn't change the save procedure it would work as well. http://apex.oracle.com/pls/otn/f?p=9655:6
Carl
Similar Messages
-
I have a form which uses a customer form/report, drop downs etc..
the debug shows it running this statement
...Execute Statement: begin begin SELECT distinct initcap(RTRIM (LTRIM (e.surname, ' *0123456789-/:.?,'), ' *0123456789-/:.?,') || ', ' || RTRIM (LTRIM (e.first_name, ' *0123456789-/:.?,'), ' *0123456789-/:.?,' )) empname, e.ID bulk collect into wwv_flow_utilities.g_display,wwv_flow_utilities.g_value FROM dms.dms_employees@dmsprd e, dms.dms_employee_contracts@dmsprd ec WHERE e.ID = ec.emp_id and e.surname like '%%' AND :p75_date BETWEEN ec.start_date AND NVL (ec.end_date, :p75_date) AND e.brh_id = 3654 ORDER BY 1; end; end;
Then says
"report error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small"
Any Ideas?
Thanks
DeanDenes Kubicek wrote:
A select list is limited in size. I am not sure what the limit is but that is definitelly the case.The maximum size for the HTML generated for a select list is 32K.
86 options sounds on the low side to be hitting that limit, but there are other concerns to this as well. Scrolling through hundreds/thousands of options in a select list is a pain for users, and huge select lists produce bloated pages that impact load times and network bandwidth. That list of around 200 countries you find on many sites is about the sensible maximum length for a select list.
You should use popups.Indeed. -
The oracle application express environment is created by installing the HTTP Server on the windows server and the application express 3.2.1 components on the 11.1.0.7 oracle database on UNIX. The installation is successfully and have not seen any issues during the installation. After completing all the steps, when tried to login and click the application builder or workspace components, I see the error message
report error:ORA-06502: PL/SQL: numeric or value error: character to number.
This error message is seen on most of the pages when trying to accessed and not able to understand the reasons behind it. Its a brand new environment setup and not even presented to developers to test it.
Below error message is always seen when trying to access most of the components like application builder, schema comparison and some other tabs. Please advice
report error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
Edited by: user589320 on Jun 9, 2011 5:17 PMI think its better you use APEX 4.x version ratherthan using old version.
You will get more features and some bug fixes and also it's easy for you to get some help when you need.
* If this answer is helpfull or correct then please mark it and grant the points. -
We face the above error in HTMLDB (APEX) application Ver 3.1.0. This occurs when we try to display more number of rows/records in drop-down list (LOV in tabular forms). We are able to display 200 records in LOV. When the list of records exceeds 230, we face the below error
report error:ORA-06502: PL/SQL: numeric or value error: character string buffer too small
the values listed in LOV are from tables (one of the columns in table)
Could anyone give us a solution?Hi
As you are using a tabular form, you could actually do the following:
1 - In the tabular form column's attributes, set the following:
Display as: Select List (query based on LOV)
Display extra values: Yes
List of values definition: SELECT null d, null r FROM DUAL
2 - Add a new page item and set it to generate your select list
3 - Create an HTML region with no template and use the following for its source:
<script type="text/javascript">
function loadList(c, l)
var s = document.getElementsByName(c);
var lItem = document.getElementById(l);
var lLength = lItem.options.length;
var k;
var j;
var x = lItem.innerHTML;
var v;
var o;
var z;
for (k = 0; k < s.length; k++)
z = s[k];
v = z.value;
z.options.length = 0;
for (j = 0; j < lLength; j++)
o = new Option()
o.value = lItem[j].value;
o.text = lItem[j].text;
z.options[j] = o;
z.value = v;
if (z.selectedIndex == -1)
z.selectedIndex = 0;
loadList("f05", "P1_MGR");
</script>
(Change "f05" and "P1_MGR" as appropriate to your column and your new page item respectively)
Now, when you load the page, the select list contains a null entry plus the entry already on the database. The javascript kicks in automatically, loops through every entry in the "f05" column, copies the existing value, replaces the select list with the new page item version and sets its value to the copied value.
Your new page item could be in a DIV tag that has a style of "display:none" to hide it from view.
Andy -
Hi everybody,
I have two Distinct Databases on two distinct servers. (Oracle Ent. Release 10.2.0.3.0 on AIX 5.3). After I install the latest patch last week, One of the APEX installation has some problems on Home>Application Builder Page. The error message is very random and
report error:
ORA-06502: PL/SQL: numeric or value error: NULL index table key value.
When i change the view (details to icons), everything goes to normal. This error message is reflected some of the pages (report region) of some of my applications randomly. When it appears in a report region, i deselect the order method of the region, the result is normal.
But the other APEX application on the other instance has no problem. It is a bug? or Should i re-install the APEX instance?
Thank you for your interest?
Gökhan ÇATALKAYANo, but we have a reproducible test case now so we're working on it. See ORA-06502: PL/SQL: numeric or value error: NULL index table key value
Scott -
Hi,
I am trying toceate an interface which collects data from database make some transformation and populated seeded tables in the same database.
My Approach is :
a) Create a record type variable ( concists of multiple segments)
b) Create a pl/sql table type of the records type in a)
c) Created a cursor of same structure as pl/sql table type ( collects data)
d) BULK CoLLECT data from cursor into pl/sql table
e) Print the data
But during Bulk Collect i get the below error :
Unexpected error in xxc_hr2hr_populate_elements.main at FLOW TRACE-1.120. Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value
ORA-20003: Unexpected error in xxc_hr2hr_populate_elements.get_data at FLOW TRACE-1.1.100. Error: ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated BindAshish_Apps wrote:
Hi,
I am trying toceate an interface which collects data from database make some transformation and populated seeded tables in the same database.
My Approach is :
a) Create a record type variable ( concists of multiple segments)
b) Create a pl/sql table type of the records type in a)
c) Created a cursor of same structure as pl/sql table type ( collects data)
d) BULK CoLLECT data from cursor into pl/sql table
e) Print the data
But during Bulk Collect i get the below error :
Unexpected error in xxc_hr2hr_populate_elements.main at FLOW TRACE-1.120. Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value
ORA-20003: Unexpected error in xxc_hr2hr_populate_elements.get_data at FLOW TRACE-1.1.100. Error: ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated BindVerify the rows you are fetching are having the same data types as your Record like Dates should go to date , decimal should not be fetched in type defined as number etc. -
Error : ORA-06502: PL/SQL: numeric or value error while fetch LONG datatype
Hello All,
I have written a script to fetch the text for a view in PLSQL and it gives me the following error :
Error : ORA-06502: PL/SQL: numeric or value error
declare
l_text all_views.text%type;
begin
SELECT text INTO l_text FROM all_views WHERE view_name = 'XXVIEW';
exception
when others then
dbms_output.put_line('Error : '||sqlerrm);
end;
The above works for some views and not view other views. Can anyone let me know what could be the reason for ORA-06502 when fetching into a long variable in PLSQL.
Would appreciate any response.
Thanks,If view 'XXVIEW' contains "no record" for field "text" then it'll show this error.
I mean "SELECT text FROM all_views WHERE view_name = 'XXVIEW';" returns "No record found" then how can you assign "no record" to a variable "l_text ".
try to execute : SELECT text FROM all_views WHERE view_name = 'XXVIEW';
What does it give you? any "Blank records"?
Edited by: H. on Feb 20, 2009 8:17 AM -
E-Mail Generating from database error ORA-06502: PL/SQL:
Hello,
I have write script for generating HTML formated email from database (11g).
when text body increase 4000 char it generating error
ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "EXPORT.REALIZATIONHTML", line 56 ORA
how i can resolve it.
I also try with LONG
ThanksThanks for reply.
I try with CLOB, Reason is that message body have almost 1000 recode and length(message) have more than 8000 characters even more than 10000
how i can resolve it , which data type I have to use
Thanks -
Problem with error ORA-06502: PL/SQL: numeric or value error string
Hi,
I am running a loop to just spool output data using 'dbms_output.put_line' and I keep getting this error after a few records. I resorted it and it happen at a different interval. Could it have to do with the length of the item I am trying to spool? Thanks.
ORA-06502: PL/SQL: numeric or value error stringSD wrote:
Hi,
I am running a loop to just spool output data using 'dbms_output.put_line' and I keep getting this error after a few records. I resorted it and it happen at a different interval. Could it have to do with the length of the item I am trying to spool? Thanks.
ORA-06502: PL/SQL: numeric or value error stringyes, it is a data dependent error.
Handle: SD
Status Level: Newbie
Registered: Nov 21, 2001
Total Posts: 289
Total Questions: 189 (183 unresolved)
why do you waste time here when you rarely get your questions answered? -
Package Returning Error ORA-06502: PL/SQL: numeric or value error
Hi,
I create a package to export to spread sheet .xls, The package work for simple query if i pass the query to package.
There is no error in package please create the package and do the following as mentioned below
create or replace
PACKAGE export_pkg_spread_sheet
AS
procedure download_excel(vsql in clob );
PROCEDURE excel_header(p_header in out nocopy clob);
procedure excel_content(p_content in out nocopy clob,
vsql in clob );
procedure excel_footer(p_footer in out nocopy clob);
procedure get_usable_sql (p_sql_in IN clob,
p_sql_out OUT clob);
END export_pkg_spread_sheet;
create or replace
PACKAGE body export_pkg_spread_sheet
AS
PROCEDURE excel_header (p_header IN OUT nocopy CLOB)
AS
BEGIN
p_header := '<html><body>';
END;
procedure download_excel( vsql in clob )
as
p_header clob;
p_footer clob;
p_content clob;
begin
owa_util.mime_header( 'application/octet', FALSE );
htp.p('Content-Disposition: attachment; filename="report.xls"');
owa_util.http_header_close;
excel_header( p_header);
excel_content(p_content,vsql);
excel_footer(p_footer);
dbms_output.put_line(p_header ||p_content|| p_footer);
HTP.PRN( p_header ||p_content|| p_footer);
htmldb_application.g_unrecoverable_error := true;
end;
procedure excel_content(p_content in out nocopy clob,
vsql in clob)
as
p_sql_stmt clob;
cur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
cols DBMS_SQL.DESC_TAB;
ncols PLS_INTEGER;
TYPE varColumn IS TABLE OF varchar2(32000);
vtab varColumn;
v_column_count NUMBER DEFAULT 0;
v_status INTEGER;
BEGIN
htp.prn('am here');
/* SELECT region_source into p_sql_stmt
FROM apex_application_page_regions
WHERE region_id = p_region_id AND
page_id = p_page_id AND
application_id = p_app_id; */
get_usable_sql (vsql,p_sql_stmt);
p_content := p_sql_stmt;
-- Parse the query.
DBMS_SQL.PARSE(cur, p_sql_stmt , DBMS_SQL.NATIVE);
-- Retrieve column information
DBMS_SQL.DESCRIBE_COLUMNS (cur, ncols, cols);
-- Display each of the column names
p_content := '<table> <tr>';
FOR colind IN 1 .. ncols
LOOP
p_content := p_content || '<td>' || cols(colind).col_name || '</td>';
END LOOP;
p_content := p_content || '</tr>';
vtab := varColumn(null);
for i in 1..ncols
loop
vtab.extend;
DBMS_SQL.DEFINE_COLUMN (cur, i, vtab(i), 2000);
--dbms_output.put_line(vtab(i));
end loop;
v_status := DBMS_SQL.EXECUTE (cur);
LOOP
p_content := p_content || '<tr>';
EXIT WHEN (DBMS_SQL.FETCH_ROWS (cur) <= 0);
FOR i IN 1 ..ncols
loop
DBMS_SQL.COLUMN_VALUE (cur, i, vtab(i));
-- p_content := p_content || '<td>' || 'xyz' || '</td>';
p_content := p_content || '<td>' || vtab(i) || '</td>';
END LOOP;
p_content := p_content || '</tr>' ;
END LOOP;
p_content := p_content || '<table>' ;
DBMS_SQL.CLOSE_CURSOR (cur);
exception
when others then
p_content := '<td>Exception Error in printing data</td><table>' ;
DBMS_SQL.CLOSE_CURSOR (cur);
end;
procedure excel_footer( p_footer in out nocopy clob)
as
begin
p_footer := '</body></html>';
end;
PROCEDURE get_usable_sql (p_sql_in IN clob, p_sql_out OUT clob)
IS
v_sql clob;
v_names DBMS_SQL.varchar2_table;
v_pos NUMBER;
v_length NUMBER;
v_exit NUMBER;
BEGIN
v_sql := p_sql_in;
v_names := wwv_flow_utilities.get_binds (v_sql);
FOR i IN 1 .. v_names.COUNT
LOOP
<<do_it_again>>
v_pos := INSTR (LOWER (v_sql), LOWER (v_names (i)));
v_length := LENGTH (LOWER (v_names (i)));
v_sql :=
SUBSTR (v_sql, 1, v_pos - 1)
|| v_names (i)
|| SUBSTR (v_sql, v_pos + v_length);
v_sql :=
REPLACE (v_sql,
UPPER (v_names (i)),
'(SELECT v('''
|| LTRIM (v_names (i), ':')
|| ''') FROM DUAL)'
IF INSTR (LOWER (v_sql), LOWER (v_names (i))) > 0
THEN
GOTO do_it_again;
END IF;
END LOOP;
p_sql_out := v_sql;
END;
END export_pkg_spread_sheet;
After creating the package pass the parameter to package like this
begin
export_pkg_spread_sheet.download_excel('select * from emp');
end;
Package will allow to download the spread shreet. If i try to pass the a complex query to package it is returning error as mentioned below
ORA-06502: PL/SQL: numeric or value error
In the above package there is a procedure called procedure excel_content which actuall prints the data in the spread sheet this is where the error is coming from there is a variable called vsql have declared it as clob to hold large string but still i am getting the same error when trying to pass a big string.
Please check the error and let me know.
Thanks
SudhirHi Praveen,
This is the query i am using to pass
Declare
qry clob;
Begin
qry := ' 'SELECT
AR.REGION_CODE,
AR.DISTRICT_CODE,
AR.TERRITORY_CODE,
CASE
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NULL AND AR.TERRITORY_NAME IS NULL THEN
AR.REGION_NAME
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NULL THEN
AR.DISTRICT_NAME
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NOT NULL THEN
AR.TERRITORY_NAME
END TERR_NAME,
AR.EMPLOYEE_ID,
AR.LAST_NAME,
AR.FIRST_NAME,
AR.GENDER,
AR.DATE_OF_HIRE,
AR.PROJECT_EMPLOYEE_TITLE_ID,
AR.COMPANY_ID,
AR.CUSTOMER_EMAIL,
AR.BUSINESS_EMAIL,
AR.CUSTOMER_VOICEMAIL,
AR.CUSTOMER_VOICEMAIL_EXT,
AR.QUINTILES_VOICEMAIL,
AR.QUINTILES_VOICEMAIL_EXT , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ZipCode" FROM AR_V_ROSTER AR
LEFT JOIN AR_V_ADDRESS_HISTORY AAH
ON
(AR.PROJECT_ID = AAH.PROJECT_ID AND
AR.EMPLOYEE_ID = AAH.EMPLOYEE_ID)
WHERE
UPPER(AR.USER_EMPLOYEE_ID) = ''Q766730'' AND
AR.PROJECT_ID = 81 ';
export_pkg_spread_sheet.download_excel(qry);
End;
Praveen you can pass your DB table query to check the error. I am trying to pass as mentioned above.
Please let me know if my question is not clear.
Thanks
Sudhir -
Hi, i have this error when i try to call a store procedure from my VB.NET (2005) program.
The store procedure:
CREATE OR REPLACE PROCEDURE MY_EXECUTE (CMD IN VARCHAR2, FIELD IN VARCHAR2, IID OUT NUMBER) IS
BEGIN
EXECUTE IMMEDIATE CMD || ' RETURNING ' || FIELD || ' INTO :1' USING OUT IID;
END;
I use this function tu return th value of a sequence field in an insert istruction.
When i call this SP from my .net program (i use ODP dirver vers. 2.102.2.20) i recieve the error:
We recieve ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 1 on some updates.
If i call the same SP with OleDB provider all works fine.
SYSTEM:
Thanks for help.
A.T.Hi,
Is this behavior consistent or intermittent?
If intermitten, and your db is 9206, you're likely encountering the following rdbms bug:
Bug.4015165 (74) REGRN SCALAR VARCHAR2 IN BINDS WITH DIFFERENT SIZE RANDOMLY FAILS WITH ORA-06502
and should be resolved by patching your database.
I'm not sure why, but ODP seems to encounter this bug a lot more than other drivers.
If not intermittent, or if you are using a current patch level of database, a complete testcase would probably be best.
Cheers,
Greg -
Disco for Oracle Apps with Scheduling not in Apps ~ Throws Error ORA-06502
Hi All,
I have had an SR with Oracle for almost 1/2 year now to set-up scheduling with the scheduling schema not being Apps. They have not been able to fix this yet.
I have used note 757831.1. When I try to set-up a schedule that is recurring, the following error is thrown: ORA-06502.
Does any one have a success story associated with setting-up scheduling in a Disco Oracle Apps end user layer where the scheduling schema is not apps?
Thanks,
Patrick
Edited by: Patrick Bacon on Dec 10, 2010 7:18 AM
Edited by: Patrick Bacon on Dec 10, 2010 8:21 AMPl do not post contents of MOS Docs publicly - this violates terms of your support contract.
We were successful in doing this with Disco 4i a long time ago. I am assuming the process is the same for 10g. Pl see if these MOS Docs can help. Pl post the complete error message.
Error When Trying To Schedule Workbooks: The Batch Repository Schema Must Have Been Granted Direct Access To All Of The Tables Referenced In This Sheet (Doc ID 1125208.1)
How To Store Scheduled Workbooks Results In A Different Schema Other than APPS? (Doc ID 370855.1)
Error When Trying To Schedule Workbooks: The Batch Repository Schema Must Have Been Granted Direct Access To All Of The Tables Referenced In This Sheet (Doc ID 464968.1)
Discoverer Quick Start: Setting Up Workbook Scheduling (Doc ID 74116.1)
Scheduling Workbooks In A Applications Mode EUL Configured With A Batch User Fails With Errors ORA-06502, ORA-06512 (Doc ID 331165.1)
HTH
Srini -
Hello,
I am getting this error when i am trying to execute a PL/SQL script using an Oracle API
We are using Oracle 10g release 2 database. I am getting this error only on some instances. This script is running fine in Development instances.
Script:
SET VERIFY OFF;
SET serveroutput on size 100000;
SET linesize 300;
EXEC FND_STATS.GATHER_COLUMN_STATS ('AR', 'HZ_LOCATIONS', 'COUNTRY');
SELECT
hl.location_id,hl.state, hl.country,
hcasa.org_id
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%';
--PROMPT Dropping Table pmr13286_temptable
DROP TABLE pmr13286_temptable;
CREATE TABLE pmr13286_temptable AS (SELECT
hp.attribute_category , hl.address_lines_phonetic,
hps.party_site_number,hca.cust_account_id,
hcsua.site_use_code, hcsua.primary_flag, hcsua.status,
hl.address1, hl.address2, hl.address3, hl.address4,
hl.city, hl.state, hl.postal_code, hl.country,
hl.county, hl.province, hcasa.org_id,
hl.creation_date
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%');
DECLARE
l_location_rec hz_location_v2pub.location_rec_type;
l_object_version_number hz_locations.object_version_number%TYPE;
p_status_code NUMBER;
l_api_status VARCHAR2 (2000);
l_msg_count NUMBER (15);
l_msg_data VARCHAR2 (2000);
v_total_count NUMBER (15);
v_prvi_count NUMBER (15);
v_countr_count NUMBER (15);
v_null_count NUMBER (15);
v_rem_recs NUMBER (15);
v_status_code VARCHAR2 (2000);
l_sql_errmsg VARCHAR2 (500);
CURSOR c_cust_addr
IS
SELECT
hl.*
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%';
BEGIN
v_total_count := 0;
v_prvi_count := 0;
v_countr_count := 0;
v_null_count := 0;
dbms_output.put_line('Total Count'||v_total_count );
dbms_output.put_line('PR/VI Conversion Count'||v_prvi_count );
dbms_output.put_line('PR/VI to US Conversion Count'||v_countr_count );
dbms_output.put_line('Non US/CA State Null Count'||v_null_count );
FOR i IN c_cust_addr
LOOP
l_location_rec := NULL;
v_total_count := v_total_count + 1;
l_location_rec.location_id := i.location_id;
l_location_rec.state := i.state;
l_location_rec.country := i.country;
dbms_output.put_line('Location_id '||l_location_rec.location_id||' '||'State '||l_location_rec.state||' '||'Country '||l_location_rec.country);
BEGIN
SELECT hl.object_version_number
INTO l_object_version_number
FROM hz_locations hl
WHERE hl.location_id = l_location_rec.location_id;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
raise_application_error (
-20059,
'object_version_number not found for location = '
|| TO_CHAR (l_location_rec.location_id)
END;
Update 1 - Update Addresses of 3 records that have wrong country names
BEGIN
IF (l_location_rec.location_id IN (1436720,119456,604649)) THEN
dbms_output.put_line(' 3 records Location_id '||l_location_rec.location_id);
IF ( l_location_rec.location_id = 1436720) THEN
l_location_rec.state := 'OH';
l_location_rec.country := 'US';
ELSIF ( l_location_rec.location_id = 119456) THEN
l_location_rec.country := 'US';
ELSIF ( l_location_rec.location_id = 604649) THEN
l_location_rec.country := 'PK';
END IF;
hz_location_v2pub.update_location (
fnd_api.g_true,
l_location_rec,
l_object_version_number,
l_api_status,
l_msg_count,
l_msg_data
IF l_api_status <> fnd_api.g_ret_sts_success
THEN
dbms_output.put_line(' Error In API with status of '||l_api_status);
IF l_msg_count > 1
THEN
FOR s IN 1 .. l_msg_count
LOOP
l_sql_errmsg :=
SUBSTR (
RTRIM (l_sql_errmsg)
|| ' , '
|| RTRIM (
fnd_msg_pub.get (p_encoded => fnd_api.g_false)
1,
500
END LOOP;
ELSE
l_sql_errmsg := SUBSTR (l_msg_data, 1, 500);
END IF;
dbms_output.put_line(' Error Message '||l_sql_errmsg);
ROLLBACK;
RETURN;
END IF;
END IF;
END;
Update 2 - Update state to 'VI','PR' where country is in 'VI','PR'
BEGIN
IF (i.country = 'PR' AND (i.state <> 'PR' OR i.state IS NULL))
OR (i.country = 'VI' AND (i.state <> 'VI'OR i.state IS NULL)) THEN
v_prvi_count := v_prvi_count + 1;
dbms_output.put_line(' State to PR/VI Location_id '||l_location_rec.location_id);
SELECT DECODE (i.country,'PR','PR','VI', 'VI') INTO l_location_rec.state
FROM apps.hz_locations WHERE
location_id = l_location_rec.location_id;
hz_location_v2pub.update_location (
fnd_api.g_true,
l_location_rec,
l_object_version_number,
l_api_status,
l_msg_count,
l_msg_data
IF l_api_status <> fnd_api.g_ret_sts_success
THEN
dbms_output.put_line(' Error In API with status of '||l_api_status);
IF l_msg_count > 1
THEN
FOR s IN 1 .. l_msg_count
LOOP
l_sql_errmsg :=
SUBSTR (
RTRIM (l_sql_errmsg)
|| ' , '
|| RTRIM (
fnd_msg_pub.get (p_encoded => fnd_api.g_false)
1,
500
END LOOP;
ELSE
l_sql_errmsg := SUBSTR (l_msg_data, 1, 500);
END IF;
dbms_output.put_line(' Error Message '||l_sql_errmsg);
ROLLBACK;
RETURN;
END IF;
dbms_output.put_line('Location_id '||l_location_rec.location_id||' '||'State '||l_location_rec.state||' '||'Country '||l_location_rec.country);
END IF;
END;
Update 3 - Update Country code to 'US' where state code is either 'PR' or 'VI'
BEGIN
IF l_location_rec.state = 'PR' OR l_location_rec.state = 'VI'
THEN l_location_rec.country := 'US';
v_countr_count := v_countr_count + 1;
dbms_output.put_line('PR/VI country to US Location_id '||l_location_rec.location_id);
hz_location_v2pub.update_location (
fnd_api.g_true,
l_location_rec,
l_object_version_number,
l_api_status,
l_msg_count,
l_msg_data
IF l_api_status <> fnd_api.g_ret_sts_success
THEN
dbms_output.put_line(' Error In API with status of '||l_api_status);
IF l_msg_count > 1
THEN
FOR s IN 1 .. l_msg_count
LOOP
l_sql_errmsg :=
SUBSTR (
RTRIM (l_sql_errmsg)
|| ' , '
|| RTRIM (
fnd_msg_pub.get (p_encoded => fnd_api.g_false)
1,
500
END LOOP;
ELSE
l_sql_errmsg := SUBSTR (l_msg_data, 1, 500);
END IF;
dbms_output.put_line(' Error Message '||l_sql_errmsg);
ROLLBACK;
RETURN;
END IF;
dbms_output.put_line('Location_id '||l_location_rec.location_id||' '||'State '||l_location_rec.state||' '||'Country '||l_location_rec.country);
END IF;
END;
Update 4 - Update state code to NULL where state code is NOT NULL and country code is not in US or CA
IF l_location_rec.country NOT IN ('US','CA') AND l_location_rec.state IS NOT null
THEN l_location_rec.state := FND_API.G_NULL_CHAR;
v_null_count := v_null_count + 1;
dbms_output.put_line('Non US/CA to Null Location_id '||l_location_rec.location_id);
hz_location_v2pub.update_location (
fnd_api.g_true,
l_location_rec,
l_object_version_number,
l_api_status,
l_msg_count,
l_msg_data
IF l_api_status <> fnd_api.g_ret_sts_success
THEN
dbms_output.put_line(' Error In API with status of '||l_api_status);
IF l_msg_count > 1
THEN
FOR s IN 1 .. l_msg_count
LOOP
l_sql_errmsg :=
SUBSTR (
RTRIM (l_sql_errmsg)
|| ' , '
|| RTRIM (
fnd_msg_pub.get (p_encoded => fnd_api.g_false)
1,
500
END LOOP;
ELSE
l_sql_errmsg := SUBSTR (l_msg_data, 1, 500);
END IF;
dbms_output.put_line(' Error Message '||l_sql_errmsg);
ROLLBACK;
RETURN;
END IF;
dbms_output.put_line('Location_id '||l_location_rec.location_id||' '||'State '||l_location_rec.state||' '||'Country '||l_location_rec.country);
END IF;
END LOOP;
v_countr_count := v_countr_count +2;
dbms_output.put_line('Total Count'||v_total_count );
dbms_output.put_line('PR/VI Conversion Count'||v_prvi_count );
dbms_output.put_line('PR/VI to US Conversion Count'||v_countr_count );
dbms_output.put_line('Non US/CA State Null Count'||v_null_count );
BEGIN
SELECT
count(*) into v_rem_recs
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%';
dbms_output.put_line('remaining count '||v_rem_recs );
END;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error in Program: ' ||' Error Message ' || SQLERRM);
ROLLBACK;
END;
SELECT
hl.location_id,hl.state, hl.country,
hcasa.org_id
FROM hz_cust_site_uses_all hcsua,
hz_cust_acct_sites_all hcasa,
hz_party_sites hps, apps.hz_locations hl,
hz_parties hp,
hz_cust_accounts hca
WHERE hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
AND hcasa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hp.party_id = hps.party_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hca.party_id = hp.party_id
AND hl.country NOT IN ('US','CA')
AND hps.party_site_number NOT LIKE 'M%';You may want to zero in on the part of the code that throws this error.
(i)
Try executing a small part of your code, while commenting out the rest. If that is successful, execute a slightly bigger part of the code, and so on successively. Once you know, where exactly the code is failing, it should be easier to create a small testcase against your data and investigate the problem.
(ii)
Check those local variables and the values that get assigned to them. It is a good practice to anchor local variables to database columns. That way, there will be less surprises when the table structures are altered.
(iii)
The script as such does not show any glaring error, but you may want to check those procedure calls e.g. -
hz_Location_v2Pub.Update_Location(fnd_aPi.g_True,l_Location_rec,l_Object_Version_Number,
l_aPi_Status,l_msg_Count,l_msg_Data);It's quite possible that the procedure is assigning a value to an output parameter that is too small to store that.
Note that, given such a huge script and not knowing your database, we are not particularly inclined to debug it. The only person who can make things easier for himself/herself is you.
HTH,
isotope -
Report error:ORA-06502: PL/SQL: numeric or value error
In a report region of an apex application I have 41 rows of data displayed, I want to provide subtotals split out by project, I have achieved this by using break formatting, however once all rows have been retrieved the above error is displayed and the user can the not navigate back through to the first rows, any help would be appreciated.
This problem was resolved by re-ordring the columns in the select statement of the report to match the display order
-
ORA-06502: PL/SQL :character string buffer too small
Dear Sir,
Hi, in htmldb I am trying to create package body, but when I select the package name which I already have the specification part for it, and click next I got this error.
what should I do please help thanksWhat do you mean "execute the package"?
Your parenthetical suggests that you want to compile the package body in the SQL Commands window. If that is the case, just type all that code in there and click the Run button (everything from "create or replace up to but not necessarily including the slash ('/') after the last "end" statement.
If you mean "execute" then you can run any of the functions or procedures in the package (after it is compiled) in the SQL Commands window using PL/SQL anonymous blocks.
Scott
Maybe you are looking for
-
How to track return message in file to proxy interface
I am using file to proxy scenerio, where i will get my file from FTP and updating it into a table , after updating i am calling a program to Run BDC, in my method for proxy, after that i dont how to track return message , anyone please tell me sugges
-
Multiple problems with iTunes 12
Problem 1: I did a clean install of Yosemite on my mac, and updated iTunes (from 12 to 12.0.1) before I opened it. Since I have my iTunes Media folder in a different drive I used preferences to choose (really point to) the location. After clicking OK
-
AV cable from Qosmio G20 to Mini HiFI Stereo System Speaker
Hi When I connect my Qosmio G20 to my stereo using that AV cable (with red, yellow and white jack) and my Qosmio includes a cable that joins this 3 cable to the laptop's line for headphones. The problem is, it only sends the sound to one speaker if I
-
Mini wakes up.G5 Doesn't
I have a wireless network operating through a router. It works just fine except that the G5 Powermac will not wake up when requested on the network yet the Mac Mini which is on the same power settings will wake up. Both of these are being called up f
-
How to create more Timestamps fileds in EDS data object?
Hi All, I am trying to create BAM Data Objects fro EDS.I provided details for the DB connections, while saving Data Objects its not allowing the timestamps fields. is there any workaround to this and please let me know possibilities. Thanks. swamy