When and where to use Dbms_Error_Code, Error_Code and SqlCode.

I have gone thru some docs and books on dev to understand error messages in Developer. After reading i am more confused reg the difference between
Dbms_Error_Code, Error_Code and SqlCode.
Can any one tell me concisely the difference and the situation where these are used.
This is my understanding so far.....
DBMS_ERROR_CODE and DBMS_ERROR_TEXT return the last Oracle Server error code and message due to an implicit DML within form application.
SQLCODE and SQLERRM return the last Oracle Server error code and message due to an explicit DML within a form application.
So why use ERROR_CODE at all?
Below is an extract from the Oracle help Docs...
When an implicit DML raises an error, it is handled with an ON-ERROR trigger using the ERROR_CODE function. This function contains the last Oracle Form error code. These errors are prefixed with FRM-.
Okay but why not just use DBMS_ERROR_CODE instead of ERROR_CODE?
Example: /*
** Built-in: DBMS_ERROR_CODE,DBMS_ERROR_TEXT
** Example: Reword certain Oracle Forms error messages by
** evaluating the DBMS error code that caused them
** Trigger: On-Error
DECLARE
errcode NUMBER := ERROR_CODE;
dbmserrcode NUMBER;
dbmserrtext VARCHAR2(200);
BEGIN
IF errcode = 40508 THEN
** Oracle Forms had a problem INSERTing, so
** look at the Database error which
** caused the problem.
dbmserrcode := DBMS_ERROR_CODE;
dbmserrtext := DBMS_ERROR_TEXT;
IF dbmserrcode = -1438 THEN
** ORA-01438 is "value too large for column"
Message('Your number is too large. Try again.');
ELSIF dbmserrcode = -1400 THEN
** ORA-01400 is "Mandatory column is NULL"
Message('You forgot to provide a value. Try again.');
ELSE
** Printout a generic message with the database
** error string in it.
Message('Insert failed because of '||dbmserrtext);
END IF;
END IF;
END;Regards
Gus

Sorry Steve as wonderful as your code example may be you are putting the cart before the horse as far as the purpose of this thread goes. I don't need guidance on HOW to use certain error functions at least not until i know WHEN i should use them and thats why i started this thread. There are 3 different sets of Oracle functions below for use in forms but not enough guidance in the docs as to when to use them for the newcomer to forms. All i need is a simple definition as to when these functions should be used appropriately in forms. The rest I will find out for myself when i start using forms properly (including the use of your wonderful code). At the moment i just want to pass the Forms exam and to have a better understanding of what i am doing.
DBMS_ERROR_CODE & DBMS_ERROR_TEXT
SQLCODE & SQLERRM
ERROR_CODE & ERROR_TEXT
I've got one person saying this....
DBMS_ERROR_TEXT and DBMS_ERROR_CODE built-ins are intended to be used in a form-level ON-ERROR trigger.
SQLCODE and SQLERRM functions are intended to be used in a WHEN OTHERS exception handler.
and another saying ...
Use error_code to handle Forms error
Use dbms_error_code to handle database error
.. then i've got your code which predominantly uses ERROR_CODE.
Then the STS test papers say this...
When an implicit DML raises an error, it is handled with an ON-ERROR trigger using the ERROR_CODE function. This function contains the last Oracle Form error code. These errors are prefixed with FRM-.
Example:
IF ERROR_CODE = 40508 THEN
  MESSAGE ('Invalid insert');
  RAISE FORM_TRIGGER_FAILURE;
END IF;DBMS_ERROR_CODE and DBMS_ERROR_TEXT return the last Oracle Server error code and message due to an implicit DML within form application. These errors are prefixed with ORA-.
SQLCODE and SQLERRM return the last Oracle Server error code and message due to an explicit DML within a form application. These functions must be used in the exception handler of the program unit that issues the DML command.
A little Confusing to say the least!!!
Okay, so is this correct...
SQLCODE and SQLERRM are used with explicit DML within a form application and are used in the exception handler of the program unit that issues the DML command.
When an implicit DML raises an error, it is handled with an ON-ERROR trigger using the ERROR_CODE function. These errors are prefixed with FRM-.
DBMS_ERROR_CODE and DBMS_ERROR_TEXT are also used with implicit DML within form application. These errors are prefixed with ORA-.
So why use DBMS_ERROR_CODE and DBMS_ERROR_TEXT if ERROR_CODE and ERROR_TEXT are to be used in ON-ERROR triggers and if an implicit DML error arises then whats the difference between ERROR_CODE FRM- errors and DBMS_ERROR_CODE ORA- errors? Apart from one being a form error and the other being a server error, what different things do they tell us? If an implicit DML error ocurrs would this generate ORA- and FRM- errors at the same time.
Cheers
Gus
Message was edited by:
gusora

Similar Messages

  • How can and where i use the function "HTMLDB_UTIL.CLEAR_PAGE_CACHE "

    how can and where i use the function "HTMLDB_UTIL.CLEAR_PAGE_CACHE " ?
    where is the place to put this function?

    i have notice that sometime, during visual a report of a table, order by data insert desc, some record are not displayed on some client.
    Only whe we clear the cache of internet explorer than this record can view.
    I have an idea that a clear page when i call the report may be solve the problem.
    Thank's.
    ------------------------

  • I started to learn HTML, and I'm using text edit and everything is going fine, when I save the file with a .html extension and open it with safari I only view the code and not the webpage that was supposed to be created.

    I started to learn HTML, and I'm using text edit and everything is going fine, when I save the file with a .html extension and open it with safari I only view the code and not the webpage that was supposed to be created.

    That is because you don't have a web server configured and running to serve the html page. In order to see the page in a browser you need to access it using a url similar to http://localhost/~yourUserName if you are serving the page from your user account.
    Prior to Mountain Lion you could go into web sharing and turn on the web server. With Mountain Lion there is no option, other than using terminal, to turn on the web server. The web sharing menu item has been removed in Mountain Lion. Apache is still on your computer but it will take a little searching these forums or the Internet to find how to turn it on.
    If you want a graphic user interface to turn on/off the Apache server you could download and install a server application like xampp, http://www.apachefriends.org/en/xampp.html. I use this and it works well.

  • TS2611 I re installed my Final Cut express software, now when I go to use my "halo" and "arrow" application I get a message that says the file format is too new for this version of the application.  Anybody have suggestions?

    I re installed my Final Cut express software, now when I go to use my "halo" and "arrow" application I get a message that says the file format is too new for this version of the application.  Anybody have suggestions?

    After install, did you go to  Apple menu > Software Update to update your FCE to the latest version?
    MtD

  • What is info type 1957 and where its used?

    What is info type 1957 and where its used?

    I have used this infotype.
    check out this link
    P1957 Infotype 1957 - Obsolete, DO NOT USE - SAP Structure - ABAP

  • Oracle BI what is cubes and dimention and where we use cubes and dimention

    Dear ,
    I am working on Oracle BI.
    what is cubes and dimentionS and where we use cubes and dimention
    Please give a link where i get stuff regarding cubes and dimentions.
    thanks

    Possibly you are lost in the wrong forum category ...
    Post your query in:
    Hyperion EPM

  • I lost my iphone 5 yesterday and i tried using find iphone and i found it offline. What is best to do? Please help me. Thank you..

    I lost my iphone 5 yesterday and i tried using find iphone and i found it offline. What is best to do? Please help me. Thank you..

    If you forgot (or don't know) your passcode, restore the device from backup on the last computer it was synced with when the passcode was turned on... this will remove the passcode. If you do not have access to the last computer it was synced with, or you don't have a backup, you will have to force it into recovery mode & restore as a new device.
    See this for more info... http://support.apple.com/kb/HT1212

  • I am writing an interactive book and want to use media files and stuff.

    I am writing an interactive book and want to use media files and stuff. My question is: If I want to sell this book in the iBookstore,
    may I use photos I find on google images and media i find on youtube? Or must all be my own stuff?

    No !  well not just any photo image or "media". The person who created the photo images has a copyright protection IF  he/she wishes to impose it - ditto video and other  media.
    However if its out of copyright by  virtue of age and certain other factors - its considered in "The Public Domain" which is why you see paintings by the Impressionists all over chocolate boxes and posters to name but two!
    There are websites offering images donated by the creators and all for free.
    Taking and using a picture you do not own copyright and placing online where it can be downloaded is  first "publishing" and you  need permission and placing in a situation where it can be copied and re-distributed is a breach of copyright.
    Look at the  tail end credits on any DVD...  the above is always  included.
    Others rmay  correct me but Copyright in some countries is vaild from creation until 50 years after the death of the creator. However, that is not always the case.  Example, assume I am bequeathed a photo archive and on the  last day year 50,  I  publish a completely new version of the archive, wizzed through Photoshop, cleaned, cropped and modified in other ways.. then I can assert my claim for copyright of the renewed archive, but its a bit more complicated!!!
    You can search for "Free Photo Images (  media) , or royalty free images and if you land on a particular website you can ask permission. If you send me a request, my reply will be NO... and you get a warning of dire consequences if your infringe my copyright!  Other may be more lenient and in fact feel pretty good to be  asked.
    A way to get some guidance is to check out Wikipedia and the many  images included in its subject matter, check out the copyright status.
    Beware of using  photo images of paintings in  Galleries and Museums, they may have copyright conditions.. but one can always contact them to seek  permission.
    Search  for  Copyright and ownership and it should bring up some good information. Depending on your country.. it may have its own  Copyright website. USA are more detailed than most, The UK has the 1988 Copyright Act.
    Also remember that all photo images carry exif embedded data which  among other things carries the copyright information and shows up in a google search for the right  keyword!  Scanned images processed through Photoshop and other editors  can have the metatdata added also.

  • I had Premier pro given me by the college I attend and do no use wi fi and do not use cloud. My laptop completely died and will be sent back to Apple for exchange. How can I reinstall Premier Pro on a new Apple computer since the old one is completly dead

    I had Premier pro given me by the college I attend and do no use wi fi and do not use cloud. My laptop completely died and will be sent back to Apple for exchange. How can I reinstall Premier Pro on a new Apple computer since the old one is completly dead and could not be unregistered?

    Hi,
    You have not specified which version of Premiere Pro was given to you. If you don't have the disc (which i suppose you don't have) you will have to download it online.
    As far as your registration is concerned, for Premiere Pro CS6 or earlier you will have to reach Adobe chat support for further help: http://helpx.adobe.com/contact.html
    For Premiere Pro CC and later, you will not have much problems reactivating it.
    Thanks,
    Rameez

  • How to test the SAP modules like SD and MM By using Quality Center and QTP

    Hi Experts,
    How to test the SAP modules like SD and MM By using Quality Center and QTP. Can you please provide the documentation regarding this.
    Regards,
    Skumar.

    Hi Sampath,
    First install QTP and SAP Addin with in QTP.
    2nd use QC to develop the test plan and then convert that test plan design to Test Scripts (QTP vesrion using settings)
    3rd record the R/3 GUI screen of SAP for SD, MM like Create order or Create PR.
    Once recording is done QTP will create a script in VB
    SAPGuiSession("Session").SAPGuiWindow("SAP Easy Access  -  User").SAPGuiOKCode("OKCode").Set "/nVA01"
    SAPGuiSession("Session").SAPGuiWindow("SAP Easy Access  -  User").SendKey ENTER
    you can always add a parameter and other customization according to your requirement.
    Let me know if you need more information regarding this.
    Good Luck!

  • How to create process chains,and how to use process like and or xor

    Hi,
    How to create process chains,and how to use process like and or xor.
    can any one please give me a example in each.
    Thanks,
    cheta.

    Hi Cheta,
    Here is step by step procedure to create process chains
    Process chain is nothing but executing a process ..(or) loading the data any process we can do in background.. that means.. automatically we can execute our process based on Time or any event..
    Creating Process Chains
    Prerequisites
    If you want to include a load process in the process chain, you need to have already created an InfoPackage.
    You cannot load flat file data from a client workstation in the background. For this reason, you have stored your data on an application server.
    Creating Process Chains
    You have the option of creating a process chain in the process chain maintenance screen directly or by using a maintenance dialog for a process:
    Creating a Process Chain Directly in the Process Chain Maintenance Screen
    You are in the BW Administrator Workbench.
    1. Click on the Process Chain Maintenance icon in the AWB toolbar.
    The Process Chain Selection dialog window appears.
    2. Choose Create.
    3. Enter the technical name and a description of the chain, and confirm your entry.
    The Add Start Process dialog window appears.
    4. Create a variant for a start process.
    1. a. On the Maintain Start Process screen, choose whether you want to schedule the chain directly or whether you want to start it using a metachain.
    2. b. If you choose to schedule the chain directly, enter the start date value for the chain under Change Selections and save your entries.
    The Maintain Start Process screen appears again.
    3. c. Save your entries, return to the previous screen and confirm your entries in the Add Start Process dialog window.
    You are taken to the Plan View of the process chain maintenance screen.
    In the left-hand area of the screen, a navigation area is displayed. In the right-hand area of the screen, the process chain is displayed.
    5. Use the drag-and-drop function to add the relevant processes into your process chain.
    You use the Process Types function to select the processes. This sorts the process types according to different categories. You can also call up InfoPackages and processes for the data target from the separate InfoSources and Data Targets navigation trees.
    Hope this helps
    Regards
    Karthik

  • I signed up for free trail 1 day ago and went to use it today and it says expired

    i signed up for free trail 1 day ago and went to use it today and it says expired

    If the trial version indicates as being expired then it has expired. There is no way to extend the trial.
    You can find more details at Adobe trial software expired early -http://helpx.adobe.com/x-productkb/global/trial-software-expired-early .html.

  • Hi..Iam an Architect...I would like to purchase a macbook pro 15.4 inch 512 gb, 16 gb.So i would like to know the possibilities and advantages of using 3d softwares and autocad.And also is 3dsmax available for mac os or should i install it with windows.

    hi..Iam an Architect...I would like to purchase a macbook pro 15.4 inch 512 gb, 16 gb.So i would like to know the possibilities and advantages of using 3d softwares and autocad.And also is 3dsmax available for mac os or should i install it with windows.

    System Requirements for AutoCAD 2013 for Mac:
    Apple® Mac OS® X v10.8.0 or later (Mountain Lion), OS X v10.7.2 or later (Lion), or OS X v10.6.8 or later (Snow Leopard) with 64-bit Intel processor
    Apple® Mac® Pro 4.1 or later; MacBook® Pro 5.1 or later (MacBook Pro 6.1 or later recommended); iMac® 8.1 or later (iMac 11.1 or later recommended); Mac® mini 3.1 or later (Mac mini 4.1 or later recommended); MacBook Air® 2.1 or later; MacBook® 5.1 or later (MacBook 7.1 or later recommended)
    3 GB of RAM (4 GB recommended)
    2.5 GB free disk space for download and installation (3 GB recommended)
    All graphics cards on supported hardware
    1,280 x 800 display with true color (1,600 x 1,200 recommended)
    All Mac OS X supported language operating systems
    Apple® Mouse, Apple Magic Mouse, Magic Trackpad, MacBook® Pro trackpad, or Microsoft-compliant mouse.
    Mac OS X-compliant printer
    Additional Requirements for 3D Modeling (All Configurations)
    Pentium 4 or Athlon processor, 3 GHz or greater or Intel or AMD dual-core processor, 2 GHz or greater
    4 GB RAM or more
    6 GB hard disk space available in addition to free space required for installation
    1,280 x 1,024 true color video display adapter 128 MB or greater, Pixel Shader 3.0 or greater, Direct3D®-capable workstation-class graphics card
    3ds Max 2014 and 3ds Max Design 2014 are available for windows only:
    System requirements for 3ds Max 2014 and 3ds Max Design 2014
    Windows 8 or Windows® 7 64-bit Professional operating system
    64-bit Intel or AMD multi core processor
    4 GB RAM minimum (8 GB recommended)
    4.5 GB free disk space for installation
    3-button mouse
    Latest version of Microsoft® Internet Explorer®, Apple® Safari®, or Mozilla® Firefox® web browser
    Recommened Mac:
    15-inch MacBook Pro with Retina display : 15.4-inch (diagonal) LED-backlit display with IPS technology
    2880-by-1800 native resolution at 220 pixels per inch with support for millions of colors
    Hardware
    2.4GHz quad-core  Quad-core Intel Core i7
    16GB 1600MHz DDR3L SDRAM
    512GB Flash Storage
    Autodesk AutoCAD 2014 for Windows vs AutoCAD 2013 for Mac
    USER INTERACTION                                                                          Windows         Mac
    Command line


    Multifunctional grips


    Dynamic input


    Auto-complete command entry2


    Hide and isolate objects


    Create and select similar objects


    Delete duplicate objects


    Properties palette


    Quick properties palette

    Quick view


    In-canvas viewport controls


    Editable UCS icon


    Layer tools3


    Layer groups


    Layer state manager4

    New layer notification

    Filter

    Quick select

    DesignCenter

    Tool palettes

    Content palette

    Navigation bar

    ShowMotion

    Coverflow navigation

    Multi-touch gestures

    AutoCorrect command entry

    File tabs

    DOCUMENTATION
    Geometry creation & measurement tools


    Parametric constraints


    Associative arrays


    Copy array


    Object and layer transparency


    Strike-through text


    Blend curves


    Multiple hatch editing


    Sheet set manager

    Project manager

    Dynamic blocks5


    Model documentation tools

    Table style editing

    Hatch creation preview

    Multiline style creation

    Digitizer integration

    Change space

    Express tools6

    Text align

    DESIGN
    Solid, surface, and mesh modeling


    Surface curve extraction


    PressPull


    Autodesk materials library


    Material creation, editing, and mapping

    Basic rendering


    Sun properties7


    Visual styles7


    Advanced rendering settings

    Camera creation

    Walkthroughs, flybys, and animations

    Autodesk ReCap point cloud tool

    Import Sketchup files (SKP)

    Geographic location

    CONNECTIVITY
    External references (DWG)


    Image underlays


    PDF underlays


    DWF underlays

    DGN underlays

    In-place editing of DWG references


    Batch publish


    Publish or plot to PDF


    Plot styles


    Plot style table editor


    AutoCAD WS connectivity


    Autodesk 360 connectivity

    Data links

    Data extraction

    Hyperlinks

    Markup set manager

    dbConnect manager

    eTransmit

    WMF import and export

    FBX import and export

    SAT import and export


    Additional model import

    Design feed

    Share on Facebook

    LICENSING
    Standalone licensing


    Network licensing


    Cross-platform licensing

  • Create and send EDM using Adobe MUSE and Business Catalyst.

    There is just one thing missing in my armour as a graphic designer – creating and sending EDMs.
    Given the success of creating websites using Adobe Muse, an EDM functionality would be a fantastic addition to MUSE and Business Catalyst (BC). Imagine this:
    1. I open Adobe Muse.
    2. I select "New EDM"  (instead of "New Site").
    3. I design and build my EDM to spec.
    4. I test my EDM using 'Preview' or a single send to myself.
    5. I publish my EDM to Business Catalyst.
    6. In BC, I review my EDM and add 'FROM NAME', 'FROM EMAIL ADDRESS' and 'SUBJECT'.
    7. I import my database.
    8. I hit SEND!
    After my EDM has gone out, I can review a report in BC - just like any report for a website.
    As a designer that does not know code but can build a website using MUSE - creating an EDM is the one thing I can't personally offer. Using a digital supplier can be expensive and website like Mail Chimp aren't professional enough.
    To the Adobe Muse team, please – for the love of humanity – consider this as viable addition to MUSE. You will save a lot of heart ache and win a lot of hearts.
    Thanks,
    Phil

    Done!
    See here: Create and send EDM using Adobe MUSE and Business Catalyst.

  • HT4623 i have apple iphone 4 32gb orange,currently i m india,and unable to use indian sim,and i have updated it to new ios6,can u plz help me out

    i have apple iphone 4 32gb orange,currently i m india,and unable to use indian sim,and i have updated it to new ios6,can u plz help me out

    Select the country in which the iPhone was originally sold:
    http://support.apple.com/kb/HT1937
    You'll find a link to the carrier on whose pages you can probably find contact information.
    As RG said, only the carrier to which the iPhone is locked can authorize unlocking. That is the only "way out". To have an iPhone that was "factory unlocked", you would have had to purchase it that way.
    Regards.

Maybe you are looking for

  • Where is the best place to buy an iTunes Gift Card?

    When I purchased an iTunes Gift Card at a Wal-Mart store, the cashier scanned the card (like any other item), instead of sliding it, and I paid for it. When I got home to redeem it, iTunes said this message: "The Gift Certificate or Prepaid Card code

  • Using an Apple Keyboard in Windows

    So it's a pretty commonly known issue that the function keys on the Apple Wireless keyboard don't do a thing in Windows. Is there some way. I'm using Windows 8.1 on an Windows PC, not a Mac, so I don't have access to the Boot Camp drivers. Is there s

  • Mountain Lion calendar and notes sync problems with exchange server via WLAN

    After upgrading to Mountain Lion calendar and notes do not sync anymore with my exchange server via WLAN. There are no syncing problems via ethernet if WLAN is deactivated. Mail works fine with both connection types. Similar problems known? Solutions

  • Passing parameter from applet to portal is failing

    hi all. We have an external applet that we can view on the portal. We want to have two parameter (parm1 and parm2) passed from the applet to the gateway and thus have them re-written by the portal gateway. When we access the applet from the portal, a

  • Can i import my dvds to my ipod?

    is there any way to import my dvds to my ipod?