Getting ORA-22835: buffer too small for to CHAR CLOB or BLOB to RAW conversion in my ODI interface
Hi all
I am creating an interface ODI as explained below,
I table A column 'Comments' and one other table with column B "No Comment." I create a view as shown below and use it as a source for my interface.
SELECT * FROM WC_EQM_CSAP_FS_TMP WHERE to_char (QUESTION_COMMENT) IN (SELECT NO_COMMENTS FROM WC_EQM_NO_COMMENTS_LIST).
But my interface fails with the error below
ORA-22835: buffer too small for to CHAR CLOB or BLOB to RAW conversion (real: 4108, maximum: 4000)
22835 00000 - "too small buffer tank CLOB or BLOB to RAW conversion (actual: %s, maximum: %s)) '
* Cause: an attempt was made to convert CLOB to CHAR or BLOB to RAW, where
LOB size was larger than the buffer for CHAR and RAW limit types.
Note that the widths are reported in characters if characters length isadds are in effect for the column, other widths are
in bytes.
Here QUESTION_COMMENT is of type CLOB data. NO_COMMENTS is also CLOB data type. The maximum length of the data of QUESTION_COMMENT is also 11710
Please tell us how to solve.
Thank you
Dany
IMHO, it is not good to compare CLOB, can be that it is possible to use the primary key for the comments
Is it QUESTION_COMMENT and NO_COMMENTS a PRIMARY INDEX,
may be is the best solution to create vacabulary with comments (if it does not exist) and then compare it by id;
You can simply use the left join and check for null in a CASE statement
Try this, but I don't know... as I said before I have no Oracle DB
SELECT INTEGRATION_ID, DATASOURCE_NUM_ID, QUESTIONNAIRE_ID, QUESTION_ID,
CLIENT_ID, SITE_ID, CLIENT_REP, COMMITMENT, ENGAGEMENT_TYPE, TOP_CLIENT_FLG,
INITIAL_PLANNED_DT, REVISED_PLANNED_DT, INTERVIEW_DT, RECEIVED_DT, QUESTION_SCORE,
(
CASE WHEN EXISTS (SOME T2.NO_COMMENTS OF WC_EQM_NO_COMMENTS_LIST T2 WHERE DBMS_LOB.COMPARE (TMP.) (QUESTION_COMMENT, T2.NO_COMMENTS) = 0)
THEN NULL
OF OTHER QUESTION_COMMENT
END QUESTION_COMMENT),
(CASE WHEN QUESTION_SCORE<=5 then="" 1="" else="" 0="" end)="">=5>
0 AS QWOCOMMENTS,
CREATED_ON_DT, CHANGED_ON_DT OF WC_EQM_CSAP_FS_TMP as TMP
P.S. does not use TO_CHAR (LOB) there are possible error
Tags: Business Intelligence
Similar Questions
-
Hi all
I have the underside of SQL that returns the error in question:
WITH c_file_imp_data AS (select t_data.src from sni_ar_file_import_blob t, xmltable('/a/b' passing xmltype('<a><b>'||replace(UTL_RAW.CAST_TO_VARCHAR2(t.file_blob),chr(10),'</b><b>')||'</b></a>') columns src varchar2(4000) path '.' ) t_data ) SELECT -- regexp_subsr is finding the position of the x occcurrance of a tab delimitter -- the format mask for date is reckognizing masks without '-' e.g. 01feb2016 will work as well as 01-Feb-2016 to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 1), chr(9))), --RECORD_ID to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 2), chr(9))), --BILL_TO_CUSTOMER_NUMBER, to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 3), chr(9))), -- BILL_TO_LOCATION, to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 4), chr(9))), -- SHIP_TO_CUSTOMER_NUMBER, to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 5), chr(9))), -- SHIP_TO_LOCATION, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 6), chr(9)), -- CURRENCY, to_date(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 7), chr(9)), 'DD-MON-YYYY'), -- GL_DATE, to_date(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 8), chr(9)), 'DD-MON-YYYY'), -- TRANSACTION_DATE, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 9), chr(9)), -- TRANSACTION_TYPE_NAME, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 10), chr(9)), -- TRANSACTION_SOURCE, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 11), chr(9)), -- TERMS, to_date(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 12), chr(9)), 'DD-MON-YYYY'), -- DUE_DATE, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 13), chr(9)), -- PAYMENT_METHOD, to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 14), chr(9))), -- SALESREP_NUMBER, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 15), chr(9)), -- ITEM, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 16), chr(9)), -- DESCRIPTION, to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 17), chr(9))), -- QUANTITY, to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 18), chr(9))), -- UNIT_SELLING_PRICE, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 19), chr(9)), -- UNIT_OF_MEASURE, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 20), chr(9)), -- WAREHOUSE, to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 21), chr(9))), -- TAX_RATE, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 22), chr(9)), -- TAX_CODE, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 23), chr(9)), -- GL_ACCOUNT_STRING, to_number(rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 24), chr(9))), -- CURRENCY_EXCHANGE_RATE, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 25), chr(9)), -- LINE_TRX_DFF_CONTEXT_VAL, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 26), chr(9)), -- LINE_TRANSACTION_FIELD1, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 27), chr(9)), -- LINE_TRANSACTION_FIELD2, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 28), chr(9)), -- LINE_TRANSACTION_FIELD3, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 29), chr(9)), -- LINE_TRANSACTION_FIELD4, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 30), chr(9)), -- LINE_TRANSACTION_FIELD5, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 31), chr(9)), -- LINE_TRANSACTION_FIELD6, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 32), chr(9)), -- LINE_TRANSACTION_FIELD7, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 33), chr(9)), -- LINE_TRANSACTION_FIELD8, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 34), chr(9)), -- LINE_TRANSACTION_FIELD9, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 35), chr(9)), -- LINE_TRANSACTION_FIELD10, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 36), chr(9)), -- LINE_TRANSACTION_FIELD11, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 37), chr(9)), -- LINE_TRANSACTION_FIELD12, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 38), chr(9)), -- LINE_TRANSACTION_FIELD13, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 39), chr(9)), -- LINE_TRANSACTION_FIELD14, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 40), chr(9)), -- LINE_TRANSACTION_FIELD15, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 41), chr(9)), -- INV_LINE_INFO_DFF_CONT_VAL, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 42), chr(9)), -- NO_ANIMALS, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 43), chr(9)), -- MX_WEIGHT, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 44), chr(9)), -- MX_SLAUGHTER, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 45), chr(9)), -- REBILLED, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 46), chr(9)), -- NON_STAT, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 47), chr(9)), -- ATTRIBUTE12, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 48), chr(9)), -- ATTRIBUTE13, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 49), chr(9)), -- ATTRIBUTE14, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 50), chr(9)), -- ATTRIBUTE15, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 51), chr(9)), -- ATTRIBUTE8, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 52), chr(9)), -- ATTRIBUTE11, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 53), chr(9)), -- ATTRIBUTE2, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 54), chr(9)), -- ATTRIBUTE3, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 55), chr(9)), -- ATTRIBUTE4, rtrim(regexp_substr(src, '[^' || chr(9) || ']*' || chr(9) || '', 1, 56), chr(9)) -- ATTRIBUTE9 FROM c_file_imp_data ;
The sni_ar_file_import_blob of source table has the FILE_BLOB column as blob data type. The data inside the tab delimeted and as we can see above the limit.
Is anyone know anything how to get this data and select as stated above?
Oracle version: 12 c
Kind regards
Alex
Hello
You must use dbms_lob.writeappend
Here is an example here:
-
java.sql.SQLException: ORA-22835: buffer too small for CHAR or BLOB CLOB
Hello
I am facing this problem. Anyone know what is happening?
ERROR, June 1, 2011 15:08:50, [XELLERATE. APPLICATIONS], class/method: tcRequestOperationsBean/getPendingApprovalTasksAssignedToUser some problems: {1}
com.thortech.xl.orb.dataaccess.tcDataAccessException
at com.thortech.xl.dataaccess.tcDataAccessExceptionUtil.createException (unknown Source)
at com.thortech.xl.dataaccess.tcDataBase.createException (unknown Source)
at com.thortech.xl.dataaccess.tcDataBase.readPartialPreparedStatement (unknown Source)
at com.thortech.xl.dataaccess.tcDataBase.readPreparedStatement (unknown Source)
at com.thortech.xl.dataobj.PreparedStatementUtil.execute (unknown Source)
at Thor.API.Base.tcBaseUtility.execPreparedStatement (unknown Source)
at com.thortech.xl.ejb.beansimpl.tcRequestOperationsBean.getPendingApprovalTasksAssignedToUser (unknown Source)
at com.thortech.xl.ejb.beans.tcRequestOperationsSession.getPendingApprovalTasksAssignedToUser (unknown Source)
at com.thortech.xl.ejb.beans.tcRequestOperations_i5iyve_EOImpl.getPendingApprovalTasksAssignedToUser(tcRequestOperations_i5iyve_EOImpl.java:4776)
at com.thortech.xl.ejb.beans.tcRequestOperations_i5iyve_EOImpl_WLSkel.invoke (unknown Source)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at com.thortech.xl.ejb.beans.tcRequestOperations_i5iyve_EOImpl_1030_WLStub.getPendingApprovalTasksAssignedToUser (unknown Source)
at Thor.API.Operations.tcRequestOperationsClient.getPendingApprovalTasksAssignedToUser (unknown Source)
at sun.reflect.GeneratedMethodAccessor1334.invoke (unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
to Thor.API.Base.SecurityInvocationHandler$ 1.run (unknown Source)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs (unknown Source)
at weblogic.security.Security.runAs(Security.java:41)
at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs (unknown Source)
at Thor.API.Base.SecurityInvocationHandler.invoke (unknown Source)
to $Proxy61.getPendingApprovalTasksAssignedToUser (Unknown Source)
at com.glob.service.RequestDataService.getPendingApprovals(RequestDataService.java:3492)
at com.glob.struts2.requestdetails.RequestDetailsAction.getRequestInformation(RequestDetailsAction.java:202)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.glob.struts2.security.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:171)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs (unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by [nested Exception]:
java.sql.SQLException: ORA-22835: buffer too small for to CHAR CLOB or BLOB to RAW conversion (real: 4826, maximum: 4000)
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
Thank you
JUM, seems like you get this error. ORA-22835 and com.thortech.xl.orb.dataaccess.tcDataAccessException | This is resolved with this article ID 388512.1. Go to metalink and let me know if it
solve your problem, please.see you soon,
Thiago Guimarães L -
ORA-24331: buffer too small user
Hello
Passage of 9 to 10g Oracle, you get "ORA-24331: buffer too small user" to read the values of files using xslprocessor xml text node.
Anything over 4 k gives this error.
Any ideas anyone?
Thanks in advance.Bingo. Behavior of the function xslprocessor.valueof in 10g amended such that it has a size limit of 4 k node (Metalink 444621.1)
The ORA-24331 comes internally change to the function.
The valueof procedure doesn't have the same restrictions as the function.
Or, replace all references to operate at the reference procedure or create your own function to encapsulate a call to the procedure and to call this function instead.
Published by: dombrooks on 7 Sep 2009 14:46
-
ORA-24331: buffer too small user (dbms_xslprocessor.valueOf)
Hello
I'm stuck with an XML file parsing problem... everything went perfectly fine until I hit a large XML file and now my procedure returns this error ORA-24331: buffer too small user. I Googled it a little and found out that it is the cause of dbms_xslprocessor.valueOf.
Anyway could someone help me out? Below you will find my version of db Oracle and proceure I use.
Thank you!
Oracle:
And procedure:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi PL/SQL Release 10.2.0.5.0 - Production CORE 10.2.0.5.0 Production TNS for Linux: Version 10.2.0.5.0 - Production NLSRTL Version 10.2.0.5.0 - Production
PROCEDURE xml is BEGIN DECLARE l_parser dbms_xmlparser.Parser; l_doc dbms_xmldom.DOMDocument; l_nl dbms_xmldom.DOMNodeList; l_n dbms_xmldom.DOMNode; l_temp VARCHAR2(1000); v_lang_ctx NUMBER := dbms_lob.default_lang_ctx; v_warning NUMBER; v_dest_clob CLOB; v_src_clob BFILE; v_amount NUMBER; v_src_offset NUMBER:=1; v_dest_offset NUMBER:=1; TYPE tab_type IS TABLE OF klasius_srv%ROWTYPE; t_tab tab_type := tab_type(); BEGIN v_src_clob := bfilename( directory => 'XML_DIR', filename => 'srv.xml'); dbms_lob.createtemporary(v_dest_clob, cache=>FALSE); dbms_lob.open(v_src_clob, dbms_lob.file_readonly); dbms_lob.loadclobfromfile (dest_lob => v_dest_clob ,src_bfile => v_src_clob ,amount => dbms_lob.getlength( v_src_clob ) ,dest_offset => v_dest_offset ,src_offset => v_src_offset ,bfile_csid => NLS_CHARSET_ID('UTF8') ,lang_context => v_lang_ctx ,warning => v_warning ); dbms_lob.close(v_src_clob); dbms_session.set_nls('NLS_DATE_FORMAT','''DD-MON-YYYY'''); l_parser := dbms_xmlparser.newParser; dbms_xmlparser.parseClob(l_parser, v_dest_clob); l_doc := dbms_xmlparser.getDocument(l_parser); dbms_lob.freetemporary(v_dest_clob); dbms_xmlparser.freeParser(l_parser); l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/NewDataSet/Table'); FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP l_n := dbms_xmldom.item(l_nl,cur_emp); t_tab.extend; dbms_xslprocessor.valueOf(l_n,'code_x0020_ra',t_tab(t_tab.last).srv); dbms_xslprocessor.valueOf(l_n,'code_x0020_kat',t_tab(t_tab.last).sif_srv); dbms_xslprocessor.valueOf(l_n,'Des',t_tab(t_tab.last).de_srv); dbms_xslprocessor.valueOf(l_n,'Deskriptor_x0020__x0028_ang_x0029_',t_tab(t_tab.last).ang_srv); END LOOP; FORALL i IN t_tab.first .. t_tab.last INSERT INTO klasius_srv VALUES t_tab(i); COMMIT; dbms_xmldom.freeDocument(l_doc); END; END;
Well, it depends on the definition of klasius_srv % RowType - like that the members of the structure (columns/fields) is used by dbms_xslprocessor. ValueOf() to write values in.
To find this error, you will need to determine the size of a member in this structure and the size of the value being written inside.
The error occurs in one (or more) of the following statements in your code:
.. dbms_xslprocessor.valueOf(l_n,'code_x0020_ra',t_tab(t_tab.last).srv); dbms_xslprocessor.valueOf(l_n,'code_x0020_kat',t_tab(t_tab.last).sif_srv); dbms_xslprocessor.valueOf(l_n,'Des',t_tab(t_tab.last).de_srv); dbms_xslprocessor.valueOf(l_n,'Deskriptor_x0020__x0028_ang_x0029_',t_tab(t_tab.last).ang_srv); ..
Thus, for example: what is the size of the of (description?) writing XML element in the .de_srv t_tab (t_tab.last) - in other words, in the de_srv of the klasius_srv table column?
If this XML element is 200 characters and your database column is a 100 bytes in size, then dbms_xslprocessor. ValueOf() won't be able to write the value of the XML element in that column variable.
Bottom line - you must debug 4 statements above of the source code you wrote - and ensure that the amount of data that you read from the XML element can be written in the variable (column) that is used to receive this value.
The 4000 bytes, I mentioned is the largest size of column varchar2 (string), you can set in the SQL engine. If this XML value is 1 KB, then you cannot use varchar2. In this case, you will need to look at using the CLOB data type instead.
-
Addition of virtual column: ORA-12899: value too large for column
I am using Oracle 11g, OS Win7, SQL Developer
I'm trying to add the virtual column to my test table, but get ORA-12899: value too large for column error. Here are the details.
Can someone help me in this?
CREATE TABLE test_reg_exp (col1 VARCHAR2(100)); INSERT INTO test_reg_exp (col1) VALUES ('ABCD_EFGH'); INSERT INTO test_reg_exp (col1) VALUES ('ABCDE_ABC'); INSERT INTO test_reg_exp (col1) VALUES ('WXYZ_ABCD'); INSERT INTO test_reg_exp (col1) VALUES ('ABCDE_PQRS'); INSERT INTO test_reg_exp (col1) VALUES ('ABCD_WXYZ');
When I try to, I get the correct results:ALTER TABLE test_reg_exp ADD (col2 VARCHAR2(100) GENERATED ALWAYS AS (REGEXP_REPLACE (col1, '^ABCD[A-Z]*_'))); SQL Error: ORA-12899: value too large for column "COL2" (actual: 100, maximum: 400) 12899. 00000 - "value too large for column %s (actual: %s, maximum: %s)" *Cause: An attempt was made to insert or update a column with a value which is too wide for the width of the destination column. The name of the column is given, along with the actual width of the value, and the maximum allowed width of the column. Note that widths are reported in characters if character length semantics are in effect for the column, otherwise widths are reported in bytes. *Action: Examine the SQL statement for correctness. Check source and destination column data types. Either make the destination column wider, or use a subset of the source column (i.e. use substring).
Thank you.SELECT col1, (REGEXP_REPLACE (col1, '^ABCD[A-Z]*_')) FROM test_reg_exp;
Yes, RP, it works if you give col2 size > = 400.
@Northwest - could you please test the same w/o having a clause of regex in col2?
I have a doubt about using a REGULAR expression in this case Dynamics col.Refer to this (might help) - http://www.oracle-base.com/articles/11g/virtual-columns-11gr1.php
Below excerpt from above link... see if that helps...
>
Notes and restrictions on the virtual columns include:The indexes defined on the virtual columns are equivalent to a function-based index.
Virtual columns can be referenced in the updates and deletions WHERE clause, but they cannot be manipulated by DML.
The tables containing virtual columns may still be eligible for result caching.
Functions in expressions must be deterministic when the table is created, but can then be recompiled and non-deterministic without for as much invalidate the virtual column. In such cases, the following steps must be taken after the function is recompiled:
Constraint on the virtual column must be disabled and re-enabled.
On the virtual column indexes must be rebuilt.
Materialized views that access the virtual column must be fully refreshed.
The result cache must be flushed if the virtual column acceded to the request (s).
Statistical table must be regathered.
The virtual columns are not supported for the organized and external object in index, cluster or temporary tables.
The expression used in the virtual column definition has the following restrictions:
It cannot refer to another virtual column by name.
It can refer to the columns defined in the same table.
If it refers to a deterministic user-defined function, it cannot be used as a partitioning key column.
The result of the expression must be a scalar value. It cannot return that an Oracle supplied the data type, a type defined by the user, LOB or LONG RAW.
>Published by: Vanessa B on October 16, 2012 23:48
Published by: Vanessa B on October 16, 2012 23:54
-
ORA-06502: PL / SQL: numeric or value error: character string buffer too small
Dear friends,
We have a package customized for FTP PLSQL.
I get ORA-06502: PL/SQL: digital or value error: character string buffer too small when the FTP service running.
The FTP function call the HOST function that is in fact to launch the above mentioned error.
Here is the code for FTP and HOST functions.FUNCTION HOST(text_in IN VARCHAR2, result_out IN OUT VARCHAR2) RETURN BOOLEAN IS ret boolean; drun boolean; hid number; BEGIN dbms_output.put_line('host1 begin'); ret := HOST(text_in,result_out,hid,drun,1); if not drun then dbms_output.put_line('not derun'); return false; end if; dbms_output.put_line('after if'); return ret; END HOST;
FUNCTION GET_ENV(env IN VARCHAR2) RETURN VARCHAR2 IS res boolean; out varchar2(256); BEGIN res := HOST('echo '||env,out); return out; END GET_ENV;
FUNCTION HOST(text_in IN VARCHAR2, result_out IN OUT VARCHAR2, hostid IN OUT NUMBER , demrunning IN OUT boolean, maxlines IN NUMBER DEFAULT NULL) RETURN BOOLEAN IS tempid number; tempstat varchar2(10); n number; m number; retry number; mult number; timestamp_date date; lv_result_out varchar2(200); BEGIN --result_out := NULL; --fcxh76 demrunning := true; dbms_output.put_line('host2 begin'); select XXAR_SHELL_CMD_S.nextval into tempid from dual; hostid := tempid; dbms_pipe.pack_message(tempid); n := dbms_pipe.send_message('CMD'); dbms_pipe.pack_message(abs(maxlines)); dbms_pipe.pack_message(rtrim(text_in)); n := dbms_pipe.send_message ('CMD'||rtrim(to_char(tempid)),0); m := dbms_pipe.receive_message('CMDSTAT'||rtrim(to_char(tempid)),5); if m = 1 then demrunning := false; dbms_output.put_line('m=1'); result_out := 'ERROR : GLCC0005 presumed not running'; dbms_output.put_line('result_out - '||result_out); return FALSE; elsif m = 0 then dbms_pipe.unpack_message(tempstat); end if; if tempstat = 'ERROR' then dbms_output.put_line('tempstat = ERROR'); result_out := NULL; dbms_output.put_line('after result out'); return FALSE; end if; <<CHECK_AGAIN>> m := dbms_pipe.receive_message('RSLT'||rtrim(to_char(tempid)),0); if m <> 0 then goto CHECK_AGAIN; end if; if m = 0 then dbms_pipe.unpack_message(result_out); dbms_pipe.purge('RSLT'||rtrim(to_char(tempid))); return TRUE; else result_out := 'ERROR : Call to GLCC0006 failed'; return FALSE; end if; END HOST;
Here is the PLSQL block that I will carry out and also the output on this blockFUNCTION FTP (program_name in VARCHAR2, source_file in VARCHAR2, dest_file in VARCHAR2 default NULL) RETURN BOOLEAN AS fd utl_file.file_type; res boolean; res1 boolean; out varchar2(256); out1 varchar2(256); ftp_dnsname varchar2(50); ftp_user varchar2(50); ftp_pass varchar2(50); ftp_pre_opt varchar2(150); ftp_post_opt varchar2(150); ftp_override varchar2(150); destination_file varchar2(50); ftp_command varchar2(2000); ftp_main varchar2(2000); proc_id varchar2(10); fderr varchar2(100); rec varchar2(1024); temp_buf varchar2(100); base_source varchar2(100); log_dir varchar2(100) := get_env('$APPLCSF')||'/log'; fndc_logfile_dir varchar2(100) := 'FNDC_LOGFILE_DIR'; i number ; ftp_tried boolean; begin ftp_tried := false; dbms_output.put_line('begin'); for ftp_rec in ( select attribute1, attribute2, attribute3, attribute4, nvl(attribute5,' ') attribute5, nvl(attribute6,' ') attribute6, nvl(rtrim(attribute7),'put') attribute7 from fnd_flex_values where flex_value_set_id in (select flex_value_set_id from fnd_flex_value_sets where flex_value_set_name = 'CPC_FTPS' ) and flex_value like program_name ) LOOP dbms_output.put_line('Looping'); ftp_tried := true; ftp_dnsname := ftp_rec.attribute1; ftp_user := ftp_rec.attribute2; ftp_pass := ftp_rec.attribute3; destination_file := ftp_rec.attribute4; if dest_file is not null then destination_file := dest_file; end if; if destination_file is null then destination_file := base_name(source_file); end if; ftp_pre_opt := ftp_rec.attribute5; ftp_post_opt := ftp_rec.attribute6; ftp_override := lower(ftp_rec.attribute7); dbms_output.put_line('host'); res := HOST('echo $$',proc_id); dbms_output.put_line('proc_id - '||proc_id); dbms_output.put_line('after host'); base_source := rtrim(base_name(source_file)); dbms_output.put_line('host 1'); res := HOST('> '||log_dir||'/ftpcmd.'||proc_id || ' ; chmod 777 '||log_dir||'/ftpcmd.'||proc_id,out1); dbms_output.put_line('host 2'); res := HOST('> '||log_dir||'/ftpmain.'||proc_id || ' ; chmod 777 '||log_dir||'/ftpmain.'||proc_id,out1); dbms_output.put_line('host 3'); res := HOST('> '||log_dir||'/ftplog.'||proc_id || ' ; chmod 777 '||log_dir||'/ftplog.'||proc_id,out1); dbms_output.put_line('host completed'); ...... ...... ......
Output:declare lv_ftp_result boolean; begin lv_ftp_result := u.FTP('XXAR_REV_PA', ' ' || '/u07/app/qaoa083a/data/outgoing/xxar/PARECREV' || '/' || 'REVENUE_20120319014318.dat','REVENUE_20120319014318.dat'); IF lv_ftp_result THEN dbms_output.put_line('True'); ELSE dbms_output.put_line('False'); END IF; exception when others then dbms_output.put_line('in exception - '||sqlerrm); end;
The flow of execution goes like this:host1 begin host2 begin m=1 result_out - ERROR : GLCC0005 presumed not running not derun begin Looping host host1 begin host2 begin m=1 in exception - ORA-06502: PL/SQL: numeric or value error: character string buffer too small
1 FTP function called from PL/SQL block
2 inside of the FTP service, the Sub statement calls the HOST function
3. This HOST function in turn calls another function of overloaded HOST (code shown above).log_dir varchar2(100) := get_env('$APPLCSF')||'/log';
4. in the function overloaded with the HOST, the following statements are executed successfully, and FALSE is returned by the function
5. the remaining code in the FTP service is running and the HOST function is called again using the Sub statementdbms_output.put_line('m=1'); result_out := 'ERROR : GLCC0005 presumed not running'; dbms_output.put_line('result_out - '||result_out);
6.again, this HOST function in turn calls another function of overloaded HOST (code posted above).res := HOST('echo $$',proc_id);
7. this time, in the function overloaded host, ORA-06502 is thrown when the following statement is executed and the execution stops here that this exception is unhandled.
This statement is very successfully in the previous call to the function of HOST (step 4), but it fails now.result_out := 'ERROR : GLCC0005 presumed not running';
Any idea on why this error occurs in this scenario? Because the issue of memory?
DB Info:
Kind regardsOracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production
Anthony
Published by: Anthony Alix on March 20, 2012 08:53Hello
HOST (1) calls the function of MODERATOR (2) with his second parameter as result_out
The first time you call the function of host (1) in the function get_env you use
... out varchar2(256); BEGIN res := HOST('echo '||env,out); ...
out is big enough varchar2 (256)
The second time you call (1) HOST of the FTP function as:
... ftp_main varchar2(2000); proc_id varchar2(10); fderr varchar2(100); ... ... res := HOST('echo $$',proc_id); dbms_output.put_line('proc_id - '||proc_id); ...
Here, use you proc_id which is varchar2 (10)
And it's not big enough!
Kind regards
Peter
-
Hi all
FUNCTION to CREATE or REPLACE fnc_two (p_in_job IN VARCHAR2)
RETURN VARCHAR2
AS
CUR CURSOR
IS
SELECT ename
WCP
WHERE job = p_in_job;
v_first_name emp.ename%TYPE;
BEGIN
FOR my heart IN rec
LOOP
IF v_first_name IS NULL
THEN
v_first_name: = rec.ename;
ON THE OTHER
v_first_name: = v_first_name | ',' || Rec.Ename;
END IF;
END LOOP;
RETURN v_first_name;
END;
SQL > SELECT fnc_two ('CLERK')
2 FROM dual;
SELECT fnc_two ('CLERK')
*
ERROR on line 1:
ORA-06502: PL/SQL: digital or value error: character string buffer too small
ORA-06512: at the 'APPS '. FNC_TWO', line 17
SQL > select distinct work of emp
2.
JOB
---------
CLERK
SELLER
PRESIDENT
MANAGER
ANALYST
v_first_name: = v_first_name | ',' || Rec.Ename;
The above statement is the original error. The value has been assinged to v_first_name is larger than the computer can handle.
Increase the size of the variable v_first_name to avoid the error example
v_first_name varchar2 (100);
-
My select statement fails with the error:
The ORA-19011 string buffer too small
The select statement looks like:
SELECT TO_CLOB)
XMLELEMENT ("accounts",
XMLELEMENT ("count",
XMLATTRIBUTES)
rownum AS "recordId."
To_date('20130520','YYYYMMDD') AS "datestarted."
123456 AS "previousBatchId."
56789 AS 'previousRecordId '.
),
....
.... .
.....
XMLFOREST)
SIG_ROLE AS "SignatoryRole."
To_char(TRANSFER_DATE,'YYYY-mm-DD') AS "TransferDate."
NVL(Reason,0) AS 'reason '.
) AS the 'transfer '.
)
()) AS CRDTRPT
OF ANY_TABLE;
- It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)
I'd use the XMLGEN package. But the environment team says no mounted drives in the future with the arrival of the EXADATA.
NO HARD DRIVE MOUNTED, NO ACCESS TO THE DATABASE DIRECTORIES
No UTL_FILE
I need to use the REEL spool the resulting XML data of the SELECT query.
SQL is a standard in my org, but I can do with a PL/SQL solution also to load data into a table (cannot use a COIL with PL/SQL)
What I do is:
- a column of type CLOB to a xml_report of the loading of the above SELECT query table
- Then using SELECT * FROM xml_report to SPOOL the data to a file report.xml
No need of XMLTYPE data behind. Xml data stream is fine for me.
In addition, I need to validate the XML file, also using XSD.
Problem is that the resulting lines of the select query are supposed to be from 15000 to 20000 bytes long.
Oracle database version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
A Suggestion or a solution to this problem would be appreciated.
(Sorry for the use of "BOLD", just to make it more readable and highlight the imp points)
Bravo!
Rahul
It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)
You use the right method.
There is an implicit conversion from XMLType to the data type VARCHAR2 as expected by the function TO_CLOB, where the limitation, and the error.
To serialize XMLType to CLOB, use the XMLSerialize function:
SELECT XMLSerialize (DOCUMENT
XMLELEMENT ("accounts",
...
)
)
OF ANY_TABLE;
For the rest of the requirement, I wish you good luck trying to spool the XML correctly.
You may need to play around with the SET LONG and SET LONGCHUNKSIZE commands to operate.
-
error report: ORA - 06502:character too small string buffer. urgent!
Hi guys,.
My version of the APEX is 3.0.1.00.08, my application run on my test environment, but on the PROD environment, she raised the error:
error report:
ORA-06502: PL/SQL: digital or value error: character string buffer too small
On this page, on the left is a tree, the right side is a tabular presentation, when I click on a tree node, it will pass the id of the current node to the form and the form shows data from children. When I click on a tree node, it triggers the ORA-06502 error, but when click on some other nodes, it is correct. I don't know why. And on my test environment, it does not have this error, the test environment has same version with the prod environment, has only less data in the database. Could you help me?
I searched in the forum, someone said it's LOV problem, if there is problem LOV, all nodes must have the error, why click on some nodes are ok?
Thank you!
JessicaI don't know, but why do you need a semicolon at the end of the SQL?
Denes Kubicek
-------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
------------------------------------------------------------------- -
ORA-06502: PL/SQL: digital or value error: character string buffer too small
Hello
I am facing infinity listagg that 4000 bytes in listagg issue, so I created a defined user aggregate function suggested by asking tom team,
https://asktom.Oracle.com/pls/Apex/f?p=100:11:0% 3A % 3A % 3A % 3aP11_QUESTION_ID: 2196162600402
But I am facing the error as "digital or value error: character string buffer too small" in the Type on line 27 when questioning this way
Select stragg (val) in the dummy_tab;
My table has a column and the data type is varchar2 (50) and he has more than 300 documents,.
can someone here help me to solve this problem.
Thanks and greetings
Guru
Now if you followed this link, so I hope that you:
(a) set the attribute of the object type to be a CLOB
(b) sets the return value of your Mapper function to be a CLOB
and not as in the example (which is the time before the existence of LISTAGG) as a Varchar2...
HTH
-
PL/SQL error: digital or value error: character string buffer too small
HI gurus of the oracle,.
I'm new to PL/SQL,
my version of oracle's oracle 11g.
I create a procedure to insert data from flat file to a table using UTL_FILE.
The table is
CREATE TABLE EXT_PERSON_INFO
(
ID_PERSON NUMBER (38),
ID_BATCH NUMBER (38),
ID_PERSON_NBR VARCHAR2 (3 BYTE),
ID_AREA VARCHAR2 (5 BYTE),
NM_FINAL VARCHAR2 (20 BYTE),
NM_START VARCHAR2 (20 BYTE),
DATE OF DT_DOB,
ID_SERIAL VARCHAR2 (BYTE 9),
DATE OF DT_RESPONSE,
TRANS_TYPE VARCHAR2 (2 BYTE),
REG_RESPONSE VARCHAR2 (1 BYTE),
TM_RX TIMESTAMP (6)
)
My procedure is
CREATE OR REPLACE PROCEDURE PROC_PERSON
IS
f_line VARCHAR2 (2000);
f utl_file.file_type;
f_dir VARCHAR2 (250);
fname VARCHAR2 (50);
F_ID_PERSON EXT_PERSON_INFO.ID_PERSON%type: = 1;
F_ID_BATCH EXT_PERSON_INFO.ID_BATCH%type: = 1;
F_ID_PERSON_NBR EXT_PERSON_INFO.ID_PERSON_NBR%type;
F_ID_AREA EXT_PERSON_INFO.ID_AREA%type;
F_NM_FINAL EXT_PERSON_INFO. Type of NM_FINAL %;
F_NM_START EXT_PERSON_INFO. Type of NM_START %;
F_DT_DOB EXT_PERSON_INFO. Type of DT_DOB %;
F_ID_SERIAL EXT_PERSON_INFO.ID_SERIAL%type;
F_DT_RESPONSE EXT_PERSON_INFO. Type of DT_RESPONSE %;
F_TRANS_TYPE EXT_PERSON_INFO. Type of TRANS_TYPE %;
F_REG_RESPONSE EXT_PERSON_INFO. Type of REG_RESPONSE %;
BEGIN
fname: = "D:\raj\raj.txt";
f: = utl_file.fopen('RAJ',fname,'r');
loop
Start
UTL_FILE.get_line (f, f_line);
exception
When no_data_found then
"exit";
end;
F_ID_PERSON: = 1;
F_ID_BATCH: = 1;
F_ID_PERSON_NBR: = substr (f_line, 1, 3);
F_NM_FINAL: = substr (f_line, 4, 22);
F_NM_START: = substr (f_line, 23, 34);
F_DT_DOB: = substr (f_line, 35, 44);
F_ID_SERIAL: = substr (f_line, 45, 48);
F_DT_RESPONSE: = substr (f_line, 49, 58);
F_TRANS_TYPE: = substr (f_line, 59, 60);
F_REG_RESPONSE: = substr (f_line, 61, 61);
F_ID_AREA: = substr (f_line, 62, 64);
insert into EXT_PERSON_INFO VALUES (F_ID_PERSON, F_ID_BATCH, F_ID_PERSON_NBR, F_ID_AREA, F_NM_FINAL, F_NM_START, F_DT_DOB, F_ID_SERIAL, F_DT_RESPONSE, F_TRANS_TYPE, F_REG_RESPONSE);
end loop;
UTL_FILE.fclose (f);
commit;
end;
/
am getting error
ORA-06502: PL/SQL: digital or value error: character string buffer too small
Please help me in this regard. Impossible to trace the issue.
Thanks in advance
Kind regards
REDA
The error message should include a line number to reference your code to see what line the error occurred on.
That said, look at the documentation for SUBSTR as you incorrectly use the third parm. It's length, no end of race. That's your problem.
-
problem string buffer too small
Hey, guys:
I have a question may be stupid, I received the error "ORA-06502: PL/SQL: digital or value error: character string buffer too small" when I run a query. If I Uncomment ' and rox.status ='Active "" ' State, I do not have the error. I guess it's related to specific lines. I checked online, it looks like the length of a certain variable varchar2 is not enough, but I can't find cause. I also note that there could be an error on v_level in the function, I use number instead of type varchar2. but after I changed the type of v_level, the error is still there. I would be cautious, because this is a legacy system. Could someone help me on this problem?
I have a query like this:
I get the error message like:select * from registration_offender_xref rox where SOR_OFFENDER_DETAILS.get_offender_level(rox.offender_ID)=3 --and rox.status='Active' and rox.end_registration_date is not null;
ORA-06502: PL/SQL: digital or value error: character string buffer too small
ORA-06512: at "get OUT. SOR_OFFENDER_DETAILS', line 124
06502 00000 - "PL/SQL: digital error or the value of %s.
SOR_OFFENDER_DETAILS.get_offender_level returns a numeric value from 1 to 3, or a null value. Here is the code
Thank you very much!function get_offender_level(p_offender_id IN NUMBER) return NUMBER as sex_offender_flag number; tier_level number; override_num number; v_status varchar2(10); v_aggravated varchar2(10); v_habitual varchar2(10); v_level varchar2(10); cursor tierNum is -- as May 22, 2008 per HKT of DOC (past portal code), Level/Tier is displayed for all offenders select max(c.tier) from sor_offense o, sor_offense_code c where o.offender_id = p_offender_id and o.OFFENSE_CODE = c.CODE_ID and upper(o.status) = 'ACTIVE'; begin select count(*) into sex_offender_flag from registration_offender_xref rox where rox.offender_ID=p_offender_id and reg_type_ID=1; if sex_offender_flag>0 then OPEN tierNum; FETCH tierNum INTO v_level; if tierNum%NOTFOUND then tier_level := null; end if; CLOSE tierNum; select tier_overRide into overRide_Num from registration_offender_xref where offender_id = p_offender_id and reg_type_id = 1; if overRide_Num is not null then v_level:=overRide_Num; end if; --dbms_output.put_line('overRide_Num:'||overRide_Num); --dbms_output.put_line('after override:'||p_level); /*error line*/ select status, decode(aggravated,'Y','Yes','No') aggravated, decode(habitual,'Y','Yes','No') habitual into v_status, v_aggravated, v_habitual from registration_offender_xref where offender_id = p_offender_id and reg_type_id = 1; if upper(v_status) in ('COMPLETED', 'DECEASED', 'DELETED') then v_level := null; end if; --dbms_output.put_line('before final:'||p_level); if v_aggravated = 'Yes' or v_habitual = 'Yes' or v_level = 3 then v_level := 3; end if; --dbms_output.put_line('final:'||p_level); if override_num is not null then v_level := overRide_Num; end if; else v_level:=null; end if; return v_level; end get_offender_level;
Sam
Published by: lxiscas on May 23, 2013 08:38
Published by: lxiscas on May 23, 2013 08:41
Published by: lxiscas on May 23, 2013 09:01I do not pretend that it is your problem, but
select status into v_status, from registration_offender_xref
But you said
v_status varchar2(10);
Much better to say things like that
v_status registration_offender_xref.status%type;
In this way, you know that your variable is declared with a good length, if the length of the column never changes, your code won't kaboom.
See you soon,.
-
PL/SQL: digital or value error: string buffer too small characters - LOV?
Environment:
APEX 3.1.1.00.09 under AIX 5.3 10.2.0.2 in
Problem sample on apex.oracle.com:
Workspace: GALWAY
ID: GWICKE
Password: GWICKE
Application ID: 43172 (BUILDERPL) NOTE: there are three 3 applications with the same name, but this one is currently broken
I get the dreaded "" ORA-06502: PL/SQL: digital or value error: character string buffer too small "when you try to create a new line."
To reproduce the error:
1 run page 3
2 - Select any agency
3 - Click on the button "create a new contract.
4 - Select the start and end dates in the DATE picker
5 - Click on the button "Add contract".
If the line is added successfully if please go to Indianapolis and run the app for me since you obviously have the 'touch '! ;-) >
But seriously folks,
I've read many threads about this error and for the most part, they seem to point to large LOV. I have three 3 LOV on the page but only a 1 is dynamic and display and back elements are the same, a description in this case. There are 400 lines in the LOV table and the description is defined as VARCHAR2 (75), so we're not talking a huge amount of data.
To further complicate the issue, this application was working just a couple of days. What changes I've made since a few days, you might ask?
The only thing that comes to mind is I did go through the definitions of element and change the values of maximum size equal to the size of the columns in the target table, using a value of 22 for the NUMBER of columns.
Since then I went back and changed at a much greater value than their corresponding column definitions, but nothing helped.
Another interesting fact is that if an existing contract is selected on the page (Page 3 in my case) by selecting an agency that produces values in the second select list (selection of contract) and then clicking on "change this contract." After you change any value or fill in one of the missing values, click "Apply Changes" and he should have success.
The new contract page and the page of modification of the contract are the same (Page 2) just with different buttons.
Thanks a lot for any assistance. Indeed, it is greatly appreciated.
-gary
PS I also tried to change the LOV both given a popup and a standard text box I typed in, both received the same message.Gary - I deleted then recreated your DML process and it seems to have solved the problem. Export page reveals something odd in the process definition:
declare p varchar2(32767) := null; l_clob clob; l_length number := 1;beginp:=p||'F|#OWNER#:BUILDERPL_CONTRACT:P2_CONTRACT_SEQ:CONTRACT_SEQ|I'; wwv_flow_api.create_page_process( ...
That the assignment statement must not have ' F | "as the first two characters. There must be a bug in one of the wizards who created the process. Have you used a wizard to create the page?
Scott
-
"Character String Buffer too small" classic report Apex 3.2.1
Hi all
I know it's a very old version I mention here, but that's what we have in our environment, would be very grateful if anyone can help out.
I have a classic report with the sub query in this, I have added a filter using an element from the selection list (P70_GROUP).
SELECT VWS. ServerID AS Display_ID, vws. ServerID AS ID, vws. Host name, vws. ServerStatus, vws. SiteName AS Site vws. Customer, vws. CoreHours, vws. Patch_Notes, vws. PATCH_DEP, vws. Patch_Day, vws. PATCH_GROUPID, vws. PATCH_TIMEID AS VW_Live_Support FROM Time LEFT JOIN W_Patch_Groups wpg vws WE (vws. Patch_GroupID = wpg.ID) WHERE the vws. ID = ' no AND NVL (wpg. Ignore, 'n') = ' n AND ((: P70_GROUP > 1 AND vws.)) PATCH_GROUPID =: P70_GROUP) OR (: P70_GROUP = 1 AND vws.) (Patch_GroupID IS NULL) OR (NVL(:P70_GROUP,0) = 0)) AND (INSTR (UPPER (vws. Host name), SUPERIOR (NVL (: P70_SEARCH, vws.)) HostName))) > 0 OR INSTR (UPPER (vws. ServerStatus), SUPERIOR (NVL (: P70_SEARCH, vws.)) ServerStatus))) > 0 OR INSTR (UPPER (vws. SiteName), SUPERIOR (NVL (: P70_SEARCH, vws.)) SiteName))) > 0 OR INSTR (UPPER (vws. (Client), SUPERIOR (NVL (: P70_SEARCH, vws.)) Customer))) > 0 OR INSTR (UPPER (vws. CoreHours), SUPERIOR (NVL (: P70_SEARCH, vws.)) CoreHours))) > 0 OR INSTR (UPPER (vws. Patch_Notes), SUPERIOR (NVL (: P70_SEARCH, vws.)) (Patch_Notes))) > 0)
This is when I select a group in the list, I get
"error report:
"ORA-06502: PL/SQL: digital or value error: character string buffer too small.
an unusual thing, that I've noticed here is when I select "All groups", which returns the value 0, it is works well and return of 3700 lines but when I select any group that returns 10 to 20 lines I get the above error.
does not include why it is, please help me.
Kind regards
Tauceef
Hi all
I am able to solve the problem by referring to the link below:
What I am able to solve without even changing the item type. Things are working fine now, but it would be really helpful if someone could give me their expert commentary on the solution above.
Is this feasible? I'll be able to solve the problem forever, or it will cause problems again in the future?
Kind regards
Tauceef
Maybe you are looking for
-
External hard drive became a drive F when it used to be an E?
I have my music library pc located on a 250 GB external drive. When I first plugged into the USB it's an E reader. Now, I think because I've used other devices in the USB ports, it has become a F. is it possible to say to the computer I want to ALWAY
-
Hello I found the "imaq create King vi" and its good for what I want to do, but I have a problem. In Control Panel, you can set only one KING. But I want to create many Kings (lines) on the same image of King cunstructor to make me a table of coordin
-
Windows Mail doesn't let me add a contact or group.
The buttons appear depressed, but the appropriate screen is not started.
-
I had resonance just do a system restore on my computer but now if I do not touch my computer for five minutes, it becomes automatically black and goes on Hibernate, and I don't know how to solve this problem. I tried to look in my settings and chang
-
Smartphones blackBerry Desktop Manager error
I'm trying to make a backup of my Storm and receive a "backup of databases error" error dialog box. This happens when it hits the address book options. If anyone can help with this error? I am running Desktop Manager 4.7.0.32 v Concerning