The use of Exception in function

Hi I want to know which is the standard practice of exception handling in a stored function?

EXCEPTION
WHILE OTHERS THEN
sp_log_error (...);
LIFT;

or

EXCEPTION

WHILE OTHERS THEN
RETURNS A NULL VALUE.

If the function has no exception handler, and the function throws an exception, then the INSERT statement throws this exception. Depending on the version of Oracle and requirements, you can potentially use the clause of ERRORS in the LOG so that the lines that do not cause an exception get inserted and lines that cause an exception get connected in a separate table.

Justin

Tags: Database

Similar Questions

  • Limitations on the use of SQL/PLSQL functions in reports 6i / 10g

    Hi gurus...

    We have a limitation on the use of TRIM, Regular Expressions, CASE operator subquery in cursor in reports 6i/10 g...
    Could you please let us know all these limitations for reports 6i / 10g. Any reference document will be much more useful...

    Any help will be greatly appreciated...
    Thank you in advance...

    gt1982

    There is no documentation. For example, documentation reports 6i can't say you cannot use regular expressions, simply because it is right, it did not exist at the time.
    The pl/sql in the forms and reports engine is always behind, on the database. You should put as much code as possible in the procedures of database and the views if you want to use again (pl /) sql features.

  • Problem with the use of MID/LEFT functions

    I have a problem, see the point of these functions if (as seems to be the case) they will not allow another cell to be referenced.

    I want to do a SUMIFS with match being the first four characters of another cell data. I can't find any way to do it without manually copying the first four characters in another cell.

    If I use only LEFT like this:

    LEFT ('ABCD', 3) to derive 'ABC '.

    so why would just enter ABC in the first place? But that's what show examples and any attempt to do what I really want

    that is LEFT (F19: 3)

    causes a syntax error.

    I believe that I'm missing something really stupid, but I'm darn if I can see it.

    Hi jon,

    LEFT (F19: 3)

    causes a syntax error.

    Try a comma in place of the colon

    = LEFT(B2,3)

    It's your area used for the decimal point. If you use the comma for decimals, use a semicolon in the formula, = LEFT(B2;3)

    Kind regards

    Ian.

  • Recover the use of memory (WCF function)

    Hoped one of the officiando on this forum could enlighten me on what I could possibly hurt.

    I created a WCF dashboard that shows a VMs CPU and memory Avg and Max using for the last 30 days. Data vFogkight in the dash of my review of the virtual machine via vCenter, display correctly and are provided below

    When I create a function that takes the same exact measurements I for some reason some don't get the same information.

    1 average for the period seems correct

    memAverage = virtualMachine.get("memory/hostMemory/utilization/period/average")

    2 Max memory is does not correspond to what is stated in the above data table

    memMax = virtualMachine.get("memory/hostMemory/utilization/period/max")

    3. average CPU does not correspond to what is stated in the above data table

    cpuAverage = virtualMachine.get("cpus/hostCPUs/utilization/period/average")

    4 Max CPU for the period seems correct

    cpuMax = virtualMachine.get("cpus/hostCPUs/utilization/period/max")

    Any help to help me understand where I went wrong is greatly appreciated.

    Thank you

    Joshua

    specificTimeRange is provided automatically, based on the timeRange selected within the parameters of the user dashboard.

    If you test the service in WCF, you get a specificTimeRange = all the time.  Quite annoying, really.

    If you assign the result of the function of a column on a simple line-oriented table (or no matter what display), it inherits the timeRange Dashboard automatically.

  • the use of exceptions to differentiate static/instance fields

    I want to identify the instance fields of a class I know nothing about.
    This example does this:
    public class Main {
      public static void main(String args[]) {
        test();
      }
    
      static void test() {
        try {
          Field[] fields = Foo.class.getFields();
          for(int i = 0; i < fields.length; i++) {
            System.out.print(fields.getName());

    try {
    fields[i].get(null);
    } catch(NullPointerException e) {
    System.out.println(" <-- instance");
    continue;
    }
    System.out.println(" <-- static");
    }
    } catch(Exception e) {
    e.printStackTrace();
    }
    }

    static class Foo {
    public static int staticInt = 5;
    public static String staticString = "five";

    public int instInt = 10;
    public String instString = "ten";
    }
    }
    I am using NullPointerException throwing to control the flow of my method. I am sure a good programmer would never do this, right?
    So, is there any other way to determine if a field is a class's instance, or static, field?
    thank you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    http://download.Oracle.com/javase/6/docs/API/Java/lang/class.html#getModifiers)

  • How can I fix a black and white screen on the air from my iPad? I rebooted it and ran the last updated IOS 9.2 on it. It is stuck and won't return to the color. All other functions work except this.

    How can I fix a black and white screen on the air from my iPad? I rebooted it and ran the last updated IOS 9.2 on it. It is stuck and won't return to the color. All other functions work except this.

    Have you checked the settings > General > accessibility > greyscale > power off.

    If this does not work ty settings > General > accessibility > zoom > on. Triple, tap the screen with three fingers. Tap choose filter. Click None. Triple, tap the screen to get rid of the menu zoom. If you have enabled greyscale in zoom you can disable it in zoom.

  • Disable the use of structure in a lead time library function node increases

    I found that if I use a stureture disable to disable one of the outputs of a library function node call, the run time will be greatly increased. Can someone explain this?

    You can read this thread and benchmarking, I did there.

    Turn off debugging and check if the loss of performance you MENTION (but not quantified) is still there.

  • can not get the printer to work when sending my laptop computer that he used to work the printer is on and functional

    Can't get printer to work when sending my laptop computer that he used to work the printer is on and functional. Canon pixma MP180

    Hi NickManchisi

     

    1. for how long have you been faced with this problem?
    2. what happens when you try to print?
    3. do you receive any error messages?

    Method 1 :
    Please refer to the below mentioned article and check if the given steps help.

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


    Method 2:

    You can even perform a restore of the system to a previous point, when the issue was not present. The System Restore tool uses points of restore to return the system files and settings to an earlier point in time. You can use it to restore the operating system to a point in time when you have not experienced the problem.

     

    Note: When you use System restore to restore the computer to a previous state, programs and updates that you have installed are removed.

    To do this, there must be a restore point from the system in which the connection was successful.

    Refer to the following help link on performing a system restore.
    http://support.Microsoft.com/kb/306084

     

    I hope this helps.

  • Is the function of automatic update of Windows found in the use of control panel of your compensation for the use of the Internet from my ISP?

    Original title: Windows updates

    Is the function of automatic update of Windows found in the use of control panel of your compensation for the use of the Internet from my ISP? If so, how? In addition, how to hide an update, I don't want to? For example, I use (and I'm happy with) Windows Internet Explorer (v7), but receive reminders to update update to Internet Explorer v9, which I don't want.

    Is there a way to prevent Windows Update for sending this reminder in the future?

    Geoff

    Hide and Yes will use you PSI data usage. It depends on how much the updates install you, on the amount of data it uses

  • Hello, im a student in England, student of architecture. I have the pack student for 12 months and I really need to know my limits with the use, (copyright licensing). I am allowed, except by using my home application to show works that i already have)

    Hello, im a student in England, student of architecture. I have the pack student for 12 months and I really need to know my limits with the use, (copyright licensing). I am allowed, except by using my home application to show works which I have already done (as portfolios) to architectural firms, I intend to request a placement to? also can I post my stuff (already did the work) on my blog or tumblr? I intend not to use for profit/money at all well (if I was I wouldn't ask you this lol). Thank you.

    Hi,

    Please see Licensing FAQ: where can I find the terms of membership and the terms of use?

    Hope that helps!

    Kind regards

    Sheena

  • You want to clarify the whole picture except for a small area - using a MAC PS thanks CC!

    You want to clarify the whole picture except for a small area - using a MAC PS thanks CC!

    The target of the layer mask.

    Use the paint brush tool

    Use black paint

    paint over the area you want to return the origanal look.

  • Hi all! I'm new in this forum, as well as in the use of Muse. I ask if there is a sequence of steps o specific function to convert the Fund size tablet and phone Web site.

    Hi all! I'm new in this forum, as well as in the use of Muse. I ask if there is a sequence of steps o specific function to convert the Fund size tablet and phone Web site.

    Y does it can someone help me? Thank you in advance to all

    Good bye

    Hello

    I would say to start from this article

    How to create a mobile website with Adobe Muse | Adobe Muse CC tutorials

    Let me know if you have any question.

  • What is the use of the DUMP function

    Hi friends,

    What is the Dump function? What is the use of dump? where can I use dump?

    ex:

    Select (sysdate) dump of double;

    Please expline with good example,


    By,.
    Symph.

    Sometimes you can have data in your database that you expect to be returned or excluded by a query, but you do not know why it does not work as expected. With the help of DUMP, you can examine the contents of the byte-by-byte data to help identify issues...

    SQL> with t as (select '&data' as dta from dual)
      2  --
      3  -- end of test data
      4  --
      5  select dta, dump(dta), dump(dta,16) from t;
    Enter value for data: Fred Smith
    old   1: with t as (select '&data' as dta from dual)
    new   1: with t as (select 'Fred Smith' as dta from dual)
    
    DTA
    ----------
    DUMP(DTA)
    ---------------------------------------------------------
    DUMP(DTA,16)
    ---------------------------------------------------------
    Fred Smith
    Typ=96 Len=10: 70,114,101,100,255,83,109,105,116,104
    Typ=96 Len=10: 46,72,65,64,ff,53,6d,69,74,68
    

    So my entry of "Fred Smith" looks like it's just two names separated by a space, but in reality in this example, the 'space' is the character ascii 255 (FF hex). This can be seen in the DUMP information. If it's data to my database, I would now be able to determine why, for example, I wasn't getting it back in my query when you query for "Fred Smith" by using a space character.

    There are other options as well, for example, to examine the character set...

    SQL> select dump('Fred Smith',1017) from dual;
    
    DUMP('FREDSMITH',1017)
    ------------------------------------------------------------
    Typ=96 Len=10 CharacterSet=WE8MSWIN1252: F,r,e,d, ,S,m,i,t,h
    
    SQL> select dump('Fred Smith',1016) from dual;
    
    DUMP('FREDSMITH',1016)
    ----------------------------------------------------------------------
    Typ=96 Len=10 CharacterSet=WE8MSWIN1252: 46,72,65,64,20,53,6d,69,74,68
    

    Take the result of the DUMP function you can use for all sorts of things based on what your needs are... example...

    In binary or hex string conversion...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with x as (select 'Fred' as txt from dual)
      2  --
      3      ,t as (select txt, regexp_substr(dump(txt),'[0-9,]*$') as bytes from x)
      4      ,s as (select txt, rownum rn, to_number(regexp_substr(bytes,'[^,]+',1,rownum)) as byte
      5             from   t
      6             connect by rownum <= length(regexp_replace(bytes,'[^,]*'))+1
      7            )
      8      ,b as (select txt, rn, byte, to_char(byte, 'fm0x') as hx
      9                   ,bitand(byte,128)/128||
     10                    bitand(byte,64)/64||
     11                    bitand(byte,32)/32||
     12                    bitand(byte,16)/16||
     13                    bitand(byte,8)/8||
     14                    bitand(byte,4)/4||
     15                    bitand(byte,2)/2||
     16                    bitand(byte,1) as bin
     17             from s)
     18  --
     19  select txt
     20        ,ltrim(sys_connect_by_path(byte,','),',') as bytes
     21        ,replace(sys_connect_by_path(bin,','),',') as bin
     22        ,replace(sys_connect_by_path(hx,','),',') as hx
     23  from b
     24  where connect_by_isleaf = 1
     25  connect by rn = prior rn + 1
     26* start with rn = 1
    SQL> /
    
    TXT  BYTES                          BIN                                      HX
    ---- ------------------------------ ---------------------------------------- --------------------
    Fred 70,114,101,100                 01000110011100100110010101100100         46726564
    
    SQL>
    

    or the conversion from the internal representation of a date in binary.

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select sysdate as dt, regexp_substr(dump(sysdate),'[0-9,]*$') as bytes from dual)
      2      ,s as (select dt, rownum rn, to_number(regexp_substr(bytes,'[^,]+',1,rownum)) as byte
      3             from   t
      4             connect by rownum <= length(regexp_replace(bytes,'[^,]*'))+1
      5            )
      6      ,b as (select dt, rn, byte
      7                   ,bitand(byte,128)/128||
      8                    bitand(byte,64)/64||
      9                    bitand(byte,32)/32||
     10                    bitand(byte,16)/16||
     11                    bitand(byte,8)/8||
     12                    bitand(byte,4)/4||
     13                    bitand(byte,2)/2||
     14                    bitand(byte,1) as bin
     15             from s)
     16  --
     17  select dt
     18        ,ltrim(sys_connect_by_path(byte,','),',') as bytes
     19        ,replace(sys_connect_by_path(bin,','),',') as bin
     20  from b
     21  where connect_by_isleaf = 1
     22  connect by rn = prior rn + 1
     23* start with rn = 1
    SQL> / 
    
    DT                  BYTES                     BIN
    ------------------- ------------------------- ------------------------------------------------------------------
    06/01/2010 08:56:46 218,7,1,6,8,56,46,0       1101101000000111000000010000011000001000001110000010111000000000
    

    If you have a real need for it is another matter, but it is good to know that it is possible.

  • Can not use the hash within forms (tips) function

    Hello Guru,

    Oracle 10.2.0.4.0 on Linux ES4 with a forms 6i application.

    We have this simple hash function that I use as a program unit on a user form in forms 6i.
    It hashes passwords using this function;

    create or replace function md5 (value varchar) return varchar2 is
    v_input varchar2 (2000): = value;
    hexkey varchar2 (32): = null;
    Start
    hexkey: = rawtohex (dbms_obfuscation_toolkit.md5 (input = > utl_raw.cast_to_raw (v_input)));
    return of nvl (hexkey, '< null >');
    end;
    /

    I want to use it on a front Insert and before update trigger within forms. When I have the use of the md5 function code it gives me an error something on air of "cannot use this function in a sql statement" for example, that I expect to use it as follows:
    insert into users (username, password) values (: user.username, md5(:user.password));))
    and the same would go for the update.
    I know that I can pull this off the form code and create an insert or update trigger after and call that the md5 function here, but I like to keep the code of hash in the user form - I already have 4 triggers in database on the table and do not want to create more.

    Any advice would be great... :-)

    Just a small chance: try to call the function by using the names of block and item OTHER than: user, user name, and password.

    All or part of them are reserved words, and maybe that's the problem.

    If not, why not just call the function in the form to define a declared value of pl/sql, and then use this value in the insert and update statements.

  • Basic queries on the use of the iPod Mini G2 converted '8 GB CF'

    7 years ago, I asked for help to convert iPod found in a draw to the fate-many pieces for the tip!

    Kenichi gave me good advice, but he re-entered the drawer only to discover again seven years later!

    This time, I finally got round to do the conversion.

    Everything went exceptionally well and I now have an 8 GB player that functions perfectly I can say now.

    As it was the machine of my daughter, I don't know how to take control of it!

    Just to give you an idea of my skill level; It took me several minutes to find out how to increase the volume.

    First problem I have is that iTunes does not allow me to 'manually manage' my music before the 'restoration', because these options are greyed out!

    Once he had "restored", and I re-connected, these options are available to me.

    Since all my "music" collection has now been copied to the device, which includes a couple of 'e-Books' and also various sound effects, ringtones, poster ads etc. I would like to 'eliminate' this is not a soothing music, but I'm afraid of the consequences!

    Having chosen to 'Manually manage' my music, I was scared by a message that says actually ' do you really want to do?

    Do not understand the consequences that could follow if I said 'yes', I thought that I would be wise to consult the oracle first!

    If it is indeed possible to "take control" without too much pain, I would like to know how to remove the offending bells, whistles, horns, etc.

    I could then move on to the next possible stumbling block, 'e-books '. who are currently in the Albums and songs, just as they are on my phone, I hope there is a way to recognize them on the iPod as 'books '.

    Once it is fully charged, I hope that he will play well with system 'Audio 50' of my Merc.

    All the words of wisdom would be very appreciated!

    Now, I also have an iPod mini with flash storage.  I previously did similar mods on gen 3rd and 4th generation iPod "classic".  iPod mini is very accommodating to replace his drive hard micro with flash storage.  The main reasons are that its 'MicroDrive' use already the compact flash (CF) card form and connector.  But the current prices for the physically smaller SD card (and most popular) is much lower than in the same capacity, compared to the CF card, so I used a card SD to CF card adapter and turned a 64 GB SD card a card see  This is the adapter that I used

    http://www.Amazon.com/DP/B00EPMWT1M/

    Its size (including thickness) is an exact match for the 4 GB MicroDrive it replaces.  I already had a 64GB SD card that I used with my Mac, but they cost less than $25 on sale these days!  And the adapter is $ 13.  Surprisingly, the embedded software (designed for 4 GB, 6 GB of storage) mini iPod works perfectly at 64 GB.  The available capacity is about 59 GB; I have about 54 GB charge.

    So if you exceed the 8GB size in your mini iPod, here is your project "next"...   Back to your actual questions.

    First problem I have is that iTunes does not allow me to 'manually manage' my music before the 'restoration', because these options are greyed out!

    Without doubt because (at the time), it was set up to synchronize with your daughter iTunes library.  The iPod can be associated with both iTunes library.  When you did a restore using your iTunes library, the previous association has been removed.

    Don't worry if any currently on the iPod are in your library iTunes (on the computer), on the "consequences".  You can re - sync anything to the iPod, if you delete something by mistake.  Here's a convenient way to establish things...

    Create a new playlist in your iTunes library.  You can call it iPod songs.  Add ALL the songs you want on your iPod to the playlist.  At this point, the iPod has no need to be connected.  You work with your iTunes library only.  You can post back, if you want some advice on the use of playlists.

    Then, connect your iPod and select it in iTunes (click on its button on the device on the horizontal bar) to show its settings screen in the iTunes window (as seen in my screenshot above).  The side left (in the sidebar), under settings, click music.  Right, parameters of music on the iPod screen.

    NOTE: For anyone else reading this, all the songs of the iPod that are not in your iTunes library will be lost.

    Check the box to Sync music, if it isn't already.  Below, choose the option to sync selected playlists, albums, artists and genres.  Below, under playlists, search for and select (check) this playlist of songs from iPod .  You don't need to choose something else on this screen (you can if you wish).  Click apply.  iTunes syncs only the songs you put on this playlist of songs from iPod to iPod.  Everything that is currently on the iPod is removed.

    Further, you can update this iPod songs playlist in your iTunes (add/remove songs).  The iPod has no need to be connected.  The next time that you connect the iPod (or click sync , if already connected), iTunes automatically updated the iPod with the same changes.  That's how I use my iPod 8 GB nano, unless I have more than one playlist that synchronize to the iPod (a few selections for the race and a "Favorites" playlist).

    I could then move on to the next possible stumbling block, 'e-books '. who are currently in the Albums and songs... If all goes well, there is a way to recognize them on the iPod as 'books '.

    I think you mean audio books.  Text-based 'e-books' do not work with the iPod (except iPod touch).  If audio books to appear in your library iTunes music, they should be classified as audiobooks in iTunes.  Right-click a 'song' (which is actually a digital audio book) in iTunes and get information.  You can select several elements at the same time and get information on the selection.  In the Info window, go to the Options tab.  Change media kind in audiobook, then OK.  The item now appears in your library of audiobooks to iTunes (not your music library).  See also the article as an audiobook iPod, not a song, when synchronized.

    To set up synchronization of audio books, the procedure is similar to the songs.  On the settings screen of the iPod, in the sidebar, under settings, click on audio books.  Set up screen setting audio books from iPod and apply.

Maybe you are looking for