How do u write a LEFT JOIN in Oracle Developer Forms 6i?

I have 2 tables:PERSDET and EMP_MEDICAL_LTA
PERSDET has EMP_ID,EMP_NAME n some other fields.
EMP_MEDICAL_LTA has EMP_ID,FIELD1,FIELD2 n some other fields
EMP_ID is the common field between these 2 tables.
My requirement is to display all the EMP_NAME,that is-EMP_NAME which have field1 and field2 entries, as well as EMP_NAME which donot have field1 and field2 entries. I thought of using a LEFT join for this operation. The query I used is as follows:
SELECT PERSDET.emp_id,PERSDET.emp_name,EMP_MEDICAL_LTA.field1,EMP_MEDICAL_LTA.field2 into emp_id,emp_name,m,l FROM
PERSDET LEFT JOIN EMP_MEDICAL_LTA ON PERSDET.emp_id=EMP_MEDICAL_LTA.EMP_ID
where …<some other joining conditions>;
This query worked perfectly fine when I tried it running on the SQL prompt, but when I wrote it in a cursor in Oracle Forms 6i, it gave an error on the “LEFT” keyword!
Is there any substitute for LEFT JOIN in Oracle Forms 6i???
Please help!
Thanks!

hi,
yes it is very much possible. and you query willbe as follows;
SELECT PERSDET.emp_id,PERSDET.emp_name,EMP_MEDICAL_LTA.field1,EMP_MEDICAL_LTA.field2 into emp_id,emp_name,m,l FROM
PERSDET where PERSDET.emp_id=EMP_MEDICAL_LTA.EMP_ID(+)
where …<some other joining conditions>;
yse, you just have to use (+) symble on the side where the join condition is not fullfilled. the 2 possibilites for your qury is PERSDET.emp_id=EMP_MEDICAL_LTA.EMP_ID(+)
PERSDET.emp_id(+)=EMP_MEDICAL_LTA.EMP_ID
you can execute both and suit your self.
MohibMaan.

