Server Utilities :: Using Decode In SQL*Loader / ORA-00917 / Missing Comma

Mar 13, 2010

For some reason, sql loader is raising an error for this line

CNT_CODECHAR "decode(:CNT_CODE,'GB',:CNT_CODE,RPAD(:CNT_CODE,3)",

Basically what i want to do is, if the country code is 'GB' then dont change anything but if its not append a space to the country code and return a 3 character value.

The error that is generated is

Record 3: Rejected - Error on table WORLD_COUNTRIES.
ORA-00917: missing comma

There is nothing wrong with the source data because i have tested these different combinations both work fine

CNT_CODECHAR "RPAD(:CNT_CODE,3)",
CNT_CODECHAR,

its only when i use the DECODE function that it complains.

View 3 Replies


ADVERTISEMENT

PL/SQL :: ORA-00917 - Missing Comma?

Dec 18, 2012

I am trying to insert data into a table which I created but I keep getting the error: missing comma.

INSERT INTO EMPLOYEE_DATA

(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, DEPARTMENT, SALARY_(£), SALARY_PAIDON)

VALUES
('1', 'David', 'Smith', 'IT', '20,000', '3/11/2012')

View 12 Replies View Related

SQL & PL/SQL :: ORA-00917 - Missing Comma Error

Mar 5, 2013

SELECT XMLELEMENT (DECODE ('RF', 'RF', 'Credit', 'Sale'), xmlattributes ('01234567' AS "id") ) AS Order FROM DUAL

when I run the above SQL I'm getting "ORA-00917-missing comma" error.

View 6 Replies View Related

Server Utilities :: SQL Loader Comma Delimiter

Dec 22, 2011

I am using sqlloader for loading the data into database by using csv file.My csv file is delimited by comma in that i am having a column which is having the , and line feeds targeted to load into a long data type.for example as below

descri,dfdfdfd,dfdfdf,
sdfsdf,
dfsdfd,

i want to move this column data into a single table column.But due to because of delimited "," it is splitting into number of columns

View 6 Replies View Related

Server Utilities :: DECODE Not Working While Using With SQL Loader?

Sep 18, 2010

I had a requirement of loading flatfile into staging table using SQL Loader, One of the columns in the the Flat file is having values FALSE or TRUE and my requirement is that I load 0 for FALSE and 1 for TRUE which can be achieved by simple DECODE function...I did use decode and tried to load several times but did not work.

INFILE 'sql_4ODS.txt'
BADFILE 'SQL_4ODS.badtxt'
APPEND
INTO TABLE members
FIELDS TERMINATED BY "|"

[code]...

I did try putting a trim as well as SUBSTR but did not work....the cloumn just doent get any values in the output (just null or say free space)

View 5 Replies View Related

Server Utilities :: SQL Loader Is Missing

Feb 4, 2011

I installed oracle 10G complete so I can have everything. But now I cannot run sql loader. I check my oracle devsuitehome directory and I cannot find sqlldr.exe

I need to install sql loader separately? I can't find sql loader installer on web.

View 3 Replies View Related

Server Utilities :: Decode Value For Sqlldr?

May 10, 2011

I am trying to upload attached csv data in below described table.

Name Null? Type
------------ -------- --------------------------

MSISDN VARCHAR2(20)
PREFERENCES VARCHAR2(100)
PHONE_DIG NUMBER

There is some character type and null MSISDN records in csv file. due to this I want 0 in my PHONE_DIG column.

Accroding to attached ctl file i am not able to do that.

View 6 Replies View Related

Server Utilities :: ORA-00907 / Missing Right Parenthesis

Apr 24, 2012

expdp test/test directory=dmpdir dumpfile=wip.dmp logfile=wip.log tables=wip_runcard query=wip_runcard:'"where org_id=51 and time<to_date ('2011-01-01 00:00:00','yyyy-mm-dd hh24:mi:ss') and ship_time is not null and wip_route=999 and used_status=5"'

but error:

ORA-31693: Table data object "TEST"."WIP_RUNCARD" failed to load/unload and is being skipped due to error:
ORA-00907: missing right parenthesis

