HELP!! - Need PL/SQL to write to a flat file!!

I'm trying to query information about a customer's salesrep, and append the results to a flat file. I'm a beginner, and the following pseudocode is the best I have so far. Any advice would be much appreciated.
Thanks in advance!!
Paul
CREATE OR REPLACE PROCEDURE paul IS
file_handle utl_file.file_type;
mgrname CHAR;
mgrphone CHAR;
mgrext CHAR;
BEGIN
utl_file.open('C:\WINNT\Profiles\pking\Desktop\outputfile.txt','w');
SELECT
name
,attribute7
,attribute8
INTO
mgrname
,mgrphone
,mgrext
FROM
ra_salesreps_all
rem WHERE
rem X-X-X-X-X
rem
rem EXCEPTION
rem WHEN no_data_found THEN
rem NULL;
utl_file.putf(file_handle, mgrname, mgrphone, mgrext);
utl_file.fclose(file_handle);
END paul;
null

Below is a simple one....
Procedure WRITE2FILE
id_h in integer,
matter in varchar2 default null
IS
v_FileHandle utl_file.file_type;
root_dir varchar2(200);
file_h varchar2(100);
BEGIN
file_h := 'msg_'| |id_h| |'.txt'; -- you can give dynamic file name
root_dir := 'unix_or_nt/home/file_dir';
v_FileHandle := utl_file.fopen(root_dir,file_h,'w');
if matter is not null then
utl_file.put_line(v_FileHandle,'Additional Information');
utl_file.put_line(v_FileHandle,'------------------------------------------------------------------');
utl_file.put(v_FileHandle,matter);
utl_file.new_line(v_FileHandle,1);
utl_file.put_line(v_FileHandle,'------------------------------------------------------------------');
else
utl_file.put(v_FileHandle,matter);
end if;
utl_file.fflush(v_FileHandle);
utl_file.fclose_all();
exception
when utl_file.invalid_path then
DBMS_OUTPUT.PUT_LINE('Invalid path:');
when utl_file.invalid_mode then
DBMS_OUTPUT.PUT_LINE('invalid_mode');
when utl_file.invalid_filehandle then
DBMS_OUTPUT.PUT_LINE('invalid_filehandle');
when utl_file.invalid_operation then
DBMS_OUTPUT.PUT_LINE('Invalid_operation. ');
DBMS_OUTPUT.PUT_LINE('The File is not available.');
when utl_file.read_error then
DBMS_OUTPUT.PUT_LINE('read_error');
when utl_file.write_error then
DBMS_OUTPUT.PUT_LINE('write_error');
when utl_file.internal_error then
DBMS_OUTPUT.PUT_LINE('internal_error');
when others then
DBMS_OUTPUT.PUT_LINE(4, 'A problem was encountered while writing the document.');
end ;
Calling procedure>>>>>>>>>
execute write2file(100,'Prints the matter in here.');
will result in a file with name msg_100.txt and the contents of the file will be...
Additional Information
Prints the matter in here.
1)Make sure the directory has write permissions
2)Initialization parameter UTL_FILE = 'unix_or_nt/home/file_dir' on database server. If not, then put this in init.ora (ask your DBA) and restart the db.
3)check the syntax for the '/' and '\' depending on your OS
null

