SQL Loader Excel Sheet Work book Issue!

Hi Everyone:
How can my Excel Sheet convert into CSV or whatever format where I can able to load data into oracle.
Rigth now I do copy and paste from excel sheet into notepad.
Please reply me at your earliest convenience.
Regards,
Zeeshan

If you have seperate sheets in your workbook then you're going to have to save each one out as a seperate CSV file and load each one into Oracle either using SQL*Loader or using External Tables (this latter will require that the files are located on the database server).
Or...
You could set up an ODBC connection to your Excel workbook and, provided your data is is a suitably table type style and your database is running on a windows server, you will be able to set up an external database connection to the Excel workbook and query each sheet as a table e.g.:
1- Go to Control Panel>Administrative Tools>Data Sources (ODBC)>System DSN and create a data source with appropriate driver. Name it EXCL.
2- In %ORACLE_HOME%\Network\Admin\Tnsnames.ora fie add entry:
EXCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.0.24)(PORT = 1521))
(CONNECT_DATA =
(SID = EXCL)
(HS = OK)
Here SID is the name of data source that you have just created.
3- In %ORACLE_HOME%\Network\Admin\Listener.ora file add:
(SID_DESC =
(PROGRAM = hsodbc)
(SID_NAME = <hs_sid>)
(ORACLE_HOME = <oracle home>)
under SID_LIST_LISTENER like:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = d:\ORA9DB)
(PROGRAM = extproc)
(SID_DESC =
(GLOBAL_DBNAME = ORA9DB)
(ORACLE_HOME = d:\ORA9DB)
(SID_NAME = ORA9DB)
(SID_DESC =
(PROGRAM = hsodbc)
(SID_NAME = EXCL)
(ORACLE_HOME = D:\ora9db)
Dont forget to reload the listener
c:\> lsnrctl reload
4- In %ORACLE_HOME%\hs\admin create init<HS_SID>.ora. For our sid EXCL we create file initexcl.ora.
In this file set following two parameters:
HS_FDS_CONNECT_INFO = excl
HS_FDS_TRACE_LEVEL = 0
5- Now connect to Oracle database and create database link with following command:
SQL> CREATE DATABASE LINK excl
2 USING 'excl'
3 /
Database link created.
Now you can perform query against this database like you would for any remote database.
SQL> SELECT table_name FROM all_tables@excl;
TABLE_NAME
DEPT
EMP

Similar Messages

  • How to add number to excel sheet work book cell?

    I am trying to create an excel sheet dynamically. I am able to create and populate the data as well.
    But in one of the cell I have to add 1.0 value. Since I have added this as a new Label(...), after opening the excel sheet I can see an icon in the cell with message as "Number in this cell is formed as a text".
    SO I have changed Label to Number while adding to cell.
    I am using the format as "#.#". Othen than 1.0 everything I can see in the cell as x.y format. Like 1.2, 5.7 etc...
    But for 1.0 I can see as "1." only.
    Is there any way to write 1.0 to cell as a number.
    I am using jxl.jar for excel.

    I have jxl supported api.
    It supports formating the numbers.
    It has NumberFormat class to support formating.
    NumberFormat format = new Numberformat("#.#");
    WritableCellFormat cellFormat = new WritableCellFormat(format);
    excelSheet.addCell(new Number(1, 0, 1.0, cellFormat);
    Api for Number : Number(int column, int row, double value, Cellformat ft);
    If I add other than 1.0, data is displayed properly in the sheet.
    1.2, 4.5, 3.567 --> 3.6 etc...

  • How i can load excel sheet into a table in oracle through pl/sql procedure

    Hi,
    How i can load excel sheet into a table in oracle through pl/sql procedure or a pl/sql block. Excel sheet is saved on my c or d drive on my machine. In xls format.

    Depending on how big your spreadsheet is and how frequently you want to do this you might want to contruct insert statements in excel, then run these. I have done this to load a few hundred rows for a one off test on dev.
    e.g. if you have values 1 and 'a' in you spread sheet and want to insert them in to table xxx col1 & 2:
    | /|   A   |   B   |    C
    |1 |col1   |col2   |
    |2 |      1|a      |="insert into xxx ("&$A$1&","&B1&") values ("&A2&",'"&B2&"');"then paste the contents of colum C
    insert into xxx (col1,col2) values (1,'a');into sqlplus or a script.

  • SQl loader is not working in 10g but working in 9i

    In My PC i have installed both 9i and 10g. could you please tell me why it is not working

    "SQL loader is not working" is rather like "my car won't start" http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
    The 9i Oracle Client install includes sqlldr. The 10g Oracle Client install does NOT include sqlldr. You'd have to do a "Custom" Install and specifically select "Oracle Database Utilities" to install.
    See MetaLink Note#437377.1
    Edited by: Hemant K Chitale on Dec 31, 2008 3:58 PM
    Edited by: Hemant K Chitale on Dec 31, 2008 4:00 PM

  • Excel 2013: Slow performance loading Excel Sheets

    Our customer is migrating from Vista/Office 2007 to Windows 7/Office 2013 and they have the following configurations:
    VDI Windows 7 PRO x64, XenDesktop 5.6 - 2 Core on ESX 5.0, 4GB, VDI on SSD
    VDI Windows 7 PRO x64, XenDesktop 5.6 - 2 Core on ESX 5.5, 4GB, VDI on SSD
    Laptop, Windows 7 PRO x64, 4 core (+HT) i7, 8GB, SSD
    Advanced workstation, Windows 7 PRO x64, dual 8 core Xeon (No HT), 32GB, SSD
    On all these systems we tested Excel 2013 (patched until today) in both 32-bit as 64-bit versions. Both as AppV and Native install.
    When we open an Excel worksheet, approx 220MB with a lot of cell's and rows, Excel takes approx 2-4 minutes to open the sheet, even when calculations do not apply. In Excel 2007, the same sheet opens within 20 seconds and even faster.
    What we tried:
    Auto calculation - Disabled
    All fancy stuff in Excel - Disabled
    excel.exe.config with settings to bypass some certifcate checks
    Disabled and finally removed allmost every plugin
    Playing with a lot of options in Excel 2013
    To have a cross check, we reproduced the problem at an other client with both Excel 2013 and Excel 2010. And the problem still exists allthough Excel 2010 is not as bad as Excel 2013.
    Is there any solution for this problem other then not use Office 2010/Office 2013 and stick with Office 2007 (what has other problems in combination with newer software so is also not an option)?
    Update dec 17, 2014:
    Tested with Safe Mode - No solution
    Tested with Trusted locations - No solution

    George,
    I did do some tests as suggested and I found a huge difference between the handling of Excel 2007/2010 and 2013. I did see some strange behaviour.
    I created an Excel Sheet in all 3 environments with identical steps to get identical sheets. After save i discovered the following:
    On Excel 2007/2010 the test sheet was:
    Test Sheet.xlsx - 191.894 kB
    Test Sheet.xls - 614.881 kB
    On Excel 2013 test sheet was:
    Test Sheet.xlsx - 187.378 kB
    Test Sheet.xls - 336.092 kB
    After that we repeated tests, but due to some problems with the Vista/2007 workstation I was not able to continue my tests, and maybe tomorrow I can do the tests there.
    When I was testing with 2010 and 2013 i discovered there are some phases when loading a sheet. And there is where 2013 in my opinion does something not good. The tests run from "Open" until the sheet can be "Edited".
    Under Excel 2010 the phases can be defined as: Download, Validate, Open, Calculate, Display, Editable
    Under Excel 2013 the phases can be defined as: Download, Validate, Open, Calculate, Calculate, Display, Editable
    What i noticed is that Excel 2013 does calculate the sheet 2 times instead of one time. And I made some tests with this knowledge.
    Test/Stage
    Type
    Download
    Open/Validate
    Calculate 1
    Calculate 2
    Ready
    Excel 2013
    xls
    0:17
    0:38
    1:15
    1:48
    2:17
    Excel 2013
    xlsx
    0:10
    1:18
    1:49
    2:28
    2:32
    Excel 2010
    xls
    0:27
    3:03
    3:36
    3:42
    Excel 2010
    xlsx
    0:08
    0:56
    1:10
    1:13
    Excel 2010 (2013 sheet)
    xlsx
    0:06
    0:53
    1:09
    1:14
    So there is a second calculation loop in Excel 2013 what takes a lot of time. And i discovered some other problems when creating my test sheets where recalcuation makes a mess of it, but that is a later issue.

  • Work book  issue

    Hi BW Experts,
    We did stack upgrade  13 in Bi 7.O.
    We got issue with work book title name is not displaying.Before stack upgrade it was good.Any solution for this.
    Thanks,
    Chinna.

    problem solved.
    Thanks

  • SQL*LOADER example not working for REF

    I was working on the Oracle bulk load scripts using SQL*LOADER utility .
    I have encountered an error while using the REF column option to resolve the parent-child referential integrity .
    The example given in the URL http://www.csee.umbc.edu/help/oracle8/server.815/a67792/ch05.htm Example 5-9 Loading Primary Key REF Columns
    does not work . and generates errors : 'SQL*Loader-418: Bad datafile datatype for column DEPT_MGR'
    example :
    Control File
    LOAD DATA
    INFILE `sample.dat'
    INTO TABLE departments_alt
    FIELDS TERMINATED BY `,' OPTIONALLY ENCLOSED BY `"'
    (dept_no CHAR(5),
    dept_name CHAR(30),
    dept_mgr REF(CONSTANT `EMPLOYEES', emp_id),
    emp_id FILLER CHAR(32))
    Data file (sample.dat)
    22345, QuestWorld, 007,
    23423, Geography, 000,
    Could you please suggest any solutions for this ?

    Some of the quotes are wrong
    Try the sample from the 10.2 documentation
    LOAD DATA
    INFILE 'sample.dat'
    INTO TABLE departments_alt
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (dept_no       CHAR(5),
    dept_name      CHAR(30),
    dept_mgr       REF(CONSTANT 'EMPLOYEES', emp_id),
    emp_id         FILLER CHAR(32))

  • Unable to load excel sheet into oracle

    Can somebody help me...
    I just want to load data records from MS Excel spreadsheet into Oracle table without converting that MS Excel file,
    my ENV: Linux (centos 5.4 + Oracle EE 11gR2)
    here what I did:
    -ODBC-Conf on MS
    create a system DSN 'odbc_excel' => OK
    -Create HS initialization File => OK
    cat initexcel.ora
    HS_FDS_CONNECT_INFO = odbc_excel
    HS_AUTOREGISTER = TRUE
    HS_DB_NAME = dg4odbc
    -Modify listener.ora => OK
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = excel)
    (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
    (PROGRAM = dg4odbc)
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
    (PROGRAM = extproc)
    -Modify tnsnames.ora: => OK
    excel =
    (DESCRIPTION =
    (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = DEDUSOBI)(PORT = 1521)))
    (CONNECT_DATA = (SID = excel)) (HS = OK)
    -lsnrctl reload => OK
    LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-MAR-2010 13:15:32
    Copyright (c) 1991, 2009, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    The command completed successfully
    -tnsping excel => OK
    TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 11-MAR-2010 13:15:09
    Copyright (c) 1997, 2009, Oracle. All rights reserved.
    Used parameter files:
    /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = DEDUSOBI)(PORT = 1521))) (CONNECT_DATA = (SID = excel)) (HS = OK))
    OK (20 msec)
    -create link in ORA => OK
    SQL> create database link excel using 'excel';
    Database link created.
    SQL> select * from dba_db_links where DB_LINK like '%EXCEL%';
    OWNER SYSTEM
    DB_LINK EXCEL
    USERNAME
    HOST excel
    CREATED 11-Mar-10
    -check link => NOK :-(
    SQL> select table_name from all_tables@EXCEL;
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    ORA-02063: preceding line from EXCEL
    -listener.log
    11-MAR-2010 13:33:30 * (CONNECT_DATA=(SID=excel)(CID=(PROGRAM=)(HOST=DEDUSOBI)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp) (HOST=127.0.0.1)(PORT=58093)) * establish * excel * 0
    All comments are welcome, thanks
    Zeynel
    Edited by: seyrekel on Mar 11, 2010 4:07 AM

    thanks for the respond Werner, that seems to be the most tricky part (ODBC-Conf@Linux)
    the driver should be available:
    # rpm -qa | grep -i odbc
    unixODBC-devel-2.2.11-7.1
    unixODBC-2.2.11-7.1
    # odbcinst -j
    unixODBC 2.2.11
    DRIVERS............: /etc/odbcinst.ini
    SYSTEM DATA SOURCES: /etc/odbc.ini
    USER DATA SOURCES..: /root/.odbc.ini
    #file /.../dbhome_1/bin/dg4odbc
    /.../dg4odbc:
    ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
    for GNU/Linux 2.6.9, dynamically linked (uses shared libs),
    for GNU/Linux 2.6.9, not stripped
    # odbcinst -s -q
    [ODBC]
    [AnalyticsWeb]
    [Cluster]
    [SSL_Sample]
    but still the same error message...
    thanks
    Zeynel

  • Does excel sheets work on Numbers3.0

    can you open an excel work sheet in numbers 3.0?

    you can open excel workbooks in numbers, and those workbooks can contain multiple sheets. Which will show up as individual tabs in numbers with a single table on each that holds the data for each sheet from excel.
    If you add tables to the sheets in numbers they will be turned into individual sheets in the new excel export you do.
    Please remember that not all functions are available in numbers that excel supports, nor is VBA supported, adn currently there is no applescript workaround currently.
    Jason

  • SQL Loader Excel input file in different order than table

    Hi,
    Have an instance where I have an Excel spreadsheet we've used for a while got a field added to it. This field has been added as the fourth field. On my Oracle table, I added a column and its listed last. So of course when I import, the fields are out of order. Does any one know what can be done to fix this? I'm a newby at this, and couldn't find the answer already listed, so any help is appreciated.
    Thanks,
    Vic

    Hello Victoria.
    Please provide actual or sample statements and the full text of errors along with error code to help the forum members help you better. In this case, the DDL for the table, a couple lines of the data and the control file being used would be extremely helpful. Please enclose in { code } with no spaces so that the spacing is retained in the postas in  this   exampleThanks,
    Luke

  • Loading Data Error while using SQL Loader

    Hi All,
    I am facing another issue while loading the data from text file to oracle db.
    I have a table in which data is loaded from multiple files. What i want the when i load the data i want to load the filename as well in the table in front of the record. the script which works fine when i load data in windows OS but i am getting error in Unix OS. My sql loader script is as follows.
    source $HOME/. .bash_profile
    export LOGFILE=/NSN/rawfiles/scripts/PAYMOBILE_LOAD/load.log
    ORACLE_ACCESS=cdr/cdr123_awcc@$ORACLE_SID
    FILES=`ls /NSN/rawfiles/bkp/PAYMOBILE/JAN2013/*.txt`;
    for file in ${FILES[@]}
    do
    filename=`expr substr "$file" 43 50`
    echo $filename
    sqlldr $ORACLE_ACCESS control=/NSN/rawfiles/scripts/PAYMOBILE/CAT.ctl log=$LOGFILE data=/NSN/rawfiles/bkp/PAYMOBILE/JAN2013/$filename skip=0 direct=true
    cd
    mv /NSN/rawfiles/bkp/PAYMOBILE/JAN2013/$filename /NSN/backup/PAYMOBILE/JAN2013/
    done
    Control File for the same which i run on unix is :
    Load data
    INFILE "AR_101_1011_01-01-2013-01-32.txt"
    Append
    into table CDR.PAY_MOBILE_012013
    fields terminated by "|" optionally enclosed by " "
    trailing nullcols
    VERSION, TICKETTYPE, GMT_TIME Date 'YYYY-MM-DD HH24:MI:SS' , LOCAL_TIME Date 'YYYY-MM-DD HH24:MI:SS', TRANSACID, EXTERNAL_TRANSACTION_ID, MEDIUM, ALIASCATEGORY, SERVICE, OPERATION, ACTORID,
    ALIASNAME, SENDERACTORID, SENDERALIASNAME, RECIPIENTACTORID, RECIPIENTALIASNAME, THIRDACTORID, THIRDALIASNAME, ERRORHRN, CLASS, SNE,
    MASTERSNE, VOUCHERCATEGORYID, VOUCHERSCENARIOID, EXPIRYDATE Date 'YYYY-MM-DD HH24:MI:SS', UNITVALUEID, CREDIT, VAT, IERROR, OPERSTATE, OPERERROR, CREATION_DATE Date 'YYYY-MM-DD HH24:MI:SS',
    LAST_UPDATE Date 'YYYY-MM-DD HH24:MI:SS', BRANDID, CREDIT_PERIOD, CREDIT_EXPIRY_DATE Date 'YYYY-MM-DD HH24:MI:SS', SENDER_ACCOUNT, SENDER_TRANSAC, SENDER_ACCOUNT_TYPE, RECIPIENT_ACCOUNT,
    RECIPIENT_TRANSAC, RECIPIENT_ACCOUNT_TYPE, RECIPIENT_MEDIUM, TIMESTAMP Date 'YYYY-MM-DD HH24:MI:SS', SENDERBILLINGTYPE, RECIPIENTBILLINGTYPE
    Control file which works fine in windows is as follows:
    Load data
         Append
         into table CDR.PAY_MOBILE_012013
         fields terminated by "|" optionally enclosed by " "
         trailing nullcols
    VERSION, TICKETTYPE, GMT_TIME Date 'YYYY-MM-DD HH24:MI:SS' , LOCAL_TIME Date 'YYYY-MM-DD HH24:MI:SS', TRANSACID, EXTERNAL_TRANSACTION_ID, MEDIUM, ALIASCATEGORY, SERVICE, OPERATION, ACTORID,
    ALIASNAME, SENDERACTORID, SENDERALIASNAME, RECIPIENTACTORID, RECIPIENTALIASNAME, THIRDACTORID, THIRDALIASNAME, ERRORHRN, CLASS, SNE,
    MASTERSNE, VOUCHERCATEGORYID, VOUCHERSCENARIOID, EXPIRYDATE Date 'YYYY-MM-DD HH24:MI:SS', UNITVALUEID, CREDIT, VAT, IERROR, OPERSTATE, OPERERROR, CREATION_DATE Date 'YYYY-MM-DD HH24:MI:SS',
    LAST_UPDATE Date 'YYYY-MM-DD HH24:MI:SS', BRANDID, CREDIT_PERIOD, CREDIT_EXPIRY_DATE Date 'YYYY-MM-DD HH24:MI:SS', SENDER_ACCOUNT, SENDER_TRANSAC, SENDER_ACCOUNT_TYPE, RECIPIENT_ACCOUNT,
    RECIPIENT_TRANSAC, RECIPIENT_ACCOUNT_TYPE, RECIPIENT_MEDIUM, TIMESTAMP Date 'YYYY-MM-DD HH24:MI:SS', SENDERBILLINGTYPE, RECIPIENTBILLINGTYPE, FILENAME CONSTANT "AR_101_1011_01-12-2012-23-32.txt"
    and the sql loader script which works fine in windows is as follows:
    cd K:\paymobilefiles\DEC2012\1
    for %%f in (*.txt) do (K:\paymobilefiles\DEC2012\1\LOAD\REPTEXT K:\paymobilefiles\DEC2012\1\LOAD\TEST.ctl "%%f">K:\paymobilefiles\DEC2012\1\LOAD\MYMOBILE.ctl
    sqlldr userid=cdr/cdr123_awcc@tsiindia control=K:\paymobilefiles\DEC2012\1\LOAD\MYMOBILE.ctl rows=50000 bindsize=20000000 readsize=20000000 data=%%f log=K:\paymobilefiles\DEC2012\1\LOAD\MYMOBILE.log
    move %%f K:\paymobilefiles\DEC2012\backup\1
    when using windows based scripts i am getting filename in the filename column but when running the above mentioned scripts i am not able to get the filenames in the filename column.
    Can anyone help over the same please

    HI,
    There is Difference in Control files , no INFILE & FILENAME CONSTANT values
    Load data
    Append
    into table CDR.PAY_MOBILE_012013
    fields terminated by "|" optionally enclosed by " "
    trailing nullcols
    VERSION, TICKETTYPE, GMT_TIME Date 'YYYY-MM-DD HH24:MI:SS' , LOCAL_TIME Date 'YYYY-MM-DD HH24:MI:SS', TRANSACID, EXTERNAL_TRANSACTION_ID, MEDIUM, ALIASCATEGORY, SERVICE, OPERATION, ACTORID,
    ALIASNAME, SENDERACTORID, SENDERALIASNAME, RECIPIENTACTORID, RECIPIENTALIASNAME, THIRDACTORID, THIRDALIASNAME, ERRORHRN, CLASS, SNE,
    MASTERSNE, VOUCHERCATEGORYID, VOUCHERSCENARIOID, EXPIRYDATE Date 'YYYY-MM-DD HH24:MI:SS', UNITVALUEID, CREDIT, VAT, IERROR, OPERSTATE, OPERERROR, CREATION_DATE Date 'YYYY-MM-DD HH24:MI:SS',
    LAST_UPDATE Date 'YYYY-MM-DD HH24:MI:SS', BRANDID, CREDIT_PERIOD, CREDIT_EXPIRY_DATE Date 'YYYY-MM-DD HH24:MI:SS', SENDER_ACCOUNT, SENDER_TRANSAC, SENDER_ACCOUNT_TYPE, RECIPIENT_ACCOUNT,
    RECIPIENT_TRANSAC, RECIPIENT_ACCOUNT_TYPE, RECIPIENT_MEDIUM, TIMESTAMP Date 'YYYY-MM-DD HH24:MI:SS', SENDERBILLINGTYPE, RECIPIENTBILLINGTYPE, FILENAME CONSTANT "AR_101_1011_01-12-2012-23-32.txt"
    )Thanks,
    Ajay More
    http://moreajays.blogspot.com

  • SQL*LOADER script with ORA-03135: connection lost contact error

    Hello,
    I got a really strange problem with a script that transfer data from a database to an other. Each day we recieve the raw data in zipped txt files, then we feed it to the database with SQL Loader. This worked fine until two weeks ago. At first, I thought the error must have been in the script, but it didn't change at all since 3 months. And the weirdest thing is that sometime it works without any problems, but now I get almost anytime the "ORA-03135: connection lost contact" and it seems to happen randomly. It never fails at the same place , thought the data I feed the script is always the same.
    I'm new to SQL*Loader and since the script seems to send all the data, I don't understand where that error come from. Can I do something on my workstation or the problem is on the database server ?
    I think the problem would be that the connection get a timeout out on the server, but we never got that problem on the production server and it has a lot more data to transfer then my little test script.
    Have you any idea on whjat the problem could be ?

    03135, 00000, "connection lost contact"
    // *Cause:  1) Server unexpectedly terminated or was forced to terminate.
    //          2) Server timed out the connection.
    // *Action: 1) Check if the server session was terminated.
    //          2) Check if the timeout parameters are set properly in sqlnet.ora.I would suspect networking issues external to sqlldr & Oracle

  • Sql loader hangs

    Hi All,
    I have a java program which runs sql loader in a timer. That is the sql loader is used to load some tables with the data contained in a flat file. And I want this to be run every night.
    I am using Runtime class to initiate a process which will invoke the sql loader. This works fine when I directly call my function in main.
    But since I want this to run every night, I decided to invoke it thru the timer class. And when I do that the sql loader hangs and I have to terminate the process manually.
    Is there any solution for the above problem?
    Any help will be appreciated.
    Regards,
    Chitra

    Just to give a lil bit more added clarity on the issue.
    The requirement is like this. I have a flat file which needs to be uploaded to a database periodically. Every 24hrs. Now I am using Oracles SQL Loader to upload the data flat file. I am calling SQL loader from with a java program using Runtime class. Now I initiated this using a standard Java application and put it in the main class. It works fine. Now since I needed to have this running every 24hrs I used a Timer class to set the timer and to have it running evry 24 hrs. Now if I execute the same class above within the timer class, the SQL loader pops up in a new window and the program does not complete the execution. It just hangs. Which requires for me to terminate the process manually. All the data in the flat file is uploaded to the database but that is shown only after the proecess is treminated. Is there any solution for this ? Or does anyone have any idea as to why this is happenin ?
    heres the code that I have written.
    public class RmsDataLoader
    Toolkit toolkit;
    Timer timer;
    public RmsDataLoader()
    toolkit = Toolkit.getDefaultToolkit();
    timer = new Timer();
    timer.schedule(new RMSJobThread(),
         0, //initial delay
         24*60*60*1000); //subsequent rate
    public static void main(String[] args)
    RmsDataLoader rms = new RmsDataLoader();
    class RMSJobThread extends TimerTask
    public RMSJobThread()
    public void run()
    RMSJob rmsjob = new RMSJob();
    rmsjob.runJob();
    and the function in runJob is
    public void runJob (String errorlog) {
    try {
    // Validation 1 : The datafile exists and the file size is not 0
    String strDataFile = "W:\\rms_amps\\" + todayDate + "\\inv_company_label.dat";
    File dataFile = new File(strDataFile);
    if(!dataFile.exists()){
    rmsExp.createLog(filename, filename, " Data File does not exist", todayDate);
    } else {
    long len = dataFile.length();
    if (len <= 0) {
    rmsExp.createLog(filename, filename, " File size is 0 ", todayDate);
    // End of Validation 1
    // create a process to invoke sql loader
    Process process = Runtime.getRuntime().exec("sqlldr USERID=scott@umidb/tiger CONTROL=load_company_label.ctl LOG=load_company_label.log BAD=inv_company_label.bad DATA=inv_company_label.dat");
    return ;
    } catch (Exception ei) {
    rmsExp.createLog(filename, filename, ei.getMessage() , todayDate);
    ei.printStackTrace();
    System.out.println (" Error while initiating the data loading " );
    return ;

  • Substitution variable in sql load rules file

    Okay gurus,
    I need a little guidance, I have to replace the value of 201020 and 2008 from substitution variables. I have created the variables and set them up globally on the essbase server.
    201020 = FW00
    2008 = FY00
    WHERE ACT.FISCAL_WEEK_ID <= 201020
    AND ACT.FISCAL_YEAR_ID > 2008
    AND RTDIV.DIV IN (1,2,3,4,5,6,7,8,9,99) (This is the query with hard coded values of week and year)
    When i m trying to put sub variables there , its throwing the error. please find below the way i was trying to do it.
    WHERE ACT.FISCAL_WEEK_ID = '&FW00'
    AND ACT.FISCAL_YEAR_ID = '&FY00'
    But unfortunately, its throwing error Error: 1021001 Failed to Establish Connection With SQL Database Server. See log for more information
    I know that this is the generic error because if i put the hard coded value in sql load rules it works fine.
    Is it the right way to out sub var in sql load rules???
    Please advice and thanks in advance.

    Hi Genn,
    I tried to see the app log for sql but i m afraid that there is nothing in there, the only error message which I am getting in app log is this:
    Failed to Establish Connection With SQL Database Server. See log for more information
    Its an ASO cube and initially i was using the variable as FY00 AS "2008" it did not work and than i tried without quotes in variable but is still not working.
    Any idea..thanks in advance.

  • SQL Loader - Also posted in Database-General forum

    Hi All,
    I am using Oracle 9i and am new to it. I created a new user and I am not very sure if I assigned all the priveleges and roles correctly.
    Problem is that I cannot log into SQL Plus and neither can I use SQL Loader. Am working in Windows XP environment. I can connect to SQLPLUS and SQL LOADER with the usual scott/tiger userid/passwd. Why cant I connect with the username/password that I created?
    I can use the Enterprise Manager Console provided by Oracle with scott/tiger as well as with the new username/password that I created. But why cant I connect to SQL Loader and SQL Plus?
    Regards,
    Mahesh.

    The error says:
    ORA-01017: invalid username/password; logon denied
    Which seems to indicate that you are not using correct
    password that you assigned when CREATE USER command was
    executed.
    Possibly, when you connect using enterprise manager, you
    might be connecting as SYSDBA which allows you to login
    since your NT userid might be part of the DBA group.
    try conncting to the database using the AS SYSDBA syntax
    when using SQL*Plus:
    click on START -> RUN
    and type "SQLPLUS.EXE /nolog" (without double-quotes) and click ok.
    At the SQL prompt, type connect <username> AS SYSDBA
    and see if you can connect.
    If you can, this means that when you created this new
    user you gave it SYSDBA privs. and at that point,
    password (or the username for that matter) is ignored.
    See the following session. here I do NOT have any user created by the name "XYZ" still when I connect AS SYSDBA,
    it allows me to connect:
    =======================================================
    SQL> connect xyz as sysdba
    Enter password:
    Connected.
    SQL>
    =======================================================

Maybe you are looking for

  • My edit isn't working!!please help.. : )

    here's my code in our project. it accesses a database and all of the methods are working except that the "edit" action performed wont work. the problem is that it's not updating my table whenever i tried to save what i edited. can someone help me.. t

  • ITunes icon not showing up in the iCloud

    Just upgraded to Mountain Lion and am trying to get everything settled in and up and running.  My understanding is that iTunes should now show up in iCloud, but it's not happening.  I'm running iTunes 11...

  • My phone (5530xm) won't start

    i'm one of those unlucky ones. when i did an update on my nokia 5530xm, it just went hung, now, everytime i push the power button it just vibrates and won't do a thing. what should i do? got one more question, can i reformat my phone even it its not

  • WLC sitting in a DMZ zone on an ASA

    I am trying to figure out a way to do a Guest Network without using an ACL tied to the SSID. (Customer's request) Its a layer 3 network and they suggested creating a DMZ zone off their ASA and connecting the WLC there that way its outside their netwo

  • How can I resolve Exception : "Count Field Incorrect" error

    Hi all, I am experiencing with "Count Field incorrect" error. What's wrong with it? How can I resolve it? This error is occured at UPDATE function of SQL. My JSP page is to update the old record. Sometimes, "Update statement error" message appear. Th