how to use expdp query paramter with time?

View 6 Replies View Related

Server Utilities :: Rules Missing After Import

Apr 5, 2010

We were trying to refresh the QA database from the production export dump.After import we checked the dba_rules in QA database doesnot show any rule . This seems a reasons for many of the packages get invalidated after import.I checked the production database that have 16 rules defined under dba_rules tables.I am not sure abt the syntax for the creation of rules . Is there any way i can take the backup of rules from PROD or some creation of rule script so that i can create similar rules in QA.

View 2 Replies View Related

Server Utilities :: Export / Import From One Oracle DB To Other - Rows Missing?

May 31, 2011

I am new to Oracle DBA. m facing one problem. i imported and exported my data from one oracle DB to another by using exp/imp.....in both exp/imp log files, its shows the fallowing messages at the end.

"Import terminated successfully with warnings."
"Export terminated successfully with warnings."

but when i count there are some rows missing in some tables...

what could be the cause? is there any other way to cross check whether export/import was successful...

View 2 Replies View Related

Server Utilities :: Missing Objects During Data Pump Import

May 18, 2011

I did the datapump export and import from one schema to a new schema in the same database. I had to use different tablespace. I used the following parameters in the parfiles :

export parfile
directory
dumpfile
logfile
parallel

import parfile
directory
dumpfile
logfile
parallel
remap_schema
remap_tablespace

Tell me whether I need to use different parameters than the one I used? Can I use both remap_schema and remap_tablespace at a time?

View 1 Replies View Related

Server Utilities :: SQL Loader - How To Implement

Jul 7, 2010

SQL Loader - How to implement/Best solution.

I have 3 tables with their columns:
- MASTER_TABLE - MASTER_ID, DATA;
- PARENT_TABLE_A - MASTER_ID, DATA;
- PARENT_TABLE_B - MASTER_ID, DATA.

And the file I need to import has lines like the ones below:

MMMASTER_TABLE1
PAPARENT_TABLE_A1
PBPARENT_TABLE_B1
MMMASTER_TABLE2
PAPARENT_TABLE_A2
PBPARENT_TABLE_B2
MMMASTER_TABLE3
PAPARENT_TABLE_A3
PBPARENT_TABLE_B3

The line means:

- 1 - M or P: indicates which table to insert: MASTER or PARENT;
- 2 - M or A or B: indicates MASTER, PARENT_A, PARENT_B;
- 3:18 - DATA.

Based on the values above, what I need to do is:

1. Load a line to MASTER_TABLE;
2. Load a line to PARENT_TABLE_A pointing to its relative line in MASTER_TABLE;
3. Load a line to PARENT_TABLE_B pointing to its relative line in MASTER_TABLE;
4. In the original file line, there is nothing I can use to join a MASTER line with a PARENT line.

The result would be:
MASTER_ID PARENT_DATA
1 PARENT_TABLE_A1
1 PARENT_TABLE_B1
2 PARENT_TABLE_A2
2 PARENT_TABLE_B2

I tried to use both: SEQUENCE and Sequence.NextVall (CurrVal) but they only work when using ROWS=1 and the file I need to load has millions of rows, so I need direct path loading.Also, I read about External Table, but it does not suit my needs because the Application server is not the same as Database server, which is needed by external tables.

in this case is better load the data to a temporary table and then insert to the other tables, I found almost the same question in the topic pointed by the link below: URL....

View 7 Replies View Related

Server Utilities :: Load WKT Using Sql*loader

Mar 10, 2010

I want to load geometry into a table using sql*loader. My datafile contains geometry defined as WKT URL...., a standard for geometry and also Oracle has a function called sdo_util.from_wktgeometry.If I'm using a separate 'insert into' statement using this function in sql*plus, there's no problem. But if I'm using the same function in my control-file for sql*loader import, I get a sql*loader-418 error: "bad datafile for column geometrie".

Why and how I can import WKT using sql*loader?