Similar Messages

  • Help Needed in SQL QPAC

    Hi there,
    I need some help regarding the SQL QPAC which is a built in QPAC in Adobe Livecycle Workflow. The SQL QPAC takes MYSQL as the default database. Suppose if we need to connect to the SQL Server or any other database, what is the procedure to do that.
    Suraj

    Hi Suraj
    You need to deploy a second copy of the SQL QPAC, and point it at a different datasource. The datasource is defined as a deployment parameter (it will prompt you when you deploy the new version of the qpac).
    You will also need to define the datasource in your application server. This is done in different ways for different application servers - for details, please see: standards_based_qpacs.pdf (part of the Workflow SDK), page 12, "Creating a JNDI datasource".
    Alternately, you can try out our SQLPlus QPAC. This allows you to directly specify connection url, driver, username and password. The SQLPlus QPAC does a lot of other things that the regular SQL QPAC doesn't do, such as handling multiple rows, testing your query, and outputting the data in a variety of ways.
    Details at: http://www.avoka.com/avoka/qpac_library.shtml
    Howard

  • Help needed on SQL*LOADER

    Hi,
    I am using oracle 8i for Windows release 8.1.7.
    I have a data feed file 'XYZ.ctl' which contains numerous records.Each record is having various data. This data is subdivided into fields seprated by '~'.
    Each field can be of variable length. Thus my data per line is represented as below:
    1)A~BG~1223~023456~AW3456DF~001~desc1~002~desc2~~~~~~~~~~~~
    2)A~MN~1423~073453~AW56DF~001~desc11~002~desc22~003~desc33~~~~~~~~~~~~~~~~~~
    Here the point that is to be noted is each field ends with '~'.
    Now I would like to push data from 'A' to 'AW3456DF' of 'record 1' to Table X and from there on i.e from '001' to 'desc2' to Table Y.
    Similarly for record 2 I would like to push data from 'A' to 'AW56DF' to Table X and from there on i.e from '001' to 'desc33' to Table Y.
    This has to be achieved through SQL*Loader. Can it be achieved? If not then is there another way? Actually much of the loading that is done in production is already present and working fine. We just need to implement
    the above functionality.
    Another point is that the numeric part i.e. '001' would go in column 'Col1'and the description part i.e 'desc1' would go in column 'Col2' of table Y.
    Please let me know if anything could be done.
    Thanking in advance.
    Rajeev

    UTL_FILE
    With the UTL_FILE package, your PL/SQL programs can read and write operating system text files. UTL_FILE provides a restricted version of operating system stream file I/O.
    UTL_FILE I/O capabilities are similar to standard operating system stream file I/O (OPEN, GET, PUT, CLOSE) capabilities, but with some limitations. For example, you call the FOPEN function to return a file handle, which you use in subsequent calls to GET_LINE or PUT to perform stream I/O to a file. When file I/O is done, you call FCLOSE to complete any output and free resources associated with the file.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_file.htm#ARPLS069
    Joel P�rez

  • VCM installation help needed on SQL DB and Reporting server

    Hi All,
    I'm new to VCM and now i got stuck at the SQL DB and Report server portion.
    I'm running the vcm server on VM and the SQL is a physical server, both are sitting on the same LAN.
    I have create the SQL DB but VCM just fail to validate the DB and report server.
    I login to VCM using a Domain account for installation, and i tried to testing the DB using ODBC from the window, result fail.
    Error message as attach.
    I'm now totally lost on SQL portion.
    My Question:
    Is there any configuration needed on SQL DB?
    How to get the reporting server to working?
    What port is needed to it all working??
    VCM server Ms Win2012.
    SQL version 2012.
    Many thanks to all who reply.

    Hi Simonhoo79,
    For SSRS,   first check whether the report server link is accessible from your browser : "http://s01-fes-vcm1:80/ReportServer" . If you continue to get 404 error there also, then you need to reconfigure you report server first before proceeding to vcm installation. Follow the steps on below link on how to reconfigure report server using report services configuration Manager for 404 error.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/75910bcb-a879-4eb7-9757-acc45201fa3a/can-not-connect-to-reportserver-http-404-file-not-found?forum=sqlexpress
    For SQL server ODBC connection,
    Dont create ODBC connection for SQL Native Client. Create ODBC connection for SQL Server.
    1. Open ODBC Data Source Administrator
    2. Click User DSN tab and Click Add button.
    3. Select SQL server and click finish
    4. Give name and description and Give the SQL server name (with instance name if your using named instance) or IP in the Server text box.
    5. Click Next and select either Windows authentication or sql authentication based on your SQL server authentication mode and click next.
    6. If the details given are correct then it will proceed further and  check "Change the dafault database to" to your VCM database
    7. Click next and finish and try test data source.
    VCM 5.7.2 and below will support installation only on windows server 2008 R2  and it doesn't support windows server 2012  but it support both 2008 and 2012 sql servers.

  • Help Required regding: Validation on Data Loading from Flat File

    Hi Experts,
    I need u r help in the following issue.
    I need to validated the transactional data loading to the GL Cube from Flat file,
    1) The transactional data to the Cube to be loaded <b>only if master data</b> record exists for the <b>“0GL_ACCOUNT”</b> info object.
    2) If the master data record does not exits then the record need to be skipped from the loading and after the loading  the system should throw a message saying that these many records have been skipped (if there are any skipped records.).
    I would really appriciate u r help and suggestions on solving this issue.
    Regds
    Hari

    Hi, write a <b>start routine</b> in transfer rules like this.
      DATA: l_s_datapak_line type TRANSFER_STRUCTURE,
            l_s_errorlog TYPE rssm_s_errorlog_int,
            <b>l_s_glaccount type /BI0/PGLACCOUNT</b>,
            new_datapak type tab_transtru.
           refresh new_datapak.
           loop at datapak into l_s_datapak_line.
           select single * from /BI0/PGLACCOUNT into l_s_glaccount
             where CHRT_ACCTS eq l_s_datapak_line-<b>field name in transfer structure/datsource for CHRT_ACCTS</b>
    and GL_ACCOUNT eq l_s_datapak_line-<b>field name in transfer structure/datsource for GL_ACCOUNT</b>
    and OBJVERS eq 'A'.
           if sy-subrc eq 0.
             append l_s_datapak_line to new_datapak.
           endif.
           endloop.
           datapak = new_datapak.
           if datapak[] is initial.
    abort <> 0 means skip whole data package !!!
             ABORT = 4.
           else.
             ABORT = 0.
           endif.
    i have already some modifications but U can slightly change it to suit your need.
    regards
    Emil

  • Need to create sale order from the flat file & mail has to be sent

    Hi Experts,
              I have a requirement to create a sale order from a flat file and once the oder is created, mail has to be sent to customer as well as to internal user with the order details. I want to know how this process can be implemented and what adapters are needed to execute this.
    it would be very helpful, if i get an step-by-step procedure.
    Points assured for any helpful answers.
    Thanks in Advance
    Jai

    HI Jai,
    You need to create two interfaces as file will be sending the Sales oreder details that you need to capture in IDOC or RFC and then have to trigger to create the sales order. For this Standard BAPIs are also available.
    These RFC or BAPIs will response with Sales order details that you need to divert to Mail adapter with the use of BPM and also have to go for Async to Sync bridge.
    File -
    >XI (BPM) ---> BAPI/RFC  (Request)
    MailAdapter <- XI (BPM) <--- BAPI/RFC (Response)
    For this refer below links for step by step
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] - File to Mail
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm - Walk through BPM
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm - Schedule BPM
    /people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - Use of Synch - Asynch bridge in ccBPM
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken] - Use of Synch - Asynch bridge in ccBPM
    If you will use IDOC then In IDOC inbound processing you need to trigger for Sales order creation and then have to send the Sales Order generated IDOC as an Outbound to Mail Adapter
    Flat file -
    > XI ---> IDOC
    IDOC -
    > XI ---> Mail
    This will be bit easy scenario to develope as compare to using BAPI with BPM
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping - Any flat file to any Idoc
    configuring IDOC-XI-Mail scenario using following web-log:
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/sravya.talanki2/blog/2005/08/18/triggering-e-mails-to-shared-folders-of-sap-is-u - Triggering Email from folder
    Thanks
    Swarup

  • Problem Loading Microsoft Sql Serer table data to flat file

    Hi Experts,
    i am trying to load data from SQL Server table to flat file but its errror out.
    I have selected Staging area different form Targert ( I am using SQL Server as my staging area)
    knowlegde modue used: IKM SQL to file Append
    I reciee the following errror
    ODI-1217: Session table to file (124001) fails with return code 7000.
    ODI-1226: Step table to file fails after 1 attempt(s).
    ODI-1240: Flow table to file fails while performing a Integration operation. This flow loads target table test.
    ODI-1227: Task table to file (Integration) fails on the source MICROSOFT_SQL_SERVER connection POS_XSTORE.
    Caused By: java.sql.SQLException: Could not read heading rows from file
         at com.sunopsis.jdbc.driver.file.FileResultSet.<init>(FileResultSet.java:164)
    Please help!!!
    Thanks,
    Prateek

    Have you defined the File Datastore correctly with appropriate delimiter and file properties.
    Although the example is for oracle to file , see if this helps you in any way - http://odiexperts.com/oracle-to-flat-file.

  • SQL*Loader - How to combine Flat File 3 columns and put into one single column

    Receive a flat file delimited by comma. Want to combine Flat File last 3 columns and put into one single column(Table).
    e.g.
    Flat File
    100,239,30,20,30
    While inserting into table want to combine last 3 columns and insert into invoice number column.
    302030

    It is not possible to combine the last 3 columns as those columns are seperated by commas and in the SQL Loader control file you must ve specified COMMA as an delimiter. So u better have all the columns in the table plus add one more column which holds the concatenation of the 3 columns.
    Vijay

  • Help needed for SQL query

    hello ,
    I am a beginner in terms of writing sql queries. I hope some body can help me out.
    I have two tables
    mysql> desc user_group_t;
    ---------------------------------------------------+
    | Field | Type | Null | Key | Default | Extra |
    ---------------------------------------------------+
    | userAccountId | char(8) | | PRI | | |
    | groupId | char(8) | | PRI | | |
    ---------------------------------------------------+
    2 rows in set (0.00 sec)
    mysql> desc group_t;
    ---------------------------------------------------+
    | Field | Type | Null | Key | Default | Extra |
    ---------------------------------------------------+
    | id | char(8) | | PRI | | |
    | name | char(50) | YES | | NULL | |
    | email | char(100) | YES | | NULL | |
    | description | char(254) | YES | | NULL | |
    | parentId | char(8) | YES | | NULL | |
    | creatorId | char(8) | YES | | NULL | |
    | createDate | char(20) | YES | | NULL | |
    | updateDate | char(20) | YES | | NULL | |
    | updatorId | char(8) | YES | | NULL | |
    ---------------------------------------------------+
    9 rows in set (0.00 sec)
    what I want is list of all groups with id,name and #of members(which is the # of rows in the user_group_t for any given id). Importantly I need the groups with 0 members also to be listed. In short my output should contain exactly the same number of rows as in group_t table with an additional column indicating # of members for that group.
    Any help would be greatly appreciated.
    Thanks in Advance.
    -Vasanth

    Thanks Donald,
    Actually I figured it out, with the following query:
    select id,name,sum(if(groupid is not null,1,0)) as members from group_t left join user_group_t on id=groupid group by id;
    I tried your solution, but mysql says there is an error at '+' . Anyway I modified your solution to the one below and it worked.
    select a.id, a.name, count(b.groupid) from group_t a left join user_group_t b on a.id=b.groupid group by a.id, a.name;
    I tried that before but then I used Count(*) instead of count on groupid. Your solution is elagant and I will go with yours.
    Thanks again.
    Vasanth

  • Help need in sql

    i have a scenario like
    bank_division sum(amount) total_percentage(calculated by : / total sum of adjacent amounts i.e(10000+2000+3000+4000) *100
    aaaa 10000
    bbb 2000
    ccc 3000
    dddd 40000
    for above thing i have written sql like
    select bank_division,sum(amount)  from bank group by bank;
    but i am unable to calculate percentage for each bank_division..........
    .its like for aaaa correspoding percentage will be
    10000/ total sum of adjacent amounts i.e(10000+2000+3000+4000) *100
    and for bbb it will be
    2000/ total sum of adjacent amounts i.e(10000+2000+3000+4000) *100
    so on...
    can any one help me how to write in single sql

    user632733 wrote:
    in your sql you are using lag to display from existing total_sal....which cant be possible in above scenario..??? Where did you see existing total_sal? EMP table:
    SQL> select deptno,ename,sal from emp
      2  /
        DEPTNO ENAME             SAL
            20 SMITH             800
            30 ALLEN            1600
            30 WARD             1250
            20 JONES            2975
            30 MARTIN           1250
            30 BLAKE            2850
            10 CLARK            2450
            20 SCOTT            3000
            10 KING             5000
            30 TURNER           1500
            20 ADAMS            1100
        DEPTNO ENAME             SAL
            30 JAMES             950
            20 FORD             3000
            10 MILLER           1300
    14 rows selected.
    SQL> As you can see, there are multiple employees in each department. Now look at mu solution. Inner select:
             select  deptno,
                     sum(sal) total_sal
               from  emp
               group by deptnosummarizes sal for each department. If you run it separately:
    SQL>          select  deptno,
      2                   sum(sal) total_sal
      3             from  emp
      4             group by deptno
      5  /
        DEPTNO  TOTAL_SAL
            30       9400
            20      10875
            10       8750
    SQL> Outer select calculates previous department total salary and its ratio to report.
    SY.
    P.S. And if you want to display individual employees along with department level summarization:
    select  deptno,
            ename,
            total_sal,
            prev_deptno,
            last_value(total_sal) over(order by deptno range between unbounded preceding and 1 preceding) prev_dept_total_sal,
            ratio_to_report(total_sal) over () * 100
      from  (
             select  deptno,
                     ename,
                     sum(sal) over(partition by deptno) total_sal,
                     max(deptno) over(order by deptno range between unbounded preceding and 1 preceding) prev_deptno
               from  emp
      order by deptno
        DEPTNO ENAME       TOTAL_SAL PREV_DEPTNO PREV_DEPT_TOTAL_SAL RATIO_TO_REPORT(TOTAL_SAL)OVER()*100
            10 MILLER           8750                                                           6.38569604
            10 KING             8750                                                           6.38569604
            10 CLARK            8750                                                           6.38569604
            20 ADAMS           10875          10                8750                           7.93650794
            20 FORD            10875          10                8750                           7.93650794
            20 JONES           10875          10                8750                           7.93650794
            20 SMITH           10875          10                8750                           7.93650794
            20 SCOTT           10875          10                8750                           7.93650794
            30 WARD             9400          20               10875                           6.86006203
            30 TURNER           9400          20               10875                           6.86006203
            30 ALLEN            9400          20               10875                           6.86006203
        DEPTNO ENAME       TOTAL_SAL PREV_DEPTNO PREV_DEPT_TOTAL_SAL RATIO_TO_REPORT(TOTAL_SAL)OVER()*100
            30 JAMES            9400          20               10875                           6.86006203
            30 BLAKE            9400          20               10875                           6.86006203
            30 MARTIN           9400          20               10875                           6.86006203
    14 rows selected.
    SQL>

  • Help Needed In SQL Query

    HI All,
    Oracle sql clarification required
    Sample Table:
    empno empname Job mgr_id hire_date salary deptno
    7788 SCOTT ANALYST 7566 19-APR-87 3000 20
    7902 FORD ANALYST 7566 03-DEC-81 3000 20
    7934 MILLER CLERK 7782 23-JAN-82 1300 10
    7900 JAMES CLERK 7698 03-DEC-81 950 30
    7369 SMITH CLERK 7902 17-DEC-80 800 20
    7876 ADAMS CLERK 7788 23-MAY-87 1100 20
    Need "single / one" sql for this requirement statement:
    There will be 2 drop down boxes (1st - Job list, 2nd - empno) in the form in which the following result set is expected
    1) When user selects value from 1st drop down box (job) as "ANALYST" leaving the second drop down unselected, the result expected is 2 (no. of rows for that job)
    2) When user selects value from 1st drop down box (job) as "ANALYST" and the value from 2nd drop down box as 7902, the result expected is 1 (no of rows for that job and empno)
    Sqls which I have tried from my side (given below) didn't give the expected result and please do help me in correcting this
    select count(1) from scott.emp where job='ANALYST' and ( empno = :empno or empno is null ) ;
    Please help for this requirement. Any help is deeply appreciated.
    Thanks
    Zaheer

    Hi,
    welcome to the forum.
    Please read SQL and PL/SQL FAQ
    When you put some code or output please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    For your question the following will both work:SQL> select * from emp
    where job='ANALYST' and (empno =:empno or :empno is null)
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7788 SCOTT ANALYST 7566 19/04/1987 00:00:00 3000 20
    7902 FORD ANALYST 7566 03/12/1981 00:00:00 3000 20
    2 rows selected.
    SQL> select * from emp
    where job='ANALYST' and empno =NVL(:empno, empno)
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7788 SCOTT ANALYST 7566 19/04/1987 00:00:00 3000 20
    7902 FORD ANALYST 7566 03/12/1981 00:00:00 3000 20
    2 rows selected.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Help needed in SQL statement

    Hi,
    From the SQL statement below, i need help in explaining what does the line "WHERE ( lims_sys.result.result_template_id = lims_sys.result_template_limit.result_template_id (+))" do?
    This statement was written by a vendor and now i have problem displaying some new data. Only a portion of what i need is displayed.
    SELECT "LIMS_SYS"."RESULT"."DESCRIPTION",
    "LIMS_SYS"."RESULT_TEMPLATE_LIMIT"."NUMERIC_LIMIT",
    "LIMS_SYS"."RESULT"."FORMATTED_RESULT",
    "LIMS_SYS"."RESULT"."CONCLUSION",
    "LIMS_SYS"."RESULT_USER"."U_RESULT_SEQUENCE" ,
    "LIMS_SYS"."RESULT"."RESULT_ID"
    FROM "LIMS_SYS"."RESULT",
    "LIMS_SYS"."RESULT_TEMPLATE_LIMIT",
    "LIMS_SYS"."RESULT_USER",
    "LIMS_SYS"."ALIQUOT",
    "LIMS_SYS"."SAMPLE",
    "LIMS_SYS"."SDG",
    "LIMS_SYS"."TEST"
    WHERE ( lims_sys.result.result_template_id = lims_sys.result_template_limit.result_template_id (+)) and
    ( "LIMS_SYS"."RESULT"."RESULT_ID" = "LIMS_SYS"."RESULT_USER"."RESULT_ID" ) and
    ( "LIMS_SYS"."SDG"."SDG_ID" = "LIMS_SYS"."SAMPLE"."SDG_ID" ) and
    ( "LIMS_SYS"."SAMPLE"."SAMPLE_ID" = "LIMS_SYS"."ALIQUOT"."SAMPLE_ID" ) and
    ( "LIMS_SYS"."ALIQUOT"."ALIQUOT_ID" = "LIMS_SYS"."TEST"."ALIQUOT_ID" ) and
    ( "LIMS_SYS"."TEST"."TEST_ID" = "LIMS_SYS"."RESULT"."TEST_ID" ) and
    ( ( LIMS_SYS."SDG"."SDG_ID" = :sdg_id ) AND
    ( LIMS_SYS."RESULT"."STATUS" <> 'X' ) AND
    ( LIMS_SYS."RESULT"."REPORTED" = 'T' ) AND
    ( LIMS_SYS."RESULT_USER"."U_RESULT_CATEGORY" in ( 'Metal' , 'Mean Metal', 'Range Metal')) )
    Thanks for all your help.

    Hi,
    After WHERE .......... is indicates an OUTER Join condition.
    In this type of join, system retrieves the data for matched and
    as well as unmatched.
    Example:
    EMP table have a column DEPTNO with the data 10, 20, 30 (total rows=14)
    DEPT table have a column DEPTNO with the data 10, 20, 30, 40, 50 (total rows=5)
    If the WHERE clause contained EMP.DEPTNO(+) = DEPT.DEPTNO
    then the output contain the data relative to 10, 20, 30, 40, 50 (total rows = 16)
    i.e. 14 rows (with matching data) and 2 rows (with unmatching data)
    Regards,
    Sailaja

  • Expert Help needed with Sql Loader !

    Hello Friends...I am using one .dat file that contains several values in a
    particular column and I need to load those values in different tables with
    sqlloader.....For example: in column 3 there are values 0001, 0004, 0007, 9999
    ..> values 0001 and 0004 need to be loaded into table1 and value 0007 is
    loaded into table2 and value 9999 needs to be loaded into table3.
    I can successfully use the when clause to load one value at a time but
    cannot load a range or multiple values during the sqlloader load. I can
    call and run separate .ctl files but less complexity and fewer files would
    be better. Tried everything I know but no luck, can't do loads in same
    .ctl file......Does the when clause have limitations whereby only one value
    at a time can evaluated as True or False ?
    I would like to do a Not or InBetween evaluations if possible on that
    single coulmn and then do the loads in the specific tables.
    Any help would be appreciated as I can see my hair turn grayer by the
    minute..My thanks in advance..

    You're asking sql*load to perform an unnatural act.
    Load in you dat file as-is. Create a pl/sql procedure to do the rest.
    Your batch script calls sql*load, then sql*plus to run the proc.
    Must simpler. sql*load is not a procedural language.

  • Help needed with sql long names

    i need help bringing in column names as the short name. currently my select statment is bringing in the sql longname. is there a way to bring in the short name specified in my db2 database. my code for my connection is as follows:
    driver      =(Driver) Class.forName "com.ibm.as400.access.AS400JDBCDriver");
    DriverManager.registerDriver(driver);
    conn = DriverManager.getConnection("jdbc:as400://system;date format=iso;", props);

    Try setting the sys property on the properties object.
    You can set a '.' or '/' for system or sql naming conventions!

  • Help needed on SQL

    Hi,
    I am attending few interviews I need some good quires to expertise SQL , I try to find them but not succeeded...can any one help me?
    Thanks and Regards
    Mahe

    Interview questions? some basic queries to start with would be:
    1. How to find duplicate rows in a table
    2. Delete all duplicate rows except 1
    3. Find top salary
    4. Find 3rd highest salary
    the list goes on and on.. mugging up the queries won't help.. you get expertise only if you work on actual scenarios...
    Anyways, best luck
    Aalap Sharma :)

