Can possible positive value of SQLCODE

Hi All,
Please let me know that, can possible positive value of SQLCODE and can I use SQLCODE, SQLERRM in user defined exception. Your suggestion would be greatly appreciated.
Edited by: user13842301 on Mar 18, 2011 8:53 AM

As per my knowledge, User cannot define positive error codes.
here is the snippet from oracle documentation -
The procedure RAISE_APPLICATION_ERROR lets you issue user-defined ORA- error messages from stored subprograms. That way, you can report errors to your application and avoid returning unhandled exceptions.
To call RAISE_APPLICATION_ERROR, use the syntax
raise_application_error(error_number, message[, {TRUE | FALSE}]);
where error_number is a negative integer in the range -20000 .. -20999 and message is a character string up to 2048 bytes long. If the optional third parameter is TRUE, the error is placed on the stack of previous errors. If the parameter is FALSE (the default), the error replaces all previous errors. RAISE_APPLICATION_ERROR is part of package DBMS_STANDARD, and as with package STANDARD, you do not need to qualify references to it.
where error_number is a negative integer in the range -20000 .. -20999
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/07_errs.htm
Oracle gurus, correct me if i am wrong.!

Similar Messages

  • Displaying a positive value in form

    I have got a table tblshipping which has got two col named as send_qty,received_qty from where i calculate the quantity.
    the thing is some times in the calculation i get a negative value and some times positive i want always the positive value should be displayed to end user
    SQL>select sum(send_qty) - sum(received_qty) from tblshiping where matid='1';
    i will get say some thing (-5)
    in the fom i want to display this (-5) as (5) ....can any1 help me out how this is possible.....
    I know changing the order in the query it can be done but again for some condition it will display negative value which i dont it to display

    Use ABS
    SELECT ABS(SUM(SEND_QTY)-SUM(RECEIVED_QTY)) ...

  • Cubeset to only return positive values?

    Yet another cube formula question... In Excel 2010, no powerpivot or olap pivottable extensions, this is a pure Excel project.
    I am building various cubeset, cubemember, and cubevalue formulas to validate an ETL process.
    Question:
    I need to create a cubeset that only returns the members of a cube that have positive values for a specific measure. This cubeset will then be one of several cubesets that gets fed into a cubevalue formula that would otherwise exceed the 255 char limit.
    I can create a cubeset for the overall measure:
    =CUBESET("MyCube","[Measures].[RetailPrice]")
    but haven't found the right syntax for limiting results to only those that have positive values, I think it would be something like:
    =CUBESET("MyCube","FILTER[Measures].[RetailPrice],[Measures].[RetailPrice]>0")
    This syntax actually doesn't return an error, so maybe it is valid syntax... but when I wrap it in a simple cubevalue statement,
    =CUBEVALUE("MyCube", A2)       where A2 is the Cubeset above, or if I also add date range and other filters,
    I get a #Value error, indicating that "the tuple is invalid" per
    http://office.microsoft.com/en-in/excel-help/cubevalue-function-HA010342391.aspx?CTT=5&origin=HA010342384
    I'm still a newbie with the cubeformula syntax and MDX, so I appreciate any suggestions!

    Hi Rohit-
    The cube has a net value of 1220 for the measure I'm trying to calculate (when I don't filter on > or < zero).
    I tried my formula both ways (looking for just positive, and just negative values) and while both work in the standalone cubeset formula, neither return a value when I use it in a cubevalue formula.
    My suspicion, other than a syntax error, is that this may have something to do with me trying to filter on the measure value(s), instead of a dimension- which I think must be possible, but again maybe not with this syntax.
    Let's assume that we had a total of 1280 in retail price, but due to a few returns, we have a few records that show value of -60. If we were looking at profitability, the 1220 is what matters. If we are looking at "dollars exchanged" as a variable expense
    driver of some other measure, then we'd actually want the absolute value of retail price (1280+60 = 1340). I hadn't been able to get the MDX ABS to work, so this was my attempt to grab the positive and negative numbers separately, and then add them to get
    the equivalent of ABS.
    In this case, slicers aren't a desirable option due to how the report is being constructed (I've used slicers in other reports with cubeformulas, but with Excel 2010 I have to have an extra pivot table to get the slicer value, which then has to get fed into my
    cubeform and I'm back at step 1, getting it to work in the cubeformula syntax)
    Thanks!

  • Photo:getRawMetadata( "gpsAltitude") always returns a positive value

    I noticed, both on Windows 7 and Apple OS X 10.9 that calling the photo:getRawMetadata( "gpsAltitude") always returns a positive value.
    Also when Lightroom in the user interface displays a negative value.
    The strange thing is that the photo:getFormattedMetadata( "gpsAltitude") returns the right value, however formatted.
    I reported the bug, see Lightroom 5 SDK photo:getRawMetadata( "gpsAltitude") gives always positive value also when it should be negative
    I thought to document it also here for those who walk into this also.

    Yes, this will be a good idea! Please include!
    In general, if it will be possible to access (read/write) all EXIF tags with its name will be good. Also true for IPTC/IIM tags.
    Maybe, what someone can do with Geo-Tagging, this external program can give some very good ideas: http://www.geosetter.de
    A simple LUA scripts, which also uses the Exiftool can be found here:
    http://code.google.com/p/geotag-lightroom-plugin/
    But if sometimes LR will have functionalities like GeoSetter, this will be the best solution. Maybe, in a few years, every camera will have built-in GPS hardware, but if you look at GeoSetter, there is much more in Geo-Tagging than a GPS coordinate. I prefer, to have only one tool in my Workflow... And I like to see LR here. ;-)
    Manfred

  • Get positive values from sql

    I have balance column and i need to pick only positive values from sql query.
    Balance
    200
    -20
    -220
    100
    Expected
    Balance
    200
    100

    Hi Frank,
    Sorry i think i am not clear.
    below is my function get_total.
    one billing_key is nothing but one billing period-each period has 6 programkeys.
    by following function i will get 6 records by passing 6 programkeys and one biling key
    now i need to get over all balance of all periods per program. condition is i need to take only +ve amounts from the below function and sum it up
    expected out. i am just giving an example of output.
    actual
    programkey get_total
    a 100
    a -50
    a -50
    b 200
    c 300
    c -200
    d -100
    d -25
    d 400
    e 500
    e -10
    f 600
    f -200
    we are taking only +ve amounts from the above.
    How can i write a procedure or script to acheive program_key and balance as below.
    programkey balance
    a 100
    b 200
    c 300
    d 400
    e 500
    f 600
    create or replace FUNCTION GET_TOTAL (p_bill_key IN varchar2,
    p_prog_key IN varchar2) RETURN NUMBER AS
    l_total NUMBER;
    l_dum_bill NUMBER;
    p_count NUMBER:=0;
    BEGIN
    BEGIN
    SELECT count(*) into p_count
    FROM billing_adjust b where b.billing_key = p_bill_key ;
    if p_count < 1 then
    SELECT NVL(surch_amount,0) + NVL(adjust_amount,0)
    INTO l_total
    FROM mv_billing a, mv_prog_surch b
    WHERE a.billing_key = b.billing_key and
    a.billing_key = p_bill_key and
    b.program_key = p_prog_key;
    return l_total ;
    end if;
    SELECT NVL(surch_amount,0) + NVL(adjust_amount,0)
    INTO l_total
    FROM billing_adjust b, prog_surch_adjust c
    WHERE b.billing_adjust_key = c.billing_adjust_key and
    b.billing_key = p_bill_key and
    c.program_key = p_prog_key;
    return l_total;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    null;
    End;
    RETURN 0;
    END GET_TOTAL;
    This is what i have started writing to acheive expected output need help on this.
    Create or replace function balance(p_company_id) return number as
    v_total_due number:=0;
    v_total number:=0;
    CURSOR p_idn IS
    SELECT PROGRAM_KEY,PROGRAM_NAME FROM MV_PROGRAM_DICT where CURRENT_YN = 'Y' order by PROGRAM_NAME_ID;
    cursor p_billkey_idn is
    select biling_key from billing where company_id=p_company_id;
    Begin
    for v_idn in p_idn loop
    for v_billkey in p_billkey loop
    SELECT sum(get_total(v_billkey.billing_key,v_idn.program_key)) into balance
    FROM dual
    WHERE get_total(v_billkey.billing_key,v_idn.program_key)>0;
    END LOOP;
    END loop;

  • Can the position and szing of a control element in a View be controlled from the ViewModel?

    Is it possible to change the position of a control, say a label, as a response to some action/operation from the ViewModel?  Like if one response to something is true then place the label in the top left corner.  If false, place the label
    in the lower right corner.  I realize you could have a label in each position and just set the visibility.  But can the position and sizing of said label be controlled from the View Model?  What would be a sample coding of this?  would
    it be in the xaml or combination of a method in the ViewModel and the xaml? 
    Rich P

    First off Rich, say TextBlock to yourself ten times.
    Use a TextBlock rather than a label.
    There are a bunch of different ways to do this and the easiest is to have two controls whose text is bound to the one property.
    Bind the Visibility of each to another 2 properties in the viewmodel.
    Collapse one and Visible the other.
    The reason for that is that it's easier.
    Technically, you could put one textblock in a grid and use margin to control this.  You could animate x y co-ordinates and move the textblock mysteriously across the window if you put your mind to it.
    Or you could put it in a row/column "cell" of a grid and change which cell it goes in - but that would involve some mechanism like messaging from the viewmodel to the view and is not really ideal if you can avoid it.
    I'd have a pair of textblocks, here's one:
    <TextBlock Name="TopLeftMsg"
    Text="{Binding Msg}"
    Visiblity="{Binding TopLeftVis}"
    Both would bind to a public string property msg in the viewmodel.
    They each get their own public visibility property  and that'd be switched between Visibility.Visible and Visibility.Collapsed.
    Sizing of textblocks is best fitted to content because all you see is the text.
    Textboxes are arguably different because you can see the things.
    Hope that helps.
    Recent Technet articles:
    Property List Editing;  
    Dynamic XAML

  • Positive Value with Zero Stock

    hi Experts
    I noticed while doing a stock audit report that I had a positive value of £35.00 for a item code where the stock level was zero.   How can I get the amount down to zero too?  Stock Revaluation won't work because there is no stock and any in/out stock transaction simply result in outstanding amount of £35.00. 
    We are using FIFO for value .   I would also be interested to know how I can query other items with this issue?
    thanks
    Geoff
    Edited by: Geoff Lord on Jul 8, 2011 5:26 PM

    Hi Goeff.......
    If the stock of the item is zero and still it shows the item cost then this means nothing.
    It does not affect anything in system.
    The moment you book GRN the purchase value will be overrite on it. It only shows for display as last price......
    You can try a purchase in demo DB and then run the Audit report you can find the difference.......
    Regards,
    Rahul

  • Display only positive values for a particular Keyfigure

    Hi..
    (Sorry, I accidentally posted this also in Datawarehousing forum, actually it related to BeX forum).
    For a particular column(keyfigure) in my report, the user wants to display only positive values.
    I used the formula from the one of the forums
    (Keyfig > 0)* Keyfig.
    This displays only positive values in the column as required. But, the result for this column is also affected. As the result is negative, it shows, zero in the result for this column.
    Is there a way in which the result will not be affected by the formula?
    I went into the properties of the particular keyfigure and chose Calculate Result as -> Summation.
    It throws out the following error message
    'Calculating result as...' was not executed
    Message no. BRAIN141
    Diagnosis
    The function 'Calculate Results as ...' could not be used in all
    instances.
    The recalculation of a result cell always occurs based on the set of
    detailed cells subordinated to this cell. This is the most detailed
    level of the drilldown. Therefore it is not posible to recalculate in
    hierarchical lists. The calculation of a results cell is not performed
    if a cell or column with an expand symbol is assigned beneath it.
    Otherwise the newly calculated result is changed every time one of its
    lower-level nodes is expanded. This is not supported for technical
    reasons and would also only confuse users.
    Note, however, that calculating with "Suppress Results" is always
    executed because the restriction described above does not apply in this
    case.
    NOTE:
    The query shows the keyfigure values for a selected title, for profit center and territory hierarchies.
    Any suggestions would be greatly appreciated.
    Thanks,
    Sai.

    Hi Deepu,
    Thanks for the reply. I tried with ur formula.
    LEAF(keyfig) gives all values "zero" for that particular column including the result.
    NOT LEAF(keyfig) gives all values "one" for that particular column including the result.
    So, ur formula gives the same values as of the present column values.
    I tried condition, but it's not working...it says the following errors...
    There is a condit. on Title, results row suppress. active on Profit Center    
    (conditional                                                                               
    Message no. BRAIN144                                                                               
    Diagnosis                                                                               
    Characteristic Title has an output condition and the 'Suppress Results    
        Cells' property is active for Profit Center. This generally leads to an   
        incomprehensible output list.                                                                               
    System response                                                                               
    As soon as an output condition is defined for a characteristic (here      
        Title), the system calculates the corresponding result cells and applies  
        the output condition. If a result cell of this type is later deleted by   
        the condition, all the lower-level detail and result cells in its         
        drilldown are suppressed. Because the result cell is suppressed the       
        Title rows are then omitted from Profit Center.                                                                               
    In extreme cases this can lead to an entirely empty list being            
         displayed, although the single rows or columns would be displayed if the  
         condition were deactivated.                                                                               
    Procedure                                                                               
    Check the query settings, especially results row suppression and the      
         output conditions.                                                                               
    Procedure for System Administration                                                                               
    You can deactivate this message Brain 144 with transaction RSRT1.                                                                               
    There is a condit. on Profit Center, results row suppress. active on        
    Territory as in SPL (conditional                                                                               
    Message no. BRAIN144                                                                               
    Diagnosis                                                                               
    Characteristic Profit Center has an output condition and the 'Suppress  
        Results Cells' property is active for Territory as in SPL. This         
        generally leads to an incomprehensible output list.                                                                               
    System response                                                                               
    As soon as an output condition is defined for a characteristic (here    
        Profit Center), the system calculates the corresponding result cells and
        applies the output condition. If a result cell of this type is later    
        deleted by the condition, all the lower-level detail and result cells in
        its drilldown are suppressed. Because the result cell is suppressed the 
        Profit Center rows are then omitted from Territory as in SPL.                                                                               
    In extreme cases this can lead to an entirely empty list being            
         displayed, although the single rows or columns would be displayed if the  
         condition were deactivated.                                                                               
    Procedure                                                                               
    Check the query settings, especially results row suppression and the      
         output conditions.                                                                               
    Procedure for System Administration                                                                               
    You can deactivate this message Brain 144 with transaction RSRT1.
    Thank you very much.
    Regards,
    Sai.

  • Negative  values in red and Positive values in black CONDITIONAL FORMATTING

    Hi ... Everyone
    I have to show Negative values in red and Positive values in black in one of my report.
    i tried these conditions
    1. <?if:GAIN<0.00?><?attribute@inlines:color;'red'?><?end if?>
    but it shows negative values only in red ,positive values in black are missing
    2. <?if:GAIN<0.00?><?attribute@incontext:color;'red'?><?end if?><?if:GAIN>0.00?><?attribute@incontext:color;'black'?><?end if?>
    This gives the exact result what i wanted ...but the problem is i have five tables in my report ... so the above condition only allow changes in ONE TABLE ONLY. :(
    Plzzzz anyone who can help me to sort out my problem or else SUGGEST ANOTHER WORKING CONDITION
    Regards
    Subham Mittal

    Subham,
    This should not be difficult and moreover the BI Publisher Desktop installation comes with a set of examples:
    Start -> Programs -> BI Publisher Desktop -> Samples -> RTF Templates -> Advanced -> Conditional
    There you can find two templates with the exact same situation like yours, highlighting either the foreground color or background color.
    regards
    Jorge

  • Logic X Staff Styles for drum kit:  can't position?

    I'm new to Logic but l I believe I'm doing this right and have hit a bug.  By default, the snare drum is mapped to what would be a "b" in treble clef.  I'd like this to be mapped to a "c".  To change this, I open Staff Styles and edit the mapped style for drums.  The snare group is at position "-4" by default, which I believe means it is four steps down from the the top staff line.  I want to change this to -3 to move it up to a "c".  I can change the value by clicking and dragging the -4, but when I do this, instead of the note moving up, it snaps to the top (position 0) and stays there.  If I close this window and re-open it, sure enough, logic has assigned a zero to the position.  No change seems to affect it, and if I save a project like this the snare group is forever at position zero, basically ruining the project.
    Has anyone experienced this?  Am I doing something wrong or is this just a bug? If it's a bug, does anyone know a work-around?
    Thanks for any insight,
    Brian.

    Hi
    Brian Pepin wrote:
    Has anyone experienced this?  Am I doing something wrong or is this just a bug? If it's a bug, does anyone know a work-around?
    Confirmed bug in LPX 10.0.7 ( works as expected in 10.0.6)
    There is a *very* clunky workaround:
    Create a new Mapped Instrument object in the MIDI Environment and cable it up to the required software Instrument channel object.
    Drag the Mapped interment object from the Environment and drop it on the required track in the Track area track list ( to route the track via the new mapped instrument object)
    Edit the snare entries in the mapped instrument object: up 0.5 transposition)
    This change is not immediately updated in the Score; you have to change the staff style to any other one then re-apply the #drums style.
    CCT

  • Positive Value only Display or Edit Pattern

    Hello, could someone please explain how I can prevent a negative result in a calculation field? i.e., a result less than zero. In other words, how can I ensure that users only enter positive values in a numeric field, and that the subsequent simple "subtract" calculation will also remain positive?
    Harry

    THANKS NASSIA, this works for disallowing negatives by force, however it gives me script failed alert.
    Would you know how to suppress "Script Failed" alerts, such as this:
    Script failed (language is formcalc; context is
    xfa[0].form[0].form1[0].SF_CalculationTable[0].acview[1])
    script=(ac[1] / tr[1]) * 100
    Error: arithmetic over/underflow.
    . (+ 25 more...)
    These seem to be only happening because the field is not yet populated, (except with zeros). How do I suppress this error, because the form works fine.

  • Is there any way we can set default value for a Date Attribute to current date in Master Data Services

    Is there any way we can set default value for a Date Attribute to current date in Master Data Services.
    I as well wants to know that is there any posibility to show Calendar control while input data into respective date attributes.
    Thanks.

    Hi Anagha,
    So far i havent found any way to set todays date by default from MMI, but i guess this flow should work as workaroud
    1. Add buisness rule which can set a default value when Date = NULL/Blank
    2.get the entity table ,use -select EntityTable from mdm.tblEntity where Name = '<enter entity name>'
    3.Go to that table and add a after update trigger like
    if uda_<entityid>_<attributeid(Date attribute)> = default value
    update uda_<entityid>_<attributeid(Date attribute)> =getdate() where id = <LastUpdatedRow>
    I will check on this too from my side.
    By the way AFAIK i dont think so calendar control integration is possible .

  • Can i create value range in domain

    can i create value range in domain

    Hi,
    Value range means we will give possible values at Domain level.
    We will have Value tabe also at Domail level.
    when we give possible values at Domain level it will restrict to those values to that particular field.
    Deepak.
    If this helps you reward with points.
    Message was edited by: KDeepak

  • IDCS3: Can't enter values into dialog boxes

    I've just started using InDesign CS3 on an Intel Mac, having been using CS2 on a G5. When I try to enter a value into a dialog box, nothing happens. The dialog box refuses to accept any inputted value. If I use the up/down arrows, I can change the value but only in whole increments. I can't, for instance, place an item 10.5mm from the page edge. It has to be 10 or 11mm.
    The same is true of any dialog box for any value.
    Has anyone else experienced this very frustrating issue?
    Thanks.

    I guess I need to clarify my situation. I was using the wrong terminology. When I talk about "dialog boxes" I mean the palettes like the Control Panel, Paragraph, Character, Stroke, etc. I can't type into any of them. If I put the cursor in, say, the X pos text box and hit tab (to go to the Y pos text box) all that happens is that all the palettes are hidden. It's like I can't get any focus at all in the palette text boxes.
    Sorry about the confusion.
    This problem isn't limited to my machine, it happens on any of our networked Macs running CS3, so I think the problem may be related to something else, possibly the Suitcase Server. But there's no way I can confirm this. I was hoping someone else had had the same problem and discovered a solution.
    Cheers.

  • Positive Values

    I need to be able to enter only positive numbers in a field. How do I do this in Forms. I tried format mask 9999999. Do I need to write a when_validate_item trigger ??? I have the same type of item in different blocks..please suggest.
    Thanks

    In the property palette for the item you can specify the value 1 in Lowest Allowed Value.

Maybe you are looking for

  • How to make the video looks greenish ?

    Hi there, Can I know how to make a video looks bit greenish ? Thanks

  • Making the thumbnail view larger for templates

    Hello - I was working on my resume last night on Pages (new to mac) and found myself having to click on a template to be able to see the layout, then close it out if I did not like and repeat ad nauseum. Is there a way to make the view of the templat

  • 10.4.6 skewered my generic printing...

    Why, oh why, me? So, I have an HP OfficeJet K80 and of course, HP has no drivers. So, 3 years now and I've been trucking along fine with an HP JetDirect / IP Printing / Gimp-Print HP 900 driver v5.0.0 beta (whatever that is). Even printing wirelessly

  • J2EE Help

    I am new to J2EE and am having problems deploying a JSP page with java embeded in it: <%! java.util.Date today = new java.util.Date(); %>. This is straight out of a J2EE book. I get an error: No Java compiler was found to compile the generated source

  • FI-AA / CO - Impossible to input cost center in asset acquisition

    Hello everyone, I have a question about asset acquisition postings (transaction ABSO). In first item of the document (with posting key 70) i click on 'Additional account assignement' but fields 'Cost center' and 'Profit center' are both locked (no po