-- data file
id;geometrie
1;POINT(120123.123 485345.789)
2;LINESTRING(123456.01 482543.21, 125764.76 483444.11)
3;POLYGON((121121.22 484394.22, 122887.444 484721.48, 122911.098 486382.45, 121005.21 486592.01, 121121.22 484394.22),(121922.56 485333.23, 122010.22 485854.83, 121922.56 485333.23))
4;MULTIPOINT((120586 483958.33),(120635 483726.11))
5;MULTILINESTRING((117948 480284, 118215 481236),(118475 481604, 120462 482822))
6;MULTIPOLYGON(((123678 481948, 124654 485215, 123678 481948),(127321 488321, 124907 483921, 127321 488321)))
[code]....

View 15 Replies View Related

Server Utilities :: To Use SQL Loader In A Procedure

Nov 10, 2011

I want to use SQL loader in a procedure..will it be possible to use it in procedure and if yes then how..?

View 4 Replies View Related

Server Utilities :: SQL Loader With WHEN And DISCARD?

Sep 25, 2012

My data file contains records with RECORD_TYPE '01', '02', '03' and '04' in position (30:31) I use sql loader to load this data into a table. I need to load ONLY rows with RECORD_TYPE ='04'. I have to output all the other rows into a file, so I decided to use DISCARD file. Now, those with RECORD_TYPE ='4' have to be loaded into different columns depending on the value in position (267:268).

So, my ctl file should look something like:

WHEN (30:31) = '04'
into table MYDATA
WHEN (267:268) != 'O '
into table MYDATA
WHEN (267:268) = 'O '

and whatever is not '04' goes to discard file.

I tried to use

into table MYDATA
WHEN (30:31) = '04' and (267:268) != 'O '
into table MYDATA
WHEN (30:31) = '04' and (267:268) = 'O '

but I don't get the right result in terms of the discard file.

Is there any way to put together all these conditions?

View 3 Replies View Related

Server Utilities :: SQL Loader Loads Only 1 Record

Sep 21, 2011

The SQL loader somehow is loading only first record. The data file is a csv and the end of line character is a new line. Some text fields have multiple new lines.

Here is my control file

load data
infile '/home/devo/c0397105/RuleImport/testLoad/dummyLoad.csv'
Truncate
into table DUMMY_LOAD_TABLE
fields terminated by "," optionally enclosed by '"'
( ID "to_number(:ID)",REQUESTED_GROUP,PURPOSE,COMMENTS)
[code]........

We don't have Retail resource type as Dependent System now; the rule will be changed later when Dependent Systems can accept resource types other than application"

View 1 Replies View Related

Server Utilities :: CSV File As Datafile In SQL Loader

Sep 5, 2010

1) can we use a CSV file as a Data file in any format (fixed, delimited...) of Sql loader. I tried, but not succeeded.

2) if not then tell me the reason for it....

3) Also tell me is there any restriction on using the file format for a datafile?

View 18 Replies View Related

Server Utilities :: SQL Loader Number Format

Aug 25, 2011

I have a small problem when I am trying to load data into a table using SQL Loader. The data I am trying to load should be a number, but it is in the format '999,999,999 USD'. When I try to load the data, I am getting an invalid number error, due to the USD (I have already accounted for the thousands seperators). My question is, how can I load the data as a number with USD in the format?

Sample Data(testfile.dat):

sample1, "342,2343,543 USD"
sample2, "564,324,465 USD"
sample3, "534,753,213 USD"
[code]....

View 4 Replies View Related

Server Utilities :: SQL Loader TRIM In WHEN Clause?

Apr 9, 2012

My control file is :

