Error loading data using SQL loader

I get an error message like "SQL * Loader - 350 combination illegal syntax of non-alphanumeriques characters error during loading of a file using SQL loader in RHEL." The command used to run SQL * Loader is:

Sqlldr userid = < user name > / < password > control = data.ctl

The control file is data.ctl:

DOWNLOAD the data

INFILE ' / home/oraprod/data.txt'

Add in the table test

{

EmpID completed by «,»,

fname completed by «,»,

lname completed by «,»,

treatment is completed with a white space

}

The data.txt file is:

1, Kaushal, Hamad, 5000

2, Chetan, Hamad, 1000

Hopefully, my question is clear.

Please get back with the answer to my query.

Concerning

Replace "{" by "("dans votre fichier de contrôle) "

DOWNLOAD the data

INFILE 'c:\data.txt.

Add the emp_t table

(

EmpID completed by «,»,

fname completed by «,»,

lname completed by «,»,

treatment is completed with a white space

)

C:\>sqlldr user/pwd@database control = c.ctl

SQL * Loader: release 10.2.0.3.0 - Production on Wed Nov 13 10:10:24 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Commit the point reached - the number of logical records 1

Commit the point reached - the number of logical records 2

SQL > select * from emp_t;

EMPID, FNAME LNAME SALARY

---------- -------------------- -------------------- ----------

1 kone hamadi 5000

2 Chetan Hamad 1000

Best regards

Mohamed Houri

Tags: Database

