Nvl function problem

hello
can i use the following nvl funtion with sql query..
NVL('', SELECT DEPARTMENTCODE FROM TBLDEPARTMENT )
if not then what can be used instead of it?
Pl tell me??
Thanking You
With Regards
Vishal Agrawal

my query is
SELECT DISTINCT(A.CARDNO)PAYCODE,B.EMPNAME,C.COMPANYNAME,D.SHIFT,
E.SHIFTATTENDED,
TO_CHAR(E.SHIFT_INDT,'DD/MM/YYYY HH24:MI:SS') SHIFT_INDT,TO_CHAR(E.SHIFT_OUTDT,'DD/MM/YYYY HH24:MI:SS')SHIFT_OUTDT,
TO_CHAR(E.PUNCH1,'DD/MM/YYYY HH24:MI:SS')PUNCH1,TO_CHAR(E.PUNCH2,'DD/MM/YYYY HH24:MI:SS')PUNCH2,
TO_CHAR(E.PUNCH3,'DD/MM/YYYY HH24:MI:SS')PUNCH3,TO_CHAR(E.PUNCH4,'DD/MM/YYYY HH24:MI:SS')PUNCH4,
TO_CHAR(E.PUNCH5,'DD/MM/YYYY HH24:MI:SS')PUNCH5,TO_CHAR(E.PUNCH6,'DD/MM/YYYY HH24:MI:SS') PUNCH6,
TO_CHAR(E.PUNCH7,'DD/MM/YYYY HH24:MI:SS')PUNCH7,TO_CHAR(E.PUNCH8,'DD/MM/YYYY HH24:MI:SS')PUNCH8,
E.HW,E.ISMANNUAL,E.MANNUAL_HOURS
FROM
TEMPDATA1  A,
TBLEMPLOYEE B,
TBLCOMPANY C,
TBLEMPLOYEESHIFTMASTER D,
tbltimeregister1 e
WHERE
A.CARDNO NOT LIKE '0000%' AND
A.CARDNO NOT LIKE 'CANT%' AND
A.OFFICEPUNCH between to_date('01/12/2012 01:00:00','dd/mm/yyyy hh24:mi:ss') AND
to_date('01/12/2012 23:59:59','dd/mm/yyyy hh24:mi:ss') AND
A.CARDNO=B.PAYCODE AND
B.PAYCODE=D.PAYCODE AND
B.COMPANYCODE=C.COMPANYCODE  AND
B.DEPARTMENTCODE IN nvl( '', SELECT DEPARTMENTCODE FROM TBLDEPARTMENT) and
E.DATEOFFICE=TO_DATE('01/12/2012','DD/MM/YYYY') AND
A.CARDNO=e.paycode
ORDER BY A.CARDNO;