LOAD DATA
APPEND
INTO TABLE IPGITLREDATA WHEN ITL_REC_TYPE = 'D'
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(

[code].....

The data file might have a value of " D " instead of "D" for ITL_REC_TYPE and ITL_REC_TYPE is in the WHEN clause. How can I check for the trimmed value of ITL_REC_TYPE in the WHEN clause ?

View 5 Replies View Related

Server Utilities :: Count Of Data In Sql Loader?

Aug 3, 2012

I want to populate totale number of record in the file. Usually i get 10000 records per file and i load them using sql loader.I want to also insert the number of records in file while loading the data in table.

How can i achive it.

structure of control file is

load data
BADFILE '/backup/temp/rajesh/RIO/BadFiles/FILENAME'
append into table ERS_RIO_SRC
TRAILING NULLCOLS
(
INSTALLATION_ID CHAR

[code]...

data

V5_RIO_5K7C|78967|172.16.43.153|RioLoginSrc.asp|0.375|01/08/2012 07:44:44.623|01/08/2012 07:44:45.000|V5_RIO_5K7C||||||||||
V5_RIO_5K7C|78968|172.16.43.150|RioLoginSrc.asp|0.187|01/08/2012 08:22:32.813|01/08/2012 08:22:33.000|V5_RIO_5K7C||||||||||

[code]...

table structure

CREATE TABLE ERS_RIO_SRC
(
INSTALLATION_ID VARCHAR2(50 BYTE) NULL,
TRANSACTION_ID VARCHAR2(50 BYTE) NULL,
SERVER_ID VARCHAR2(50 BYTE) NULL,
CLINICAL_TRANSACTION_ID VARCHAR2(255 BYTE) NULL,

[code]...

View 4 Replies View Related

Server Utilities :: Tuning SQL Loader Process

Jun 17, 2010

I have loaded 14324590 rows into target tables using sql*loader.I used below consideration during the load process.

1) direct=true,parllel=true
2) unrecoverable
3) disable all indexes and triggers.

But, sql loader takes 21 minutes to load 14324590 rows in database? tuning sql loader process? we cannot change data file because it has given by client.

View 2 Replies View Related

Server Utilities :: Table Creation - SQL Loader?

Aug 2, 2010

Check table creation script

