RPAD NVL function

I am using a function in a select statement (saturn_midd.stud_adm_util_miis_pkg.get_email_address(srbrecr_pidm)
It is returning the right results but I am trying to line up correctly, it seems that if value before is null it will move the email
the output, the email should be lining up
00468474 Mr. Eamonn Gallagher 200998 QIPU CMQ LSWA LSAK [email protected]
00469714 Ms. Ly Le P.O. Box 7907, Farin Easton PA 18042 200998 QIPU CMQ L [email protected]
Can I do this in a function
RPAD(NVL(saturn_midd.stud_adm_util_miis_pkg.get_email_address(srbrecr_pidm),' ',50, ' ') email_address,I am using the RPAD function like this
CASE
                   WHEN spraddr_atyp_code = 'CR'
                   AND spraddr_atyp_code != 'CM'
                      THEN RPAD (NVL (spraddr_zip, ' '), 8, ' ')
                END zip1,
                CASE
                   WHEN spraddr_atyp_code = 'CR'
                   AND spraddr_atyp_code != 'CM'
                      THEN RPAD (NVL (spraddr_cnty_code, ' '), 8, ' ')
                END cnty_code1,
                CASE
                   WHEN spraddr_atyp_code = 'CR'
                   AND spraddr_atyp_code != 'CM'
                      THEN RPAD(NVL(spraddr_natn_code, ' '), 8,' ' )Edited by: user648177 on Apr 28, 2009 10:33 AM
Edited by: user648177 on Apr 28, 2009 10:33 AM

Hi,
You asked
Can I do this in a functionWell, yes:
MHO%xe> create or replace function gimme_null
  2  return varchar2
  3  as
  4  begin
  5   return null;
  6  end;
  7  /
Functie is aangemaakt.
Verstreken: 00:00:00.73
MHO%xe> select '$'||rpad(nvl(gimme_null, ' ' ), 10, ' ')||'$' from dual;
'$'||RPAD(NVL(GIMME_NULL,''),10,'')||'$'
$          $
Verstreken: 00:00:00.01
MHO%xe> select length(rpad(nvl(gimme_null, ' ' ), 10, ' ')) from dual;
LENGTH(RPAD(NVL(GIMME_NULL,''),10,''))
                                    10So, I suspect not lining up correctly happens in some preceding column.
Unfortunatly your sample data is unformatted and your query incomplete and we lack the column names you need.
So, that's all I can say based on your inputs sofar....
Edited by: hoek on Apr 28, 2009 8:06 PM turned <>'s into $ so it's visible

Similar Messages

  • 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

  • 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 &lt;&gt; '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 &lt;&gt; 'XE'
    AND F.CD_STAGE &lt;&gt; '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 &lt; query above &gt;.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

  • 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'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 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.

  • 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

  • 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

  • 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}

  • 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/

  • 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 ;

  • Rpad alternate function

    Hi All,
    Can anyone tell me is there any alternate function for rpad in pl sql.I am using rpad in my application but there seems to be some problem as the query is returning some data but in the front end , it is showing as null.

    REGEXP is available from oracle 10g , its not present in 9i.
    Please check out for the alternative here -
    Possibility of installing regexp for 9i
    Hope this helps -
    tempdbs :)
    www.dwforum.net

  • Using NVL function in Dynamic SQL

    Hi ,
    I have created a procedure using the Dynamic SqL and while using the NVL() getting the following error . ORA-00936: missing expression.
    The query I have written as
    SQL_Txt:=' INSERT INTO VF.tblCData (A, B, C, D, E, F,G,H,I,J)
         SELECT '||l_A||',
         '||l_B||',
         '||l_C||',
              '||l_D||',
              NULL ,
              '||L_F||',
              NVL('||Param1||',''''),
              NVL('||Param2||',''''),
              NVL('||Param3||',''''),
              NULL
              FROM '||ParamTbl1||' WHERE ' ;
    and so on.
    For Param1 I have data for one execution and Param2 and Param3 is null for that execution.
    While executing the same I am getting below
    INSERT INTO VF.tblCData (A, B, C, D, E, F,G,H,I,J)
    SELECT 25,
         1,
         7,
              6,
              NULL ,
              5,
              NVL(PurchaseDate,''),
              NVL(,''),
              NVL(,''),
              NULL
              FROM xyz.PBuyer@pocdb WHERE
    and error ORA-00936: missing expression is popping up for Param2 and Param3 NVL(,'')
    Any suggestion to resolve this issue is highly appreciable.
    Thanks
    Sudipta

    NVL(,''),Where's the first argument to NVL? That's the obvious problem. Empty strings are NULL in Oracle anyway, so just lose the NVL and insert the values...
    C:\>                                                                        
    C:\>sqlplus hr/hr                                                           
    SQL*Plus: Release 11.2.0.3.0 Production on Wed May 8 10:08:53 2013          
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.                     
    Connected to:                                                               
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> set NULL I_AM_NULL                                                     
    SQL> create table x(y varchar2(20));                                        
    Table created.                                                              
    SQL> insert into x values ('');                                             
    1 row created.                                                              
    SQL> select * from x;                                                       
    Y                                                                           
    I_AM_NULL                                                                   
    SQL>                                                                        

Maybe you are looking for

  • The simplest way to do dynamic text

    HI! What would be the best way doing dynamic text and objects to your FC builded web site? I know that FC is not developer tool and I probably have to use Flash Builder. I've had lot of request to make web pages with parts that customers can upgrade

  • "Same" report but different selection

    CRXi SQL2005+ I'm working on a report that works fine but the selection for the output needs updating or maybe I need 2 more reports.... Tables are: USER TABLE (has all the application's user information)     TableKeyID for THIS table     Application

  • A solution to Sluggishness/Spinning ball issue!!!

    I have a G5 dual 1.8Ghz with 2.5GBs of ram and a 300GB hard drive. I'm running OS 10.2.4 and FCP 5.0.3 and have never had a problem with speed... Until this week. Normally I edit footage imported into FCP using a DVCam which stores the files into my

  • Why does my Safari 8.0.2 on Yosemite drop some image on html web pages ?

    Problem: Some images on the web(HTML) page not displayed. (images are dropped and displays as "?" marks) When I used OS X Mavericks, there was no problem. After updating OS X Mavericks to Yosemite, this problem has occur until now. I did do safe boot

  • Organize music

    hi,i am organizing my music in itunes.i got a question.will the organization of music in itunes,automatically organize main file? i organized it before, it took me a week.it was great.but recently i added a extra hard drive. with all the moving aroun