i had small query on external tables. i had (.csv) file outside the database. In this file, one column will be added monthly. i need to create the external table dynamically by adding the column for every month.
How the procedure can be created for this requirement.
I have got a procedure that successfully creates an oracle external table and populates it with the contents of a file. This works fine until I have a situation where one of the fields is a VARCHAR2(2) and I try to insert say, a 5 character value. When this happens the record in question does not get populated in the external table (and rightly so), but I could do with working out if there is a discrepancy in the number of records in the file and the number of records that actually make it into the table so I could inform the user that there is a problem.
I have attached the code that creates the external table and populates it.
Step 1.Insert all records from the external table into the export table. Truncate the export table first
Step 2.Read in a record from the export map table
Step 3.Search through export table records looking for the key words BRANCH =. Compare the branch code with the branch code form the map table
Step 4.If a match is found mark all records in the export table for the worksheet with the global ID from the export map table as follows..The first line of a worksheet is marked by the words WKSHTS..The last line of the work sheet is marked by the words COMPANY CONFIDENTIAL..We will need to capture the line break so also mark the next line after the COMPANY CONFIDENTIAL line
Step 5.Continue with Steps 2 - 4 until all records have been processed from the export map table.
first I have to create a procedure ti insert data from external table to export table.Global id will be blank.it will be updated by the mapping table's Global Id when The EB COLUMN's data(i.e 8p,2Betc ) will match with the BRANC=NA,2Betc of the datasheet loaded from the external table.. FOLLOWING IS THE SAMPLE DATASHEET
WKSHTS AAAAA BBBBBBBBBBB ELECTRONICS INC. TIME REPORT-DATE PAGE SORT - BR, SLSREP AEC FIELD SALES REPRESENTATIVE 16:14 09/21/12 1 BRANCH = 2B EMPLOYEE NAME SALVAAG, GREGG Days in the Month 28 [code]....
THERE ARE 2 pages..I have to split this LONG REPORT STORED IN WKSHT_LINE COLUMN OF EXPORT TABLE to 2 records..like wise 500 pages are there means 500 records.. AND THEN FIND BRANCH= after that which two words will come i.e NA,2B etc if it will MATCH WITH MAPPING TABLE"S EB COLUMN"S DATA,THEN MAPPING TABLE's GLOBAL ID WILL BE UPDATED TO EXPORT TABLE's GLOBAL ID WHICH IS BLANK
I'm experiencing some problems when trying to import an 50Mb XML file to an Oracle database. In this XML file I do have several data from customers:
- Name - Address - Contacts
I also have several tables within the DB that would receive this information:
- Customer - CustomerAddress - CustomerContacts
The problem is that, with my XML Transformation and correspondent insertion onto the databse I'm having an huge problem of time expended. I'm having more than 3 hours to insert over 180.000 records on those tables. what can I do to accelerate the process?
During ASM Disk Groups creation after the ASM instance creation, receive the following error: Disk Group ORAASMGROUP2 already exists. Cannot be created again
The Grid infrastructure was deinstall one time and still the same issue.
I need to do some analysis and research to find if any of these 8000 tables I have in a spreadheet that are going to be spit off into a separate database are used by any of our PeopleSoft processes.
I'm assigned to Student Records identified by NTSR.
So for table AAP_ETHNIC_PMPT, I could do something like
SELECT * FROM PSSQLTEXTDEFN where SQLID like 'NTSR%' AND upper(sqltext) like '%PS_AAP_ETHNIC_PMPT%';
But how can I automate this and search 8000 rows in column A2 of a spreadsheet? What other tables other than PSSQLTEXTDEFN or PSPROJECTITEM can I use to search for values of NTSR?
when i am writing dump from external table, it is accessing records from dump.but when i am trying to access other dumps(create thru expdp) it is giving error.the logic i am following is mentioned below-
CREATE OR REPLACE DIRECTORY "DIR_GMS" AS 'D:Gopal_works est_env_files'
GRANT READ ON DIRECTORY dir_gms TO gopal; GRANT WRITE ON DIRECTORY dir_gms TO gopal;
New point: -- taking export thru expdb expdp hr/hr tables=EMPLOYEES directory=DIR_GMS dumpfile=HR_EMP.dmp logfile=expdpEMP.log then i created one EXTERNAL TABLE TO access it.
function isnumeric( p_string in varchar2) return boolean as l_number number; begin l_number := p_string; return TRUE; exception when others then return FALSE; end;
It is not recognizing function IS NUMERIC. Is there any way, I can do this through External Table.
I'm getting error like
The following error has occurred:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400: data cartridge error KUP-00554: error encountered while parsing access parameters KUP-01005: syntax error: found "identifier": expecting one of: "comma, date_format, defaultif, enclosed, (, ltrim, lrtrim, ldrtrim, notrim, nullif, optionally, ), rtrim, terminated" KUP-01008: the bad identifier was: isnumeric KUP-01007: at line 9 column 16 ORA-06512: at "SYS.ORACLE_LOADER", line 14 ORA-06512: at line 1
I have an external table. The table gets created successfully. Once the table is created when I try to access it, I get the following error :
ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400: data cartridge error error opening file /cmpnt/dev/test/ADE_TEMP_4992.log
The default directory is valid and does not have any issues. The IP address of my DB server and the server from which I am connecting to the DB are different. Is this is the issue ? However , all SQL queries are working fine except this one.
then it gets " select * from ext_schoolof " BUT when i use procedure, it creates external table but when I try to get " select * from ext_schoolof ", then I get errors
SQL> select * from oldemp8; select * from oldemp8 * ERROR at line 1: ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400: data cartridge error KUP-00554: error encountered while parsing access parameters KUP-01005: syntax error: found "(": expecting one of: "comma, defaultif, nullif, )" KUP-01007: at line 7 column 16 ORA-06512: at "SYS.ORACLE_LOADER", line 19
SQL>
what is the syntax error in the above command. I place the notepad file properly.i create external table before many time but cant find any this type of error.
While creating external table how can I specify a particular decode condition for a date field that comes in as '2099-99-99' i want to change it to '2099-01-0001', how i can translate it
I already have this in the access parameters..
Incoming_DATE CHAR(20) DATE_FORMAT DATE MASK "YYYY/MM/DD"
I am importing some data using an external table, but the file on which the external table is built has some rows where a certain column is populated with two empty space characters.
CREATE OR REPLACE DIRECTORY xtern_data_dir AS 'C:/...';
This is an except of what's in the external text file. The full text file has been attached.
000011|0030|....|000000.000000| |000000.000000| |0002 000011|0365|....|000000.000000| |000000.000000| |0002 000011|0730|....|000000.000000| |000000.000000| |0002 ^ blank spaces may be | causing error----------
Here is the error message I am receiving. I believe this is caused by the blank fields in the data.
INSERT INTO RPDMMA1_PEDI_MSTR (GCN_SEQNO,.... * ERROR at line 1: ORA-29913: error in executing ODCIEXTTABLEFETCH callout ORA-30653: reject limit reached ORA-06512: at "SYS.ORACLE_LOADER", line 52
This is difficult to work with because the external table function does not appear to be even reading the file so it's not like I can convert the data as I'm loading into the internal database table. What are some approaches I can use to get Oracle to accept these blank columns and either populate them with blank spaces or set them to null?
CREATE TABLE EXT1 ( COL1 NVARCHAR2(2000), COL2 CLOB ) ORGANIZATION EXTERNAL ( TYPE ORACLE_LOADER DEFAULT DIRECTORY FILE_DIR ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE FIELDS TERMINATED BY '|' MISSING FIELD VALUES ARE NULL ( "COL1" CHAR, [code]....
From here I can count all records and the total number of records matching the file record count, but could not read the clob columns. it's not picking up the values. but if I take this out
( "COL1" CHAR, "COL2" RAW )
then I am missing the record counts.Also if you put all varchar and char, that also missing the count against the file.
I am having difficulty importing Spanish text files into my Oracle 11g XE database. Below is my external table declaration code. The external file is attached.
CREATE OR REPLACE DIRECTORY xtern_data_dir AS 'C:/.../';
All 406 rows seem to import fine, but do not display the Spanish accent characters correctly. Note the strange characters:
SQL> SELECT count(*) FROM ET_SLBLWD0_SPNSH_DESC;
COUNT(*) ---------- 406
SQL> select * from et_slblwd0_spnsh_desc;
LBL_ LBL_TXTSNS LBL_DESCS L L L L ---- ---------- ------------------------------------------------------- - - - - 0001 1 Puede causar somnolencia. El alcohol puede intensificar 0001 2 este efecto. Tenga cuidado cuando conduzca veh¿los 0001 3 automotores u opere maquinaria peligrosa. 0002 1 Importante: Acabe todo este medicamento a menos que 0002 2 quien le escriba la receta le indique lo contrario.
[Code]...
I tried modifying my external table declaration by adding CHARACTERSET WE8ISO8859P1 and CHARACTERSET WE8MSWIN1252, but that just seems to cause the system to throw out ALL the rows containing Spanish characters:
COUNT(*) ---------- 197
SQL> select * from et_slblwd0_spnsh_desc;
LBL_ LBL_TXTSNS LBL_DESCS L L L L ---- ---------- ------------------------------------------------------- - - - - 0001 1 Puede causar somnolencia. El alcohol puede intensificar 0001 3 automotores u opere maquinaria peligrosa. 0002 1 Importante: Acabe todo este medicamento a menos que 0002 2 quien le escriba la receta le indique lo contrario. 0005 1 Debe tomar este medicamento con mucha agua. 0006 1 Puede descolorar la orina o las heces.
[Code]...
The log file specifies the following error on the bad rows:
error processing column LBL_DESCS in row xxx for datafile ...SLBLWD0_CRLF.TXT ORA-12899: value too large for column LBL_DESCS (actual: 55, maximum: 55)
What can I do to import these Spanish characters correctly?
i'm having some issues with the External table. Currently my database encoding is AL32UTF8. If my external table wants to read the txt file with the ZHS16GBK, the value will not show correctly when the external table reads the file. Is there any ways to display the value in the txt file correctly without changing the encoding database and encoding in the txt file.
My db version: Oracle 11g I have an empty csv file.I created a external table for the empty csv file.When I run:select count(*) from externaltblname;It returns 1. It should return 0 right. In the definition, I specified "SKIP 1"But still it returns 1. When I use this external table to load into a target table. It loads a single row with null values.How to fix this.
I created a table but I want to add the Unique check to it as I forgot to apply it to the table when I created it.Is it possible to make the field Unique after having created the table or do I have to drop the table and re-create it?
i am trying to create table inside function where in after creating table when am trying to access the table with select statement oracle is throwing error 'Table/view doesnot exist -00942', below is the code snippet
create or replace function example (mkey in varchar2) return varchar2 is g_key varchar2(100); l_tbl_ntext exception; pragma exception_init(l_tbl_ntext , -942); begin
begin execute immediate 'select * from example1';
exception when l_tbl_ntext then null; end; execute immediate 'create table example1(skey varchar2, g_key varchar2) storage(buffer_pool, keep)'; end example; /
the relationship on my script.What I want to do is make it possible to assign many courses to a student.But I have read a few books on foreign keys and primary keys, and I still dont get how to go on doing this....
This is how the table creation with the keys looks right now...
CREATE TABLE CAMPUS ( CAMPUSID NUMBER(4) NOT NULL, NAME VARCHAR2(80) NOT NULL, CONSTRAINT CAMPUS_PK PRIMARY KEY (CAMPUSID));
I need to create a temp table within a stored procedure. I want to apply some logic on the table, and then delete it when it is completed in runtime -- all inside the stored procedure.
I have table property and flat , in both of these tables I have cvp_id common colomn .Now I want to add cluster on this colomn so how can I add cluster to table which is already exists.
I am getting compilation error when create nested table type depend on table structure
SQL> CREATE OR REPLACE TYPE typ$nttb$1 IS TABLE OF emp%rowtype 2 ; 3 /
Warning: Type created with compilation errors.
SQL> show error Errors for TYPE TYP$NTTB$1:
LINE/COL ERROR -------- ----------------------------------------------------------------- 0/0 PL/SQL: Compilation unit analysis terminated 1/29 PLS-00329: schema-level type has illegal reference to SCOTT.EMP SQL>