APEX and SQL Loader

Is it possible to use SQL within the APEX charger? I want to have a table editing a csv file... normally I would use the WWV_FLOW_FILES table, but with this file, it mixes tabs and comma in the data, in order to create a reliable upload script is becoming a nightmare. I would like to take advantage of the sql loader so I can specify the delimiter, optional quotes etc. The file will be in the same location on the file system, so a regular and automated process would be perfect.

If so, does anyone know of a tutorial that could help out me?

If you have a chance, you can send me the error?

Thank you
Tyler

Tags: Database

Similar Questions

  • Difference between external tables and sql * loader

    Hello

    Could you please tell me the difference between
    tables external and sql * loader

    I have serached on the net but did ' get correct idea

    Please help me

    1 SQL LOADER can be run on the network (from any client computer), external tables can't

    2. return to the Oracle 9, external Tables could not load CLOB/BLOB (Oracle10 changed it)

    3 oracle 11 external tables have preprocessor, which is pretty dam characteristic cool - running essentially any OS command e.g. decompress before external table run. What's even better is the fact that the result of the operating system command is the source of the outer table, which means that there are no required temporary file (unzip the tracks and the output is the source of the external table). There are several ways to great use this - look at my blog for samples rare http://jiri.wordpress.com/2010/01/19/no-more-unix-scripts-in-11-2/

    4. as long as the 009 stressed, filed external load anything, they show just. Think of it more as load on request - it's great if you have old files archived and one or two users what to see content once a while

    5. external tables require no user access to the operating system, it is oracle environment pure - this may seem minor but for me it's huge. The fact that the ETL needs no special unix, no control file command and uses the simple SQL and DDL is nice and important

    6. external tables can load more text files, Oracle export dump files can be loaded, perhaps in the future more formats will be supported (hopefully all right excel format?)

    now the same thing to kill the myth - the TWO are EXACTLY the same when it comes to speed, I would actually drive of the external tables before will be faster because sql loader is old technology oracle doesn't really develops more

  • Remote debugging with Apex and SQL Developer

    Hello

    I try to turn on remote debugging with Apex and SQL Developer.

    I can debug the PL/SQL procedure when it is called from SQL * PLUS, but when I call the procedure from Apex 'Process', the debugger does not stop at breakpoints.

    I checked that the procedure is called Apex process as I can see 'things' happening in the procedure but the debugger does not stop at breakpoints. The program being debugged (session Apex) manages to fix the SQL Developer debug listener.

    Apex (OnSubmit) process
    ---------------------------

    BEGIN

    DBMS_DEBUG_JDWP. CONNECT_TCP ('10.176.20.225', 4000);
    DONOTHING;
    DBMS_DEBUG_JDWP. DISCONNECT;
    END;


    Procedure
    -------------------------------------
    CREATE OR REPLACE
    PROCEDURE DONOTHING ACE
    testvar VARCHAR2 (100);
    BEGIN
    update cross-set test_data = 'I came here 11111'; -It is run
    commit;
    testvar: = "aaa"; -bREAK POINT IS HERE
    DONOTHING END;
    /

    Thanks in advance,
    Paresh

    Published by: pyadav1 on November 19, 2008 15:19

    Hello

    Sorry... seems I was too hasty in reading your question...

    You also gave * DEBUG ON [Parsingschema]. [procediurename] * APEX_PUBLIC_USER (or ANONYMOUS or HTMLDB_PUBLIC_USER). Otherwise, the behavior is exactly the same as you have described...

    The privilege of the DEBUGGING SESSION to CONNECT need to given to the schema analysis but the APEX_PUBLIC_USER schema needs debug privilege on the function or procedure...

    Does that help?

    Carsten-

  • Oracle RAC and sql loader

    Hi all
    We have Oracle 10 g RAC on IBM AIX
    Today I will be downloading the data in a table through sql loader.

    I want that at the point only insert data that i am inserting all in the table, as I use the sequence on A particular column.

    Problem is if I stop database, then I will not be able to insert data, and if I was not closing db value this column A is generated automatically when the application is running.

    I have recommended that we should stop application with database connectivity and then I will fill insertion, but some people say no. Find another method

    Should what I do?

    Must sqlldr data have column has specific values?

    Sequences do not guarantee free gap values. They guarantee the increase of the unique values.

    If you have data that NEEDS to have a specific primary key, so it would be best to fill with sql and plsql instead of a sequence.

  • SQL * Loader Control path

    Hi all


    I created a sql * simultaneous program of charger with a parameter to pass the path of the data file with file name. Now my question is how does the program know that the control file is in a specific path.

    For example, I kept the control file in the $XXX_TOP/bin and the data file in the $XXX_TOP.

    I have now in the program parameter, pass the path of the data file, but how the program takes the path of the default control file $XXX_TOP/bin.

    Thanks and greetings
    El M

    I created a sql * simultaneous program of charger with a parameter to pass the path of the data file with file name. Now my question is how does the program know that the control file is in a specific path.

    For example, I kept the control file in the $XXX_TOP/bin and the data file in the $XXX_TOP.

    I have now in the program parameter, pass the path of the data file, but how the program takes the path of the default control file $XXX_TOP/bin.

    You can provide information on the data file in the control file, or switch the full directory path and the name of your file as an argument. Concurrent Manager passes the "data = (full path of the data file)" token at query execution time. Without a data file name, the concurrent manager ignores this token and SQL * Loader uses the data file name specified in the control file.

    http://docs.Oracle.com/CD/E18727_01/doc.121/e12897/T302934T458254.htm#4163833

    The control file must be placed in the directory XX_TOP/bin $.

    http://oracleapplications99.blogspot.ca/2011/12/sqlloader-examples.html
    http://imdjkoch.WordPress.com/2010/08/12/registering-SQL-Loader-as-a-concurrent-program/
    http://erpschools.com/articles/SQL-Loader

    Thank you
    Hussein

  • 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)

  • SQL Loader issue - CSV with commas and quotes IN the data

    Hello, I have a dataset for a simple table of 2 columns like this:

    Column 1, "it is given for"Column 2", with commas and quotes."

    Data are delimited by commas and may be surrounded by double quotes.  In ADDITION, it may include commas and quotation marks in the data fields.  I CANNOT manipulate data before sending it to SQL Loader.

    I set my file of control like this:

    DOWNLOAD THE DATA

    INFILE '. / TEST.dat'

    BADFILE '. / TEST. BAD'

    DISCARDFILE '. / TEST. DSC"

    REPLACE IN THE TEST TABLE

    Fields ended by ',' POSSIBLY BOX BY ' "' TRAILING NULLCOLS"

    (

    Col1 char (50),

    Col2 char (500)

    )


    Now when I run the present via SQLLDR, I get the following error in the log file:


    Sheet 1: Rejected - error on table TEST, column COL2.

    no terminator found after CLOSE and CLOSED field

    What are my options to get the loaded data as presented above?  I'm working on Oracle 11 g (11.2.0.3.0) 64-bit on AIX 6.1.0.0.

    Thank you!

    In this case, there is no way she can tell who's a delimiter or pregnant and which is part of the data.  As far as I know, there is no way that you can load it into the appropriate columns.

  • SQL Loader and batch ID

    Hi all

    In our application, we allow the user to download data using the worksheet in the excel user interface.

    We use a PHP script in the user interface and using SQL Loader to load the data of insert_table excel sheet.

    The insert_table has a primary key.


    Here, my question is, is it possible to put some package for each download id in the table in an automatic way?

    While we can easily extract data using the code batch

    We use Oracle 11 g.

    What is load a constant value, in which case you may as well use 815 constant in your control file. If you want to automatically increment the value of each batch, then you must use a different method.

    Please see the example below. Before each data load, he loads the next value in the sequence into a separate table and then selects this value while loading data. Note that SQL * expression of charger that uses select must appear in parentheses in the double quotes.

    SCOTT@orcl_11gR2> host type test1.dat
    1 Prod1
    2 Prod2
    3 Prod3
    4 Prod4
    5 Prod5
    
    SCOTT@orcl_11gR2> host type test2.dat
    6 Prod6
    7 Prod7
    8 Prod8
    
    SCOTT@orcl_11gR2> host type batch.ctl
    options(load=1)
    load data
    replace
    into table batch_tab
    (batch_id expression "test_seq.nextval")
    
    SCOTT@orcl_11gR2> host type data.ctl
    load data
    append
    into table temp_table
    fields terminated by whitespace
    trailing nullcols
    (p_id,
    p_name,
    batch_id expression "(select batch_id from batch_tab)")
    
    SCOTT@orcl_11gR2> create table temp_table
      2    (p_id      number primary key,
      3     p_name    varchar2(6),
      4     batch_id  number)
      5  /
    
    Table created.
    
    SCOTT@orcl_11gR2> create sequence test_seq
      2  /
    
    Sequence created.
    
    SCOTT@orcl_11gR2> create table batch_tab
      2    (batch_id  number)
      3  /
    
    Table created.
    
    SCOTT@orcl_11gR2> -- first load:
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=batch.ctl log=batch1.log
    
    SQL*Loader: Release 11.2.0.1.0 - Production on Fri Apr 19 17:16:33 2013
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Commit point reached - logical record count 1
    
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=data.ctl data=test1.dat log=test1.log
    
    SQL*Loader: Release 11.2.0.1.0 - Production on Fri Apr 19 17:16:33 2013
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Commit point reached - logical record count 5
    
    SCOTT@orcl_11gR2> select * from batch_tab
      2  /
    
      BATCH_ID
    ----------
             1
    
    1 row selected.
    
    SCOTT@orcl_11gR2> select * from temp_table
      2  /
    
          P_ID P_NAME   BATCH_ID
    ---------- ------ ----------
             1 Prod1           1
             2 Prod2           1
             3 Prod3           1
             4 Prod4           1
             5 Prod5           1
    
    5 rows selected.
    
    SCOTT@orcl_11gR2> -- second load:
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=batch.ctl log=batch2.log
    
    SQL*Loader: Release 11.2.0.1.0 - Production on Fri Apr 19 17:16:33 2013
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Commit point reached - logical record count 1
    
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=data.ctl data=test2.dat log=test2.log
    
    SQL*Loader: Release 11.2.0.1.0 - Production on Fri Apr 19 17:16:33 2013
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Commit point reached - logical record count 3
    
    SCOTT@orcl_11gR2> select * from batch_tab
      2  /
    
      BATCH_ID
    ----------
             2
    
    1 row selected.
    
    SCOTT@orcl_11gR2> select * from temp_table
      2  /
    
          P_ID P_NAME   BATCH_ID
    ---------- ------ ----------
             1 Prod1           1
             2 Prod2           1
             3 Prod3           1
             4 Prod4           1
             5 Prod5           1
             6 Prod6           2
             7 Prod7           2
             8 Prod8           2
    
    8 rows selected.
    
  • Problem with LDAP in the APEX and not in sql query * more

    Hello everyone.

    Hereby, I refer to an existing thread: Query LDAP APEX

    I have a problem using LDAP in the APEX (DB version: 11.2.0.2.0;) APEX version: 4.0)

    I get "Authentication failed" by their SUMMIT. However, when I run it in SQL * more (SQL Developer) (I created it as seen in the referenced forum thread) it works! Can I use my own function, but that looks like reinventing the wheel.
        l_ldap_host := 'oursite.be';
        l_ldap_port := '389';
        l_ldap_domn := 'oursite';
        l_ldap_user := i_username;
        l_ldap_pass := i_pw;
        l_ldap_base := 'ou=oursite,dc=oursite,dc=be';
    
    
        dbms_ldap.use_exception := true;
        
        l_session  := dbms_ldap.init(l_ldap_host,l_ldap_port);
        l_retval   := dbms_ldap.simple_bind_s(l_session, l_ldap_domn||'\'||l_ldap_user, l_ldap_pass);    
        l_attrs(1) := 'name';
        l_attrs(2) := 'title';
        l_retval   := dbms_ldap.search_s(
                        l_session, 
                        l_ldap_base, 
                        dbms_ldap.scope_subtree, 
                        '(sAMAccountName='||l_ldap_user||')',
                        l_attrs,
                        0,
                        l_message
                      );
    
        l_retval := dbms_ldap.count_entries(l_session, l_message);
    We must search the sAMAccountName because that contains our login credentials (dennis.surname). The common name is just our full name (Dennis Surname)


    At the SUMMIT, I have these settings:

    * LDAP host: oursite.be
    * Port: 389
    Use SSL: No SSL
    Use exact DN: No.
    * String DN: ou = oursite, dc = oursite, dc = be
    * Search filter: sAMAccountName = % LDAP_USER %


    When I try to test it I get "Authentication failed" but I don't know why. It works very well in sql * more (in the the same pattern of course!) so I have really no idea what I'm doing wrong. In addition, the message comes instantly and sql * more it takes about a second to authenticate.

    I tried so many things! remove the 'or '. Connect with my name, change 'cn = % LDAP_USER %' filter, connect with dennis.surname and Dennis Surname, using exact DN,... and all the possible combinations of them... Nothing works.

    I can go further by using my own function, but I really want to use the settings of the APEX, because it's so much easier.

    Thanks in advance for help out me!
    Dennis

    Hi Dennis,

    Try this

    The exact use DN Yes value
    Change your DN string to

    %LDAP_USER%@domain
    

    or

    domain\%LDAP_USER%
    

    The authentication uses a simple_bind_s. You must use the same syntax in these text boxes. You actually do a single with bond

    dbms_ldap.simple_bind_s(l_session, 'sAMAccountName=' || l_ldap_user, l_ldap_pass);
    

    It does not work. It's the syntax to use in the search for search_s filter.

    Please keep in mind that the apex_040100 (for apex 4.1) user must connect the rights on the domain server.

  • SQL Loader and Oracle 11g

    Hello

    IM receiving a sqlldr: not found error. IM is going to discuss with our system of administration of the situation. Before I wanted to make sure that SQL Loader (sqlldr) is an add-on available for customer Oracle 11. A colleague mentioned SQLLDR maybe isn't available as an add-on in the Oracle 11 client and that we should rather use IMPORT/EXPORT. Is that a true statement?

    Can someone please clarify these questions for me?

    Thanks a bunch!

    SQL * Loader is certainly available in 11.1 or 11.2 full client install. It may or may not be a component that is installed by default according to the type of installation you choose during installation. But you can always go back and install this component.

    If you mean the instant customer, I'm not sure that SQL * Loader or import and export work with the Instant Client.

    And just to the point, if you are using 11g, you usually would using external tables rather than SQL * Loader.

    Justin

  • SQL loader by using functions and position

    Hi all, I need help, loading data in my table using sql loader. study the following
    CREATE TABLE er
    (                     
    a1 NUMBER,
    a2 number,
    a3 VARCHAR2(100),
    a4 VARCHAR2(100),
    a5 VARCHAR2(100),
    a6  VARCHAR2(100),
    a7  VARCHAR2(100),
    a8  VARCHAR2(100)
    );
    
    OPTIONS (BINDSIZE=20548000, READSIZE=20548000, STREAMSIZE=20548000, DATE_CACHE=25000,  SKIP=0)
    LOAD DATA
    INTO TABLE er
    APPEND     
    TRAILING NULLCOLS
    (
      a1            POSITION(0001:0021)               ,
      a2            POSITION(0022:0042)       "DECODE(SUBSTR(:a2,1,3),'***',NULL,:a2)"      ,
      a3            POSITION(0043:0053)       ,
      a4            POSITION(0054:0064)          ,
      a5            POSITION(0065:0075)           ,
      a6            POSITION(0076:0086)       ,
      a7            POSITION(0087:0093)      "DECODE(SUBSTR(:a7,1,3),'***',NULL,:a7)"   
    )
    BEGIN
                     0.00 ******************** X          X          X          *X          ****
    END;
    If you look at the data, some fields have a lot of * and some af a bit such as *. I want to load data into a table, and when a field contains all * as the value, I want to set to null. If a field contains a * and alphanumeric, so this value should be as it is.

    in the above example, * must be set to null and * should also be defined with a null value. Note that there is a field with x as this area contain alpha numeric, it must be loaded into the table, as is.  the only time in field must be set to null, it's when the value contains all .

    someone in this forum suggest using to decode, but looks like it doesn't work and I get error when it reads the second field and try to insert into the column number a2.

    is it possible to use regular expressions to find out if a field contains all *. I also want to cut each field as they may contain spaces.
    can be a help for this, use the ctl sqlloader and above?

    You can include regular expressions in you SQL * file the charger control.

    An example can be found here:
    http://www.morganslibrary.org/reference/sqlloader.html
    Demos of 7 and 8 by using the UPPER and DECODE functions to illustrate how do.

  • SQL Loader: Help TRIM and Decode functions please

    Hello

    I have load data from a flat file, for some columns, I need to use the TRIM and DECODE functions. It's a pipe delimited file.

    I get a syntax error (one is lower) same error listed for GARNISH.

    SQL * Loader-350: at line xx syntax error.
    Expected ', 'or') ', found 'DECODE '.


    ===========
    , FINAL_BILL_DATE CHAR (30) "TRIM(:FINAL_BILL_DATE)".
    , BUSINESS_ID 'DECODE(:BUSINESS_ID,'B',1,'C',2,'E',3,'G',4,'O',5,'R',6,'T',7,'U',8,'H',9,-1) '.


    Can someone please help.

    Thank you
    Josiane

    Hello josiane.
    The error you receive leads me to believe that at some point before the DECODING on the BUSINESS_ID line, probably some line before the FINAL_BILL_DATE line, it is a syntactic error causing the quotes before DECODING actually put an end to some other syntaxes. Without any lines that might actually contribute to this, including details of the header, it's the best I can advise.

    Hope this helps,
    Luke

    Please check the answer as helpful or response, if it is so. If this is not the case, further clarification.
    Try to always provide create table and table insert to help members of the forum to help you.

  • SQL * LOADER skip the header and the footer while loading

    Hi, how can I ignore the header and footer both a flat file during the loading of a table using sql * loader?
    Also, can I use the direct method if my target table has a primary key and not null constraints defined on it?

    Hello

    To ignore the header, you can use JUMP, for the footer there is no specific way to ignore it (maybe it would be rejected).

    For more information on the laoding modes, you can check [11 classics and Direct Path loads | http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_modes.htm#g1023818].

    Kind regards

  • No content is loaded when you try to use Apex and ADR

    Hello

    I try to use Apex 4.2 on a database of 11g XE on a Windows 7 machine and I am running on a question.

    I did the installation and the tasks according to the instructions and had no problem with this.

    I want to use ADR as a standalone option, so I just did the following:

    java -jar ords.war
    

    And went through the configuration options and seized what was needed. I put static resources such as D:\apex\images\ (where is my install apex) and set the port as 8080 I then ran in stand-alone mode, once again just by placing the same order as above and stated that:

    INFO: http://localhost: 8080/ADR / began to.

    Now when I try to connect to this I get a blank page so I thought to go and look at the html source code as I thought it would be that it does not find the static resources, but seen in firebug html code is:

    <html>
    <head>
    <link title="Wrap Long Lines" href="resource://gre-resources/plaintext.css" type="text/css" rel="alternate stylesheet">
    </head>
    <body>
    <pre></pre>
    </body>
    </html>     
    

    I made a mistake in the configuration as its unable to serve the content of the page in the database or I did something else wrong? Windows authorization would have something to do with it or will I be stupid?

    See you soon,.

    Paul.

    Hello

    I realized that it was. It relates to the problems here: Apex 4.2.2 via Apex earpiece 2 - white screen returns

    I don't know why I never saw this in the search. When I called full URL like: http://localhost: 8080/ADR/f? p = 4550:1:0: the apex login screen comes to us as expected.

    Kind regards

    Paul.

  • SQL * loader and sdo_geometry field

    Is it possible to load coordinates longitude/latitude of a flat file directly into a field sdo_geometry with sql * loader? If so, does anyone have an example? I just want to create point functions.

    Thank you
    David

    David,
    Section 4.1.2 of the space Guide has examples for this:

    DOWNLOAD THE DATA
    INFILE *.
    TRUNCATE
    CONTINUEIF NEXT(1:1) = ' # '.
    POINT OF TABLE
    FIELDS TERMINATED BY ' |'
    TRAILING NULLCOLS)
    GID INTEGER EXTERNAL,
    GEOMETRY COLUMN OBJECT
    (
    SDO_GTYPE INTEGER EXTERNAL,
    COLUMN SDO_POINT_TYPE OBJECT
    (X FLOAT EXTERNAL,
    THERE FLOAT EXTERNAL)
    )
    )

    BEGINDATA
    1. 2001 | -122.4215 | 37.7862 |
    2. 2001 | -122.4019 | 37.8052 |
    3. 2001 | -122.426 | 37.803 |
    4. 2001 | -122.4171 | 37.8034 |
    5. 2001 | -122.416151 | 37.8027228 |

    You must add the SRID field if you want to add the SRID for geometry.
    Or you can do this with SQL when the data is loaded into the DB.

    Siva

Maybe you are looking for