Maybe you are looking for

  • Hi, a bit of a complicated one :)

    We have move from Switzerland to Italy and I used a time capsule as back up disk and wireless in Switzerland. The Italian telephone company came to install the internet with their own wireless router and had no idea what to do with my time machine. W

  • Document currency in cube but not in the getting in query out put

    Hi Gurus, I am in production.... my query is regarding account receivable( which is user defined ie., is custom )  i am able to see amount in document currency in cube but is not appering when i excute the query ... And i am to get the output amount

  • Java.lang.NoClassDefFoundError when compile SQLJ source file

    Always got error message java.lang.NoClassDefFoundError: sun/io/CharToByteConverter when using sqlj to compile SQLJ source file. The CLASSPATH (partial) .:$ORACLE_HOME/sqlj/lib/translator.zip:$ORACLE_HOME/sqlj/lib/runtime.zip I am able to compile the

  • Need 'Creation Date' function in '09

    I'm looking for a formula that automatically generates the date in a cell, when data is entered in an adjacent cell. Currently, whenever data is entered into A1 for example, B2 displays the current date using the 'TODAY' function, but that will chang

  • Help everyone..anyone!  My ipod is frozen and my computer does not detect.

    Hi everyone I'm very disappointed to say that my ipod photo has been frozen for the past few days. First off, I accidentally disconnected it while plugged into the computer, and now my computer won't recognize the ipod at all. It says that "the devic