Reg:sql loader in Forms 10g

Hai,
we used sqlldr in forms 6i using host command. Later we upgraded to forms 10g but now the host command is not working. we are able to create directory with the host command, but not able to invoke sqlldr, also forms 10g is not giving any error also, (forms status is success). Did anybody faced similar problem? Can anyone please help me regarding this..

I think, I did not make it clear, Sorry for that.
Actually, sqlldr is on the application server and running fine with the 6i, as the respective control, data and log files were on the same machine. Now, we upgraded to forms 10g and trying to use the same sqlldr, but found that it is not being invoked at all.
We first suspected the host command, but we are able to create a directory as follows,
host('mkdir c:\test_host');
This is working fine. But not sqlldr... I searched on metalink if there are any links on the issue but able to find the same problem unanswered.
I will try for xhost facility...

Similar Messages

  • Calling SQL*Loader from Forms

    Hi,
    I was wondering if anyone has called SQL*Loader from Forms?
    What I am wanting to do is use Oracle Forms as the interface where you can specify a file that you can import into the database and it will use a set control file. Push the import button and SQL*Loader does the rest.
    Is using Java code to call SQL*Loader from Forms a viable option, or is there an easier way to achieve the desired outcome.
    Any ideas or guidance will be much appreciated.
    Thanks,
    Scott.

    Scott,
    In forms, there's a HOST built-in command which is supposed to execute any o/s commands.
    What you have to do is :
    1. Bult up the string exacltly in the fashion which you will run in o/s
    2. Call the HOST Built-in and pass in the string
    Here's a example :
    Declare
    lOsCmd Varchar2(1000) := Null;
    Begin
    lOsCmd := 'sqlldr user-id=userid/passwd@connectStr '
    || ' control=c:\temp\abc.ctl log=c:\temp\abc.log '
    || ' bad = c:\temp\abc.log';
    Host (lOsCmd, No_Screen);
    End;
    -- Shailender Mehta --

  • Is there any difference in Oracle 9i SQL Loader and Oracle 10g SQL Loader

    Hi
    Can anyone tell me whether is there any difference in Oracle 9i SQL Loader and Oracle 10g SQL Loader?
    I am upgrading the 9i db to 10g and wanted to run the 9i SQL Loader control files on upgraded 10g db. So please let me know is there any difference which I need to consider any modifications in the control files..
    Thank you in advance
    Adi

    answered

  • Run SQL*Loader from forms

    How can we run SQL*Loader from forms. I guess HOST command will run the OS comman on the clinet. How do I invoke the Loader script on the server from the forms clinet?
    -Ravi.

    Look..the oracle server is in UnixWare 7 and the client PC
    is on Windows XP Pro, but before install the Oracle Client Software into the client pc the builtin HOST doesn't work
    then I install the Software in Windows XP pc and now I'm
    working loading the txt file into the server on Unix,
    Try to install the Oracle Client Software into the Citrix
    client, I think it work.

  • Issues in calling Sql Loader through forms developer (10g)

    Hi,
    I am developing a form(in 10g) ,in which I am calling sql loader for loading data onto a oracle database table from external source (e.g. data file is a .CSV file).
    But , somehow the sql loader is not getting executed.
    Here , I am giving the environment settings , approach i am taking;
    This is a distributed system , both the application server,and database server are mounted on two different servers.
    The form is delpoyed on the application server.
    The database table , and the sql loader are configured on the databse side.
    I am using host(<sql loader command>) command to invoke the Operating System command through forms.
    The sql loader is working ok , and the data is getting loaded successfully onto the required database table when I am executing the sql loader command on Unix prompt , but through the forms , it's not working.
    Do I need to change some environmental setting to make this work...
    Any quick help in this regard is highly appreciated.
    Thanks.

    Hi Craig,
    I have already tried out the option of calling sql loader through stored procedure,but this is not working ...
    could you please share any examples to do so ...
    code snippet i am using in forms:
    declare
    usid get_application_property(userid);
    pwd get_application_property(password);
    db get_application_property(host);
    msqlldr varchar2(250);
    begin
    msqlldr:='/u01/oracle/formss/bin/sqlldr' username=<uid/pwd@db> control=<control file name> data=<data file name> log=<log file name>
    hosts(msqlldr);
    end;
    Note that sqlldr command ,for that matter any unix shell command is not working through the hosts() command ...
    could you please suggest any way out ...
    Thanks.

  • Loading data by sql loader in oracle 10g on linux

    I am trying to load data in Oracle 10g on linux by using sql loader, but getting error
    Problem in log showing that field length of SURNAME field is more than table field size.
    Following is the error in log file of sql loader
    Record 21: Rejected - Error on table TABLE1, column
    SURNAME.
    ORA-12899: value too large for column SURNAME (actual: 65, maximum: 64)
    and it is evident from following controlfile that i am using trim to discard any space then why it is giving an error.
    LOAD DATA
    TRUNCATE
    INTO TABLE TABLE1
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    ID INTEGER EXTERNAL,
    OPTION1 CHAR,
    REF1 CHAR,
    OTHER_REF CHAR,
    TITLE "TRIM(:TITLE)",
    FORENAME "TRIM(:FORENAME)",
    SURNAME "TRIM(:SURNAME)",
    JOINT_TITLE "TRIM(:JOINT_TITLE)",
    JOINT_FORENAME "TRIM(:JOINT_FORENAME)",
    JOINT_SURNAME "TRIM(:JOINT_SURNAME)",
    I checked the bad file and count number of characters, they are 64 characters.
    When i am inserting individual record from bad file by sql loader, it is loading

    Probably your database character set is multi-byte. That is %UTF8 or AL16UTF16%
    Post your NLS Database Parameters value
    select * from nls_database_parameters;
    In General varchar2(65) by default means 65 BYTES unless
    you have changed your Defalut NLS_LENGTH_SEMANTICS parameter from BYTE to CHAR.
    With best regards
    Shan

  • How to connect to SQL Server from Forms 10g?

    Hello all,
    How do we connect to SQL Server database from Forms 10g?
    In Oracle Metalink site they have suggested using Transparent Gateway for SQL Server as a solution.
    But is there a way we can connect directly to SQL Server from Forms using an ODBC connection
    without installing anything on the database server?
    Pls help!
    Regards,
    Sam

    Hello all,
    I was able to connect to SQL Server from Oracle using Generic Connectivity (HSODBC).
    Transparent gateway was not required.
    Followed metalink note 109730.1
    So, after I created a dblink to SQL Server, I created a synonym for the dblinked SQL Server table.
    When I used the synonym as the table source in Oracle Forms, I got the following error while querying.
    "ORA-02070 - ROWID is not supported in this context."
    This is because Forms has an invisible ROWID field and when data is fetched from SQL Server table
    no Rowid is fetched since SQL Server table doesn't have one.
    Is there a way to overcome this issue or do we have populate the block manually using a SQL query ?
    Pls suggest.
    Regards,
    Sam

  • SQL*LOADER IN Oracle 10g Release 2

    Hi,
    Recently i installed oracle 10g release 2 on windows vista.I want to use sqlloader utility.Where can i found it.I checked for sqlldr.exe in oracle home folder,but i didn't find it.Any one plz help me regarding this..

    You would better to look here
    Using:
    http://download.oracle.com/docs/cd/B19306_01/win.102/b14304/tools.htm#i1006973
    It will be also good to look at:
    Concepts
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_concepts.htm#SUTIL003
    SQL*Loader Control File Reference
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_control_file.htm#SUTIL005

  • Need help, Trouble in uploading records using sql loader in Forms 6i

    Hi,
    I am trying to develop a screen for uploading records to a table by using a ctl file, batch file and sql loader.
    Env: Forms 6i, Oracle 8
    Table to be updated is: shy_upload_table
    My TSN entry looks similar to this,
    TEST_AXA.CNB.COM =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 11.23.11.123)(PORT = 1234))
    (CONNECT_DATA =
    (SID = axdabc)
    My intention is whenever i press the upload_button, I should truncate the table and upload it with the contents of the file.
    In the when-button-pressed event of the upload_button I have the following code. always I am able to truncate the table but am not able to upload it with the contents of the file. Can any of you help me fix this problem ?
    declare
         var_control varchar2(256);
         VAR_DATA VARCHAR2(256);
         VAR_OUTPUT VARCHAR2(500);
         var_filename varchar2(256);
         str varchar2(50);
         cnt number;
    begin
         FORMS_DDL('TRUNCATE TABLE shy_upload_table ');
         select count(*) into cnt from shy_upload_table;
         message('count '||cnt);
         MESSAGE('');
    If NOT form_success Then
         MESSAGE('Upload Failed');
         MESSAGE('Upload Failed');           
    else
         set_item_property('DISPLAY_PB',enabled,property_true);
    --when ever i run, i am able to see the display_pb enabled. it means form_success is true.
    end if;
         var_filename := :txt_filename;
    --I have tried with each of the below option,
    --sqlldr userid/[email protected] control=F:\ERP\file_upload.ctl
    --sqlldr userid/password@axdabc control=F:\ERP\file_upload.ctl
    --sqlldr userid/password@TEST_AXA.CNB.COM control=F:\ERP\file_upload.ctl
         VAR_DATA :='data=' || var_filename ;
         VAR_OUTPUT := var_control|| ' ' ||VAR_DATA;
         host('F:\a.bat');
    end;
    batch file contents...
    # I have tried with each of the below options
    sqlldr userid/[email protected] control=F:\ERP\file_upload.ctl data=F:\ERP\sample.txt log=F:\ERP\x.log bad=F:\ERP\x.bad
    #sqlldr userid/password@axdabc control=F:\ERP\file_upload.ctl data=F:\ERP\sample.txt log=F:\ERP\x.log bad=F:\ERP\x.bad
    #sqlldr userid/password@TEST_AXA.CNB.COM control=F:\ERP\file_upload.ctl data=F:\ERP\sample.txt log=F:\ERP\x.log bad=F:\ERP\x.bad
    pause
    Thanks
    vish

    Hi Francois,
    Thanks for responding, I am not very sure of what you want me to try out.
    When I double click the batch file containing the below, the record gets inserted in the table. Only when using my form and trying to upload, it fails to insert the record.
    batch file contents...
    #sqlldr userid/password@TEST_AXA.CNB.COM control=F:\ERP\file_upload.ctl data=F:\ERP\sample.txt log=F:\ERP\x.log bad=F:\ERP\x.bad
    pause
    Thanks
    Vish

  • SQL Loader through Forms 6i

    Hi,
    I need to know the steps to run sql loader through forms6i in windows environment.
    Please help me in this regard.

    1. Create a control file for Sql*Loader with all parameters you need
    2. Create a .bat file to run Sql*Loader, e.g. "sqlldr username/password@db control=<file above>"
    3. Use HOST command within Forms 6i to run the .bat file.

  • No PL/SQL windown in Forms-10g Debug

    Dear gurus...I used to use a PL/SQL window in 6i forms debug tool which displayed at the bottom of debugging module. It was very useful to look at the database values of current session but I'm unable to fine this PL/SQL interation tool in 10g Forms debug module. Is it away from my eyes only or really doesn't exist in 10g-Forms???

    Caz,
    Two things. First; it is considered poor Forums Etiquette to hijack someone else's posting. Always create your own post and include a link to a related posting if your issue is similar to someone else's.
    Second; now that you have the FORMS_TRACE_PATH defined, you create the trace file by adding the "RECORD=FORMS" parameter to the URL. Optionaly, you can add the "TRACEGROUP=DEBUG/CUSTOM1" parameter as well as long as you have specified the CUSTOM1 trace group in the ftrace.cfg file. Just adding the RECORD=FORMS should be enough, however.
    If that still doesn't produce the results you are looking for, check out the following references: Oracle9i Forms Diagnostic Techniques and Oracle9iAS Forms Services Tracing and Diagnostics. I know these are for Forms 9i, but the process did not change between Forms 9i and Forms 10g. If you are using Forms 11g, I'm not sure if these technigues will work the same as I am not using Forms 11g yet. ;-)
    Craig...

  • PL/SQL engine in Forms 10g Release 2

    Hello,
    Can anyone tell me if in Forms 10g Release 2 I can use these?
    - Native dinamic SQL
    - Indexed arrays by VARCHAR2 instead of BINARY_INTEGER
    Thanks

    Hello,
    1. EXECUTE IMMEDIATE is as server side instruction, so it cannot be used within a Forms pl/sql block.
    2. Yes, Indexed arrays by VARCHAR2 work fine in 10gR2 ;o)
    Francois

  • Calling SQL Loader from Forms 4.5 using HOST command in Win2000

    One of my forms calls SQL Loader 7.3 using HOST command to load a csv file onto the database(Oracle 7.3) under Windows 2000 platform.
    Only after sql loader finishes its operation the control should come to my form i.e. synchronous execution.
    As of now its running asynchronously.
    Is there any way to make it synchronous. If Not any other work arounds?
    Environment Details
    Forms [32 Bit] Version 4.5.10.6.0 (Production)
    Windows 2000 Operating System
    Oracle7 Release 7.3.2.3.2

    Forms6i running on W2000, Rdbms 8.1.7
    in Forms I added a button TEST,
    Trigger when-button-pressed : host('test.bat') ;
    in directory .......\frm I added file test.bat :
    REM ===============
    cd /d C:\........\ldr
    pause
    sqlldr parfile=test.par
    pause
    type test.log
    pause
    exit
    REM ================
    now, pressing TEST button opens DOS window, telling me what's going on, running sqlldr, finally going back to forms
    Are you using NO_PROMPT or NO_SCREEN option of HOST command ?
    Had a look at Forms 4.5 manuals, there is no mentioning of (a)synchronously operation in connection with HOST command.

  • SQL Loader from Forms 10

    Hello!
    How can i call to SQL Loader from my application developed by Forms 10?

    My application is doing something similar.
    Given that the iAS server can read from the data source (where the flat file for the sqlldr to load), all you need is to write a shell script that is invoked from within the forms application (using the host command). The shell script (I use Perl) will do invoking the sqlldr and also other checks, etc
    hope this helps

  • SQL Loader Help in 10g

    Hello,
    Is it possible to forcefully abort the sql loader when a value is not present? I've the data file like this
    1|XXX123|XXX|20121121||
    4|XXX123|XXX|||
    5|XXX123|XXX||1|
    5|XXX123|XXX||2|
    5|XXX123|XXX|||
    9|XXX123|XXX|||
    Template:
    record type|batch number|batch desc|date|detail line num|others
    1,4,5,9 are the record types, if you see this line 5|XXX123|XXX||1| .. 1 represents a detail line number, My requirement is if the detail line number is null for record type 5 then I want to abort the sqlloader.
    Is it possible?
    Edited by: 940838 on Nov 21, 2012 11:54 PM

    940838 wrote:
    I think i am not clear in my requirement...
    The question was how to abort the loader if the detail line number is not present in record type 5. It is however normal that detail line num is not mandatory for other record types. any insights.Hi,
    you have been clear and I have made a quick test. Unfortunately you cannot do such check in SQL*Loader as the WHEN clause in control file does not allow any OR.
    Even if you add this check using a constraint in your table and specify the maximum number of errors to be 0, SQL*Loader will load the records up to that error.
    Let me show you an example:
    1) create the table with a constraint that for record_type 5 detail_line_number cannot be null.
    CREATE TABLE test
       record_type    INTEGER
    , batch_number   VARCHAR2 (10)
    , batch_desc     VARCHAR2 (10)
    , batch_date     DATE
    , detail_line_num INTEGER
    , other          VARCHAR2 (10)
    ALTER TABLE test
      ADD CONSTRAINT check_rec_5
         CHECK (   record_type = 5 AND detail_line_num IS NOT NULL
                OR record_type != 5) ENABLE;
                In this table you will not be able to load rows having record_type=5 and detail_line_num NULL as this will be considered as an error.
    Let's prepare your input file:
    1|XXX123|XXX|20121121||
    4|XXX123|XXX|||
    5|XXX123|XXX||1|
    5|XXX123|XXX|||
    5|XXX123|XXX|||
    9|XXX123|XXX|||
    1|XXX123|XXX|20121121||
    4|XXX123|XXX|||
    5|XXX123|XXX||1|
    5|XXX123|XXX||2|
    5|XXX123|XXX|||
    9|XXX123|XXX|||1|XXX123|XXX|20121121||
    4|XXX123|XXX|||
    5|XXX123|XXX||1|
    5|XXX123|XXX||2|
    5|XXX123|XXX|||
    9|XXX123|XXX|||1|XXX123|XXX|20121121||
    4|XXX123|XXX|||
    5|XXX123|XXX||1|
    5|XXX123|XXX||2|As you can see the input file has the fourth line with record_type = 5 and detail_line_num NULL. This will be an error for the constraint.
    Here the control file I have used:
    --test.ctl
    load data
    INFILE 'test.dat'
    APPEND
    INTO TABLE test
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS
    record_type     ,
    batch_number    ,
    batch_desc      ,
    batch_date      Date 'YYYYMMDD',
    detail_line_num ,
    other
    )If I try to execute the SQL*Loader and ask to stop at first error in this way:
    sqlldr userid=yourname/yourpass@yourdb control=test.ctl errors=0 rows=100SQL*Loader will load only 3 records because it encounters an error at line 4 and having specified errors=0 will not continue to load. Actually the process will continue until it reach the commit point (100 rows in this case) but it will not load any record after the error nor continue to read the file.
    So if I check the table
    SELECT * FROM test;
    RECORD_TYPE BATCH_NUMBER BATCH_DESC BATCH_DATE            DETAIL_LINE_NUM OTHER    
              1 XXX123       XXX        21-11-2012 00:00:00                            
              4 XXX123       XXX                                                       
              5 XXX123       XXX                                            1           You will see only records until you have reached the error.
    This cannot be avoided as documented in SQL*Loader reference manual:
    <h3>Load Discontinued Because Maximum Number of Errors Exceeded</h3>
    If the maximum number of errors is exceeded, SQL*Loader stops loading records into any table and the work done to that point is committed. As you can see SQL*Loader abort the processing but it will anyway commit the records until that error.
    One alternative solution is to create an external table in Oracle and do all the checks you want before copying your external table into a database table, as BluShadow suggested.
    Regards.
    Al

Maybe you are looking for