helps the nvl

Hello eveibody

IM fancing the following problem.

Im a consultation with a few tables of construction. (from table1 a, b from table2, table3 c and so)

and I want using the nvl in a single element of the array has. This:

(instr (upper ("A.DESCRIPCION"), upper (nvl (: P700_MUESTRA, "A.DESCRIPCION"))) > 0)
or: P700_MUESTRA IS NULL)

I need know how I can use the nvl in this query.

Any help wellcome
Thanks in advance to everyone.

using like this

(instr(upper(A.DESCRIPCION),upper(nvl(:P700_MUESTRA,A.DESCRIPCION))) > 0
or :P700_MUESTRA IS NULL)

without "(quotation).

Iqbal

Published by: Sabrina Sep 22, 2010 02:32

Published by: Sabrina Sep 22, 2010 02:33

Tags: Database

Similar Questions

  • How to use the NVL function to a parameter with comma delimited values

    Gurus,

    It is confusing to me.  I am trying to use the NVL function, but the setting that I'm passing in my cursor contains multiple values with commas.  The NVL function is confused when analyzing the values.

    'Where' cursor clause...

    and nvl (sn.c_attribute1,'x@#$%') in nvl (p_desig,'x@#$%'( )

    translated parameter values...

    and nvl (sn.c_attribute1,'x@#$%') in nvl ('SPRT''GOOD' 'BAD' 'x@#$%') -NVL does not parse the value correctly

    Any idea on how to get NVL recognize 'x@#$%' , if p_desig is null?

    Thank you

    Scott

    HI, Scott.

    Whenever you have a problem, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) of all the tables involved, so that people who want to help you can recreate the problem and test their ideas.

    Also post the results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

    My best guess, based on what you posted bone is present, that your problem is discussed in the following:

    http://tkyte.blogspot.com/2006/06/varying-in-lists.html

    http://www.Oracle-base.com/articles/Misc/DynamicInLists.php

  • Decode the statement using the nvl function

    I inherited the code uses a decode and nvl. I'm not sure the purpose of him and wants confirmation that it is logical and an error. The situation can be re-created by implementing the following.

    CREATE TABLE XX_TEST
    (IDENTIFICATION NUMBER,
    DOMAIN VARCHAR2 (255)
    )

    INSERT INTO XX_TEST (ID, FIELD) VALUES (1, 'Yes')
    INSERT INTO XX_TEST (ID, FIELD) VALUES (2, 'No')
    INSERT INTO XX_TEST (ID, FIELD) VALUES (3, NULL)

    Commit

    SELECT ID,
    FIELD,
    DECODE (on the GROUND, the 'yes', ' Yes result this ", NVL (FIELD, 'No'),"no results don't do this","catch all result do this")
    OF XX_TEST

    I'm not sure of the NVL (FIELD, 'No') I think that the creator may have thought this would draw the NULL values, but it is not.
    Null is not converted into no. and plunges into the place the Tote. Can anyone help with an explanation of how oracle is interpretting the select statement. Any ideas on why NVL would be used like that? Seems a mistake?

    decode compares them the first FIELD against NVL (FIELD, 'No').
    If the FIELD is null estimated them VSN none which is not null, then...
    just to make an entry for the null value and one for the 'no' with the same result.
    However, I prefer case statement in this case.

    SELECT ID,
    FIELD,
    case
    when FIELD ='Yes' then 'Yes Result do this'
    when FIELD is null or FIELD = 'No' THen 'No result do this'
    else 'catch all result do this'
    end
    FROM XX_TEST
    

    As more readable.
    concerning

  • How can I help the Uzbek language translation of Mozilla FireFox (Web browser)?

    How can I help the Uzbek language translation of Mozilla FireFox (Web browser)?

    Hi Erkin Farxodovich,
    I thank you for volunteering, to do this please contact the l10n team. And also the location on this page Quick Start Guide: https://wiki.mozilla.org/L10n:Starting_a_localization

    That should have all the information. Please reach out to the group mail as well and they can help with questions along the way.

    I hope this helps.

  • HI PLZ I WANT TO HELP THE UPGRADE TO SSD ODNT WILL I KNOW IF MY BOARD OF DIRECTORS AND THE CPU SUPPORTS

    HI PLZ I WANT TO HELP THE UPGRADE TO SSD ODNT WILL I KNOW IF MY BOARD OF DIRECTORS AND THE CPU SUPPORTS

    MODEL

    Compaq Presario CQ42-372TU computer laptop

    http://h20566.www2.HP.com/portal/site/hpsc/template.page/public/KB/docDisplay/?javax.portlet.begCac=...

    PLZ ANY BODY HELP ME

    You can upgrade to an SSD.

    The simplest method is to use an SSD as the Corsair Force 3 and don't forget that you buy the kit of migration.

    The migration kit comes with cloning software and a usb to SATA power cable that connects again SSD.

    It is recommended that you purchase and SSD that is approximately 256 GB in quality if you can find one that is affordable.

    SSD with migration in a kit options search I did.

  • I received an error code 800b0100 update. I just installed windows 7 student disc and my computer guard stop. I me trying to get the updates that might help the closing of the bottom.

    I received an error code 800b0100 update. I just installed windows 7 student disc and my computer guard stop. I me trying to get the updates that might help the closing of the bottom.

    Hi Happyrockgeek,

    Welcome to Microsoft Windows 7 answers Forum!

    This problem occurs if the Windows security .dll files are incorrectly registered.

    To resolve this problem, you can perform the two methods of troubleshooting, check if the problem is resolved.
    Method 1:
    Run (Checksur.exe) system update readiness tool.
    To do this, follow these steps:
    1. download and run the system update readiness tool. This tool runs an ad hoc analysis of inconsistencies that might prevent future maintenance operations. For more information about how to download and run the Checksur.exe tool, click on the number below to view the article in the Microsoft Knowledge Base:
    http://support.Microsoft.com/default.aspx/KB/947821
    2. try to install the updates again.
     
    Methods 2.
    Reset the Windows Update components.
    1. to reset the Windows Update components automatically, click the fix button in the link below.
    http://support.Microsoft.com/kb/971058 
    2. click run in the file download dialog box and follow the steps described in the fix it Wizard.

    I also suggest you to install the latest version of Windows Installer 4.5.
    Follow the link below to download:
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=5A58B56F-60B6-4412-95B9-54D056D6F9F4&displaylang=en
    and you can also try to install after you turn off the firewall.
     
     
    It will be useful.
     
    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum.

  • Helps the KB981852 update

    helps the KB981852 update.  the following message was published in regedit: %Windir%\KB981852.log
     
    [KB981852.log]
    8.767: ================================================================================
    8.767: 2010-11-13 22:43:22.430 (local)
    8.767: c:\690c14c58cb8e8f058d1\update\update.exe (version 6.3.13.0)
    8.783: DoInstallation: GetProcAddress (InitializeCustomizationDLL) returned: 0x7f
    8.783: hotfix started with following command line:
    8,845: CheckSystem: main Version mismatch: STATUS_NT_VERSION_MISMATCH
    8,845: DoInstallation: CheckSystem failed: 0xf021
    8,845: the version of Windows you have installed does not match the update you are trying to install.
    14.602: message displayed to the user: the version of Windows you have installed does not match the update you are trying to install.
    14.602: user input: OK
    14.602: Update.exe extended error code = 0xf021
    14.602: Update.exe return code was masked to 0 x 643 for MSI custom action compliance.

    I am running windows vista with Service Pack 2 installed.

    If you need more info please let me know

    The repeated failures to install KB981852 suggest very strongly that you see the effects of a rootkit infection W32/Alureon-Variant!

    Following the instructions on this site should help you:

    http://www.bleepingcomputer.com/virus-removal/remove-TDSS-tdl3-Alureon-rootkit-using-TDSSKiller>

    ~ or ~.

    Visit the Microsoft Solution Center and antivirus security for resources and tools to keep your PC safe and healthy.  If you have problems with the installation of the update itself, visit the Microsoft Update Support for resources and tools to keep your PC updated with the latest updates.

    Buying to meet problems installing Microsoft security updates also can visit the following page for assistance:https://consumersecuritysupport.microsoft.com/>

    For more information about how to contact your local Microsoft subsidiary for security update support issues, visit the International Support Web site:http://support.microsoft.com/common/international.aspx>

    For enterprise customers, support for security updates is available through your usual support contacts.

  • How to help the user focus

    How to help the user focus

    Magnifier enlarges part of the screen. This is especially useful for viewing objects that are difficult to see. It is also useful for people who are generally difficult to see the screen.

  • Program path: c:\windows\system32\audiodg.exe, HELP the cpu at least 99%

    Program path: c:\windows\system32\audiodg.exe, HELP the cpu at least 99%

    Hello

    Method 1: I suggest you put the computer to boot is a way to determine what's asked the origin of the problem:

    http://support.Microsoft.com/kb/929135

    Note: after a repair, be sure to configure the computer to start as usual as mentioned in step 7 in the above article.

    Method 2: You can also try the steps in the link and check if it helps:

    A problem with leaks memory occurs in the Audiodg.exe process when you play audio on a computer that is running Windows 7, Windows Server 2008 R2, Windows Vista or Windows Server 2008

    http://support.Microsoft.com/kb/981013

    Important

    This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs.

    http://Windows.Microsoft.com/en-us/Windows7/back-up-the-registry

  • How to use the NVL function in decoding?

    Hi all

    How to use the NVL function in decoding?

    SELECT Decode (Sign (sum (nvl (7), 0)-nvl (sum (5), 0)), - 1, 0, (sum (nvl (7), 0)-nvl (sum (5), 0)) QTY)

    of the double

    Thank you

    You should not do that...

    Greatest (NVL (Sum (Quantity), 0)-NVL (SUM (quantity_received), 0), 0) AS qty_arrival

    will do the same

    HTH

  • In Muse miniature slideshow container, I have images where data in image properties can be set. SEO search engines see the data and help the visibility of my site?

    In Muse miniature slideshow container, I have images where I can insert the data of image properties. SEO search engines see the data and help the visibility of my site?

    Post edited by: Howard Lower and rewrote the question because I have yet to get a response.

    Yes, they will be included in the report.

    Please check these links:

    https://helpx.Adobe.com/Muse/how-to/add-alt-text-and-ToolTips.html

    https://forums.Adobe.com/thread/1747973?start=0&TSTART=0

    Thank you

    Sanjit

  • Help the moderator please

    Help the moderator please delete a post...

    OK, it has now disappeared.

  • Do I need to use the NVL function for this request?

    I seem to have some problems using the NVL function on a date. I'm trying to create a query pulls back just a date a file was sent between the sysdate and the date_sent more a minute. Here is the code I use...

    Oracle: 10.2 G
    SELECT date_sent as date_sent
    INTO    iDateSent
    FROM    tableX
    WHERE  file_id= 9999
    AND    date_sent BETWEEN sysdate AND date_sent + 1/1440; 
    Currently Output (null):
    DATE_SENT
    Desired output when date_sent is null:
    DATE_SENT
    0:0:000 0:00:00
    Note:
    date_sent column is in a normal date - same format as sysdate format.

    The problem I encounter is when date_sent is null, the stored procedure, I built crashes because date_sent returns a null and a null value cannot be stored in the variable 'iDateSent '. I was thinking about using the NVL function here to resolve, however, I'm not entirely sure who will work with the above query. Any thoughts?

    Published by: user652714 on July 9, 2010 12:58

    Published by: user652714 on July 9, 2010 13:11

    Hello

    you said: "desired output when date_sent is null: date_sent: 0".
    It is not possible to have a date of 'zero '.

    "and a null value cannot be stored in the variable 'iDateSent'. '.

    I do not think: If this variable is declared normally (without any not null not constrained to this topic) so that it can contain a null value. (it's 99% of the time in PL/SQL).

    I think it's that your SQL retrieves no rows, to manage what you should put an exception handler:

    begin
    SELECT date_sent as date_sent
    INTO    iDateSent
    FROM    tableX
    WHERE  file_id= 9999
    AND    date_sent BETWEEN sysdate AND date_sent + 1/1440;
    exception when NO_DATA_FOUND then
     iDateSent:=null;
    end;
    

    So what you can do if you don't want the date empty a nvl:

    return(nvl(iDateSent,sysdate));  -- or another date ...
    

    Published by: user11268895 on July 9, 2010 22:09

  • Helps the case statement when

    I am trying to compare the (date) "LATEST_EVENT_DT" to the "Big Date" ().

    So for 'The last event,' show "CANCELLED" If the "more great Date" is superior to the "LATEST_EVENT_DT" and if not, then display the value in the column 'LATEST_EVENT_DESC'. "

    If I take the part "Last event" everything works fine. But with it in I get the error 'keyword not found FROM or planned. " If anyone can help with this?

    Select

    LATEST_EVENT_DT,


    "OIT_Closed_Date", "OIR_Closed_Date", "OIN_Closed_Date."

    largest (LATEST_EVENT_DT, nvl ('OIT_Closed_Date', TO_DATE ('01011950', 'MMDDYYYY')), nvl ('OIR_Closed_Date', TO_DATE ('01011950', 'MMDDYYYY')), nvl ('OIN_Closed_Date', TO_DATE ('01011950', 'MMDDYYYY'))) "Big Date"

    "Last event" =.
    CASE
    WHEN LATEST_EVENT_DT < 'Date of larger' THEN 'CANCELLED '.
    OF OTHER LATEST_EVENT_DESC
    END

    of apex01.greatest_date_vw_SGD

    Thank you

    Steven

    Hi, Steven,

    What is

    "Last event" =.

    supposed to do?  Do you want the column returned by the expression BOX to appear as the "Last event" in the output?  If so, use an alias for column after the expression, as you did with "Big Date".

    You cannot define an alias for column (such as "largest Date") and then refer to this alias in the select even where it has been set.  Derive from the column in a subquery, you can reference it in a great query, like this:

    WITH got_greatest_date AS

    (

    Select LATEST_EVENT_DT

    , "OIT_Closed_Date".

    , "OIR_Closed_Date".

    , "OIN_Closed_Date".

    largest (LATEST_EVENT_DT

    nvl ('OIT_Closed_Date',

    , TO_DATE ('01011950', 'MMDDYYYY')

    )

    nvl ('OIR_Closed_Date',

    , TO_DATE ('01011950', 'MMDDYYYY')

    )

    nvl ('OIN_Closed_Date',

    , TO_DATE ('01011950', 'MMDDYYYY')

    )

    ) AS "Big Date".

    of apex01.greatest_date_vw_SGD

    )

    SELECT eff.*

    CASE

    WHEN LATEST_EVENT_DT< "greatest="">

    THEN "CANCELLED."

    OF OTHER LATEST_EVENT_DESC

    END as the "last event".

    OF got_greatest_date g

    ;

    You really like the names in double quotes?  Most people find them very confusing and a lot more trouble than they are worth.

  • Helps the combined status request

    I have another puzzle game...

    I have the following:
    select * from stat;
    
    ID_NO STAT                 BEGDT       ENDDT
    ----- -------------------- ----------- -----------
        1 Active               01-JAN-2012 31-DEC-4712
    
    select * from loa;
    ID_NO STAT                 BEGDT       ENDDT
    ----- -------------------- ----------- -----------
        1 Paid                 01-FEB-2012 14-MAR-2012
        1 UnPaid               17-MAY-2012 29-MAY-2012
    I want the following:
    ID_NO  STAT             BEGDT             ENDDT
    1      Active           01-JAN-2012       31-JAN-2012
    1      Paid             01-FEB-2012       14-MAR-2012
    1      Active           15-MAR-2012       16-MAY-2012
    1      UnPaid           17-MAY-2012       29-MAY-2012
    1      Active           30-MAY-2012       31-DEC-4712
    Sample data:
    Version:
    
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    
    create table stat( id_no  number(3)
                   , stat   varchar2(20)
                   , begdt  date
                   , enddt  date
                   );
    
    create table loa( id_no  number(3)
                   , stat   varchar2(20)
                   , begdt  date
                   , enddt  date
                   );
    
    
    insert into stat values(1,   'Active',  to_date('01-JAN-2012', 'DD-MON-YYYY'), to_date('31-DEC-4712', 'DD-MON-YYYY'));
    
    insert into loa  values(1,   'Paid',    to_date('01-FEB-2012', 'DD-MON-YYYY'), to_date('14-MAR-2012', 'DD-MON-YYYY'));
    insert into loa  values(1,   'UnPaid',  to_date('17-MAY-2012', 'DD-MON-YYYY'), to_date('29-MAY-2012', 'DD-MON-YYYY'));
    I paint a complete white...
    Once more, any help would be appreciated.

    Hello

    The query below (slightly modified from what I posted yesterday) the accurate results you requested:

    WITH     all_events  AS
    (
         SELECT     id_no                    -- Beginning events from stat
         ,     stat
         ,     begdt          AS dt
         ,     1          AS rnk
         FROM     stat
        UNION ALL
            SELECT     id_no                    -- Ending events from stat
         ,     NULL          AS stat
         ,     enddt + 1     AS dt
         ,     2               AS rnk
         FROM     stat
        UNION ALL
         SELECT     id_no                    -- Beginning events from loa
         ,     stat
         ,     begdt          AS dt
         ,     4          AS rnk
         FROM     loa
        UNION ALL
         SELECT     id_no                    -- Ending events from loa
         ,     NULL
         ,     enddt + 1     AS dt
         ,     3          AS rnk
         FROM     loa
    )
    ,     got_analytics     AS
    (
         SELECT     id_no
         ,     NVL ( stat
                  , LAST_VALUE ( CASE
                                     WHEN  rnk = 1
                               THEN  stat
                                 END
                           IGNORE NULLS
                         ) OVER ( PARTITION BY  id_no
                                  ORDER BY       dt
                             )
                  )                    AS stat
         ,     dt                    AS begdt
         ,     LEAD (dt)        OVER ( PARTITION BY  id_no
                                  ORDER BY       dt, rnk
                             ) - 1     AS enddt
         FROM     all_events
    )
    SELECT       *
    FROM       got_analytics
    WHERE       begdt          < enddt
    ORDER BY  id_no
    ,            begdt
    ;
    

    Output:

    ID_NO STAT   BEGDT       ENDDT
    ----- ------ ----------- -----------
     0001 Active 01-Jan-2012 31-Jan-2012
     0001 Paid   01-Feb-2012 14-Mar-2012
     0001 Active 15-Mar-2012 16-May-2012
     0001 UnPaid 17-May-2012 29-May-2012
     0001 Active 30-May-2012 31-Dec-4712
    
     0002 Active 01-Jan-2012 31-Jan-2012
     0002 Paid   01-Feb-2012 14-Mar-2012
     0002 Active 15-Mar-2012 16-May-2012
     0002 UnPaid 17-May-2012 29-May-2012
     0002 Active 30-May-2012 14-Jun-2012
     0002 Paid   15-Jun-2012 30-Jun-2012
     0002 Term   01-Jul-2012 31-Aug-2012
     0002 Active 01-Sep-2012 31-Dec-4712
    
     0003 UnPaid 01-Feb-2012 15-Mar-2012
     0003 Active 16-Mar-2012 14-Jun-2012
     0003 Paid   15-Jun-2012 30-Jun-2012
     0003 UnPaid 01-Jul-2012 15-Jul-2012
     0003 Active 16-Jul-2012 31-Dec-4712
    

Maybe you are looking for