NVL2 in Expression

Hi All,
Im facing a problem at a map when i use the NVL2 in the expression
the following error appears
Line 1,col 1
PLS-00201: idnetifier 'NVL2' must be declared
it can be done through transformation, But i think its duable through the expression
please advice
thanks

thanks hagen,
actually i tried to change the Code generation method between the set / row but the same problem presist .
i finally did a private transformation as the following to solve the problem
select NVL2(Parameter1,Paramter2,Parameter3)
into P_result
from dual
i will try the "case" too coz i belive it will be faster in execution.
regards

Similar Messages

  • Decode or nvl2 or case functions

    create a query that displays employees lastname and commission amounts.if an employee does not earn commission,put "no commission."label column comm
    Sample Output
    lastname comm
    king no commission
    abel .3
    Note:The column commission is of number datatype

    Hi,
    This looks an awful lot like homework.
    If you're really stuck, post your best attempt so far, and a description of what you think is wrong with it.
    The assignment itself, "Decode or nvl2 or case" gives you three different ways to do this.
    CASE is a lot more useful in general, so I suggest learning how to use it first.
    NVL2 is a little more concise for this particular problem.
    DECODE can do anything CASE can do, often with a lot more coding. Unless it's required for your schiool work, I don't suggest using DECODE.
    You'll probably need to use the TO_CHAR function, to convert the commission to a string, so that whatever kind of expression you use (CASE or NVL2 or DECODE) it will always return the same datatype: VARCHAR2.
    All built-in functions are documented in the SQL Language manual:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/index.htm
    Actually, CASE and DECODE are not functions, but they're described in the same manual,.

  • What happened to nvl2(fdate, sysdate-fdate, sysdate)

    Hi guys,
    Oracle 11.2
    I just found this by chance:
    SQL> create table tab_0417(fid number, fdate date);
    Table created
    SQL> insert into tab_0417 values(1, date'2012-01-01');
    1 row inserted
    SQL> insert into tab_0417 values(1, NULL);
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> select fid, fdate, nvl2(fdate, sysdate-fdate, sysdate) from tab_0417;
           FID FDATE       NVL2(FDATE,SYSDATE-FDATE,SYSDA
             1 1/1/2012                  107.580358796296
             1                            2456035.5803588I expected an exception since the second and the third parameter of NVL2 have different data types and cannot be converted implicitly. But it executed successfully, and got a strange number 2456035.5803588, could anyone explain it?
    Thanks in advance.

    IMHO, it is bug:
    If the data types of expr2 and expr3 are different, then Oracle Database implicitly converts one to the other. If they cannot be converted implicitly, then the database returns an error.In:
    NVL2(NULL, 1, SYSDATE)expr2 is 1 - numeric and expr3 is date. Date can't be converted to number. In:
    NVL2(NULL, (SYSDATE+1)-SYSDATE, SYSDATE)expr2 is (SYSDATE+1)-SYSDATE. On one hand:
    SQL> create table tbl as select (SYSDATE+1)-SYSDATE x from dual;
    Table created.
    SQL> desc tbl
    Name                                      Null?    Type
    X                                                  NUMBERBut on the other hand:
    SQL> select dump(1),dump((SYSDATE+1)-SYSDATE) from dual;
    DUMP(1)
    DUMP((SYSDATE+1)-SYSDATE)
    Typ=2 Len=2: 193,2
    Typ=14 Len=8: 1,0,0,0,0,0,0,0
    SQL> We all know that subtracting two dates produces number of days between them. However internally oracle keeps distinction of a "number" number and "date diff" number. As you can see, internal type for "number" number is 2, while expression "date diff" internal datatype is 14. So it looks like NVL2 (and NVL or maybe even more built-in functions) treat "date diff" differently and allow date-expression conversion to "date diff" by treating date-expression as date-expression - date '1-1-1'.
    SY.

  • Decode or NVL2?

    What should be used when we have a choice of using decode or NVL2, how will it affect the performance?

    Hi,
    Nandini wrote:
    I don't want to know the difference between both. I want to know which should be prefered to use.Knowing their difference means knowing how to use them and in what particular situation you may use them.
    NVL2 is an extension of the functionality of NVL function which takes 3 arguments.
    The syntax for the NVL2 function is:
    NVL2( string1, value_if_NOT_null, value_if_null )
    string1 is the string to test for a null value.
    value_if_NOT_null is the value returned if string1 is not null.
    value_if_null is the value returned if string1 is null.
    The syntax for the DECODE function is:
    decode( expression , search , result [, search , result]... [, default] )
    expression is the value to compare.
    search is the value that is compared against expression.
    result is the value returned, if expression is equal to search.
    default is optional. If no matches are found, the decode will return default. If default is omitted, then the decode statement will return null (if no matches are found).
    Regards.

  • I can´t use NVL2 with OWB

    hi, I´m trying to use NVL2(varchar2, number, number) on Mapping Expresion Operator but when I validate the result is:
    Line 1, Col 1:
    PLS-00201: identifier 'NVL2' must be declared
    Line 0, Col 1:
    PL/SQL: Statement ignored
    Somebody knows why that happen and if there is some way to use that function?
    Regards,
    Ana

    Ana,
    Warehouse Builder supplies many pre-defined transformations, but NVL2 is not among them. However, it's easy to add any custom transformation, especially in the case where the implementation already exists in the database, such as with NVL2.
    You can create a private transformation (accessible only in the current module) under Transformations -> Functions node in your module. Or a public transformation (accessible from anywhere) under Transformations -> Custom -> Functions node in your project.
    You can name it NVL2, define the input parameters P1, P2 and P3. Then in the implementation screen of the wizard simply type:
    BEGIN
    RETURN NVL2(P1, P2, P3);
    END;
    Now you can use NVL2 in Mapping Expression Operator and it will validate.
    You would have to define separate transformations for every combination of input/output datatypes.
    Nikolai

  • SSRS Expression Month at a glance

    I have a report that I am trying to regress the payment sums out month by month. I know how to do this in SQL, but no idea in SSRS. Below is what I would like the table to look like.
    Year                             Month                 
    Total Payments       Month1            Month2             Month 3
    2012                              1                      
    10,000.00                2000.00          2000.00            6000.00
                                         2                      
    15,000.00                5000.00           1000.00           9000.00
    And this would go on. I have the report built to drill down by year and month and show the sum of the payments. What I can not figure out is how to break out the payments collected month by month. I hope this makes sense.

    Okay after much playing with this I have starting having success. This is what I want to do.
    =sum(IIF(Fields!MPaidDate.Value = Month(Dateadd(DateInterval.Month, 1, Fields!Date_Recieved.Value))
    and Fields!YPaidDate.Value = Year(Fields!Date_Recieved.Value), Fields!Amount_Paid.Value,0))
    My month 1 column I left out the dateadd and I got back the right values. But when I try to add 1 month with date add it returns false.
    Why do you need to write conditional expressions like this?Isnt it enough to bring MONTH(datecolumn) as a field in your dataset and use matrix control in your report? Add year to rowgroup and Month to column group to get data split up into monthwise. And inside
    data part add three columns to show your measure value ie.#of orders ,
        Balance 
     &  Total Paid  
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • In Photoshop Express, cannot sort images in album by filename in thumbnail view (for slideshow)l.

    In Photoshop Express, I want images to appear sorted by filename.  In the "view as a table" it sorts fine.  When I revert to the thumbnail view, the arrangement is random.  The dropdown "show" list does not offer an option for showing by filename.  If I select the"custom" option, it means I would need to sort 300 images by filename MANUALLY (!!!), a job that a computer does in milliseconds.  Anyone with a solution?  Thanks.

    fwiw, with my images in the 'Folder Location' view the photos are in order by their Windows filename. That is the same order as the hardcopy album the photos came from. So I then created a PSE Album. I selected all my photos and moved them into that album. The order of the pictures was retained in the Album. That worked out great. I wanted my PSE images to be in the same order. I thought I would do it with tags. But creating an album seems to work just fine.

  • Unable to capture via Blackmagic UltraStudio Express

    Hi,
    I'm having trouble capturing into Premiere Pro via UltraStudio Express.
    I have a macbook pro 15” retina, Adobe Premiere Pro CC 2014,  Desktop Video 10.1.4 (installed after PP), Ultrastudio Express, Ultrastudio Mini Monitor, Media Express, DaVinci Resolve 11 Lite.
    I can capture from a camera via SDI into Media Express.
    I can use LiveView and get monitor output with Resolve.
    In Premiere Pro preferences, Device Control I can see 'Blackmagic Device Control'.
    But I can't get any capture in Premiere Pro.  Following the directions in Desktop Video Manual February 2014, as I setup a new project in Premiere Pro, I click on ‘Settings’ under ‘capture’, but get no feedback.  If I proceed into a project, go to capture, I see no video from the connected camera.
    Any advice would be wonderful.  I’m trying to use this system for a green screen shoot on Monday. 
    Herb

    To my knowledge, if CC is up to date, it's up to date.  I checked and there are no updates.  Thanks.

  • BRF+ Message Log & "Rule as Expression"

    Hi colleagues,
    I am quite new to BRFplus and have two questions:
    1) I would like to use a message log action in order to indicate errors. I tried to follow https://wiki.wdf.sap.corp/wiki/display/FDT/Message+Log   with method SET_APPLICATION_LOG_OBJECT, but I can't find the class this method belogns to. I also tried modelling a rule & action message log with help of the UI. My question is how can I log messages and where can I find them after the function is beeing processed?
    2) In every guide I can read something about rule expressions and even how to create them (e.g. http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cc/85414842c8470bb19b53038c4b5259/frameset.htm), but in the workbench there is no possibilty of creating rules as expressions but only rules and rulesets (the rule is not part of the "Expression" node).
    I hope somebody knows what I mean
    Thanks a lot & kind regards,
    Ilijana

    Thanks a lot for your response!
    Could you tell me why using rules and rulesets is not recommended for 7.01 ? This could be interesting for my bachelor thesis.
    Thanks & Kind Regards,
    Ilijana

  • The expression is not being displayed in the alert inbox

    Hi,
    I have created an expression in 'Long and Short Text' tab present in the ALRTCATDEF transaction screen.
    The expression is "test Error in message &SXMS_MSG_GUID&". However if i goto alert inbox, this expression is not getting displayed. I tried putting this expression under Message title, Short text and Long text tabs. But no change in the result.
    In the above expression, SXMS_MSG_GUID is a container variable declared in ALRTCATDEF transaction screen.
    Same is the situation irrespective of the container variable being used - SXMS_ERROR_CAT etc.,
    I appreciate your early response.
    Regards
    Ganesh

    Hi Venkat,
    Without using BPM, you can think/try out with triggering an alert from UDF:
    /people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function
    Otherwise, you can use email functionality to notify the error message rather an alert....so that you can customize your output format/or error message required.
    Also check out this Michal's blog on ALERT Configuration..
    /people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated
    Hope this wull help.
    Nilesh

  • Report generation toolkit and signal express user step : problem of closing reference in "Stop" event

    Hi all,
    I'm trying to make a package of Vis to easily make Excel reports with Signal Express. I'm working on LabVIEW 8.2.1.
    I'm using the report generation toolkit, so I build a .llb from my project which contains all the hierarchy of my steps, but also the hierarchy of dynamic VIs called.
    I have made some steps, like "Open Workbook", "Write Data", etc.
    My steps run well, excepts one step : "Close Workbook".
    If my "Close Workbook" step is firing on "Run" Signal Express event, I have no error, so my reference is properly closed.
    But if my "Close Workbook" step is firing on "Stop" Signal Express event, I have an error "1", from "Generate Report Objectrepository.vi".
    I feel that I'm trying to use a reference which has been killed in the "Stop" step...
    I would like to know what exactly do Signal Express on "Stop" event and why my close function does'nt run well.
    Thanks,
    Callahan

    Hi Callahan,
    SignalExpress (SE for short) does the following on the Stop event:
    1. Takes the list of parameters that SE found on your VI's connector pane, and sets the values that the user set from the "Run LabVIEW VI" configuration page, if any.
    2. Then tells the VI that SE is running the Stop event by setting the Enum found on your VI's front panel. This in turn should produce some boolean values telling your VI to execute the Stop case.
    3. The VI is then run, with those values and states.
    4. SE checks to see if any errors where returned.
    5. Since this is the Stop event, SE releases the reference to the VI which it possesses.
    Questions for you would be, is the reference to your Workbook linked to a control on your connector pane, or held in a uninitialized Shift Register. If it's held in a Shift Register, SE would not be aware of it, and would not be able to affect that reference.
    Hope that helps. Feel free to post your LLB if it doesn't.
    Phil

  • Print a report from Application Express direct to a CUPS Printer

    Hi all, I'm new to this technology, is it possible to print a report from Application Express directly to a CUPS Printer? Can someone tell me in laymans terms how to do it? I find the terminology and documentation less than helpful.

    Jeremy,
    BI Publisher handles submitting reports directly to a CUPS printer. However, the APEX integration doesn't currently integrate with that portion of BI Publisher.
    Here's an options:
    Use the Java API of BI Publisher to build a custom Java program that would do this for you. Delivering to CUPS is part of the Java API.
    Bryan

  • I'm running Final Cut Express 2. How can I move entire project and application from one internal hard drive to another? Ran out of space on one drive. Thanks.

    I'm running Final Cut Express 2. My video project is 95% done and I've run out of space on my 500g internal hard drive. How can I (1) move the complete FCE program and video to my unused 250g internal hard drive and operate it from there and (2) how do I then purge all the FCE info from the 500g drive without losing anything from the 250 drive?
    Also, is it possible to change the aspect ratio from 4:3 to 16:9 when the project is finished? If so, how? I now know this all should have been done before I started. Thanks for the help.

    1. You can't move the application. It must remain on the system drive. Move your capture scratch folder to the external FireWire drive and use the reconnect function in the project.
    2. What's the media 16:9 or 4:3?

  • Sensor Mapping Express VI's performanc​e degrades over time

    I was attempting to do a 3d visualization of some sensor data. I made a model and managed to use it with the 3d Picture Tool Sensor Mapping Express VI. Initially, it appeared to work flawlessly and I began to augment the scene with further objects to enhance the user experience. Unfortunately, I believe I am doing something wrong at this stage. When I add the sensor map object to the other objects, something like a memory leak occurs. I begin to encounter performance degradation almost immediately.
    I am not sure how I should add to best add in the Sensor Map Object reference to the scene as an object. Normally, I establish these child relationships first, before doing anything to the objects, beyond creating, moving, and anchoring them. Since the Sensor Map output reference is only available AFTER the express vi run. My compromise solution, presently, is to have a case statement of controlled by the"First Call" constant. So far, performace seems to be much better.
    Does anyone have a better solution? Am I even handling these objects the way the community does it?
    EDIT: Included the vi and the stl files.
    Message Edited by Sean-user on 10-28-2009 04:12 PM
    Message Edited by Sean-user on 10-28-2009 04:12 PM
    Message Edited by Sean-user on 10-28-2009 04:16 PM
    Solved!
    Go to Solution.
    Attachments:
    test for forum.vi ‏105 KB
    chamber.zip ‏97 KB

    I agree with Hunter, your current solution is simple and effective, and I can't really visualize a much better way to accomplish the same task.
    Just as a side-note, the easiest and simplest way to force execution order is to use the error terminals on the functions and VIs in your block diagram. Here'a VI snippet with an example of that based on the VI you posted. (If you paste the image into your block diagram, you can make edits to the code)
    Since you expressed some interest in documentation related to 3D picture controls, I did some searching and found a few articles you might be interested in. There's nothing terribly complex, but these should be a good starting point. The first link is a URL to the search thread, so you can get an idea of where/what I'm searching.You'll get more hits if you search from ni.com rather than ni.com/support.
    http://search.ni.com/nisearch/app/main/p/q/3d%20pi​cture/
    Creating a 3D Scene with the 3D Picture Control
    Configuring a 3D Scene Window
    Using the 3D Picture Control 'Create Height Field VI' to convert a 2D image into a 3D textured heigh...
    Using Lighting and Fog Effects in 3d Picture Control
    3D Picture Control - Create a Moving Texture Using a Series of Images
    Changing Set Rotation and Background of 3D Picture Control
    Caleb Harris
    National Instruments | Mechanical Engineer | http://www.ni.com/support

  • Expression question

    I'm new at SSRS 2008 R2.  I need to return a value from PERCENT_NUM if DESCRIPTION = 'x'.  PERCENT_NUM is a numeric field and DESCRIPTION is a string field.  The DESCRIPTION field has multiple items that I need to turn into columns
    then list the equivalent value for the facility name.  The data is grouped by facility names.  I have a column called "Decreased Dosage [$]" and enter the expression below in the text box.  I have about 60 facility names and all
    but 1 are returning 0 values. 
    Thanks.
    =IIF(Fields!DESCRIPTION.Value=
    "Decreased Dosage [$]", Fields!PERCENT_NUM.Value,0)

    The table I'm getting the data from looks like:
    ID        
    Facility             
    Description      Value_Num
    1         
    facility 1          
    Blue                
    0.09
    2         
    facility 1          
    Red                 
    0.00
    3         
    facility 1          
    Green              
    0.20
    4         
    facility 2          
    Blue                
    0.12
    5         
    facility 2          
    Red                 
    0.02
    6         
    facility 2          
    Green              
    0.18
    7         
    facility 3          
    Blue                
    0.15
    8         
    facility 3          
    Red                 
    0.01
    9         
    facility 3          
    Green              
    0.15
    The results I'm trying to get are:
    Facility
    Blue
    Red
    Green
    Facility 1
    9%
    0%
    20%
    Facility 2
    12%
    2%
    18%
    Facility 3
    15%
    1%
    15%

Maybe you are looking for

  • Returnable packaging from customers

    Hi, how Returnable packaging from customers is handled in sd module... in sales order, delivery.... etc. could someone explain with the help of a business scenario with config. regards sachin

  • Sharing Computer name

    My 10.4.11 server has correct forward and backwards DNS lookup. Does changing the "Computer Name" field in System Prefs > Sharing break anything? Does this name need to match the dns name in any manner? Thanks, b.

  • Problems MenuBar

    I have a horizontal menubar with three options and without sub items: Products Sales Exit when make a click on a option this, I need to get data of this option menu please help me

  • How to hide system related info (J2EE Engine, JVM, OS) from View Source

    Hi Experts, We are developing an external facing webdynpro application for our customers. When i  right click on webdynpro application in browser and select View Source , it is showing all system specific information such as  DC names including model

  • CR2008SP2, records displayed twice

    Hi, I have a winforms app that was using CR for VS2008.  I've decided to use CR2008 on it instead.  I installed SP2. All is well except that two of my reports display every record in them twice. The records are coming from a runtime dataset.  I know