Similar Messages

  • How do I write this SQL command in Oracle

    Hi all
    I wriote this SQ L statement in Ms SQL Server. How do I write this sql command in Oracle?
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    I am very interested in this part:
    SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007
    thanks
    Edited by: user631364 on Oct 27, 2008 8:25 AM
    Edited by: user631364 on Oct 27, 2008 8:26 AM
    Edited by: user631364 on Oct 27, 2008 8:27 AM

    Thank you!!
    Now let me aslk the second part of my question.
    This sql command:
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    was created with this query in SQL Server and then I saved it in a store procedure, that I scheduled to run montlhy
    SET ANSI_NULLS ON
    DECLARE @SQLString NVARCHAR(4000)
    /* Build the SQL string once.*/
    SET @SQLString = 'ALTER VIEW dbo.Consumption AS SELECT TOP 100 PERCENT ID, CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 12) +
    "'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 12) +
    … (GOES FROM current month -12 to current month -1)
    , CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 1) +"'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 1) +
    ' FROM dbo.MasterConsumption WHERE YEAR_MONTH >= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-12 ) +"'" +
    ' AND YEAR_MONTH <= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-1 ) +"'" +
    ' GROUP BY ID ORDER BY ID '
    EXEC sp_executesql @SQLString
    Is that something that can be done in Oracle in the same way?
    Do you use another approach?
    please advice
    Edited by: user631364 on Oct 27, 2008 10:19 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:22 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:24 AM

  • How to print report in Charactor mode using Oracle Developer 10g

    Dear,
    I have converted my few reports from Oracle Developer forms 5 to Oracle Developer forms 10g,
    i am running these reports on Web, for that i have configour "rwserver" server.
    But when i run these report through menu on Web i got error message like
    "REP-1920: Character mode runtime incompatible with DESFORMAT of PDF, HTML, HTMLCSS, SPREADSHEET or RTF"
    i don't want to change the character mode to any other mode because it effects the printing.
    so how can it possible to set the mode to character and view report on Web.
    pls. suggest me solution.
    Thanks

    You have to pass the PRT file name as value for the DESFORMAT and use mode= MODE=CHARACTER.
    E.g.
    http://<host name>:<port>/reports/rwservlet?desformat=dflt&mode=character&.....

  • How to get Workflow code/wtf file from Oracle Customization Form

    Hi All,
    I am new to this forum. Can some one please help me how to get this wft file from customized oracle PO form ?
    Thanks,

    Pl post details of OS, database and EBS versions.
    What is "this wft" file ? WFT files are txt files of workflow definitions that can be downloaded from the database (or uploaded to the database) using WFLOAD utility.
    HOW TO DOWNLOAD WORKFLOW FILE .wft          [Document 578248.1]
    How To Update and Move Workflow From One Instance to Another?          [Document 398460.1]
    HTH
    Srini

  • How To do a LEFT JOIN in Oracle 8i

    Hello
    To explain my problem in a simple way: I have two tables, PROVA1 and PROVA2. Both have a primary key with two fields (CHIAVE1 amd CHIAVE2, numbers).
    I have to search for all records in A but not in B. In Oracle 8 LEFT JOIN is not available and I do not Know how doing it.
    I have read something about + operator, but I am not sure. What about:
    Select * from PROVA1 P1, PROVA2 P2 where
    (P1.CHIAVE1(+) = P2.CHIAVE1) and
    (P1.CHIAVE2(+) = P2.CHIAVE2) and
    (P2.CHIAVE1 IS NULL) and
    (P2.CHIAVE2 IS NULL)
    Thank you
    Garetano Recchi

    Gaetano, you're really close.
    The (+) sign goes near to the table where the records can be missed. In your example near P2 columns.
    Select *
      from PROVA1  P1,  PROVA2  P2
      where P1.CHIAVE1 = P2.CHIAVE1(+)
      and P1.CHIAVE2 = P2.CHIAVE2(+)
      and P2.CHIAVE1 IS NULL
      and P2.CHIAVE2 IS NULLYou can anyway use the minus operator
    Select *
      from PROVA1
      where (chiave1,chiave2) in (select chiave1, chiave2 from prova1 minus select chiave1, chiave2 from prova2);If you want to download a free book (in italiano) for oracle beginners go to
    My Oracle-related blog
    Max

  • How can i write a XML file with oracle data ?

    How can i write a XML file using PL/SQL.
    Can i do as follows.
    1.Open a file using UTL_FILE.FOPEN(LC_DIR_LOC,'abc.xml','W')     ;
    2.write all the required tag and value using UTL.put_line
    that is enough. Is not, please guide me to write.
    gk

    Having Oracle 9i.
    One more doubt. In the speck, some constand values are there, When i write the same into file, How can i write ?.
    1. l_str := ' "E27" '
    or
    2. l_str := ' E27 '
    UTL_FILE.PUT_LINE(L_FILE_POI,l_str,TRUE);          
    1 case : in XML file : "E27"
    In 2 case : E27
    When we write a XML file through editors , we have to define the constant within quote . is it?      
    Which one can i use ? Or any other way is there ..
    Thanks and Regards
    gopi

  • How to print report in Character mode using Oracle Developer 10g

    Dear,
    I migrate my forms and reports from Oracle Developer 6 to Oracle Developer reports 10g,
    We are using some character mode report for bill printing. But when i run these report through menu on Web i got error message like
    "REP-1920: Character mode runtime incompatible with DESFORMAT of PDF, HTML, HTMLCSS, SPREADSHEET or RTF"
    i don't want to change the character mode to any other mode because it effects the printing.
    so how can it possible to set the mode to character and view report on Web.
    pls. suggest me solution.

    You have to pass the PRT file name as value for the DESFORMAT and use mode= MODE=CHARACTER.
    E.g.
    http://<host name>:<port>/reports/rwservlet?desformat=dflt&mode=character&.....

  • How best to retroactively bind a schema with a developed form

    Hello all,
    I am having a big problem.  This is the first time we have developed an e-form with Adobe LiveCycle.  I discovered only too late that best practice is to produce a schema for a form before development.  However we were also told that you can retroactively bind a schema by creating a data connection and drag and dropping nodes onto the corresponding fields.  In this way I have bound nodes to one subform and left the rest of the form unbound. When trying to load xml that has been generated by this form back into the form we get the following error messages:
    "Wrong type parameter supplied to a PDS procedure"
    "There was a problem reading this document"
    We just get a blank screen in the browser.
    I have run a test with a brand new form with a data connection to the same schema and all of the fields auto generated.  Reloading this form with XML generated from the form works fine.  The problem seems to lie with the fact I am trying to bind to my large and heavily developed form.
    Have you guys ever come across similar problems?
    The developed form hierarchy is quite different to the structure of the xml generated by the form against the schema definition.  I have assumed that this does not matter as the hierarchy is not considered when there is a data connection.  Is this correct?
    Redeveloping the form is not an option at this stage so I will be very grateful for assistance.
    Best wishes,
    Kieran Kelly

    As  you mentioned the best practice is to have the schema ready before the development. But you can still bind a schema to the form after development.
    I think since you did not bind all the fields in the form to the schema, it is not giving you back the proper XML structure expected. It will only give you the tags that are bound to the fields.
    If you still have issues, you can upload the document I can have a look at it..
    Steps to upload the document
    1) goto acrobat.com website
    2) login with your Adobe login/password.
    3) In Actions you will find Upload. Select your form and upload.
    4) After uploading, select form name in All Files section and right click and select share.
    5) Check the checkbox "Allow anyone with a link to view this document".
    6) Copy the URL link and post it in the forum.
    Thanks
    Srini

  • How to make a text formatting tools in oracle developer suite 10G R2

    Dear Oracle Expert,
    This is my configurations:
    ===============
    1) OS-> windows 7 (Ultimate-32bit)
    2) Oracle Developer Suite 10G R2
    3) Oracle Database 10G
    I create this form but i want it in that way. So, i can format the text written in text box, such as BOLD, Italic, make a url link etc.
    How can i do that using Oracle Developer suite 10G R2.
    Best regards,
    Shimul

    Mr.François Degrelle ,
    Is this the proper command for sign-in the jar file
    set PATH=C:\DevSuiteHome_1\jdk\bin;%PATH%
    C:\DevSuiteHome_1\forms\webutil\sign_webutil     C:\DevSuiteHome_1\forms\java\frite.jar
    I am bit of confusing for this command C:\DevSuiteHome_1\forms\webutil\sign_webutil cuz here sign_webutil is used for webutil configuration. Just let me assure, that this is the right command or not. And if your answer is no, then what it will be.
    Thanks in Advance

  • How can I build Windows Like Help In Oracle Developer ?

    Could anyone help me by giving the information that how can I build a windows like help system ?
    Thanks In Advance.
    Saiful Alam

    I remember that in Oracle Develope 6.0 demos there are lots of this kind of help,but I don't know how to do it.If u can solve this problem,pls post it.

  • How to re-write this self join update using a CTE

    I would like to improve my performance on this update statement and would like to try re-writing using a CTE:
    UPDATE "usr_sessions" "a" SET "is_ended_at_trustable" = 't'
          WHERE (
            EXISTS (
              SELECT 1
              FROM "usr_sessions" "b"
              WHERE "a"."ended_at" = "b"."started_at"
                AND "a"."usr_space_id" = "b"."usr_space_id"
                AND "a"."account_id" = "b"."account_id"
          ) ) AND "a"."is_ended_at_trustable" IS NULL
    Any help is greatly appreciated!  Open to other suggestions as well if there is a better way!

    If I understood your description correctly, here's a way to accomplish the same thing, while dodging the need for the self join.   The update itself won't be any faster, but the overall query leading to the update will likely be faster sans self-join.
      (If my interpretation wasn't exactly what you meant, tweak the "partition by" clause).
    MERGE is generally considered better then UPDATE, but your particular update isn't at risk for the shortcomings of update (still, Merge is newer, cooler, and more trustworthy).
    Setup_Example_Data:
    Declare @Usr_Sessions table (account_id int, usr_space_id int, is_ended_at_Trustable Char(1), started_at varchar(99), ended_at varchar(99))
    Insert @Usr_Sessions
    Select 1, 10, 't', 'A1', 'A1'
    UNION ALL Select 2, 20, 'f', 'B1', 'B2'
    UNION ALL Select 3, 30, NULL, 'C1', 'C1'
    UNION ALL Select 4, 40, NULL, 'D1', 'D2'
    UNION ALL Select 5, 50, NULL, 'E1', 'E2'
    UNION ALL Select 5, 51, NULL, 'E3', 'E3'
    UNION ALL Select 6, 61, NULL, 'F1', 'F2'
    UNION ALL Select 6, 62, 't', 'F3', 'F3'
    UNION ALL Select 6, 62, 'f', 'F4', 'F4'
    Select 'Before', * from @Usr_Sessions
    OP_Query:
    BEGIN TRAN
    UPDATE A SET is_ended_at_trustable = 't' from @usr_Sessions A-- Select * from @Usr_Sessions "a" --
    WHERE (
    EXISTS (
    SELECT 1
    FROM @usr_sessions "b"
    WHERE "a"."ended_at" = "b"."started_at"
    AND "a"."usr_space_id" = "b"."usr_space_id"
    AND "a"."account_id" = "b"."account_id"
    ) ) AND "a"."is_ended_at_trustable" IS NULL
    Select 'After 1', * from @Usr_Sessions
    ROLLBACK TRAN /* Just to reset test data to original form, so second query below runs against original data */
    Dodge_Self_Join:
    With X as
    Select *
    , count(case when started_at = ended_at and is_ended_at_trustable is null then 'x' else null end)
    over(partition by account_id, usr_space_id) as Updatable
    From @Usr_Sessions
    Update X
    set is_ended_at_Trustable = 'T'
    where Updatable > 0 -- EDIT -- fixed error, previously said "updatable = 1"
    Select 'After 2', * from @Usr_Sessions

  • How to generate an excel spreadsheet from an Oracle Application forms runni

    I need URGENT generate an Excel spreadsheet with rows and columns populated from a forms that is running on Oracle Application R11.5 and open this worksheet for the User save.
    I want to include a PL*SQL code on a button and this button to run the spreadsheet open save for the User.
    Sorry my poor English, thanks for the comprehension

    909356 wrote:
    I need URGENT generate an Excel spreadsheet with rows and columns populated from a forms that is running on Oracle Application R11.5 and open this worksheet for the User save.
    I want to include a PL*SQL code on a button and this button to run the spreadsheet open save for the User. This functionality is already available in the application (File > Export) and you do not need to write a code to do that.
    How To Export Form Data To a CSV Format File [ID 779079.1]
    How To Setup Action Export Functionality in Release 11i [ID 136074.1]
    Thanks,
    Hussein

  • Left join from different database

    Hi,
    I had a scenario where I need to write a query that gets records from SQL Server Database but having a left join on Oracle table, I know we can achiev this through DB link between Oracle and SQL but my DB team are not willing to create DB links, Is there a way probably from Data Templates we can write a query which can call Oracle table too?

    Hi
    Thanks for your reply, but my situation is I do not have two queries, I have a single query which is pulling columns from SQL server based on a left join on one of the column of Oracle Table (cURRENTLY THERE IS db LINK BETWEEN TWO).
    For E.g.
    SELECT customers.first_name,customers.last_name from customers,orders
    Where
    Customers.Order_ID=Orders.Order_ID,
    The situation here is suppose the Orders is in Oracle DB and Customers in the SQL Server DB, How am I gonna achieve this using BI publisher If I do not have DB link.

  • 3 tables with left joins - bug?

    Hello,
    i am making query where i encounter problem with left join in oracle. I am using oracle 10g and i prepare simple test case.
    he is testing tables and datas - really simple i think:
    drop table t1;
    drop table t2;
    drop table t3;
    create table t1 (a number not null);
    create table t2 (a number, b number);
    create table t3 (b number);
    insert into t3 values (1);
    insert into t3 values (2);
    insert into t3 values (3);
    insert into t1 (a) values (1);
    insert into t2 (a,b) values (1,1);
    insert into t1 (a) values (2);
    insert into t2 (a,b) values (2, null);
    insert into t1 (a) values (3);
    insert into t1 (a) values (4);
    insert into t2 (a,b) values (4,1);
    insert into t1 (a) values (5);
    insert into t2 (a,b) values (5,3);
    and now query with left joins:
    select
    t1.a
    , t2.a, t2.b
    , t3.b
    from
    t1, t2, t3
    where
    t1.a = t2.a (+)
    and t2.b = t3.b (+)
    and t3.b is null
    order by t1.a
    i get two rows as result:
    A A_1 B B_1
    2 2 null null      
    3 null null null                
    i expect these rows but when i change my query - i dont want get back t3.b column:
    select
    t1.a
    , t2.a, t2.b
    /* , t3.b*/
    from
    t1, t2, t3
    where
    t1.a = t2.a (+)
    and t2.b = t3.b (+)
    and t3.b is null
    order by t1.a
    i get only one row
    A A_1 B
    2 2 null
    My question is simple how can i only by changing columns getting back change number of returned rows? I must say i dont expect these result i expect two rows again.
    Thanks for help.

    BluShadow wrote:
    I think I know what you are getting at.
    By testing for null on t3.b when you aren't selecting the column, you are enforcing oracle to perform the join through t2 onto t1, but Oracle can't join because t2 has no matching row (although it's outer joined to t1) and therefore, for the one row it can't actually determine if t3.b is null or not, so that row can't match the conditions in a "true" sense and be displayed. If you select the column then oracle can test its nullness ok. (Perhaps this is a bug, I don't know, it's just how I know it works)If you get different results only by changing the projection part of the query this is a bug and nothing else. I can't reproduce using Oracle 10g XE, I get in both cases shown the expected two rows.
    What versions are you using to test this?
    SQL>
    SQL> select * from v$version
      2  where rownum <= 1;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    SQL>
    SQL> drop table t1 purge;
    Table dropped.
    SQL> drop table t2 purge;
    Table dropped.
    SQL> drop table t3 purge;
    Table dropped.
    SQL>
    SQL> create table t1 (a number not null);
    Table created.
    SQL> create table t2 (a number, b number);
    Table created.
    SQL> create table t3 (b number);
    Table created.
    SQL>
    SQL> insert into t3 values (1);
    1 row created.
    SQL> insert into t3 values (2);
    1 row created.
    SQL> insert into t3 values (3);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (1);
    1 row created.
    SQL> insert into t2 (a,b) values (1,1);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (2);
    1 row created.
    SQL> insert into t2 (a,b) values (2, null);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (3);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (4);
    1 row created.
    SQL> insert into t2 (a,b) values (4,1);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (5);
    1 row created.
    SQL> insert into t2 (a,b) values (5,3);
    1 row created.
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> select t1.a
      2       , t2.a, t2.b
      3       , t3.b
      4  from
      5         t1 left outer join t2 on (t1.a = t2.a)
      6            left outer join t3 on (t2.b = t3.b)
      7  where t3.b is null
      8  order by t1.a;
             A          A          B          B
             2          2
             3
    SQL>
    SQL> select t1.a
      2       , t2.a, t2.b
      3  --     , t3.b
      4  from
      5         t1 left outer join t2 on (t1.a = t2.a)
      6            left outer join t3 on (t2.b = t3.b)
      7  where t3.b is null
      8  order by t1.a;
             A          A          B
             2          2
             3
    SQL>Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • EJB3 - QL using Left Join

    I have customer entity.
    To get the customer country i have to get it from the tablecountry thru countryID.
    How will i apply my LEFT JOIN for my sessionbean?
    this is my simple query for mssqlserver:
    "select Country from customer c left join tblCountry tc on c.idcountry = tc.idcountry where idcustomer = 888"
    and my EJBQL:
    "select o.iDCustomer,o.firstName,o.lastName," +
    "tc.Country from Customer o LEFT JOIN o.IDCountry tc WHERE o.iDCustomer LIKE '"+ IDCustomer +"' AND o.IDCountry = tc.IDCountry"
    pls. help me edit my EJBQL query.
    thanks.
    Message was edited by:
    tata-yang

    I want to join tables from customer_ads and customers when there is a match (and there always will be).
    However on the receivables table there may or may not match and if not I want to return that value as blank, but still need it returned.
    This above now returns the same OrderID over and over agian, but they with different cust_check_num when I add the ", receivables.cust_check_num" before the FROM statement as I am trying to retun that value. Does that make sense?
    Example:
    SELECT DISTINCT(billing.orderID),media.pub_name, billing.space_cost, billing.pub_box, billing.messenger, billing.rs_fax, billing.rs_box, billing.bold, billing.rs_email, billing.logo, billing.prod, billing.pdf, billing.printnpost, billing.shading, billing.fedex, billing.web_charge, billing.pre_pay, billing.mailed, billing.media_cost, billing.weekday_addon, billing.misc, billing.printnpostCost, billing.miscCost, billing.fedexCost, billing.net_space_cost, billing.pubsWebChargeFee, customer_ads.rs_inv_num, customer_ads.start_date, customer_ads.id, customers.company, customer_ads.job_title, customer_ads.estimatedCost, receivables.cust_check_num
    FROM (((billing
    LEFT JOIN customer_ads ON customer_ads.id = billing.orderID)
    LEFT JOIN customers ON customer_ads.client_id = customers.customers_id )
    LEFT JOIN receivables ON customer_ads.client_id = receivables.client_id )
    LEFT JOIN media ON media.id = customer_ads.media_id
    WHERE (start_date >= "2013-01-26 00:00:00") AND (start_date <= "2013-01-28 23:59:59")

Maybe you are looking for

  • MacBook randomly starting up in single-user mode

    Hi, for a few weeks now my MacBook's been starting up in single-user mode by itself, without me touching anything. The thing is, it only happens about half the time - otherwise it's booting up normally. I wiped my drive and reinstalled Lion, ran fsck

  • Memory Leak with RDC (11.5.11.1732) using SetDataSource

    I believe I have identified a 20 byte memory leak each time a VB6 application calls Report.Database.SetDataSource and passes an ADO recordset (in craxdrt.dll version 11.5.11.1732 and earlier). I've created a simple VB application which demonstrates t

  • No right click on icon view

    The right click doesn't work in the finder in mosaic view. When I use list view there is no problem. But I've always liked the mosaic view, but now I have to switch to list view to enable the right click for compressing or sending my files or anythin

  • Integration Opportunity CRM with Quotation ERP without Material integration

    Hi Experts, We have a partner with a SAP ECC 6.0 and SAP CRM 5.2 The systems SAP are uniquely integrated into the customer master. Now they ask us to integrate the sales flow between CRM Opportunity with ERP Quotation, but without item data because t

  • Mail sending error

    Hi, i am oracle 8.1.7 in HP UX B.11.11.If i am going to send a mail by using this command means i am receiving the following error. Mailx -s username@ Error: after the @ command it will go the next line, after that i am not able to give my domain nam