Similar Questions

  • How to view clob data using sql

    Hello

    In our database we have a table that is to have a column of type CLOB but now I want to display the data using sql select query but it throws error: "unsupported data Type.

    Could someone let me know how to view the clob data using the select query.

    Oracle DB version: 10.2.0.3

    Thank you

    user562223 wrote:
    Hello

    In our database we have a table that is to have a column of type CLOB but now I want to display the data using sql select query but it throws error: "unsupported data Type.

    Could someone let me know how to view the clob data using the select query.

    Oracle DB version: 10.2.0.3

    Thank you

    Usually a to_char (CLOBDFIELD) circled

    HTH,

    FJFranken

  • Question to load data using sql loader in staging table, and then in the main tables!

    Hello

    I'm trying to load data into our main database table using SQL LOADER. data will be provided in separate pipes csv files.

    I have develop a shell script to load the data and it works fine except one thing.

    Here are the details of a data to re-create the problem.

    Staging of the structure of the table in which data will be filled using sql loader

    create table stg_cmts_data (cmts_token varchar2 (30), CMTS_IP varchar2 (20));

    create table stg_link_data (dhcp_token varchar2 (30), cmts_to_add varchar2 (200));

    create table stg_dhcp_data (dhcp_token varchar2 (30), DHCP_IP varchar2 (20));

    DATA in the csv file-

    for stg_cmts_data-

    cmts_map_03092015_1.csv

    WNLB-CMTS-01-1. 10.15.0.1

    WNLB-CMTS-02-2 | 10.15.16.1

    WNLB-CMTS-03-3. 10.15.48.1

    WNLB-CMTS-04-4. 10.15.80.1

    WNLB-CMTS-05-5. 10.15.96.1

    for stg_dhcp_data-

    dhcp_map_03092015_1.csv

    DHCP-1-1-1. 10.25.23.10, 25.26.14.01

    DHCP-1-1-2. 56.25.111.25, 100.25.2.01

    DHCP-1-1-3. 25.255.3.01, 89.20.147.258

    DHCP-1-1-4. 10.25.26.36, 200.32.58.69

    DHCP-1-1-5 | 80.25.47.369, 60.258.14.10

    for stg_link_data

    cmts_dhcp_link_map_0309151623_1.csv

    DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2

    DHCP-1-1-2. WNLB-CMTS-03-3,WNLB-CMTS-04-4,WNLB-CMTS-05-5

    DHCP-1-1-3. WNLB-CMTS-01-1

    DHCP-1-1-4. WNLB-CMTS-05-8,WNLB-CMTS-05-6,WNLB-CMTS-05-0,WNLB-CMTS-03-3

    DHCP-1-1-5 | WNLB-CMTS-02-2,WNLB-CMTS-04-4,WNLB-CMTS-05-7

    WNLB-DHCP-1-13 | WNLB-CMTS-02-2

    Now, after loading these data in the staging of table I have to fill the main database table

    create table subntwk (subntwk_nm varchar2 (20), subntwk_ip varchar2 (30));

    create table link (link_nm varchar2 (50));

    SQL scripts that I created to load data is like.

    coil load_cmts.log

    Set serveroutput on

    DECLARE

    CURSOR c_stg_cmts IS SELECT *.

    OF stg_cmts_data;

    TYPE t_stg_cmts IS TABLE OF stg_cmts_data % ROWTYPE INDEX BY pls_integer;

    l_stg_cmts t_stg_cmts;

    l_cmts_cnt NUMBER;

    l_cnt NUMBER;

    NUMBER of l_cnt_1;

    BEGIN

    OPEN c_stg_cmts.

    Get the c_stg_cmts COLLECT in BULK IN l_stg_cmts;

    BECAUSE me IN l_stg_cmts. FIRST... l_stg_cmts. LAST

    LOOP

    SELECT COUNT (1)

    IN l_cmts_cnt

    OF subntwk

    WHERE subntwk_nm = l_stg_cmts (i) .cmts_token;

    IF l_cmts_cnt < 1 THEN

    INSERT

    IN SUBNTWK

    (

    subntwk_nm

    )

    VALUES

    (

    l_stg_cmts (i) .cmts_token

    );

    DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_cmts (i) .cmts_token);

    ON THE OTHER

    DBMS_OUTPUT. Put_line ("token is already present'");

    END IF;

    WHEN l_stg_cmts EXIT. COUNT = 0;

    END LOOP;

    commit;

    EXCEPTION

    WHILE OTHERS THEN

    Dbms_output.put_line ('ERROR' |) SQLERRM);

    END;

    /

    output

    for dhcp


    coil load_dhcp.log

    Set serveroutput on

    DECLARE

    CURSOR c_stg_dhcp IS SELECT *.

    OF stg_dhcp_data;

    TYPE t_stg_dhcp IS TABLE OF stg_dhcp_data % ROWTYPE INDEX BY pls_integer;

    l_stg_dhcp t_stg_dhcp;

    l_dhcp_cnt NUMBER;

    l_cnt NUMBER;

    NUMBER of l_cnt_1;

    BEGIN

    OPEN c_stg_dhcp.

    Get the c_stg_dhcp COLLECT in BULK IN l_stg_dhcp;

    BECAUSE me IN l_stg_dhcp. FIRST... l_stg_dhcp. LAST

    LOOP

    SELECT COUNT (1)

    IN l_dhcp_cnt

    OF subntwk

    WHERE subntwk_nm = l_stg_dhcp (i) .dhcp_token;

    IF l_dhcp_cnt < 1 THEN

    INSERT

    IN SUBNTWK

    (

    subntwk_nm

    )

    VALUES

    (

    l_stg_dhcp (i) .dhcp_token

    );

    DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_dhcp (i) .dhcp_token);

    ON THE OTHER

    DBMS_OUTPUT. Put_line ("token is already present'");

    END IF;

    WHEN l_stg_dhcp EXIT. COUNT = 0;

    END LOOP;

    commit;

    EXCEPTION

    WHILE OTHERS THEN

    Dbms_output.put_line ('ERROR' |) SQLERRM);

    END;

    /

    output

    for link -.

    coil load_link.log

    Set serveroutput on

    DECLARE

    l_cmts_1 VARCHAR2 (4000 CHAR);

    l_cmts_add VARCHAR2 (200 CHAR);

    l_dhcp_cnt NUMBER;

    l_cmts_cnt NUMBER;

    l_link_cnt NUMBER;

    l_add_link_nm VARCHAR2 (200 CHAR);

    BEGIN

    FOR (IN) r

    SELECT dhcp_token, cmts_to_add | ',' cmts_add

    OF stg_link_data

    )

    LOOP

    l_cmts_1: = r.cmts_add;

    l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));

    SELECT COUNT (1)

    IN l_dhcp_cnt

    OF subntwk

    WHERE subntwk_nm = r.dhcp_token;

    IF l_dhcp_cnt = 0 THEN

    DBMS_OUTPUT. Put_line ("device not found: ' |") r.dhcp_token);

    ON THE OTHER

    While l_cmts_add IS NOT NULL

    LOOP

    l_add_link_nm: = r.dhcp_token |' _TO_' | l_cmts_add;

    SELECT COUNT (1)

    IN l_cmts_cnt

    OF subntwk

    WHERE subntwk_nm = TRIM (l_cmts_add);

    SELECT COUNT (1)

    IN l_link_cnt

    LINK

    WHERE link_nm = l_add_link_nm;

    IF l_cmts_cnt > 0 AND l_link_cnt = 0 THEN

    INSERT INTO link (link_nm)

    VALUES (l_add_link_nm);

    DBMS_OUTPUT. Put_line (l_add_link_nm |) » '||' Has been added. ") ;

    ELSIF l_link_cnt > 0 THEN

    DBMS_OUTPUT. Put_line (' link is already present: ' | l_add_link_nm);

    ELSIF l_cmts_cnt = 0 then

    DBMS_OUTPUT. Put_line (' no. CMTS FOUND for device to create the link: ' | l_cmts_add);

    END IF;

    l_cmts_1: = TRIM (SUBSTR (l_cmts_1, INSTR (l_cmts_1, ',') + 1));

    l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));

    END LOOP;

    END IF;

    END LOOP;

    COMMIT;

    EXCEPTION

    WHILE OTHERS THEN

    Dbms_output.put_line ('ERROR' |) SQLERRM);

    END;

    /

    output

    control files -

    DOWNLOAD THE DATA

    INFILE 'cmts_data.csv '.

    ADD

    IN THE STG_CMTS_DATA TABLE

    When (cmts_token! = ") AND (cmts_token! = 'NULL') AND (cmts_token! = 'null')

    and (cmts_ip! = ") AND (cmts_ip! = 'NULL') AND (cmts_ip! = 'null')

    FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    ('RTRIM (LTRIM (:cmts_token))' cmts_token,

    cmts_ip ' RTRIM (LTRIM(:cmts_ip)) ")". "

    for dhcp.


    DOWNLOAD THE DATA

    INFILE 'dhcp_data.csv '.

    ADD

    IN THE STG_DHCP_DATA TABLE

    When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')

    and (dhcp_ip! = ") AND (dhcp_ip! = 'NULL') AND (dhcp_ip! = 'null')

    FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    ('RTRIM (LTRIM (:dhcp_token))' dhcp_token,

    dhcp_ip ' RTRIM (LTRIM(:dhcp_ip)) ")". "

    for link -.

    DOWNLOAD THE DATA

    INFILE 'link_data.csv '.

    ADD

    IN THE STG_LINK_DATA TABLE

    When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')

    and (cmts_to_add! = ") AND (cmts_to_add! = 'NULL') AND (cmts_to_add! = 'null')

    FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "

    TRAILING NULLCOLS

    ('RTRIM (LTRIM (:dhcp_token))' dhcp_token,

    cmts_to_add TANK (4000) RTRIM (LTRIM(:cmts_to_add)) ")" ""

    SHELL SCRIPT-

    If [!-d / log]

    then

    Mkdir log

    FI

    If [!-d / finished]

    then

    mkdir makes

    FI

    If [!-d / bad]

    then

    bad mkdir

    FI

    nohup time sqlldr username/password@SID CONTROL = load_cmts_data.ctl LOG = log/ldr_cmts_data.log = log/ldr_cmts_data.bad DISCARD log/ldr_cmts_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &

    nohup time username/password@SID @load_cmts.sql

    nohup time sqlldr username/password@SID CONTROL = load_dhcp_data.ctl LOG = log/ldr_dhcp_data.log = log/ldr_dhcp_data.bad DISCARD log/ldr_dhcp_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &

    time nohup sqlplus username/password@SID @load_dhcp.sql

    nohup time sqlldr username/password@SID CONTROL = load_link_data.ctl LOG = log/ldr_link_data.log = log/ldr_link_data.bad DISCARD log/ldr_link_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &

    time nohup sqlplus username/password@SID @load_link.sql

    MV *.log. / log

    If the problem I encounter is here for loading data in the link table that I check if DHCP is present in the subntwk table, then continue to another mistake of the newspaper. If CMTS then left create link to another error in the newspaper.

    Now that we can here multiple CMTS are associated with unique DHCP.

    So here in the table links to create the link, but for the last iteration of the loop, where I get separated by commas separate CMTS table stg_link_data it gives me log as not found CMTS.

    for example

    DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2

    Here, I guess to link the dhcp-1-1-1 with balancing-CMTS-01-1 and wnlb-CMTS-02-2

    Theses all the data present in the subntwk table, but still it gives me journal wnlb-CMTS-02-2 could not be FOUND, but we have already loaded into the subntwk table.

    same thing is happening with all the CMTS table stg_link_data who are in the last (I think here you got what I'm trying to explain).

    But when I run the SQL scripts in the SQL Developer separately then it inserts all valid links in the table of links.

    Here, she should create 9 lines in the table of links, whereas now he creates only 5 rows.

    I use COMMIT in my script also but it only does not help me.

    Run these scripts in your machine let me know if you also get the same behavior I get.

    and please give me a solution I tried many thing from yesterday, but it's always the same.

    It is the table of link log

    link is already present: dhcp-1-1-1_TO_wnlb-cmts-01-1

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-02-2

    link is already present: dhcp-1-1-2_TO_wnlb-cmts-03-3
    link is already present: dhcp-1-1-2_TO_wnlb-cmts-04-4

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-5

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-01-1

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-8
    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-6
    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-0

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-03-3

    link is already present: dhcp-1-1-5_TO_wnlb-cmts-02-2
    link is already present: dhcp-1-1-5_TO_wnlb-cmts-04-4

    NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-7

    Device not found: wnlb-dhcp-1-13

    IF NEED MORE INFORMATION PLEASE LET ME KNOW

    Thank you

    I felt later in the night that during the loading in the staging table using UNIX machine he created the new line for each line. That is why the last CMTS is not found, for this I use the UNIX 2 BACK conversion and it starts to work perfectly.

    It was the dos2unix error!

    Thank you all for your interest and I may learn new things, as I have almost 10 months of experience in (PLSQL, SQL)

  • Logic to find particular weekdays after a given date, using SQL

    Hello Experts,

    Version: Oracle 11G

    Could you please help me with logic to find a day of special week after a date in SQL
    For example, I need to know the first Friday after today's date.

    Thank you for your help.

    I hope that under query will be useful for you.

    SELECT NEXT_DAY(SYSDATE,'FRIDAY') "NEXT DAY"
    FROM DUAL
    
    Output:
    
            NEXT DAY
         2/24/2012 12:06:48 PM
    
  • To change the way of afficherdans the data using SQL

    I have data as follows:

    Name age
    Tom 24
    Harry 45
    Mona 30


    I want to convert these data in the way below

    Name1, name2 Age1 Age2 Name3 3
    24 45 30 Mona Harry Tom



    How can I do the same thing using SQL?

    Why not try to search this forum of 'PIVOT' to make this small change yourself?

    SQL> set line 1000
    SQL> WITH t AS (SELECT 101 empid,45 marks,8 rank FROM dual UNION ALL
      2             SELECT 101 empid,62 marks,7 FROM dual UNION ALL
      3             SELECT 101 empid,80 marks,2 FROM dual UNION ALL
      4             SELECT 102 empid,67 marks,5 FROM dual UNION ALL
      5             SELECT 102 empid,56 marks,6 FROM dual UNION ALL
      6             SELECT 103 empid,87 marks,7 FROM dual UNION ALL
      7             SELECT 103 empid,55 marks,9 FROM dual UNION ALL
      8             SELECT 103 empid,60 marks,6 FROM dual UNION ALL
      9             SELECT 103 empid,70 marks,3 FROM dual
     10             )
     11  ---End of Sample Data
     12  ---Now the original query.
     13  SELECT empid, MAX(DECODE(rn1,1,marks)) Marks1,MAX(DECODE(rn1,1,rank)) Rank1
     14              , MAX(DECODE(rn1,2,marks)) Marks2,MAX(DECODE(rn1,2,rank)) Rank2
     15              , MAX(DECODE(rn1,3,marks)) Marks3,MAX(DECODE(rn1,3,rank)) Rank3
     16              , MAX(DECODE(rn1,4,marks)) Marks4,MAX(DECODE(rn1,4,rank)) Rank4
     17  FROM
     18     (SELECT empid,marks,rank,
     19      ROW_NUMBER() OVER(PARTITION BY empid ORDER BY marks) rn1
     20      FROM t)
     21  GROUP BY empid;
    
         EMPID     MARKS1      RANK1     MARKS2      RANK2     MARKS3      RANK3     MARKS4      RANK4
    ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
           101         45          8         62          7         80          2
           102         56          6         67          5
           103         55          9         60          6         70          3         87          7
    
    SQL> 
    
  • Importing data using SQL loader.

    Hi all

    I'm trying to import data from a txt file. I have created a CTL and the bat which I include below.

    CTL file
    LOAD DATA
    TRUNCATE
    INTO TABLE danint.VOIP
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS
    ( destination             INTEGER EXTERNAL
      destination_group       INTEGER EXTERNAL
      country                 CHAR,
      description             CHAR,
      off_peak_period         INTEGER EXTERNAL
      first_interval          INTEGER EXTERNAL
      next_interval           FLOAT EXTERNAL,
      first_price             DECIMAL EXTERNAL
      next_price              DECIMAL EXTERNAL
      off_peak_first_interval DECIMAL EXTERNAL
      off_peak_next_interval  DECIMAL EXTERNAL
      off_peak_first_price    DECIMAL EXTERNAL
      payback_rate            DECIMAL EXTERNAL
      forbidden               INTEGER EXTERNAL
      hidden                  INTEGER EXTERNAL
      discontinued            INTEGER EXTERNAL
      effective_from          DATE 'DD/MM/YYYY',
      formula                 INTEGER EXTERNAL
      report_date             DATE 'DD/MM/YYYY'
    )
    DATA
    995,,GEORGIA,Proper,,1,1,0.0795,0.0795,1,1,0.0795,0.0795
    995122,,GEORGIA,Sukhumi proper,,1,1,0.0795,0.0795,1,1,0.0795,0.0795
    9953,,GEORGIA,proper other,,1,1,0.0795,0.0795,1,1,0.0795,0.0795
    99532,,GEORGIA,Tblisi,,1,1,0.0668,0.0668,1,1,0.0668,0.0668
    9953226,,GEORGIA,Mobile Others,,1,1,0.0795,0.0795,1,1,0.0795,0.0795
    9953297,,GEORGIA,Tbilisi city,,1,1,0.0795,0.0795,1,1,0.0795,0.0795
    99544,,GEORGIA,Abkhazia,,1,1,0.3,0.3,1,1,0.3,0.3
    99555,,GEORGIA,Mobile Geocell,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99557,,GEORGIA,Mobile Geocell,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99558,,GEORGIA,Mobile Geocell,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99571,,GEORGIA,Mobile Others,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99574,,GEORGIA,Mobile Others,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99577,,GEORGIA,Mobile,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99577,,GEORGIA,Mobile,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99579,,GEORGIA,Mobile Others,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    9959,,GEORGIA,Mobile,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99593,,GEORGIA,Mobile,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99597,,GEORGIA,Mobile,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    99599,,GEORGIA,Mobile,,1,1,0.1528,0.1528,1,1,0.1528,0.1528
    30,,GREECE,Proper,,1,1,0.019,0.019,1,1,0.019,0.019
    BAT FILE
    REM LOADING VOIP Prices
    sqlldr system/manager@test control=C:\Library\Control\VOIP.CTL data=C:\Library\Data\VOIP.txt log=C:\Library\Log\VOIP.log rows=10000
    PAUSE
    TABLE
    -- Create table
    create table VOIP
    (
      destination             NUMBER,
      destination_group       NUMBER,
      country                 VARCHAR2(65),
      description             VARCHAR2(60),
      off_peak_period         NUMBER,
      first_interval          NUMBER,
      next_interval           NUMBER,
      first_price             NUMBER,
      next_price              NUMBER,
      off_peak_first_interval NUMBER,
      off_peak_next_interval  NUMBER,
      off_peak_first_price    NUMBER,
      off_peak_next_price     NUMBER,
      payback_rate            NUMBER,
      forbidden               NUMBER,
      hidden                  NUMBER,
      discontinued            NUMBER,
      effective_from          DATE,
      formula                 NUMBER,
      report_date             DATE
    )
    tablespace TEST
      pctfree 10
      initrans 1
      maxtrans 255
      storage
      (
        initial 560M
        next 1M
        minextents 1
        maxextents unlimited
      );
    I get the following error message, but the message seems meaningless, as the comma are in fact. Any ideas?


    ORA-28002: the password will expire in 6 days
    SQL * Loader-350: error of syntax in line 7.
    Expected ', 'or') ', found 'destination_group '.
    destination_group INTEGER EXTERNAL

    You are missing commas in the CTL file

    HTH
    Srini

  • user input windows OS when loading data using sql loader

    Hello
    I have the oracle 11g Linux database.
    I have excel sheets with data that must be loaded into the database.
    I have oracle running on my windows client11g.

    When I or anyone else is running the load sql script to load the data, I need to capture the user OS (the one that runs the script of their windows login) and pass it via the sql loader and insert into the table as a column value outside the columns in the excel sheet.

    I think that this could be a very simple solution, I did some research but not just anywhere.
    Can someone guide me on this.

    Thanks in advance.
    Philip.

    Well, I built this example on the fly to show the answer. But it is based on documentation and previous experience with sql * loader or sys_context.

    SQL * Loader Control File Reference
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16536/ldr_control_file.htm#SUTIL005

    SQL * Loader field list reference
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16536/ldr_field_list.htm

    SQL - SYS_CONTEXT language reference
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/functions184.htm#SQLRF06117

    This forum is a good source of examples, as well as asktom.oracle.com

  • Recovering data using SQL SERVER

    Hello
    We migrated an environment where Oracle has been store relational data, to one where it is SQLSERVER. I'm trying to load the relational source data into Essbase using rule files. (Nothing fancy) We are on 11.1.2.1

    My rule file Essbase, which in SQL embedded in it, returns the numeric columns apparently valid, but rejects essbase each records as if the numerical value was a value of text, for example, he says "Member 12345.67890' not found.


    View SQL SERVER sets the numeric columns (Numeric (38.5), null).

    Someone at - he met before & can help?

    Thank you

    You must validate your definition of the rule of load, something pushed and charge State treats the data as members of a dimension column.

  • Extract data using SQL Expression

    Hello, I created an intermediate table and just realized that I need some new additional fields.
    Should I create them in the scene or in the target table?

    I want to use the SQL COUNT expression to fill these new data sources published, fields
    but do not know exactly how do. I'm a little amateur.

    Thank you.

    You should check the analytical functions:

    http://www.orafaq.com/node/55

  • Select quarterly data using SQL

    All-

    The database version that I use is 10.2.0.4.0

    This is probably simple, but for the life of me, I can't understand it. I have a table of approximately 200 Codes and a table that contains millions of records that are obliterated (data are from 1995 to sysdate). I need a query for a view to be used in a report that will show you the different codes used by the employee for specific areas based on a date parameter. If they have no data for this quarter I want to still show the quarter show 0 for the number.

    I created this simple example. If I see someone how I can integrate this logic in what I do.

    SQL for the test data:
    create the table bunch_of_codes
    (id_code number (12) primary key,)
    Description varchar2 (10));

    insert into bunch_of_codes
    values (1, 'APPLE');

    insert into bunch_of_codes
    values (2, 'ORANGE');

    insert into bunch_of_codes
    values (3, 'GRAPE');

    create the table bunch_of_data
    (id_code, number (12),)
    date of activity_date,
    CONSTRAINT data_id_code
    FOREIGN KEY (id_code) REFERENCES bunch_of_codes (id_code));

    INSERT INTO bunch_of_data
    VALUES (1, to_date('4/12/2011','MM/DD/YYYY'));

    INSERT INTO bunch_of_data
    VALUES (1, to_date('6/1/2011','MM/DD/YYYY'));

    INSERT INTO bunch_of_data
    VALUES (3, to_date('1/15/2011','MM/DD/YYYY'));

    INSERT INTO bunch_of_data
    VALUES (3, to_date('4/17/2011','MM/DD/YYYY'));

    INSERT INTO bunch_of_data
    VALUES (3, to_date('11/11/2011','MM/DD/YYYY'));

    COMMIT;

    What I see when I run the SQL statement is:
    DESCRIPTION QUARTER COUNTY
    ----------- ------- -----
    APPLE 1 0
    2 2 APPLE
    APPLE 3 0
    APPLE 4 0
    1 1 GRAPE
    1 2 GRAPES
    GRAPES 3 0
    4 1 GRAPE
    ORANGE 1 0
    ORANGE 2-0
    ORANGE 3 0
    ORANGE 4 0

    I need each printed code without worrying if it was not used. If it has not been used, I want to still see each quarter but show 0 for count.

    For this example, I can run this SQL to join the data:
    Select c.description,
    to_char(d.activity_date,'Q') quarter,
    Count County (d.id_code)
    of bunch_of_codes c,.
    bunch_of_data d
    where c.id_code = d.id_code
    C.description group, to_char(d.activity_date,'Q')
    order of description, quarter

    But if it is not no matter how much detail for the quarter then I don't get a row of data. I tried all sorts of things, but nothing seems to work.

    Please help if you have any ideas.

    Hi MLBrown,

    Here's a query that gives what you asked.
    Note: My table bunch_of_data has three lines that you have published, more a fourth line (the activity_date of this row is April 12, 2010, in the format DD-MON-YYYY).
    To account for the response you gave to the question of Etbin, a column Y (for data year) is included in the output. In this output, there is for the year, Q for the quarter and the total for the count.

    SQL> select * from bunch_of_codes;
    
       ID_CODE DESCRIPTION
    ---------- -----------
             1 APPLE
             2 ORANGE
             3 GRAPE
    
    SQL> select * from bunch_of_data;
    
       ID_CODE ACTIVITY_DATE
    ---------- ---------------
             1 12-APR-2010
             1 12-APR-2011
             1 01-JUN-2011
             3 15-JAN-2011
             3 17-APR-2011
             3 11-NOV-2011
    
    6 rows selected.
    
    SQL> with a as(select mi + level - 1 as y
      2            from (select min(extract(year from activity_date)) mi,
      3                         max(extract(year from activity_date)) ma
      4                         from bunch_of_data
      5                 )
      6           connect by level <= ma - mi + 1
      7            ),
      8       qt as(select '1' q from   dual
      9            union all
     10            select '2' from dual
     11            union all
     12            select '3' from dual
     13            union all
     14            select '4' from dual),
     15       allt as(select b.id_code,b.description,a.y, qt.q  as q
     16              from   bunch_of_codes b,a,qt
     17              ),
     18       temp as(select id_code,y,q,count(1) co
     19      from (select bd.id_code,extract(year from bd.activity_date) y,
     20                   to_char(bd.activity_date,'Q') q
     21      from   bunch_of_data bd)
     22      group by id_code, y,q)
     23      select allt.id_code,allt.description,allt.y,allt.q,nvl(co,0) total
     24      from allt,temp
     25      where allt.id_code =temp.id_code(+)
     26            and  allt.y=temp.y(+)
     27            and allt.q=temp.q(+)
     28      order by allt.id_code, allt.y, allt.q;
    
       ID_CODE DESCRIPTION          Y Q      TOTAL
    ---------- ----------- ---------- - ----------
             1 APPLE             2010 1          0
             1 APPLE             2010 2          1
             1 APPLE             2010 3          0
             1 APPLE             2010 4          0
             1 APPLE             2011 1          0
             1 APPLE             2011 2          2
             1 APPLE             2011 3          0
             1 APPLE             2011 4          0
             2 ORANGE            2010 1          0
             2 ORANGE            2010 2          0
             2 ORANGE            2010 3          0
    
       ID_CODE DESCRIPTION          Y Q      TOTAL
    ---------- ----------- ---------- - ----------
             2 ORANGE            2010 4          0
             2 ORANGE            2011 1          0
             2 ORANGE            2011 2          0
             2 ORANGE            2011 3          0
             2 ORANGE            2011 4          0
             3 GRAPE             2010 1          0
             3 GRAPE             2010 2          0
             3 GRAPE             2010 3          0
             3 GRAPE             2010 4          0
             3 GRAPE             2011 1          1
             3 GRAPE             2011 2          1
    
       ID_CODE DESCRIPTION          Y Q      TOTAL
    ---------- ----------- ---------- - ----------
             3 GRAPE             2011 3          0
             3 GRAPE             2011 4          1
    
    24 rows selected.
    
    SQL>
    

    Edited by: Manguilibe Jan 28 KAO. 2012 01:06

  • Support for copying data using sql

    Hello
    I want to fill the data in a table in a way
    EID     ENAME     EADDRESS     ESALARY     EDEPARTMENT     MANAGER_ID
    
    101     Pankaj Saxena     New Delhi     2000     IT     
    102     Sanjay Singh     New Delhi     2000     IT     101
    103     Dhiraj Tuteja     Kanpur     3000     NONIT     101
    104     Nitin Grover     New Delhi     4000     IT     102
    105     Juhi Agarwal     Itawa     5000     NONIT     103
    106     Siddharth     Itawa     5000     NONIT     103
    107     Kalyan     Itawa     7000     IT     104
    Now I want to fill the same data 10 times but the IDS must be incremented
    What should I do?
    I use oracle 9i
    insert into demo_1
    select eid,ename,eaddress,esalary,edepartment,manager_id from demo_1
    I have eid necessary to increase sequencially

    Create a sequence.

    insert into demo_1
    Select sq.nextval, ename, eaddress, esalary, edepartment, manager_id demo_1

  • How to choose the following data using sql?

    Hi people,

    I use oracle 10g.i have two tables as follows.

    PROGRAMMER
    PNAME                          DOB       DOJ       SEX   PROF1                          PROF2                             SALARY
    ------------------------------ --------- --------- ----- ------------------------------ ------------
    ALIAF                          02-JUL-64 02-JUL-90 M     CLIPPER                        COBOL                               2800
    JULIANA                        31-JAN-68 31-JAN-60 F     COBOL                          DBASE                               3000
    KAMALA                         30-OCT-68 30-OCT-92 F     C                              DBASE                               2900
    MARY                           24-JUN-78 24-JUN-91 F     C++                            ORACLE                              4500
    NELSON                         11-SEP-65 11-SEP-89 M     COBOL                          DBASE                               2500
    PARTICK                        10-NOV-65 10-NOV-90 M     PASCAL                         CLIPPER                             2800
    QADIR                          31-AUG-65 31-AUG-91 M     ASSEMBLY                       C                                   3000
    RAMESH                         03-MAR-67 03-MAR-91 M     PASCAL                         DBASE                               3200
    REBECCA                        01-JAN-67 01-JAN-90 F     BASIC                          COBOL                               2500
    REMITHA                        02-DEC-69 02-DEC-92 F     PASCAL                         BASIC                               3600
    REVATHI                        02-DEC-69 02-DEC-92 F     PASCAL                         BASIC                               3700
    VIJAYA                         14-DEC-65 14-DEC-92 F     FOXPRO                         C                                   3500
    ANAND                          21-APR-66 21-APR-92 M     PASCAL                         BASIC                               3200
    SOFTWARE
    PNAME                          TITLE                          DEV_IN                   DCOST     SCOST      SOLD
    ------------------------------ ------------------------------ -------------------- --------- -------
    ANAND                          PHARACHUTES                    BASIC                     6000       400        43
    ANAND                          VIDEO TITLLING PACK            PASCAL                   16000      7500         9
    JULIANA                        INVENTORY CONTROL              COBOL                     3500      3000         0
    KAMALA                         PAYROLL PACKAGE                DBASE                    20000      9000         7
    MARY                           FINANCIAL ACCOUNT              ORACLE                   85000     18000         4
    MARY                           CODE GENERATOR                 C                        20000      4500        23
    PARTICK                        READ ME                        C++                        900      2000        84
    QADIR                          BOMBAS AWAY                    ASSEMBLY                  5000       750        11
    QADIR                          VACCINES                       C                         3400      1900        21
    RAMESH                         HOTEL MANAGEMENT               DBASE                    35000     12000         4
    RAMESH                         DEAD LEE                       PASCAL                    4500       600        73
    REMITHA                        PC UTILITIES                   C                         5000       725        51
    REMITHA                        TRS HELP PACKAGE               ASSEMBLY                  6000      2500         6
    REVATHI                        HOSPITAL MANAGEMENT            PASCAL                   75000      1100         2
    REVATHI                        QUIZ MASTER                    BASIC                     2100      3200        15
    Now the task is to display the details of the software that has been developed in the language which is neither the first nor the second jurisdiction of the programmer.can u pls help me solve it.thanks in advance.


    Reg
    vids

    Now the task is I have to display the details of the software that has been developed in the language which is neither the first nor the second skill of the programmer

    SELECT s.*
    FROM   software s,
           programmer p
    WHERE  s.pname = p.pname
           AND s.dev_in NOT IN ( p.prof1, p.prof2 );  
    
  • Get each end calendar month using SQL date

    Hi guys,.

    How to get the each month end date using SQL Script?

    Ex: If the effective date is January 15, 2011, then the date will be January 31, 2011.

    can someone help me get this result?


    TIA,

    Hello
    I think that below query is useful for you.

    Select last_day (Your_Date) of double;

    Kind regards
    Fame

  • Import Export using SQL Developer

    People

    I have 6 tables whose data must be exported from a database and imported into the other. The structure of the table constraints etc. is the same across both of the DB.

    Database is 11g. Average amount of data in tables 5 is 2.5million contain lines and 1 340million.

    Could you please suggest the best possible way to the export and import of data using SQL Developer. Developer SQL version 3.2.20.09

    There is an option in the 'View' tab in Developer SQL by using 'DBA' but do not have s/n of these patterns. I am well aware expdp and impdp operations but it is managed by another team that can cause delays both want to do it myself.

    Can we do expdp and impdp on SQL Developer without access s/n?

    All of the suggestions.

    Thank you

    Simple method would be to create external table Using the ORACLE_DATAPUMP Access Driver. Its neat and fast.

    http://docs.Oracle.com/CD/B28359_01/server.111/b28319/et_dp_driver.htm#i1007502

  • 11.5.10.2 to R12.1.1 update: error loading of seeds for GL_DEFAS_ACCESS_SETS data: DEFINITION_ACCESS_SET = SUPER_USER_DEFAS, ORA-06508: PL/SQL: called program unit is not found

    Hello

    Version of the EBS: 11.5.10.2

    DB version: 11.2.0.3

    Version of the OS: AIX 6.1

    Under 11.5.10.2 R12.1.1 update, while implementing a merger 12.1.1 upgrade driver (u6678700.drv), we got below error:

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    ATTENTION: All workers have failed or are pending:

    IMPOSSIBLE: folder glsupdas.ldt worker 3.

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    drix10: / fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log > tail-20 adwork003.log

    Restart the task that failed and has been corrected.

    Time, when the worker restarted job: Wednesday, August 7, 2013 10:36:14

    Loading data using FNDLOAD.

    FNDLOAD APPS / * 0 DOWNLOAD @SQLGL:patch/115/import/glnlsdas.lct @SQLGL:patch/115/import/US/glsupdas.ldt -.

    Connecting to applications... Successfully connected.

    Call the function FNDLOAD.

    Returned by the function FNDLOAD.

    Log file: /fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log/US_glsupdas_ldt.log

    FNDLOAD of error function call.

    When the worker has no time: Wednesday, August 7, 2013 10:36:14

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    drix10: / fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log > tail-20 US_glsupdas_ldt.log

    Current system time is sea Aug 7 10:36:14 2013

    Download from data file /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/US/glsupdas.ldt

    Changing environment NLS_LANGUAGE AMERICA database

    Dumping from the LCT/LDT files (/ fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/glnlsdas.lct(120.0), fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/US/glsupdas.ldt) to the staging tables

    Dumping file fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/glnlsdas.lct(120.0 LCT) in FND_SEED_STAGE_CONFIG

    Dumping LDT file /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/US/glsupdas.ldt in FND_SEED_STAGE_ENTITY

    Dumped the lot (GL_DEFAS_ACCESS_SETS SUPER_USER_DEFAS, GL_DEFAS_ACCESS_SETS SUPER_USER_DEFAS) in FND_SEED_STAGE_ENTITY

    Download of the staging tables

    Error loading of seeds for GL_DEFAS_ACCESS_SETS data: DEFINITION_ACCESS_SET = SUPER_USER_DEFAS, ORA-06508: PL/SQL: called program unit is not found

    Simultaneous request ended

    Current system time is sea Aug 7 10:36:14 2013

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    Hello

    Please, recreate the specification and body of the respective package and try:

    -Navigate to $GL_TOP, patch, 115, sql

    -Connected as a user of the applications.

    sqlplus Oracle@Amazon sql apps]

    SQL * more: version 10.1.0.5.0 - Production Wed Aug 7 13:53:33 2013

    Copyright (c) 1982, 2005, Oracle.  All rights reserved.

    Enter the password:

    Connected to:

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > @glistdas.pls

    Addition of PL/SQL package for gl_defas_access_sets_pkg specifications

    Package created.

    Validation complete.

    ...

    ..

    SQL > @glistdab.pls

    Addition of the PL/SQL package for gl_defas_access_sets_pkg body

    Package body created.

    Validation complete.

    See if this helps you, validation of the object.

    Better subject.

Maybe you are looking for

  • Qosmio F50 - locking touchpad does not work

    Hello FN + F9 does not seem to work (touchpad is still active). I have the drivers for alps touchpad.All other FN keys working. I saw the other responses on this topic and all seem to have associated with model solutions.

  • Satellite A300 - 1 2 does not work with 3 GB or 4 GB of memory

    Does not work with 3 GB or 4 GB of memory, only 2 GB!And if I plug a memory in bank1 2 GB module (bank0 is empty) - it's doesn't work too! He arrived with 3 laptops. (Sorry, my English is not good :))

  • USB-6366

    I would like to taste several channels using different sampling frequencies high all the time and at the same time. Is this possible? If Yes, then how to combine measures of channels together in a chart?

  • Subject: Re: HP rewards is broken and a scam

    I complained this some time ago and I still receive the updates of others miserable with the same question.  Can someone from HP read and solve this problem... or just ignore him and stop the unnecessary updates.

  • what Disk Defragmenter say and do?

    Please tell me in simple terms that I can understand