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

Similar Messages

  • Need Help in Splitting a String Using SQL QUERY

    Hi,
    I need help in splitting a string using a SQL Query:
    String IS:
    AFTER PAINT.ACOUSTICAL.1..9'' MEMBRAIN'I would like to seperate this string into multiple lines using the delimeter .(dot)
    Sample Output should look like:
    SNO       STRING
    1            AFTER PAINT
    2            ACOUSTICAL
    3            1
    4            
    5            9" MEMBRAIN
    {code}
    FYI i am using Oracle 9.2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    There's this as well:
    with x as ( --generating sample data:
               select 'AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN' str from dual union all
               select 'BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN' str from dual)
    select str,
           row_number() over (partition by str order by rownum) s_no,
           cast(dbms_xmlgen.convert(t.column_value.extract('//text()').getstringval(),1) as varchar2(100)) res
    from x,
         table(xmlsequence(xmltype('<x><x>' || replace(str,'.','</x><x>') || '</x></x>').extract('//x/*'))) t;
    STR                                                S_NO RES                                                                                                
    AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN                 1 AFTER PAINT                                                                                        
    AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN                 2 ACOUSTICAL                                                                                         
    AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN                 3 1                                                                                                  
    AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN                 4                                                                                                    
    AFTER PAINT.ACOUSTICAL.1..9" MEMBRAIN                 5 9" MEMBRAIN                                                                                        
    BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN          1 BEFORE PAINT                                                                                       
    BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN          2 ELECTRIC                                                                                           
    BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN          3 2                                                                                                  
    BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN          4                                                                                                    
    BEFORE PAINT.ELECTRIC.2..45 caliber MEMBRAIN          5 45 caliber MEMBRAIN      
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Need help with adobe audtion recording using a mic i wantto plug in

    i need to record audio into adobe audtion using an external mic that i will plug intgo the mac. But whe i plug in the chord i still geth thw internal mic recording..any help please??????????????@

    I'll stress that I use Windows not a Mac so I'm not expert on that sort of thing but this guide seems to give the information you need:  How to Setup External Microphone in Mac - Make Tech Easier
    Once you have the computer itself set up, the controls you need within Audition are on the Edt/Preferences/Audio Hardware menu.  If the mic is properly recognised by the Mac operating system as per the link above, you should then find it on a drop down menu you can select from in Audition.

  • Need to call Shell script that uses SQL loader in APex4.1/11g

    Hi there!
    I have a requirement, wherein I have to call a shell script that connects to an external server, ftp's a file in and then uses sqlloader to load data into our table. Now we have the ftp script that does this for another program, but is a scheduled job. I wanted to call the ftp shell script from within APEX. Any suggestions on how this can be done, what PL/SQL logic can we use? I see online some people using dbms scheduler for this?
    Thank you
    Sun

    Hi,
    Create some sh script on your oracle host machine where you can join into external server and run the process.
    something like:
    run_external_sh.sh
    #!/bin/sh
    ssh ext_user@ext_host ./sqlloader/import/import.shThen create a external JOB to call it via ORACLE(PL/SQL)
    -- Call Shell Script.
    BEGIN
      DBMS_SCHEDULER.create_program (
        program_name        => 'external_call_sh',
        program_type        => 'EXECUTABLE',
        program_action      => '/local_host/call_external/sh/run_external_sh.sh',
        number_of_arguments => 0,
        enabled             => TRUE,
        comments            => 'Call external SH script');
    END;
    /Now you can create a scheduled/or not scheduled JOB
    -- Job defined by an existing program and schedule.
    BEGIN
      DBMS_SCHEDULER.create_job (
        job_name      => 'jb_external_call_sh',
        program_name  => 'external_call_sh',
        schedule_name => 'external_call_scheduler', -- created scheduler
        enabled       => TRUE,
        comments      => 'Job defined by an existing external_call_sh program and schedule.');
    END;
    /Now you can call the JOB in APEX in PL/SQL process.
    BEGIN
      -- Run job synchronously.
      DBMS_SCHEDULER.run_job (job_name            => 'jb_external_call_sh');
    END;Regards
    J :D

  • Use sql loader in forms

    when i put the following statements into oracle forms 9i using a mouse trigger procedure, it compiled successfully but the data was not upload
    BEGIN
    HOST('C:\orahome1\bin\sqlldr userid=hr/hr@orcl control=e:\table1.ctl data=e:\file.csv log=e:\abc.log');
    commit_form;
    END;
    however
    i use the same statement in sqlplus without the quotes '', it works and the data are uploaded successfully.
    HOST(C:\orahome1\bin\sqlldr userid=hr/hr@orcl control=e:\table1.ctl data=e:\file.csv log=e:\abc.log)
    so what was wrong with my mouse trigger procedure ?
    any idea, thanks.

    i tried to use the following and works fine
    begin
    host('del c:\temp.txt')
    end
    but it's just not working with the host command
    if i change it to client_host, i can't even compile the form successfully.
    btw, if the host command doesn't work in forms9i, how can it be compiled successfully.
    thanks for any comments.

  • How to load date with time zone using sql loader???

    Hi All,
    How to load following value in the table using SQL loader.
    [11/Jan/2006:15:20:14 -0800]
    What should be the datatype of the column in the table. I have tried with "timestamp with local time zone", but unable to load the record using sql loader. What should be the format string in the loader control file to load this type of record.
    Any help in this regard is highly appreciated.
    Sameer

    Try something like this in your control file:
    mycol char "TO_TIMESTAMP_TZ(mycol, 'DD/MON/YYYY:HH24:MI:SS TZH:TZM')"
    [pre]
    Message was edited by:
            Jens Petersen                                                                                                                                                                                                                                                                                                                                                                       

  • I have a Steinberg MI4 and a Roland Fantom X7, and am trying to use my Fantom in Logic to record audio. Need help setting it all up using MIDI cables. Please help !

    I have a Steinberg MI4 and a Roland Fantom X7, and am trying to use my Fantom in Logic to record audio. Need help setting it all up using MIDI cables. Please help !

    Encryption wouldn't matter except for Wifi.
    While 10.2 might help, there's not much you can do on the Internet these days with less than 10.4.11
    Tiger Requirements...
    To use Mac OS X 10.4 Tiger, your Macintosh needs:
        * A PowerPC G3, G4, or G5 processor
        * Built-in FireWire
        * At least 256 MB of RAM (I recommend 1GB minimum)
        * DVD drive (DVD-ROM), Combo (CD-RW/DVD-ROM) or SuperDrive (DVD-R) for installation
        * At least 3 GB of free disk space; 4 GB if you install the XCode 2 Developer Tools  (I recommend 20GB minimum)
    http://support.apple.com/kb/HT1514
    http://www.ebay.com/sch/i.html?_nkw=mac+os+x+tiger+retail+10.4
    See Tom's, (Texas Mac Man), great info on where/how to find/get Tiger...
    https://discussions.apple.com/message/15305521#15305521
    Or Ali Brown's great info on where/how to find/get Tiger...
    http://discussions.apple.com/thread.jspa?messageID=10381710#10381710
    As far as Memory, that's sort of easy, find your eMac here...
    http://eshop.macsales.com/MyOWC/Models.cfm?Family=emac&sType=Memory
    As far as Hard Drive, it's not easy to replace the Internal drive, I'd maybe suggest an external Firewire drive to boot from...
    http://eshop.macsales.com/item/Other%20World%20Computing/MAU4S7500G16/

  • Need help to fit the records of a table into a particular region

    Hi All,
    Need help in getting the records of table to be fitted into a particular region provided for it. But in my case as the records increases the textbox below are moving down accordingly into next page that i dont want.  
    As shown in the below image i have to fit 22 no. of records in that given area only not disturbing the below textbox alignments.
    Thank in advance...
    Sreekanth Note: Please vote/mark the post as answered if it answers your question/helps to solve your problem.*****

    Hello,
    In SSRS, Report items within a report can be
    kept together on a single page implicitly or explicitly by setting the keep with group or keep together properties.
    In your case, you can try to specify the "KeepTogether" property to True on the Table properties windows.
    If there are other report items  under or above the Table and you want keep all items on the single page, you can try to add a Rectangle and put all items into the Rectangle.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Need suggestions on loading 5000+ files using sql loader

    Hi Guys,
    I'm writing a shell script to load more than 5000 files using sql loader.
    My intention is to load the files in parallel. When I checked the maximum number of sessions in v$parameter, it is around 700.
    Before starting the data load, programmatically I am getting the number of current sessions and maximum number of sessions and keeping free 200 sessions without using them (max. no. of sessions minus 200 ) and utilizing the remaining ~300 sessions to load the files in parallel.
    Also I am using a "wait" option to make the shell to wait until the 300 concurrent sql loader process to complete and moving further.
    Is there any way to make it more efficient? Also is it possible to reduce the wait time without hard coding the seconds (For Example: If any of those 300 sessions becomes free, assign the next file to the job queue and so on..)
    Please share your thoughts on this.
    Thanks.

    Manohar wrote:
    I'm writing a shell script to load more than 5000 files using sql loader.
    My intention is to load the files in parallel. When I checked the maximum number of sessions in v$parameter, it is around 700. Concurrent load you mean? Parallel processing implies take a workload, breaking that up into smaller workloads, and doing that in parallel. This is what the Parallel Query feature does in Oracle.
    SQL*Loader does not do that for you. It uses a single session to load a single file. To make it run in parallel, requires manually starting multiple loader sessions and perform concurrent loads.
    Have a look at Parallel Data Loading Models in the Oracle® Database Utilities guide. It goes into detail on how to perform concurrent loads. But you need to parallelise that workload yourself (as explained in the manual).
    Before starting the data load, programmatically I am getting the number of current sessions and maximum number of sessions and keeping free 200 sessions without using them (max. no. of sessions minus 200 ) and utilizing the remaining ~300 sessions to load the files in parallel.
    Also I am using a "wait" option to make the shell to wait until the 300 concurrent sql loader process to complete and moving further.
    Is there any way to make it more efficient? Also is it possible to reduce the wait time without hard coding the seconds (For Example: If any of those 300 sessions becomes free, assign the next file to the job queue and so on..)Consider doing it the way that Parallel Query does (as I've mentioned above). Take the workload (all files). Break the workload up into smaller sub-workloads (e.g. 50 files to be loaded by a process). Start a 100 processes in parallel and provide each one with a sub-workload to do (100 processes each loading 50 odd files).
    This is a lot easier to manage than starting for example a 5000 load processes and then trying some kind of delay method to ensure that not all hit the database at the same time.
    I'm loading about 100+ files (3+ million rows) every 60 seconds 24x7 using SQL*Loader. Oracle is quite scalable and SQL*Loader quite capable.

  • I need help please , i try to use itunes but my iPhone don't appear on itunes, i try everyting ,dowwload itunes again restart computer and iPhone,restart running device support,etc.

    i need help please , i try to use itunes but my iPhone don't appear on itunes, i try everyting ,dowwload itunes again restart computer and iPhone,restart running device support,etc.

    Windows doesn't detect iPhone: http://support.apple.com/kb/ts1538
    Mac: http://support.apple.com/kb/ts1591

  • How to use SQL loader with DBF fixed format record

    Hi everybody!
    My situation is that: I want to use SQL loader with Foxpro DBF format, it similar to case 2 study (Fixed format record) but DBF file has header, how can I tell SQL loader skip header.
    Thank you in advance

    Another option is to apply SQL operators to fields
    LOAD DATA
       INFILE *
       APPEND
    INTO TABLE emp
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' (
       empno,
       ename,
       job,
       mgr,
       hiredate DATE(20) "DD-Month-YYYY",
       sal,
       comm,
       deptno CHAR TERMINATED BY ':',
       projno,
    loadseq "my_seq.nextval")This is a modified control file of Case Study 3 which originally demonstrated the use of the Sequence parameter

  • Allan Eckert, need help on G5 Coolscan 5000 use

    Allan , need help on G5 Coolscan 5000 use. Please email me from my profile.
    Thank you,
    Frank

    Just to chime in with my 2 cents and experience ...
    A few years ago I used a coolscan 4000 to scan my personal slides as a project. I had about 2000 of them from over the last 20 years and it took me about 6 weeks of personal time to do this. It was done on a Windows P4 2.5GHz Dell, but the slowest part was the actual scanning itself. I used 1 pass, Digital ICE, and saved them as 16bit TIFFs .... a whopping 65MB per scan.... To speed things up I bought the Nikon Slide adapter ($600 CDN) that would batch scan 50 slides at a time, however it would jam ( especially with the older cardboard mounted Kodachrome slides) periodically ... oh maybe 20-30 times with 2000 slides, and that really wasted time as I had to determine what need to be rescanned, and restart at the offending slide. This also would happen in the middle of the night when I was sleeping after setting the batch scan to run all night. Jamming often occurred as two slides tried to be scanned at the same time, as well as a slightly 'bent or creased' mount I found that the newer plastic mounts were better, but not entirely jam free, Nikon has some info on how well the various mounts work in their adapter on their website. Anyway I wish you well with 300+K slides to scan and recommend the batch slide adapter, and I think your speed will be determined more by the HW scan time than the CPU/GPU, so I would try to get as many scanners going as you can with that number of slides.
    -Robert
    PS I now have all originals in Aperture, and gave up the Dell 3 years ago.

  • Loading XML file using sql*loader (10g)

    Hi Everyone....
    I have a major problem. I have a 10g database and I need to use sql loader to load a large XML file into the database. This file contains records for many, many customers. This will be done several times and the number of records will vary. I want to use sql loader and load to a staging table, BUT SPLIT THE RECORDS OUT and add a sequence. I am having 2 problems.
    In the 10g documentation, when you want to split the records you use the BEGINDATA clause and indicate something (like a 0) for each instance of a record. Well my first file has 3,722 records in it. How do I know the number of records in each XML file?
    The second problem is that because this is XML, I thought that I could use ENCLOSED BY. But the start tag has an attribute /counter in it, sql*loader doesnt recognize the starting tag. (i.e.: start tag is: </CustomerRec number=1>
    end tag is: </CustomerRec> )
    So, I used TERMINATED BY '</CustomerRec>'. This will split out the records, but it will NOT include the ending tag of </CustomerRec> and when I use extract, I receive an XML parsing error.
    I have tried to get the ending tag using CONTINUEIF and SKIP. But those options are for "records" and not lines.
    Does anyone have any ideas for the 2 problems above. I am at my wits end and I need to finish this ASAP. Any help would be appreciated.
    Thank you!

    Sorry.... here is an example of what my control file looks like. At the end, I have 92 "0", but remember, I have 3722 records in this first file.
    LOAD DATA (SKIP 1)
    INFILE *
    INTO TABLE RETURN_DATA_STG
    TRUNCATE
    XMLType(xmldata)
    FIELDS
    (fill FILLER CHAR(1),
    loadseq SEQUENCE(MAX,1),
    xmldata LOBFILE (CONSTANT F001AB.XML)
    TERMINATED BY '</ExtractObject>'
    ------ ":xmldata||'</ExtractObject>'"
    BEGINDATA
    0
    0
    0
    0
    0
    0

  • Using sql loader

    hi
    I need some help in using sql loader in windows xp to do some practice.
    i know we have to use below command in unix but what was the command to use in windows.
    sqlldr userid=scott/tiger control=ulcase1.ctl log=ulcase1.log
    thanks in advance...

    sam482 wrote:
    hi
    I need some help in using sql loader in windows xp to do some practice.
    i know we have to use below command in unix but what was the command to use in windows.
    sqlldr userid=scott/tiger control=ulcase1.ctl log=ulcase1.logSearch on you Windows XP oracle directory for *.ctl you will find there are files the control loader files used to create/populate the records for the demo schema. So if you can dig deeper you will find more things demos of sql/java/procedures etc.
    I am assuming you have installed oracle on you Windows XP, if not install and check it out.
    SS

  • Using SQL Loader to insert data based on conditionally statements

    I would like to use sql loader to insert records from a single text file into an Oracle database table. Sounds easy but the problem is that I need to check the existence of data in another table (Table A) before data can be loaded into Table B.
    Table A has two columns: dept_no (primary key value) and dept_name (char)
    Table B has five columns: emp_no (primary key value), dept_no (foreign key value to Table A), employee (char), job_title (char) and salary (number)
    Text File looks like this:
    Finance Jones President 10000
    HR Smith Admin 2000
    HelpDesk Jenkins Technician 3000
    Problem:
    1. I need sql loader to insert records into Table B by first checking if the first field in the file is in Table A.
    2. If value exists get it's dept_no value.
    3. If value doesn't exist discard record ( I might want to have sql loader insert a new record for this into Table A)
    4. Using value from #2, insert the value in Table B for dept_no column.
    5. Also assign a sequence value for the emp_no value in Table B.
    Any guidance is greatly appreciated.
    Thanks,

    Hello,
    I am not sure this is possible with SQL loader. I would rather use an external table based on your file.
    Then, I would use SQL to load your data into your table, based on your conditions.
    Your request is not very complicated, writing the SQL to do that will be really more simple than trying to do it with SQL loader.
    Hope it will help.
    Regards,
    Sylvie

Maybe you are looking for

  • Problem with iChat and Address Book

    Ok, I've been having a problem ever since I used a program to remove my unwanted print drivers and language packs (I forget the program's name). Ever since then, my iChat and Address book will not open. The spinning beach ball appears, and nothing ha

  • Numbers by Apple: Can I create a custom format on the iPad, like on Mac?

    A

  • Using Disc Utility to Make a Bootable Clone

    Need some help, please. OS 10.4.6. I have an external hard drive partitioned to 3 volumes; I back up 3 computers on it to keep off site. Following instructions Kappy has posted, I initially set up as follows: 1. Open Disk Utility in the Utilities fol

  • Problem in language

    I have MySQL Database with cp1256 encoding for Arabic language I enter Arabic characters from the MySQL Manager and everything is OK. when I go to Java Studio Creator and make DataSource for my database and before doing any project I right click the

  • Warehouse Management User Manuals

    Dear Friends, Can you please forward me some user manuals for Warehouse management.. urgently needed for training purposes ? I will be very grateful. thnks nandu