Similar Messages

  • Compilation problems using NVL function in Pro*C subselect

    I have come across a weird oracle problem. When I execute the following query in SQLPlus it works but when
    I include it in Pro*C code in a EXEC SQL statement it gives syntax errors and fails to compile. Any idea what I am doing wrong.
    SELECT DISTINCT
         A.ID_PERSON,
         C.ID_STAGE_PERSON_LINK ,
         A.NM_PERSON_FULL,
         A.NBR_PERSON_AGE,
         A.ADDR_PERSON_ST_LN_1,
         A.ADDR_PERSON_CITY,
         A.ADDR_PERSON_ZIP,
         A.CD_PERSON_STATE,
         A.CD_PERSON_COUNTY,
         A.NBR_PERSON_PHONE,
         C.CD_STAGE_PERS_REL_INT
         FROM
              PERSON A,
              STAGE_PERSON_LINK C
         WHERE
         C.ID_CASE = 88776721
         AND          A.IND_INVALID_PERS IS NULL
         AND          C.CD_STAGE_PERS_TYPE = 'PRN'
         AND          C.ID_PERSON = A.ID_PERSON
         AND C.ID_STAGE_PERSON_LINK =
    NVL (
                   (SELECT MAX(F.ID_STAGE_PERSON_LINK)
                   FROM STAGE_PERSON_LINK F
                   WHERE F.ID_PERSON=C.ID_PERSON
                   AND F.ID_CASE = C.ID_CASE
                        AND F.CD_STAGE_PERS_TYPE = 'PRN'
                        AND F.CD_STAGE_PERS_REL_INT IS NOT NULL)
                   (SELECT MAX(G.ID_STAGE_PERSON_LINK)
                   FROM STAGE_PERSON_LINK G
                   WHERE G.ID_PERSON=C.ID_PERSON
                   AND G.ID_CASE = C.ID_CASE
                        AND G.CD_STAGE_PERS_TYPE = 'PRN')
    AND A.ID_PERSON NOT IN
    SELECT S.ID_PERSON
    FROM STAGE_PERSON_LINK S,STAGE T
    WHERE S.ID_CASE = C.ID_CASE
    AND S.ID_CASE = T.ID_CASE
    AND S.ID_STAGE = T.ID_STAGE
    AND T.CD_STAGE <> 'INT'
    MINUS
    SELECT H.ID_PERSON
    FROM STAGE_PERSON_LINK H, STAGE F
    WHERE H.ID_CASE = F.ID_CASE
    AND H.ID_STAGE = F.ID_STAGE
    AND H.ID_CASE = C.ID_CASE
    AND H.CD_STAGE_PERS_ROLE <> 'XE'
    AND F.CD_STAGE <> 'INT'
    This query returns data when run in sqlplus.When used in a Pro*C C program and compiled the precompiler complains with syntax errors when used with EXEC SQL DECLARE CLSS82D_CURSOR CURSOR FOR < query above >.However removing the NVL function and retaining the subselect clause compiles but that is not what I want to do.
    Syntax error at line 262, column 20, file clss82d.pc:
    Error at line 262, column 20 in file clss82d.pc
    SELECT MAX( F.ID_STAGE_PERSON_LINK )
    ...................1
    PCC-S-02201, Encountered the symbol "MAX" when expecting one of the following:
    ( ) * + - / . @ | at, day, hour, minute, month, second, year,
    The symbol "(" was substituted for "MAX" to continue.
    Syntax error at line 263, column 10, file clss82d.pc:
    Error at line 263, column 10 in file clss82d.pc
    FROM STAGE_PERSON_LINK F
    .........1
    PCC-S-02201, Encountered the symbol "FROM" when expecting one of the following:
    , ) * + - / | at, day, hour, minute, month, second, year,

    Pro*C works bit differently tha sqlplus. try removing the blank line after
    SELECT MAX(G.ID_STAGE_PERSON_LINK)
    FROM STAGE_PERSON_LINK G
    WHERE G.ID_PERSON=C.ID_PERSON
    AND G.ID_CASE = C.ID_CASE
    AND G.CD_STAGE_PERS_TYPE = 'PRN')
    good luck,
    Gauranga

  • Problem Using NVL Function

    I ran across a problem with the format of an ASCI output file of an SQL script. The problem I have is with handling a particular column that contains account numbers. The column is defined with 8 characters. However not every entry has data. I have several fields that don't have any information.
    Originally in my script I had the following line that made the script fail:
    LPAD(TO_CHAR(TO_NUMBER(konten_nr)),8,'0'),
    I then changed the line to the following: (The script ran but now I notice that the formatting is wrong)
    LPAD(TO_NUMBER(LTRIM(konten_nr)),8,'0'),
    I attempted to use the NVL function that will return a value when there is nothing in the column field but it doesn't work. Does anyone know what I'm doing wrong?
    LPAD(NVL(TO_CHAR(TO_NUMBER(konten_nr),'FM999999999'),'0'),8,'0'),

    what is exactly your problem ?
    you want to translater " 1234" in "00001234" ? then simply use to_char(konten_nr,'FM00000000') .
    You want to translate " 1 1 1 1" in "01010101", then use replace(konten_nr,' ','0')
    Give us some samples

  • Binding problem when using NVL function

    Hello.
    I have a problem with my ADF application (11.1.2.1).
    I use VO with a query (database view) - pivot table.
    If i use where clause like table.attr = :p_attr, everything works ok.
    If i use where clause like table.attr = NVL (:p_attr, table.attr) and put a value in :p_attr (executeWithParam) , query executes as if there is a null value.
    Debug console shows:
    Binding null of type 12 for "p_attr".
    Query with NVL works ok in sqldeveloper.
    But in jdev, as if the table attribute isn't bind to bind variable.
    If a just remove NVL function, it works.
    Any idea?
    Thanks.
    Regards
    Edited by: DejanH on Oct 6, 2011 1:32 PM

    Hello.
    I enter 50 in p_depart parameter and click "ExecuteWithParams". Query is executed and shows records (pivot table).
    But if i look at the log window i see that an empty query was executed first.
    <OracleSQLBuilderImpl> <bindParamValue> [427] Binding null of type 12 for "p_depart"
    <OracleSQLBuilderImpl> <bindParamValue> [428] Binding null of type 12 for "p_job"
    <OracleSQLBuilderImpl> <bindParamValue> [429] Binding null of type 12 for "p_hire_od"
    <OracleSQLBuilderImpl> <bindParamValue> [430] Binding null of type 12 for "p_hire_do"
    Then, it is autoexecuted for the second time with parameter set to the value i inserted.
    <OracleSQLBuilderImpl> <bindParamValue> [470] Binding param "p_depart": 50
    <OracleSQLBuilderImpl> <bindParamValue> [471] Binding null of type 12 for "p_job"
    <OracleSQLBuilderImpl> <bindParamValue> [472] Binding null of type 12 for "p_hire_od"
    <OracleSQLBuilderImpl> <bindParamValue> [473] Binding null of type 12 for "p_hire_do"
    The same happens in our query. But ours is much more complex and it takes a lot of time to first execute "empty" query and then with inserted parameter.
    We cannot use it.
    It looks like bug.
    Regards
    Edited by: DejanH on Oct 11, 2011 6:52 AM

  • NVL function issue

    Hello All,
    I have a strange problem with a NVL function. In one of the view I am using a NVL fuction like this "NVL(doc_id,'-1') doc_id' and when I am
    querying the view based on the doc_id it is taking more time because of the this NVL function.I removed the same and tested it is coming out withing milli secs.
    Is there any way or any other function I can use.one more thing DOC_ID in the table is a VARCHAR2 field.
    Please help me with this.
    Best regards,
    Pavan Patil

    Tried Case not working ......
    Please find the query (Table names and joines mentioned are not proper ones) ---
    SELECT DECODE (tdoc.case_ver_no,
    -1, -1,
    c.uwrt_case_tid
    ) case_tid,
    c.case_id case_id, c.case_ver_no case_version_no,
    c.prft_cntr_sid profit_cntr,
    c.jnt_life_qualf_cd joint_life, c.co_id co_id,
    (SELECT co_lnm
    FROM t
    WHERE cd = c.cd) co_lnm,
    ald.given_nm first_name, ald.mid_nm middle_name,
    ald.family_nm last_name, ald.life_idx_id life_id,
    ald.sex_cd gender, al.doc_handle_id doc_handle_id,
    alb.bnft_cd benefit_type,
    alb.propsl_si_amt propsl_fc_amt, c.crncy_cd crncy_cd,
    c.indiv_grp_cd individual_group_code,
    c.assmnt_typ_cd assessment_type,
    c.cli_ref_id client_ref,
    DECODE (TO_CHAR (tdoc.case_ver_no),
    '-1', '-1',
    c.uwrt_id
    ) underwriter_id,
    c.bu_cd bu_cd, al.assmnt_age_offset age,
    (SELECT alb.bnft_cd rider_type
    FROM te al,
    tt alb,
    tuwrt_case c
    WHERE alb.main_bnft_ind <> 1
    AND al.atid = alb.atid
    AND al.utid = c.utid
    AND c.case_id = c.case_id
    AND ROWNUM = 1) rider_type,
    (SELECT stat_cd
    FROM tat
    WHERE uwrt_case_tid = c.uwrt_case_tid
    AND seq_no =
    (SELECT MAX (ucs1.seq_no)
    FROM tat ucs1
    WHERE ucs1.uwrt_case_tid = c.uwrt_case_tid))
    status,
    NVL(tdoc.doc_id,'-1') doc_id, tdoc.doc_ttl doc_ttl,
    tdoc.doc_typ_cd doc_typ_cd,
    tdoc.bof_doc_catg_cd bof_doc_catg,
    tdoc.doc_prim_catg_cd doc_prim_catg,
    tdoc.doc_lang_cd doc_lang_cd, tdoc.doc_nm doc_nm,
    tdoc.doc_crte_meth_cd doc_crte_meth_cd,
    tdoc.doc_del_stat_cd doc_del_stat_cd,
    tdoc.doc_fmt doc_fmt,
    tdoc.doc_lock_user_id doc_lock_user_id,
    tdoc.doc_lock_ts doc_lock_ts, tdoc.doc_ver doc_ver,
    tdoc.doc_size doc_size,
    tdoc.doc_ind_stat_cd doc_ind_stat_cd,
    tdoc.doc_ind_user_id doc_ind_user_id,
    DECODE (tdoc.doc_ind_loc_cd,
    'CA', 'CAN',
    'CARB', 'CAN',
    tdoc.doc_ind_loc_cd
    ) doc_ind_loc_cd,
    tdoc.last_upd_user_id last_upd_user_id, tdoc.upd_ts,
    TO_DATE
    (TO_CHAR (TO_DATE (tdoc.doc_recv_dt,
    'yyyymmddhh24miss'
    'MM/DD/YYYY HH24:MI:SS'
    'MM/DD/YYYY HH24:MI:SS'
    ) doc_recv_dt,
    TO_DATE
    (TO_CHAR (TO_DATE (tdoc.doc_attch_dt,
    'yyyymmddhh24miss'
    'MM/DD/YYYY HH24:MI:SS'
    'MM/DD/YYYY HH24:MI:SS'
    ) doc_attch_dt
    FROM tt c,
    ttl,
    ttd,
    ttft alb,
    ttoc tdoc
    WHERE al.u_tid(+) = c.u_tid
    AND ald.a_tid(+) = al.a_tid
    AND alb.astid(+) = al.astid
    AND tdoc.doc_handle_id(+) = al.doc_handle_id
    AND alb.main_ind(+) = 1
    AND NVL (tdoc.doc_del_stat_cd, 'XX') != 'DELETD'

  • NVL Function on CLOB data type

    Hi all,
    I am not able to use the NVL function over clob..please suggest me a way to do the data validation of the CLOB in sql ....
    below is the query i was using...
    select t1.pic_name,t2.pic_name
    from table1 t1,table2 t2
    where nvl(t1.picture_message,'X') <> nvl(t2.picture_message,'X');i am getting the following error....
    ORA-00932: inconsistent datatypes: expected - got CLOBThanks
    Rede

    Your problem is not NVL but rather comparing CLOBs:
    SQL> desc tbl1
    Name                                      Null?    Type
    ID                                                 NUMBER
    X                                                  CLOB
    SQL> desc tbl2
    Name                                      Null?    Type
    ID                                                 NUMBER
    X                                                  CLOB
    SQL> select  nvl(x,'NULL CLOB')
      2    from  tbl1
      3  /
    NVL(X,'NULLCLOB')
    NULL CLOB
    SQL> select  *
      2    from  tbl1,
      3          tbl2
      4    where tbl1.x = tbl2.x
      5  /
      where tbl1.x = tbl2.x
    ERROR at line 4:
    ORA-00932: inconsistent datatypes: expected - got CLOB
    SQL> SY.

  • Has anyone had a problem with TapMedia File Manage on iPhone 5. I reported a WIFI functionality problem to the developer and asked for support. Instead they have been very unprofessional by name calling me instead of logically evaluate and troubleshoot th

    Has anyone had a problem with TapMedia File Manage installed on iPhone 5? I reported a WIFI functionality problem to the developer and asked for support. Instead the company has been very unprofessional by name calling me instead of logically evaluate and troubleshoot the problem

    Hi AKE1919,
    Welcome to the Support Communities!
    The following information should help you with this:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/HT1933?viewlocale=en_US
    Cheers,
    Judy

  • Using insert command in NVL function

    How can we use insert command in a NVL function
    exapmle : INSERT INTO employee
    VALUES ( (NVL ( (SELECT emp_id
    FROM employee
    WHERE emp_name LIKE 'Test'),
    (insert into employee values((select max(emp_id)+1 from employee),'Test')))));
    I mean i will check for the record to exist in the table and if not exist i will add it to the table.

    998504 wrote:
    How can we use insert command in a NVL function
    exapmle : INSERT INTO employee
    VALUES ( (NVL ( (SELECT emp_id
    FROM employee
    WHERE emp_name LIKE 'Test'),
    (insert into employee values((select max(emp_id)+1 from employee),'Test')))));
    I mean i will check for the record to exist in the table and if not exist i will add it to the table.The first thing caught my eye is this
    max(emp_id) +1A real bad piece of code. Never do that. Ever thought about multi user environment? Use a SEQUENCE.
    If you want EMP_NAME to be unique (Which looks strange to me), then just add a UNIQUE constraint. You dont try to do what oracle already does really well.

  • How to use NVL Function

    hi,
    i want to use nvl Function in that Quary
    select f_words(SUM(a.AMOUNT)+sum(a.vat_amount) +
    nvl( (select sum(b.LABOUR_AMT)+sum(b.service_tax_amt)
    from LAB_WORK_DTL b
    where a.bill_no =b.bill_no), 0)
    )) as t
    from TRANSACTION_DETAILS a
    where a.bill_no =:P42_bill_no
    group by a.BILL_NO;
    i am using NVL in that Quary Like This
    select f_words*(nvl(S*UM(a.AMOUNT)+sum(a.vat_amount) +
    nvl( (select sum(b.LABOUR_AMT)+sum(b.service_tax_amt)
    from LAB_WORK_DTL b
    where a.bill_no =b.bill_no), 0)
    )) as t
    from TRANSACTION_DETAILS a
    where a.bill_no =:P42_bill_no
    group by a.BILL_NO;
    I want to use NVL Function In BOLD
    How Can I use NVL Functiion.
    Thanks
    Edited by: Manoj Kaushik on Mar 25, 2010 5:55 AM

    hi,
    select f_wordsl(SUM(a.AMOUNT)+sum(a.vat_amount) +
    nvl( (select sum(b.LABOUR_AMT)+sum(b.service_tax_amt)
    from LAB_WORK_DTL b
    where a.bill_no =b.bill_no), 0)
    )) as t
    from TRANSACTION_DETAILS a
    where a.bill_no =:P42_bill_no
    group by a.BILL_NO;
    i have two tables Bill no is comman field in both tables if i have not enter value in any one of the table .
    so how can i show Total amount in words if Bill NO are not in any one table.
    Thanks

  • NVL function's strange behaviour

    Hi,
    I have a sql statement (listed below) that uses NVL function which returns either the business name of branch name depending on whether the business name is null or not. It also uses the branch_name pl/sql function that returns the name of the branch.
    What I found strange was that it executes the branch_name function even when the business_name is not null. It was my understanding that nvl returns expr1 if it's not null, and expr2 if expr1 is null. I don't want it to execute the branch_name function if business_name exists. Is it possible using NVL, or do I need to use DECODE to achieve that? p_record_id is a parameter that I pass to the function containing the sql statement e.g., p_record_id=10.
    SELECT nvl( business_name, branch_name( p_record_id) ) "Name"
    FROM entity
    WHERE record_id = p_record_id;
    Thanks
    Vic

    Marc,
    Thanks for looking into it.
    I just ran the code using DECODE and it seems that it executes the function only when the condition is true, which is exactly what I want. It won't execute the function if the condition is false, e.g., in the code below if the business_name is null then it executes the branch_name function, other wise it returns the business_name.
    SELECT DECODE ( business_name,
    null, branch_name( p_record_id ),
    business_name ) "Name"
    FROM entity
    WHERE record_id = p_record_id;
    Vic

  • NVL Function and Truncate Function in Template Builder

    Hi Guys,
    How would I use NVL function and Truncate function in the Word Template Builder.
    These functions do not work in the Query Builder when i use SQL Query as the Dataset while creating a report.
    I could not find examples in the Publisher Guide either.
    Thanks
    rkingmdu

    Hi
    How can you not use the functions in your query? Does the builder return an error? ow about just pasting your query into the report definition does the nvl/trunc work then ?
    Regards
    Tim
    http://blogs.oracle.com/xmlpublisher

  • Performance Hit Due to NVL() Function

    Hi,
    I am from dev project team,we are facing a performance hit due to NVL() function,pls give a solution to resolve this issue.
    the below is my function which i created to calculate some efforts.
    create or replace function check_function(
    v_deal_detail ,
    v_tower ,
    v_subtower,
    v_location ,
    v_client_role ,
    v_emp_category ,
    v_year ,
    v_state )
    return number
    is
    v_trans_offshore_efforts number(30,8) default 0;
    v_stdy_offshore_efforts number(30,8) default 0;
    begin
    if v_state =1
    or v_state is null
    then
    begin
    select nvl(sum(decode (d.loc_type_id,
    crmuat_global_constant_pkg.GLB_OFFSHORE,
    s.trans_efforts,
    0)),0)
    into v_trans_offshore_efforts
    from prc_calc_trans_fte_dtls_t s, prc_deal_dtl_loc_dtls_t d
    where s.deal_detail_id= d.deal_detail_id
    and s.tower_id = d.tower_id
    and s.location_id = d.location_id
    and s.deal_detail_id = v_deal_detail
    and s.client_role_id = nvl(v_client_role,s.client_role_id)
    and s.emp_category_id = nvl(v_emp_category,s.emp_category_id)
    and s.tower_id = v_tower
    and s.subtower_id = nvl(v_subtower,s.subtower_id)
    and s.location_id = nvl(v_location,s.location_id)
    and s.year_no = v_year;
    exception
    when no_data_found
    then
    v_trans_offshore_efforts := 0;
    end;
    end if;
    if v_state = 1
    then
    return v_trans_offshore_efforts;
    end if;
    end;
    pls give me a solution.
    Regards,
    shinu

    {message:id=9360003}

  • Common SAP MM Functional problems

    Fellows
    Is there anyone who can explain some common SAP MM daily functional problems. im junior consultant and want to be prepared for interviews. you may just state them in point form briefly.
    thanks
    rash

    Common Issue
    1)Vendor is not created for Purchasing Organisation XXXX.
    2)Though Vendor Master is Flag for Deletion ,Vendor is shows at the time of PO Creation.
    3)How to extend the materials for another storage location
    4)How to Create the PO for Different Currencies.
    5)While Posting The Doc . Error Occure,1) Account Determination for Entry 1000 BSV _ _ not Posssible.2)  Account Determination for Entry 1000 FRL _ _ not Posssible.
    6)Not Authorisation for Movt Type ......,Transaction Code......
    7) Account Determenation for transaction ....  Cost center ...does not maintain.
    8)While Creation of GR -Authorisation missing for Company Code 0000 Asset Class XXXX,
    9)While Removing The Stock of material by Cancelling the Goods Receipt Doc.Error occur that Stock Qty difficial by xx No.
    10)While GR Cancellation error occure that document does not contain any selected item.
    11)While Creating Service Entry Sheet Error occured that Qty entered  exceeded by Qty in PO
    12)While cancelling the matl.Doc Error occure that matl is deficit of sales ordr stock.
    13) Error-Tax code does not Exist while creating Miro
    14)TDS Amount is not Captured at Miro entry.
    15)While Miro error occure that No suitable item found for Purchase Order.
    16)User ID gets Blocked due to wrong Password entered more than 3 times.
    18)Error-Gl account does not created for Chart of account XXXX while Miro
    19)In Purchase Order Service tax is 12.24 % and at Bill service tax is 10.5 .How to adjust it and How to cancell Wrong Miro
    20)Stock Statement not matched Value still lying into Stock A/c
    Rewards if Helpful...
    Regards
    Sanjay L

  • Outer join with NVL function

    Hello
    I am trying to translate the following Sybase Query to Oracle . I am running the query on a 10gR1 database.
    The problem is with the NVL clause on the join I am getting a runtime exception .
    Is there a way to re-write this query without breaking the functionality.
    SELECT t1.*,
    NVL(t2.Branch_name, t3.Branch_name)
    FROM table1 t1
    LEFT OUTER JOIN
    table2 t2
    ON (t1.Account_id = t2.Account_id)
    LEFT OUTER JOIN
    table3 t3
    ON (t1.Account_id = t3.Account_id)
    LEFT OUTER JOIN
    table4 t4
    ON (NVL(t2.Branch_Name, t3.Branch_Name) = t4.cost_centre);
    Thanks

    The original query had a insert statement and it was failing with ORA-01400 even though the select query fetched 0 rows
    Insert into Branch_Master
    SELECT t1.*,
    NVL(t2.Branch_name, t3.Branch_name)
    FROM table1 t1
    LEFT OUTER JOIN
    table2 t2
    ON (t1.Account_id = t2.Account_id)
    LEFT OUTER JOIN
    table3 t3
    ON (t1.Account_id = t3.Account_id)
    LEFT OUTER JOIN
    table4 t4
    ON (NVL(t2.Branch_Name, t3.Branch_Name) = t4.cost_centre);
    ksedmp: internal or fatal error
    ORA-01400: cannot insert NULL into ("<<schema_name>>"."Branch_Master"."BRANCH_NAME")
    I have re-written the query using a Inline view . Can you please review and let me know if it is ok
    select * from
    ( SELECT t1.*,
    NVL(t2.Branch_name, t3.Branch_name) Branch_name_final
    FROM table1 t1
    LEFT OUTER JOIN
    table2 t2
    ON (t1.Account_id = t2.Account_id)
    LEFT OUTER JOIN
    table3 t3
    ON (t1.Account_id = t3.Account_id) ) IV_Temp
    LEFT OUTER JOIN Table4 on (IV_temp.Branch_name_final = T4.cost_centre ;

  • Similar to NVL function for SPACE

    Is there any function which will detect SPACE
    and update in that place to NULL.
    like NVL(TEST_INPUT,NULL)

    Is there any function which will detect SPACE
    and update in that place to NULL.Check it out...
    SQL> select replace('A P C', ' ', null) from dual
      2  /
    REP
    APC
    SQL> Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

Maybe you are looking for

  • My web cam is not working no video

    Hi ,   My web cam on my hp laptop G72_257CL is not working.Please help me.

  • NC Logging/Disposition with SFC QTY 1, not able to Log Second NC on SFC

    Hi, i ran into a problem with the NC Logging / Disposition functionality while trying to log NCs for SFCs with a Quantity>1 Scenario: Released SFC with Quantity = 10 NC_DATA_ENTRY Activity Rule ALLOW_PARTIAL set to YES NC_DATA_ENTRY Activity Rule AUT

  • Change File Name In The "File Download" Dialog Box For Web Reports

    Hi All , I followed the below note to change the "File Download" name. How To Change The File Name In The "File Download" Dialog Box For Web Reports? Doc ID: Note:418366.1 However its not working. Has anyone tried this and works fine ? Basically I wa

  • MX460 Run dll as an App failure

    Help Help!!! Just built Athlon 1800+ ASUS A7S333 MSI Geforce 4 MX 460 XP Pro Unable to access MSI display properties, "run dll as an app encountered a problem". AppName rundll32.exe Appver 5.1.2600.0 ModName mscicpi.dll Am able to access all other di

  • "/usr/lib is not a symbolic link" and testify+libjpeg7 problem

    everytime I update pacman or do a "ldconfig" I get this: /sbin/ldconfig: /usr/lib/ is not a symbolic link this appeared by the time i installed libjpeg7 from aur (though I'm not 100% sure libjpeg7 is responsible). I've looked through google trying to