Parse large delimited column
Hello
I have a column which contains over 25000 chars delimited by a ";". The column is a clob.
I need to parse it and insert then as rows into another table. I have the following code:
SELECT CODE
BULK COLLECT INTO l_tab_codes
FROM (
SELECT SUBSTR(CODE,
INSTR (CODE, ';', 1, ROWNUM ) + 1,
INSTR (CODE, ';', 1, ROWNUM+1) - INSTR(TRIM(CODE), ';', 1, ROWNUM) -1
) AS CODE
FROM (SELECT ';'||REC.CODE_2||';' AS CODE
FROM dual
CONNECT BY LEVEL <= LENGTH(TRIM(REC.CODE_2))-LENGTH(REPLACE(TRIM(REC.CODE_2),';',''))+1 )
WHERE INSTR(CODE,'-',1)=0;
FORALL l_tab_codes_index IN l_tab_codes.FIRST .. l_tab_codes.LAST
INSERT INTO RATE_SUPP_TERM_TEMP (RATE_LOAD_ID,CODE_1,NAME,RATE,FILE_CHANGE_TYPE,EFFECTIVE_DATE)
VALUES (i_rateloadid,TRIM(REC.CODE_1)||TRIM(l_tab_codes(l_tab_codes_index)),REC.NAME,REC.RATE,REC.CHANGE_TYPE,REC.EFFECTIVE_DATE);
It takes over 3minutes to run and I need to get it to run under a minute.
Can some see a faster way of doing this.
Oracle 10g Rel 2.
Thanks
DECLARE
BEGIN
FOR REC IN ( select RATE_LOAD_ID,CODE_1,NAME,RATE,FILE_CHANGE_TYPE,EFFECTIVE_DATE from DAN) LOOP -- code_1 is a clob of numbers delimited by ";"
I find some logical error just in your program - i guess. Correct me if i'm wrong. You didn't use any order by clause here in the above lines.
So,
select RATE_LOAD_ID,CODE_1,NAME,RATE,FILE_CHANGE_TYPE,EFFECTIVE_DATE from DANThis particular select statement fetch data randomly every time when you execute this query. ----- (1)
>
SELECT CODE
BULK COLLECT INTO l_tab_codes You are storing your data without using any ordering. That means again, here we can see the same effect. ----- (2)
FROM (
SELECT SUBSTR(CODE,
INSTR (CODE, ';', 1, ROWNUM ) + 1,
INSTR (CODE, ';', 1, ROWNUM+1) - INSTR(TRIM(CODE), ';', 1, ROWNUM) -1
) AS CODE
FROM (SELECT ';'||REC.CODE_2||';' AS CODE
FROM dual
CONNECT BY LEVEL <= LENGTH(TRIM(REC.CODE_2))-LENGTH(REPLACE(TRIM(REC.CODE_2),';',''))+1 )
WHERE INSTR(CODE,'-',1)=0;
The above one indeed a good parsing. But, what happen next ->
FORALL l_tab_codes_index IN l_tab_codes.FIRST .. l_tab_codes.LAST
INSERT INTO RATE_SUPP_TERM_TEMP (RATE_LOAD_ID,CODE_1,NAME,RATE,FILE_CHANGE_TYPE,EFFECTIVE_DATE)
VALUES Hmmm..... :(
(i_rateloadid,TRIM(REC.CODE_1)||TRIM(l_tab_codes(l_tab_codes_index)),REC.NAME,REC.RATE,REC.CHANGE_TYPE,REC.EFFECTIVE_DATE);Now, Taking ref from (1) & (2) :::: here you are inserting data which is coming out from two different sources in random order and get inserted here. But, there should be some relational link between these two sources.
END LOOP;
END;Is this really your required output? Data may be loaded but is that you called it genuine purified data? I don't think so.
Please share your logical explanation here - may be i'm missing something as it is almost 1 am here in india. Sleeps kicked in.. ;)
Regards.
Satyaki De.
Similar Messages
-
How to parse a delimited string and insert into different columns?
Hi Experts,
I need to parse a delimited string ':level1_value:level2_value:level3_value:...' to 'level1_value', 'level2_value', etc., and insert them into different columns of one table as one row:
Table_Level (Level1, Level2, Level3, ...)
I know I can use substr and instr to get level value one by one and insert into Table, but I'm wondering if there's better ways to do it?
Thanks!user9954260 wrote:
However, there is one tiny problem - the delimiter from the source system is a '|' When I replace your test query with | as delimiter instead of the : it fails. Interestingly, if I use ; it works. See below:
with t as (
select 'str1|str2|str3||str5|str6' x from dual union all
select '|str2|str3|str4|str5|str6' from dual union all
select 'str1|str2|str3|str4|str5|' from dual union all
select 'str1|str2|||str5|str6' from dual)
select x,
regexp_replace(x,'^([^|]*).*$','\1') y1,
regexp_replace(x,'^[^|]*|([^|]*).*$','\1') y2,
regexp_replace(x,'^([^|]*|){2}([^|]*).*$','\2') y3,
regexp_replace(x,'^([^|]*|){3}([^|]*).*$','\2') y4,
regexp_replace(x,'^([^|]*|){4}([^|]*).*$','\2') y5,
regexp_replace(x,'^([^|]*|){5}([^|]*).*$','\2') y6
from t;
The "bar" or "pipe" symbol is a special character, also called a metacharacter.
If you want to use it as a literal in a regular expression, you will need to escape it with a backslash character (\).
Here's the solution -
test@ORA11G>
test@ORA11G> --
test@ORA11G> with t as (
2 select 'str1|str2|str3||str5|str6' x from dual union all
3 select '|str2|str3|str4|str5|str6' from dual union all
4 select 'str1|str2|str3|str4|str5|' from dual union all
5 select 'str1|str2|||str5|str6' from dual)
6 --
7 select x,
8 regexp_replace(x,'^([^|]*).*$','\1') y1,
9 regexp_replace(x,'^[^|]*\|([^|]*).*$','\1') y2,
10 regexp_replace(x,'^([^|]*\|){2}([^|]*).*$','\2') y3,
11 regexp_replace(x,'^([^|]*\|){3}([^|]*).*$','\2') y4,
12 regexp_replace(x,'^([^|]*\|){4}([^|]*).*$','\2') y5,
13 regexp_replace(x,'^([^|]*\|){5}([^|]*).*$','\2') y6
14 from t;
X Y1 Y2 Y3 Y4 Y5 Y6
str1|str2|str3||str5|str6 str1 str2 str3 str5 str6
|str2|str3|str4|str5|str6 str2 str3 str4 str5 str6
str1|str2|str3|str4|str5| str1 str2 str3 str4 str5
str1|str2|||str5|str6 str1 str2 str5 str6
4 rows selected.
test@ORA11G>
test@ORA11G>isotope
PS - it works for semi-colon character ";" because it is not a metacharacter. So its literal value is considered by the regex engine for matching.
Edited by: isotope on Feb 26, 2010 11:09 AM -
SQL Error: ORA-12899: value too large for column
Hi,
I'm trying to understand the above error. It occurs when we are migrating data from one oracle database to another:
Error report:
SQL Error: ORA-12899: value too large for column "USER_XYZ"."TAB_XYZ"."COL_XYZ" (actual: 10, maximum: 8)
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).
The source database runs - Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
The target database runs - Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
The source and target table are identical and the column definitions are exactly the same. The column we get the error on is of CHAR(8). To migrate the data we use either a dblink or oracle datapump, both result in the same error. The data in the column is a fixed length string of 8 characters.
To resolve the error the column "COL_XYZ" gets widened by:
alter table TAB_XYZ modify (COL_XYZ varchar2(10));
-alter table TAB_XYZ succeeded.
We now move the data from the source into the target table without problem and then run:
select max(length(COL_XYZ)) from TAB_XYZ;
-8
So the maximal string length for this column is 8 characters. To reduce the column width back to its original 8, we then run:
alter table TAB_XYZ modify (COL_XYZ varchar2(8));
-Error report:
SQL Error: ORA-01441: cannot decrease column length because some value is too big
01441. 00000 - "cannot decrease column length because some value is too big"
*Cause:
*Action:
So we leave the column width at 10, but the curious thing is - once we have the data in the target table, we can then truncate the same table at source (ie. get rid of all the data) and move the data back in the original table (with COL_XYZ set at CHAR(8)) - without any issue.
My guess the error has something to do with the storage on the target database, but I would like to understand why. If anybody has an idea or suggestion what to look for - much appreciated.
Cheers.843217 wrote:
Note that widths are reported in characters if character length
semantics are in effect for the column, otherwise widths are
reported in bytes.You are looking at character lengths vs byte lengths.
The data in the column is a fixed length string of 8 characters.
select max(length(COL_XYZ)) from TAB_XYZ;
-8
So the maximal string length for this column is 8 characters. To reduce the column width back to its original 8, we then run:
alter table TAB_XYZ modify (COL_XYZ varchar2(8));varchar2(8 byte) or varchar2(8 char)?
Use SQL Reference for datatype specification, length function, etc.
For more info, reference {forum:id=50} forum on the topic. And of course, the Globalization support guide. -
Inserted value too large for column error while scheduling a job
Hi Everyone,
I am trying to schedule a PL SQL script as a job in my Oracle 10g installed and running on Windows XP.
While trying to Submit the job I get the error as "Inserted value too large for column:" followed by my entire code. The code is correct - complies and runs in Oracle ApEx's SQL Workshop.
The size of my code is 4136 character, 4348 bytes and 107 lines long. It is a code that sends an e-mail and has a +utl_smtp.write_data([Lots of HTML])+
There is no insert statement in the code whatsoever, the code only queries the database for data...
Any idea as to why I might be getting this error??
Thanks in advance
SidThe size of my code is 4136 character, 4348 bytes and 107 lines long. It is a code that sends an e-mail and has a utl_smtp.write_data(Lots of HTML)SQL variable has maximum size of 4000
-
Fdpstp failed due to ora-12899 value too large for column
Hi All,
User facing this problem while running the concurrent program.
the program is complted but with rhis error.
fdpstp failed due to ora-12899 value too large for column
Can any one tell me the excat solution for this?
RDBMS : 10.2.0.3.0
Oracle Applications : 11.5.10.2User facing this problem while running the concurrent program.
the program is complted but with rhis error.Is this a seeded or custom concurrent program?
fdpstp failed due to ora-12899 value too large for column
Can any one tell me the excat solution for this?Was this working before? If yes, any changes been done recently?
Can other users run the same concurrent program with no issues?
Please post the contents of the concurrent request log file here.
Please ask your developer to open the file using Reports Builder and compile the report and run it (if possible) with the same parameters.
OERR: ORA-12899 value too large for column %s (actual: %s, maximum: %s) [ID 287754.1]
Thanks,
Hussein -
Value too large for column "OIMDB"."UPA_FIELDS"."FIELD_NEW_VALUE"
I am running OIM 9.1.0.1849.0 build 1849.0 on Windows Server 2003
I see the following stack trace repeatedly in c:\jboss-4.0.3SP1\server\default\log\server.log
I am hoping someone might be able help me resolve this issue.
Thanks in advance
...Lyall
java.sql.SQLException: ORA-12899: value too large for column "OIMDB"."UPA_FIELDS"."FIELD_NEW_VALUE" (actual: 2461, maximum: 2000)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1170)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3423)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:227)
at com.thortech.xl.dataaccess.tcDataBase.writePreparedStatement(Unknown Source)
at com.thortech.xl.dataobj.PreparedStatementUtil.executeUpdate(Unknown Source)
at com.thortech.xl.audit.auditdataprocessors.UserProfileRDGenerator.insertUserProfileChangedAttributes(Unknown Source)
at com.thortech.xl.audit.auditdataprocessors.UserProfileRDGenerator.processUserProfileChanges(Unknown Source)
at com.thortech.xl.audit.auditdataprocessors.UserProfileRDGenerator.processAuditData(Unknown Source)
at com.thortech.xl.audit.genericauditor.GenericAuditor.processAuditMessage(Unknown Source)
at com.thortech.xl.audit.engine.AuditEngine.processSingleAudJmsEntry(Unknown Source)
at com.thortech.xl.audit.engine.AuditEngine.processOfflineNew(Unknown Source)
at com.thortech.xl.audit.engine.jms.XLAuditMessageHandler.execute(Unknown Source)
at com.thortech.xl.schedule.jms.messagehandler.MessageProcessUtil.processMessage(Unknown Source)
at com.thortech.xl.schedule.jms.messagehandler.AuditMessageHandlerMDB.onMessage(Unknown Source)
at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:101)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
at org.jboss.ejb.Container.invoke(Container.java:873)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1077)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1379)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:904)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:160)
at org.jboss.mq.SpySession.run(SpySession.java:333)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
at java.lang.Thread.run(Thread.java:534)
2008-09-03 14:32:43,281 ERROR [XELLERATE.AUDITOR] Class/Method: UserProfileRDGenerator/insertUserProfileChangedAttributes encounter some problems: Failed to insert change record in table UPA_FIELDSThankyou,
Being the OIM noob that I am, had no idea where to look.
We do indeed have some user defined fields of 4000 characters.
I am now wondering if I can disable auditing, or maybe increase the size of the auditing database column?
Also, I guess I should raise a defect in OIM as the User Interface should not allow the creation of a user field for which auditing is unable to cope.
I also wonder if the audit failures (other than causing lots of stack traces) causes any transaction failures due to transaction rollbacks?
Edited by: lyallp on Sep 3, 2008 4:01 PM -
I am getting error "ORA-12899: value too large for column".
I am getting error "ORA-12899: value too large for column" after upgrading to 10.2.0.4.0
Field is updating only through trigger with hard coded value.
This happens randomly not everytime.
select * from v$version
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
Table Structure
desc customer
Name Null? Type
CTRY_CODE NOT NULL CHAR(3 Byte)
CO_CODE NOT NULL CHAR(3 Byte)
CUST_NBR NOT NULL NUMBER(10)
CUST_NAME CHAR(40 Byte)
RECORD_STATUS CHAR(1 Byte)
Trigger on the table
CREATE OR REPLACE TRIGGER CUST_INSUPD
BEFORE INSERT OR UPDATE
ON CUSTOMER FOR EACH ROW
BEGIN
IF INSERTING THEN
:NEW.RECORD_STATUS := 'I';
ELSIF UPDATING THEN
:NEW.RECORD_STATUS := 'U';
END IF;
END;
ERROR at line 1:
ORA-01001: invalid cursor
ORA-06512: at "UPDATE_CUSTOMER", line 1320
ORA-12899: value too large for column "CUSTOMER"."RECORD_STATUS" (actual: 3,
maximum: 1)
ORA-06512: at line 1
Edited by: user4211491 on Nov 25, 2009 9:30 PM
Edited by: user4211491 on Nov 25, 2009 9:32 PMSQL> create table customer(
2 CTRY_CODE CHAR(3 Byte) not null,
3 CO_CODE CHAR(3 Byte) not null,
4 CUST_NBR NUMBER(10) not null,
5 CUST_NAME CHAR(40 Byte) ,
6 RECORD_STATUS CHAR(1 Byte)
7 );
Table created.
SQL> CREATE OR REPLACE TRIGGER CUST_INSUPD
2 BEFORE INSERT OR UPDATE
3 ON CUSTOMER FOR EACH ROW
4 BEGIN
5 IF INSERTING THEN
6 :NEW.RECORD_STATUS := 'I';
7 ELSIF UPDATING THEN
8 :NEW.RECORD_STATUS := 'U';
9 END IF;
10 END;
11 /
Trigger created.
SQL> insert into customer(CTRY_CODE,CO_CODE,CUST_NBR,CUST_NAME,RECORD_STATUS)
2 values('12','13','1','Mahesh Kaila','UPD');
values('12','13','1','Mahesh Kaila','UPD')
ERROR at line 2:
ORA-12899: value too large for column "HPVPPM"."CUSTOMER"."RECORD_STATUS"
(actual: 3, maximum: 1)
SQL> insert into customer(CTRY_CODE,CO_CODE,CUST_NBR,CUST_NAME)
2 values('12','13','1','Mahesh Kaila');
1 row created.
SQL> set linesize 200
SQL> select * from customer;
CTR CO_ CUST_NBR CUST_NAME R
12 13 1 Mahesh Kaila I
SQL> update customer set cust_name='tst';
1 row updated.
SQL> select * from customer;
CTR CO_ CUST_NBR CUST_NAME R
12 13 1 tst Urecheck your code once again..somewhere you are using record_status column for insertion or updation.
Ravi Kumar -
Install fails due to ORA-12899: value too large for column
Hi,
Our WCS 11g installation on Tomcat 7 fails giving a "ORA-12899: value too large for column".
As per the solution ticket https://support.oracle.com/epmos/faces/DocumentDisplay?id=1539055.1 we have to set "-Dfile.encoding=UTF-8" in tomcat.
We have done this beforehand by setting the variable in catalina.bat in tomcat 7 bin as shown below
But still we get the same error while installation.
If anybody has faced this , let us know how you resolved itWe were unable to install WCS on Tomcat 7 but on Tomcat 6 by specifying "-Dfile.encoding=UTF-8" in java options using "Tomcat Configure" it was succesful.
An alternative we found was to increase the value of the column itself.
Using command
ALTER TABLE csuser.systemlocalestring
MODIFY value varchar2 (4000) -
Parse large (2GB) text file
Hi all,
I would like your expert tips on efficient ways (speed and memory considerations) for parsing large text files (~2GB) in Java.
Specifically, the text files in hand contain mobility traces that I need to process. Traces have a predefined format, and each trace is given on a new line in the text file.
To obtain the attribues of each trace i use java.util.regex.Pattern and java.util.regex.Matcher.
Thanks in advance,
NickMemory mapped files are faster when you need random access and you don't need to load all the data, however here it just add complexity you don't need IMHO.
I suspect most of the time is taken by the parser so if you customise your parser it could be faster. Here is a simple custom parser
public static void main(String... args) throws IOException {
String template = "tr at %.1f \"$obj(1) pos 123.20 270.98 0.0 2.4\"%n";
File file = new File("/tmp/deleteme.txt");
// if(!file.exists()) {
System.out.println(new Date()+": Writing to "+file);
PrintWriter pw = new PrintWriter(file);
for(int i=0;i<Integer.MAX_VALUE/template.length();i++)
pw.printf(template, i/10.0);
pw.close();
System.out.println(new Date()+": ... finished writing to " + file + " length= " + file.length() / 1024 / 1024 + " MB.");
long start = System.nanoTime();
final BufferedReader br = new BufferedReader(new FileReader(file), 64 * 1024);
for(String line;(line = br.readLine()) != null;) {
int pos = 6;
int end = line.indexOf(' ', pos);
double time = Double.parseDouble(line.substring(pos, end));
pos = line.indexOf('s', end+12)+2;
end = line.indexOf(' ', pos+1);
double x = Double.parseDouble(line.substring(pos, end));
pos = end+1;
end = line.indexOf(' ', pos+1);
double y = Double.parseDouble(line.substring(pos, end));
pos = end+1;
end = line.indexOf(' ', pos+1);
double z = Double.parseDouble(line.substring(pos, end));
pos = end+1;
end = line.indexOf('"', pos+1);
double velocity = Double.parseDouble(line.substring(pos, end));
br.close();
long time = System.nanoTime() - start;
System.out.printf(new Date()+": Took %,f sec to read %s%n", time / 1e9, file.toString());
{code}
prints
{code}
Sun May 08 09:38:02 BST 2011: Writing to /tmp/deleteme.txt
Sun May 08 09:42:15 BST 2011: ... finished writing to /tmp/deleteme.txt length= 2208 MB.
Sun May 08 09:43:21 BST 2011: Took 66.610883 sec to read /tmp/deleteme.txt
{code} -
Error on reverse on XML: value too large for column
Hi All,
I am trying to reverse engineer while creating the data model on XML technology.
My JDBC URL on data server reads this:
jdbc:snps:xml?d=../demo/abc/CustomerPartyEBO.xsd&s=MYEBO
I get an error while doing the reverse.
java.sql.SQLException: ORA-12899: value too large for column "PINW"."SNP_REV_KEY_COL"."KEY_NAME" (actual: 102, maximum: 100)
After doing some check through selective reverse, found that this is happening only for few tables, whose names are quite longer.
Tried setting the "maximum column name length" and "maximum table name length" to 120 and even higher values on XML technology from Topology Manager. No luck there.
Thanks in advance for any help here.That is not the place to change.
The error states that the SNP_REV_KEY_COL.KEY_NAME in the Work Repository schema PINW has maximum length defined to be 100.
I donot know if Oracle will support this change but you will have to make a change to the Work Repository table SNP_REV_KEY_COL and change the column lengths as a workaround. -
Data Profiling - Value too large for column error
I am running a data profile which completes with errors. The error being reported is an ORA 12899 Value too large for column actual (41 maximum 40).
I have checked the actual data in the table and the maximum is only 40 characters.
Any ideas on how to solve this. Even though it completes no actual profile is done on the data due to the error.
OWB version 11.2.0.1
Log file below.
Job Rows Selected Rows Inserted Rows Updated Rows Deleted Errors Warnings Start Time Elapsed Time
Profile_1306385940099 2011-05-26 14:59:00.0 106
Data profiling operations complete.
Redundant column analysis for objects complete in 0 s.
Redundant column analysis for objects.
Referential analysis for objects complete in 0.405 s.
Referential analysis for objects.
Referential analysis initialization complete in 8.128 s.
Referential analysis initialization.
Data rule analysis for object TABLE_NAME complete in 0 s.
Data rule analysis for object TABLE_NAME
Functional dependency and unique key discovery for object TABLE_NAME complete in 0 s.
Functional dependency and unique key discovery for object TABLE_NAME
Domain analysis for object TABLE_NAME complete in 0.858 s.
Domain analysis for object TABLE_NAME
Pattern analysis for object TABLE_NAME complete in 0.202 s.
Pattern analysis for object TABLE_NAME
Aggregation and Data Type analysis for object TABLE_NAME complete in 9.236 s.
Aggregation and Data Type analysis for object TABLE_NAME
Functional dependency and unique key discovery for object TABLE_NAME complete in 0 s.
Functional dependency and unique key discovery for object TABLE_NAME
Domain analysis for object TABLE_NAME complete in 0.842 s.
Domain analysis for object TABLE_NAME
Pattern analysis for object TABLE_NAME complete in 0.187 s.
Pattern analysis for object TABLE_NAME
Aggregation and Data Type analysis for object TABLE_NAME complete in 9.501 s.
Aggregation and Data Type analysis for object TABLE_NAME
Functional dependency and unique key discovery for object TABLE_NAME complete in 0 s.
Functional dependency and unique key discovery for object TABLE_NAME
Domain analysis for object TABLE_NAME complete in 0.717 s.
Domain analysis for object TABLE_NAME
Pattern analysis for object TABLE_NAME complete in 0.156 s.
Pattern analysis for object TABLE_NAME
Aggregation and Data Type analysis for object TABLE_NAME complete in 9.906 s.
Aggregation and Data Type analysis for object TABLE_NAME
Functional dependency and unique key discovery for object TABLE_NAME complete in 0 s.
Functional dependency and unique key discovery for object TABLE_NAME
Domain analysis for object TABLE_NAME complete in 0.827 s.
Domain analysis for object TABLE_NAME
Pattern analysis for object TABLE_NAME complete in 0.187 s.
Pattern analysis for object TABLE_NAME
Aggregation and Data Type analysis for object TABLE_NAME complete in 9.172 s.
Aggregation and Data Type analysis for object TABLE_NAME
Functional dependency and unique key discovery for object TABLE_NAME complete in 0 s.
Functional dependency and unique key discovery for object TABLE_NAME
Domain analysis for object TABLE_NAME complete in 0.889 s.
Domain analysis for object TABLE_NAME
Pattern analysis for object TABLE_NAME complete in 0.202 s.
Pattern analysis for object TABLE_NAME
Aggregation and Data Type analysis for object TABLE_NAME complete in 9.313 s.
Aggregation and Data Type analysis for object TABLE_NAME
Execute data prepare map for object TABLE_NAME complete in 9.267 s.
Execute data prepare map for object TABLE_NAME
Execute data prepare map for object TABLE_NAME complete in 10.187 s.
Execute data prepare map for object TABLE_NAME
Execute data prepare map for object TABLE_NAME complete in 8.019 s.
Execute data prepare map for object TABLE_NAME
Execute data prepare map for object TABLE_NAME complete in 5.507 s.
Execute data prepare map for object TABLE_NAME
Execute data prepare map for object TABLE_NAME complete in 10.857 s.
Execute data prepare map for object TABLE_NAME
Parameters
O82647310CF4D425C8AED9AAE_MAP_ProfileLoader 1 2011-05-26 14:59:00.0 11
ORA-12899: value too large for column "SCHEMA"."O90239B0C1105447EB6495C903678"."ITEM_NAME_1" (actual: 41, maximum: 40)
Parameters
O68A16A57F2054A13B8761BDC_MAP_ProfileLoader 1 2011-05-26 14:59:11.0 5
ORA-12899: value too large for column "SCHEMA"."O0D9332A164E649F3B4D05D045521"."ITEM_NAME_1" (actual: 41, maximum: 40)
Parameters
O78AD6B482FC44D8BB7AF8357_MAP_ProfileLoader 1 2011-05-26 14:59:16.0 9
ORA-12899: value too large for column "SCHEMA"."OBF77A8BA8E6847B8AAE4522F98D6"."ITEM_NAME_2" (actual: 41, maximum: 40)
Parameters
OA79DF482D74847CF8EA05807_MAP_ProfileLoader 1 2011-05-26 14:59:25.0 10
ORA-12899: value too large for column "SCHEMA"."OB0052CBCA5784DAD935F9FCF2E28"."ITEM_NAME_1" (actual: 41, maximum: 40)
Parameters
OFFE486BBDB884307B668F670_MAP_ProfileLoader 1 2011-05-26 14:59:35.0 9
ORA-12899: value too large for column "SCHEMA"."O9943284818BB413E867F8DB57A5B"."ITEM_NAME_1" (actual: 42, maximum: 40)
ParametersFound the answer. It was the database character set for multi byte character sets.
-
Inserted value too large for column
Hi,
I have a table (desc below), with only one trigger wich fill the operatcreat, operatmodif, datecreat and datemodif column at insert and update for each row. When I try to insert, I got the following messages :
INSERT INTO tarifclient_element(tarifclient_code,article_code,prix) VALUES('12','087108',3.94);
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01401: inserted value too large for column
SQL> desc tarifclient_element
Name Null? Type
TARIFCLIENT_CODE NOT NULL CHAR(10)
ARTICLE_CODE NOT NULL CHAR(20)
PRIX NUMBER
OPERATCREAT NOT NULL VARCHAR2(30)
OPERATMODIF VARCHAR2(30)
DATECREAT NOT NULL DATE
DATEMODIF DATE
NB : tarifclient_code is an ENABLED fk, article_code is a DISABLED fk. All values exists in both referenced tables.
Any idea ?My trigger is not the problem, I tried to delete it and fill the columns manually and got the same error.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by allanplumb ():
The SQL you have shown us looks OK
(to me, au moins). However, perhaps the
error is in the trigger which fills in
the two operativ fields. It would execute
at the same time as your insert, near
enough.
-- Allan Plumb<HR></BLOCKQUOTE>
null -
Rawtohex - How to Insert ? ORA-12899: value too large for column
Hi,
Can any one please help me to resolve the following issue ?
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
Name Null? Type
ABC_OID NOT NULL RAW(8)
ABC_NAME NOT NULL VARCHAR2(30 CHAR)
UPDATE_TIME NOT NULL DATE
UPDATE_BY_WORKER_NO NOT NULL NUMBER
I'm able to insert 1st 2 records but when am inseerting 3rd one am getting error:-
insert into caps.ABC_LOOKUP values( rawtohex('SERIES'), 'SERIES','19-FEB-09','1065449')
insert into caps.ABC_LOOKUP values(rawtohex('FAMILY'),'FAMILY','19-FEB-09','1065449')
Insert into caps.ABC_LOOKUP values(rawtohex('CONNECTOR'),'CONNECTOR','19-FEB-09','1065449')
ERROR at line 1:
ORA-12899: value too large for column
"XYZ"."ABC_LOOKUP"."ABC_OID" (actual: 9, maximum: 8)
Thanks in Advance.....Yes, Done...
Actually I suggested same thing to them (application), But they did not agree with me then i got confused :-)
Now the same thing worked well..Thanks a lot for your time -
Hi All,
I am using SOA 11g(11.1.1.3). I am trying to insert data in to a table coming from a file. I have encountered the fallowing error.
Exception occured when binding was invoked.
Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
*insert failed. Descriptor name: [UploadStgTbl.XXXXStgTbl].*
Caused by java.sql.BatchUpdateException: ORA-12899: value too large for column "XXXX"."XXXX_STG_TBL"."XXXXXX_XXXXX_TYPE" (actual: 20, maximum: 15)
*The invoked JCA adapter raised a resource exception.*
*Please examine the above error message carefully to determine a resolution.*
The data type of the column errored out is VARCHAR2(25). I found related issue in metalink, java.sql.BatchUpdateException (ORA-12899) Reported When DB Adapter Reads a Row From a Table it is Polling For Added Rows [ID 1113215.1].
But the solution seems not applicable in my case...
Can anyone encountered same issue?? Is this a bug? If it is a bug, do we have patch for this bug??
Please help me out...
Thank you all...
Edited by: 806364 on Dec 18, 2010 12:01 PMIt didn't work.
After I changed length of that column of the source datastore (from 15 to 16), ODI created temporary tables (C$ with I$) with larger columns (16 instead of 15) but I got the same error message.
I'm wondering why I have to extend length of source datastore in the source model if there are no values in the source table with a length greather than 15....
Any other idea? Thanks ! -
Adding virtual column: ORA-12899: value too large for column
I'm using Oracle 11g, Win7 OS, SQL Developer
I'm trying to add virtual column to my test table, but getting ORA-12899: value too large for column error. Below 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');
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).When I try to select, I'm getting correct results:
SELECT col1, (REGEXP_REPLACE (col1, '^ABCD[A-Z]*_'))
FROM test_reg_exp;Thanks.Yes RP, it working if you give col2 size >=400.
@Northwest - Could you please test the same w/o having a regex clause in col2?
I doubt on the usage of a REGEX in this dynamic col case.
Refer this (might help) -- http://www.oracle-base.com/articles/11g/virtual-columns-11gr1.php
Below snippet from above link.... see if this helps...
>
Notes and restrictions on virtual columns include:
Indexes defined against virtual columns are equivalent to function-based indexes.
Virtual columns can be referenced in the WHERE clause of updates and deletes, but they cannot be manipulated by DML.
Tables containing virtual columns can still be eligible for result caching.
Functions in expressions must be deterministic at the time of table creation, but can subsequently be recompiled and made non-deterministic without invalidating 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.
Indexes on the virtual column must be rebuilt.
Materialized views that access the virtual column must be fully refreshed.
The result cache must be flushed if cached queries have accessed the virtual column.
Table statistics must be regathered.
Virtual columns are not supported for index-organized, external, object, 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 only refer to 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 output of the expression must be a scalar value. It cannot return an Oracle supplied datatype, a user-defined type, or LOB or LONG RAW.
>
Edited by: ranit B on Oct 16, 2012 11:48 PM
Edited by: ranit B on Oct 16, 2012 11:54 PM
Maybe you are looking for
-
I have an MacBook Pro 10.6, using disk utility I tried to verify my disk, but it came up with the message, please use your start up disk, I tried this, starting the computer up and pressing C, but it ejected the disk, the same thing happened while I
-
How do you get Itunes to recognize all the music in your library when you buy the backup in the cloud? Alot of my music was not backed up. These are songs I burned off my CD collection. Itunes Match did not recognize them either?
-
IPad mini iOS7 FiiO Rocky E02i issue
Hi, I have iPad mini + FiiO Rocky E02i AMP and with new iOS7 I have problem, after connection the headphones with AMP the Music app does not recognize any command like play, next,.... Volume is working. When I select Play via dislay, than is everythi
-
IPOD touch games won't work on my ipod
I downloaded games from the apps store. They said they were compatable with the ipod touch but everytime I open them on my ipod touch 8gb they just close again. Anyone got any ideas how to fix this? Also I downloaded an audio book but my computer kee
-
Image Capture Error Message Pain in the B*** after installing 10.4.10
I installed the 10.4.10 upgrade, and ever since then when I switch on my Brother DCP 115 printer, I get an error message linked to Image Capture that the connection to the machine has failed, that I should check the cables, switch it off and on an tr