CREATE TABLE "SCOTT"."TEST_USER"
("TX_SID" VARCHAR2(30 BYTE) NOT NULL ENABLE,
"TX_FIRST_NAME" VARCHAR2(30 BYTE) NOT NULL ENABLE,
"TX_LAST_NAME" VARCHAR2(30 BYTE) NOT NULL ENABLE,

[code]...

Here i'm loading data into these three tables through sql loader. Here is the control file

OPTIONS (SKIP=1,ROWS=5)
LOAD DATA
INFILE 'C:SQL LOADER DEMO estuser_data_lat.csv'
INTO TABLE TEST_USER

[code]...

Here are the two function which i'm calling from sql loader control file

CREATE OR REPLACE FUNCTION get_role_id(p_role_name VARCHAR2)
RETURN NUMBER IS
lv_role_id NUMBER;
BEGIN

[code]..

i'hv attached the testuser_data_lat.csv file, which is the data file.Command line

C:SQL LOADER DEMO>SQLLDR scott/sc CONTROL=rd_users_control.ctl

Now let me tell u what is happening Whem i'm running the above sqlldr, log is generating saying

Record 1: Rejected - Error on table TEST_ROLE, column ID_ROLE.
ORA-01400: cannot insert NULL into ("SCOTT"."TEST_ROLE"."ID_ROLE")
Record 2: Rejected - Error on table TEST_ROLE, column ID_ROLE.
ORA-01400: cannot insert NULL into ("SCOTT"."TEST_ROLE"."ID_ROLE")

[code]...

But when i remove

INTO TABLE TEST_ROLE(
TX_SID POSITION(1:3) CHAR,
ID_ROLE "get_role_id(:ROLE_NAME)" ,
TX_CREATED_BY CONSTANT "SYSTEM",

[code]...

from Control file, data is getting popupalated in TEST_USER and TEST_TITLE similarly if remove

INTO TABLE TEST_TITLE(
TX_SID POSITION(1:3) CHAR,
ID_TITLE "get_title_id(:TITLE_NAME)" ,

[code]...

from Control file, TEST_USER and TEST_ROLE is getting populated.

Here RD_ROLE_MASTER script

CREATE TABLE RD_ROLE_MASTER (
"ID_ROLE" NUMBER(38,0) NOT NULL ENABLE,
"TX_ROLE_NAME" VARCHAR2(20 BYTE) NOT NULL ENABLE

[code]...

Here is RD_TITLE_MASTER script
CREATE TABLE RD_TITLE_MASTER(
"ID_TITLE" NUMBER(38,0) NOT NULL ENABLE,
"TX_TITLE_NAME" VARCHAR2(25 BYTE) NOT NULL ENABLE);

Insert into RD_TITLE_MASTER (ID_TITLE,TX_TITLE_NAME) values (7,'RED_LOB_ESCALATION_L1'); what is the problem?

View 1 Replies View Related

Server Utilities :: Loading Data Using SQL Loader

Oct 15, 2010

I have a problem with loading data using SQL loader.I have such control file

LOAD DATA
INFILE 'D:oracleFIRMAS.txt'
INSERT INTO TABLE FIRMAS
FIELDS TERMINATED BY ","
(FIRMAS_REG_NR char,FIRMAS_NOS char,ID_PRODUCT char)

and data file "firmas.txt"
444557562, Avotoni SIA, 1332
445575627, Avotoni SIA, 1332
444557562, Avotoni SIA, 1332

When I try to execut this command
sqlldr userid=system/a1331 control=d:oraclefirmas.ctrl an error occured (sql*loader-350) what should I do?

View 16 Replies View Related

Server Utilities :: Load To A Table Through Sql*loader

Apr 6, 2010

I Have one csv file.i want to load to a table trough sql*loader.but in table 3 column is there.but in the csv file some record hav one semicolumn in last filed like this

1234;"hogit";78887;89
4567;"rtef";12565;89

how can we load...

View 6 Replies View Related

Server Utilities :: Trunc Function In SQL Loader

Aug 6, 2012

I am using trunc(sysdate) to load only date in a column and it is coming out with error.

SQL*Loader-350: Syntax error at line 44.
Expecting valid column specification, "," or ")", found "trunc".
DATE_LOADED trunc(SYSDATE)

View 2 Replies View Related

Server Utilities :: Call Sequence In Sql Loader?

May 18, 2012

I have to load data from sql loader in a table and the table has got a varchar2 column which accept data from sequence.the expression would be.

TRANSACTION_ID "'AUTO-'||To_Char(prt_trs_id_seq.nextval)"

TRANSACTION_ID is the column name.

When i add this expression the loader doesn't work, when i remove it works and load null for this column and valid data with other column.

View 2 Replies View Related

Server Utilities :: Checking Column Value In SQL Loader?

Jul 12, 2011

My requirement is to load the data from feed file into two tables based on the value of a column in feed file.

say column in feed file is "Activity_Value" . If the Activity_value is 10, the data from feed file should be loaded into Table A and If the Activity Value is 20 the data from feed file should be loaded into Table B.

View 3 Replies View Related

Server Utilities :: SQL Loader Error Message?

Oct 6, 2000

When I try to load a .TXT file into an Oracle table, the following message is given at the command prompt;

SQL*Loader-524: partial record found at end of datafile

and the load is not successful. The control file is as follows;

Load Data
INFILE 'c:spledlsubj.txt'
APPEND
INTO TABLE tblSubjectiveCode

[code]...

Could the .TXT file causing any problems ?

View 7 Replies View Related

Server Utilities :: SQL Loader REG - Number Values?

Jan 2, 2011

we have to load some serious amount of data into an oracle database. We have extracted data out of another database and the number format for negative values is e.g. 50.00- / Positive values doesn't have a plus in e.g. its 50.00.

Is there a way to format the 50.00- to like -50.00 during the load with SQL loader? I was thinking of a regular expression?

View 8 Replies View Related

Server Utilities :: Import Performance Using Sql Loader

Apr 6, 2010

I have a text file of 175G with the delimeter as '|*'. I want to import it using sql *loader. I know that sql *loader can load data parallely. I can employ two schemes for importing it using sql *loader

a) with the text file being imported all at once using option parallel = true
b) with the single text file being broken down into files of smaller size(say 5G each or more) and then imported in parallel using parallel = true.

I can import it in somewhat powerful server with 128G of ram, 16 intel CPus and abundant hard disk space.Now my question is which option would be better in performance (in terms of time) it takes to import data?I donot have sufficient time to test both of these approaches.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved