SQL Loader Constraints with Column Objects and Nested Tables
I am working on loading a Table that (god forbid) contains columns, column objects, and nested tables (which contains several depth of column objects). My question is does SQL Loader have a hidding undocumented feature where it states how the column objects must be grouped in refereneced to the nested tables within the loader file? I can load the various column objects, and nested tables fine right now, however, I am loading them all in strange and insane order. Can anyone answer this question? Thanks.
Peter
I just noticed that my email is wrong. If you can help, plese send email to [email protected]
thanks.
Similar Messages
-
How can I export schema with all objects and few tables without data
Hi all
Verion 10g EE.
I have to export schema with all objects but i need to ingnore some of the table data.
There are 4 table those have huge data, we need not to export those tables data but structure should export.
Thanks,
NrYou can do this with a single command. Run your export as normal and add query parameters for the 4 tables that you don't want any rows:
expdp ... query=schema1.table1:"where rownum = 0" query=schema2.table2:"where rownum = 0" ...
It is best to put the query parameters in a parameter file so you don't have to worry about escaping any OS special characters.
Dean -
Sql*loader and nested tables
I'm having trouble loading a nested table via sqlldr in Oracle 10g and was hoping someone could point me in the right direction. I keep getting the following error:
SQL*Loader-403: Referenced column not present in table mynamespace.mytable
Here's an overview of my type and table definitions:
create type mynamespace.myinfo as object
i_name varchar2(64),
i_desc varchar2(255)
create TYPE mynamespace.myinfotbl as TABLE of mynamespace.myinfo;
create table mynamespace.mytable
Info mynamespace.myinfotbl,
note varchar2(255)
NESTED TABLE Info STORE AS mytable_nested_tab;
My control file looks like this:
load data
infile 'mydatafile.csv'
insert into table mynamespace.mytable
fields terminated by ',' optionally enclosed by '"'
TRAILING NULLCOLS
Info nested table count(6)
Info column object
i_name char(64),
i_desc char(255)
note
Example mydatafile.csv would be something like:
lvl1,des1,lvl2,des2,lvl3,des3,lvl4,des4,lvl5,des5,lvl6,des6,a test data set
I can't figure out why sqlldr keeps rejecting this control file. I'm using 'direct=false' in my .par file.
Any hints?I just noticed that my email is wrong. If you can help, plese send email to [email protected]
thanks. -
Problem with generating xml and nested cursor (ora-600)
I have a problem with generating xml (with dbms_xmlquery or xmlgen) and nested cursors.
When I execute the following command, I get a ORA-600 error:
select dbms_xmlquery.getxml('select mst_id
, mst_source
, cursor(select per.*
, cursor(select ftm_fdf_number
, ftm_value
from t_feature_master
where ftm_mstr_id = pers_master_id ) as features
from t_person per
where pers_master_id = mst_id ) as persons
from f_master
where mst_id = 3059435')
from dual;
<?xml version = '1.0'?>
<ERROR>oracle.xml.sql.OracleXMLSQLException: ORA-00600: internal error code, arguments: [kokbnp2], [1731], [], [], [], [], [], []
</ERROR>
The problem is the second cursor (t_feature_master).
I want to generate this:
<master>
<..>
<persons>
<..>
<features>
<..>
</features>
</persons>
<persons>
<..>
<features>
<..>
</features>
</persons>
</master>
If i execute the select-statement in sql-plus, then I get the next result.
MST_ID MST_SOURCE PERSONS
3059435 GG CURSOR STATEMENT : 3
CURSOR STATEMENT : 3
PERS_MASTER_ID PERS_TITLE PERS_INITI PERS_FIRSTNAME PERS_MIDDL PERS_LASTNAME
3059435 W. Name
CURSOR STATEMENT : 15
FTM_FDF_NUMBER FTM_VALUE
1 [email protected]
10 ....
I use Oracle 8.1.7.4 with Oracle XDK v9.2.0.5.0.
Is this a bug and do somebody know a workaround?Very simple...Drop all type objects and nested tables and create them again. You will get no error. I'll explain the reason later.
-
Download internal table data into excel sheet with column heading and data
Hi,
I am having one internal table with column headings and other table with data.
i want to download the data with these tables into an excel sheet.
It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
what we have to do for storing the file name in runtime.
Can anyone help me on this.
Thanks,
Rose.Hi Camila,
Try this
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = PATH2
FILETYPE = 'XLS'
TABLES
DATA_TAB = IT_DATA
FIELDNAMES = IT_HEADINGS
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22 -
Hi Guys,
First of all thanks in advance any help much appriciated.
I am new in scripting and excel, i am looking for below solution as my job requires daily work of this kind and i came to know by automating this work lots of time can be saved.
Compare Server Names in Excel sheet from column1 with column 2 and exact matched server names should be saved in column 3 in same Excel sheet.
Looking solutions first using excel i.e.vlookup itself so that it will not require any approval in my job else using powersell ,vbscript.
Once again Thanks for you guys.
/Regards
Nitesh24inHi Edward,
Thanks once again
I have only changed excel file path and after that this is saved as below , i am not sure which three lines should be together in one line. Please advise.
$excel = New-Object -ComObject Excel.Application
$Workbook = $excel.Workbooks.Add("F:\NewDocsToReadNitesh26-May2013\Excel\test.xls")
$WorkSheet = $Workbook.Worksheets.Item(1)
$WorkSheet.Activate() | Out-Null
For ($i=1;$i -le $worksheet.UsedRange.Rows.Count;$i++) {
If ($worksheet.cells.item($i,1).value2 -eq $worksheet.cells.item($i,2).value2) {
$worksheet.cells.item($i,3).value2 = $worksheet.cells.item($i,1).value2
}$Workbook.Save()$excel.Quit()[System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$excel) | Out-Null
Thanks and Regards
Nitesh24in -
SQL*loader support database columns Of Binary Double/Float
Does SQL*loader support database columns Of Binary Double/Float when applying Direct Path?
Why not use Google and find out for yourself.
The first hit on Google is this
Go see for yourself
Regards
FJ -
Publishing Projects with Web Objects and YouTube Interactions
How do I publish projects with Web Objects and YouTube interactions to ensure they appear in my published project?
I am trying to publish my project, which contains Web objects and YouTube interactions, and they will not appear if I publish them either as swf or html (sometimes the Web object will appear, but not the YouTube interactions). Both objects work if I preview them on the stage.Hi,
You need to copy your published output to any web server to make Web Objects and Yout Tube interaction work.
Regards,
Mayank -
SQL*Loader-929: Error parsing insert statement for table
Hi,
I get the following error with SQL*Loader:
Table MYTABLE loaded from every logical record.
Insert option in effect for this table: INSERT
Column Name Position Len Term Encl Datatype
IDE FIRST * ; CHARACTER
SQL string for column : "mysequence.NEXTVAL"
CSI_NBR 1:10 10 ; CHARACTER
POLICY_NBR 11:22 12 ; CHARACTER
CURRENCY_COD 23:25 3 ; CHARACTER
POLICY_STAT 26:27 2 ; CHARACTER
PRODUCT_COD 28:35 8 ; CHARACTER
END_DAT 44:53 10 ; CHARACTER
FISCAL_COD 83:83 1 ; CHARACTER
TOT_VAL 92:112 21 ; CHARACTER
SQL*Loader-929: Error parsing insert statement for table MYTABLE.
ORA-01031: insufficient privileges
I am positive that I can SELECT the sequence and INSERT into the table with the user invoking sql*loader.
Where does that "ORA-01031" come from?
Regards
...Options:
1) you are wrong about privileges OR
2) you have the privilege only when you connect via SQL*Plus (or whichever other tool you used to test the insert).
Is it possible that during your test you enabled the role which granted you the INSERT privilege - and that SQL*Loader doesn't do this?
Can you see the table in this list?
select *
from user_tab_privs_recd
where table_name='MY_TABLE'
and owner='table owner whoever';
select *
from user_role_privs;Any roles where DEFAULT_ROLE is not YES?
HTH
Regards Nigel -
OCI doc says Cursor and Nested table have the same bind type SQLT_RSET but they don't
5 Binding and Defining in OCI
PL/SQL REF CURSORs and Nested Tables in OCI
says SQLT_RSET is passed for the dty parameter.
If I use SQLT_RSET for the return value of a function that returns a table and pass a statement handle's address for the OCI parameter data pointer, I expected that the statement handle will be instantiated as a result of executing the function on which I can further perform fetch, similar to a cursor. But it throws exception PLS-00382: expression is of wrong type ORA-06550: line 2, column 3. Is the above documentation wrong?
From the OCI header file I see that for varray and nested table it mentions to use SQLT_NCO. I could find no example in the OCI documentation on how to pass or receive as return value a nested value when using SQLT_NCO.
Please help before I shoot myself.So the Nested table I quoted in the doc is not actually used to mean a table type below?
create type t_resultsetdata as object (
i int, d decimal, c varchar(10)
create type t_nested_resultsetdata as table of t_resultsetdata;
create function Blah return t_nested_resultsetdata is . . .
For this you are saying to use SQL_NTY and not SQL_NCO. Can you tell where this usage is documented, because ocidfn.h says
#define SQLT_NTY 108
/* named object type */
#define SQLT_NCO 122
/* named collection type (varray or nested table) */
Another question - Because of the original document I said I followed, I thought I could treat cursor and nested table similarly in the calling application, i.e. I could repeatedly do a fetch on the OCIStmt* which will be bound for nested table. Now from what you say I understand I can't really bind a OCIStmt* for nested table but have an object type. That means it will get all the data of that collection in one go, right? LIke I said, lack of examples is making this tough. I don't want to look into OCI source code, as that will be too much. -
Inserting data with the help of nested table...!!!
The following block is giving error
ORA-06502: PL/SQL: numeric or value error
the signature and signature_bkp have the same structure
So, can anybody help me out to solve this issue :
for copying records from one table to another table
Thanking You advancely
DECLARE
CURSOR c1
IS
SELECT *
FROM signature
WHERE creation_time > TRUNC ( SYSDATE ) - 100
AND ROWNUM < 102;
TYPE sig_typ IS TABLE OF signature%ROWTYPE;
sig_t sig_typ;
BEGIN
OPEN c1;
FETCH c1
BULK COLLECT INTO sig_t;
CLOSE c1;
FORALL i IN sig_t.FIRST .. sig_t.LAST
INSERT INTO signature_bkp
VALUES sig_t ( i );
COMMIT;
END;
--DKarOr whether a INSERT statement with SELECT clause will do that for youby using this technique, it took 47:08:45 to copy 7252 rows
and by using a cursor for loop took 49:03:23 to copy 13567 rows
So there was appox. 40% increase in performance by using pl/sql. I thought it could be even faster using the bulk-bind ing features and nested tables.
OR i just want to know ....how to correct the block of code that was given in my 1st msg without changing its logic.
Thanks
--DKar -
How to cast RECORD of nested tables into OBJECT of nested tables
Right, we have an existing massive pl/sql package where some of the processing is taking too long so they want to try multithreading it.
The data in this package is stored in an array of records which contains nested tables, which themselves contain nested tables.
So, we want to split this table into 10, and submit them to 10 dbms_jobs to run concurrently, write the modified arrays to the database so they can be picked up again by the original process.
I'm stuck on converting the associative array of data (containing tables of records) into objects which can be stored in the DB.
My database objects:
CREATE OR REPLACE
TYPE ktest_claims_rt IS OBJECT
col1 varchar2(10)
,col2 varchar2(10));
CREATE OR REPLACE
TYPE ktest_claims_tt IS TABLE OF ktest_claims_rt;
CREATE OR REPLACE
TYPE ktest_driver_rt IS OBJECT
col1 varchar2(10)
,col2 varchar2(10)
,claims_nt ktest_claims_tt);
CREATE OR REPLACE
TYPE ktest_driver_tt IS TABLE OF ktest_driver_rt;
CREATE OR REPLACE
TYPE ktest_policy_rt IS OBJECT
col1 varchar2(10)
,col2 varchar2(10)
,driver_nt ktest_driver_tt);
CREATE OR REPLACE
TYPE ktest_policy_tt IS TABLE OF ktest_policy_rt;
CREATE TABLE ktest_job_table
(job_no NUMBER
,tab_type VARCHAR2(3)
,policy_nt ktest_policy_tt
NESTED TABLE policy_nt STORE AS policy_nested_tab
(NESTED TABLE driver_nt STORE AS driver_nested_tab
(NESTED TABLE claims_nt STORE AS claims_nested_tab))
/ And my local package versions:
TYPE claims_rt IS RECORD
col1 varchar2(10)
,col2 varchar2(10));
TYPE claims_tt IS TABLE OF claims_rt INDEX BY PLS_INTEGER;
TYPE driver_rt IS RECORD
col1 varchar2(10)
,col2 varchar2(10)
,claims_nt claims_tt);
TYPE driver_tt IS TABLE OF driver_rt INDEX BY VARCHAR2(20);
TYPE policy_rt IS RECORD
policy_no policy.policy_no%TYPE
,driver_tab driver_tt
,other_col VARCHAR2(20));
TYPE policy_tt IS TABLE OF policy_rt
INDEX BY pls_integer;
main_table policy_tt;What I can't get through my pea sized brain is how to turn "main_table" into an array based on ktest_policy_tt.
I got as far as:
FUNCTION convert (p_table IN policy_tt) RETURN ktest_policy_tt
IS
db_vers ktest_policy_tt := ktest_policy_tt();
db_rec ktest_policy_rt;
BEGIN
FOR i IN p_table.FIRST..p_table.LAST
LOOP
db_rec := ktest_policy_rt(p_table(i).policy_no
,p_table(i).other_col
,ktest_driver_tt(p_table(i).driver_tab(i).col1
,p_table(i).driver_tab(i).col2
,ktest_claims_tt(p_table(i).driver_tab(i).claims_nt(i).col1
,p_table(i).driver_tab(i).claims_nt(i).col1
db_vers(i) := db_rec;
END LOOP;
END;but, apart from the fact that it only coverts the first row of each table, it doesn't compile:
LINE/COL ERROR
139/10 PL/SQL: Statement ignored
143/52 PLS-00306: wrong number or types of arguments in call to
'KTEST_CLAIMS_TT'
143/52 PLS-00306: wrong number or types of arguments in call to
'KTEST_CLAIMS_TT'I'd appreciate any help as this is getting urgent.
Thanks!I would recommend writing your function in a more stepwise, explicit fashion rather than trying to write the conversion as basically one big constructor.
Firstly, you will require nested loops in your pl/sql code for the different levels of nested tables. This is not a choice, you need to do this.
Within each level of looping, explicitly create the object of the desired type before adding it to the table / record as need be.
cheers,
Anthony -
I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY QUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM .I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ?? HOW IT IS ??
Hi Kishore,
First identify deleted records by selecting "Detect deleted rows from comparison table" feature in Table Comparison
Then Use Map Operation with Input row type as "delete" and output row type as "delete" to delete records from target table. -
Sql loader error with date format
Hi everyone,
I have table and have a data in one coulmn RECORDED_DATE like '20090224' and my client is asking me to load this coulmn data in 'yyyymmdd' format.I am strucked up with my ideas.I used to_date('20090124','yyyymmdd') in control file.but it is also not working Here it is my control file
LOAD DATA
INFILE 'C:\xxxx\SQLLDR\HE data\HE_data_Feb.txt'
BADFILE 'C:\xxxx\SQLLDR\HE data.bad'
DISCARDFILE 'C:\xxxx\SQLLDR\HE data.dsc'
INTO TABLE LSCCMGR.FASTPAY_HE_DATA
REPLACE
fields terminated by X'09'
TRAILING NULLCOLS
(RECORDED_DATE "TO_DATE(:RECORDED_DATE,'mm/dd/yyyy')"
AGENT_ID
MEASURE
TRANSACTIONS
FEES
If i excute like this i am getting the error like
Record 1: Rejected - Error on table LSCCMGR.FASTPAY_HE_DATA, column RECORDED_DATE.
ORA-01843: not a valid month
Getting for all records,what i need o change to get the RECORDED_DATE as dateformat.Ple any one help me in this issue to resolve
How can we perform this using sql loader pls let me know,Thanks in advance.
SravanHi,
>>(RECORDED_DATE "TO_DATE(:RECORDED_DATE,'mm/dd/yyyy')"
*Change this line to*
(RECORDED_DATE "TO_DATE(:RECORDED_DATE,'yyyymmdd')"Regards, -
SQL Loader Problem with Date Format
Dear all,
I am dealing with a problem in loading data with SQL Loader. The problem is in the date format.
More specifically, I created the following Control File:
file.ctl
LOAD DATA
INFILE 'D:\gbal\chatium.log'
APPEND INTO TABLE CHAT_SL
FIELDS TERMINATED BY WHITESPACE
TRAILING NULLCOLS
(SL1 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
SL2 char,
SL3 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
SL4 char,
SL5 char,
SL6 char,
SL7 char,
SL8 char,
SL9 char,
SL10 char,
SL11 char,
SL12 char,
SL13 char,
SL14 char,
SL15 char)
The data we want to load are in the following file:
Apr 29, 2007 12:05:49 AM 1060615 Apr 29, 2007 12:05:35 AM 306978537730 24026384 chatium.user.userinfo WAP 0
Apr 29, 2007 12:12:51 AM 1061251 Apr 29, 2007 12:12:27 AM 306978537730 24026384 chatium.channel.list WAP 0
Apr 29, 2007 12:12:51 AM 1061264 Apr 29, 2007 12:12:32 AM 306978537730 24026384 chatium.channel.listdetail WAP 0
Apr 29, 2007 12:13:51 AM 1061321 Apr 29, 2007 12:13:31 AM 306978537730 24026384 chatium.user.search WAP 0
Apr 29, 2007 12:13:51 AM 1061330 Apr 29, 2007 12:13:37 AM 306978537730 24026384 chatium.user.userinfo WAP 0
The error log file is the following:
SQL*Loader: Release 9.2.0.1.0 - Production on Mon Apr 30 11:29:16 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Control File: file.ctl
Data File: D:\gbal\chatium.log
Bad File: chatium.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table CHAT_SL, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
SL1 FIRST * WHT DATE MonDD,YYYYHH:MI:SS
SL2 NEXT * WHT CHARACTER
SL3 NEXT * WHT CHARACTER
SL4 NEXT * WHT CHARACTER
SL5 NEXT * WHT CHARACTER
SL6 NEXT * WHT CHARACTER
SL7 NEXT * WHT CHARACTER
SL8 NEXT * WHT CHARACTER
SL9 NEXT * WHT CHARACTER
SL10 NEXT * WHT CHARACTER
SL11 NEXT * WHT CHARACTER
SL12 NEXT * WHT CHARACTER
SL13 NEXT * WHT CHARACTER
SL14 NEXT * WHT CHARACTER
SL15 NEXT * WHT CHARACTER
Record 1: Rejected - Error on table CHAT_SL, column SL1.
ORA-01840: input value not long enough for date format
Record 2: Rejected - Error on table CHAT_SL, column SL1.
ORA-01840: input value not long enough for date format
Record 3: Rejected - Error on table CHAT_SL, column SL1.
ORA-01840: input value not long enough for date format
Record 4: Rejected - Error on table CHAT_SL, column SL1.
ORA-01840: input value not long enough for date format
I wonder if you could help me.
Thank you very much in advance.
Giorgos BaliotisSQL> select to_date('Apr 29, 2007 12:05:49 AM','Mon DD, YYYY HH:MI:SS FF3AM') from dual;
select to_date('Apr 29, 2007 12:05:49 AM','Mon DD, YYYY HH:MI:SS FF3AM') from dual
ERROR at line 1:
ORA-01821: date format not recognized
SQL> ed
Wrote file afiedt.buf
1* select to_date('Apr 29, 2007 12:05:49 AM','Mon DD, YYYY HH:MI:SS AM') from dual
SQL> /
TO_DATE(
29/04/07
SQL> Then, you defined blank space as separator, but there is spaces in your date inside your file. So, you should add double-quotes around the date field like below, and add optionally enclosed by '"' into your ctlfile.
"Apr 29, 2007 12:05:49 AM" 1060615 "Apr 29, 2007 12:05:35 AM" 306978537730 24026384 chatium.user.userinfo WAP 0
"Apr 29, 2007 12:12:51 AM" 1061251 "Apr 29, 2007 12:12:27 AM" 306978537730 24026384 chatium.channel.list WAP 0
"Apr 29, 2007 12:12:51 AM" 1061264 "Apr 29, 2007 12:12:32 AM" 306978537730 24026384 chatium.channel.listdetail WAP 0
"Apr 29, 2007 12:13:51 AM" 1061321 "Apr 29, 2007 12:13:31 AM" 306978537730 24026384 chatium.user.search WAP 0
"Apr 29, 2007 12:13:51 AM" 1061330 "Apr 29, 2007 12:13:37 AM" 306978537730 24026384 chatium.user.userinfo WAP 0Example :
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_concepts.htm#sthref477
Nicolas.
Maybe you are looking for
-
Spry collapsible panel to open horizontally
Greetings, I am using CS5. Is there a way to make the sprycollapsiblepanel open horizontally (left to right...right to left) not the default, vertically (up and down)? Much Thanks!
-
Access Denied Error while accessing "Site Settings Access requests and invitations"
Hi, I am getting Access Denied Error while accessing "Site Settings > Access requests and invitations" in SharePoint 2013 online. Currently I am the owner of the site and have "FULL CONTROL" access. I am able to access using site collection account.
-
Z61t Doesn't boot after upgrading hard drive
I'm upgrading the hard drive on my girlfriend's Lenovo Z61t laptop and am running in to a strange problem. The computer will not boot anymore! I cloned the old disk to the new one using acronis true image and when I insert the new disk into the lapto
-
I want to disable the context menu which comes with the right click when I click on a H:outputlink. I want to use the oncontextmenu option but this tag does not support is Is there a way?
-
I just woke my MacBook Pro 17 HD screen and got this. The VM had just been down loaded. http://www.flickr.com/photos/payers/sets/72157614881393766/ Does this look like the symptom of the nvidia graphics card failing...8600nividia Put the compter back