• Home
  • About
  • BestBloggingIdeas
  • DotNetLearningSource
  • FORUM
  • Joblinks
  • Latest News
  • Policy
  • POSTS
  • SimplySqlServer.Com && SimplyAspDotNet.Com
  • Sitemap

Join Ours Forum

Asp.Net,C#,Ajax,Sql server,silverlight,Javascript codes exambles articles,Programming exambles

RSS Feed
  • Bounty Huge Roll [Amazon Frustration-Free Packaging]
  • XML Introduction to XML VHS Video Training, 1 hr., 32 minutes.
  • The Basic Overview of Windows Mobile Development Asp.Net C#
  • Overview of Sql server extended properties Asp.Net C#
  • How to Use Sql Server Extended properties using visual studio Asp.Net C#
  • Adobe Dreamweaver Templates Accelerate Web Development
  • Top Tips for Web Design Projects
  • How to Achieve a Good Web Design Structure
  • To Use Or Not To Use Website Templates
  • Five Tips to a Successful Website
  • Top 10 Articles,


    Silverlight Datagrid Select Update Delete Insert Asp.Net C#

    Differences Similarities Benefits Between Typed Datasets and Untyped Datasets asp.net c#

    Linq to Sql Introduction Entities Ado.Net C# SqlClasses Attributes Linq Mapping

    Linq Programming/How Linq Works?/Linq Implementation In Asp.Net C# Ado.Net

    Performing Developing Using Investigating Asp.Net 2.0 Ajax Application Development Asp.Net C#

    Hosting/Install Wcf Services in a Windows Service Asp.Net C#

    Connecting Silverlight to Wcf Asp.Net C#

    Silverlight Data Grid Data Binding WCF Asp.Net C#

    Invoking/Accessing/Calling WCF Service Without Adding/Creating Proxy/Reference Asp.Net C#

    Performing Doing Creating Insert Update Delete sql data Using Linq Database Asp.Net C#

    How to handle/Manage errors in oracle pl/sql block

    Posted by on May 3, 2010 Leave a comment (7) Go to comments

    Introduction:
    In this article,i am going to explain about how to handle/manage errorsin oracle pl/sql block.

    Main:

    Normally in pl/sql we will get two kind of exceptions.

    1.compilation errors –> compilation errors when you run an anonymous block program or attempt to build a stored program unit—a function, procedure, or user-defined object type

    2.Run-Time errors –> compilation errors when you run an anonymous block program or attempt to build a stored program unit—a function, procedure, or user-defined object type.

    Compilation Errors

    Add a Note HereCompilation errors are generally typing errors. The parsing of your PL/SQL text file into a set of interpreted instructions, known as p-code, finds lexical errors. Lexical errors occur when you misuse a delimiter, identifier, literal, or comment. You can misuse lexical units by

    Add a Note HereForgetting a semicolon (the statement terminator)
    Add a Note HereUsing only one delimiter when you should use two, as by failing to enclose a string literal
    Add a Note HereMisspelling an identifier (reserved words and keywords)
    Add a Note HereCommenting out a lexical value required by the parsing rules

    Forex,

    SQL> BEGIN
      2    dbms_output.put_line('Hello World.')
      3  END;
      4  /

    Add a Note HereThis raises the following error message:

    Add a Note Here
    END;
    *
    ERROR at line 3:
    ORA-06550: line 3, column 1:
    PLS-00103: Encountered the symbol “END” when expecting one of the following:
    := . ( % ;
    The symbol “;” was substituted for “END” to continue.

    In this examble simply we missed a semicolon in dbms_output statement,

    SQL> DECLARE
      2    a NUMBER := 0;
      3    b NUMBER;
      4    c NUMBER;
      5  BEGIN
      6    c := a  b;
      7    dbms_output.put_line('['||c||']');
      8  END;
      9  /

    Add a Note HereThe error message displayed is

    Add a Note Here
    c := a b;
    *
    ERROR at line 6:
    ORA-06550: line 6, column 11:
    PLS-00103: Encountered the symbol “B” when expecting one of the following:
    . ( * @ % & = – + ; < / > at in is mod remainder not rem
    <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || multiset member SUBMULTISET_
    The symbol “.” was substituted for “B” to continue.

    Run-time Errors:
    Run time errors are occuring while executing the sql block.we need a exception block for capturing the run time errors.

    The following demonstrates handling an assignment error raised by trying to put a two-character string into a one-character variable:

    DECLARE
      a VARCHAR2(1);
      b VARCHAR2(2) := 'AB';
    BEGIN
      a := b;
    EXCEPTION
      WHEN value_error THEN
        dbms_output.put_line('You can''t put ['||b||'] in a one character string.');
    END;
    /

    Add a Note HereRunning this program, you generate the following output message when you’ve enabled SERVEROUTPUT in your session:

    Add a Note Here
    You can’t put [AB] in a one character string.

    If you wants to terminate this sqlblock while runtime error,you need to use raise_exception statement instead of dbms_output.put_line,

    Conclusion:

    Hope this helps,
    Happy Coding.

    SQL SERVER/ORACLE
    ← How to create/develop hierarchical/Nested gridview using asp.net/c#
    How to create and use shared assemblies in asp.net →

    Learn Easily Using Video Tutorials


    How to choose the right Java IDE – explained Eclipse NetBeans BlueJ

    Developing/Creating/Performing/Configuring Java Applications Using Eclipse IDE

    Step By Step Guide for Download/Install Configure Eclipse IDE for Java

    Editing data with the GridView control Asp.Net C#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Best way to prepare asp.net Interview - Success Stories

    Download Important Questions and PPT's:

    Sql Server Important Questions Online free download

    Dotnet Important Questions Online free download

    Exploring Linq to Sql Process Flow

    Learn how to perform silverlight programming

    Learn OOPs concepts in better and well manner

    Learn Ajax in better and well manner

    Leave a comment

    7 Comments.

    1. TomPier May 7, 2010 at 7:02 pm

      great post as usual!

    2. veterinary technician May 15, 2010 at 3:03 am

      Great site. A lot of useful information here. I’m sending it to some friends!

    3. Blitzkredit May 18, 2010 at 10:36 pm

      Interessant. Kommt hier noch ein Folgeartikel? Möchte gern einiges mehr darüber wissen. Kannst du mir per E-Mail antworten?

    4. school grants May 26, 2010 at 2:53 pm

      Terrific work! This is the type of information that should be shared around the web. Shame on the search engines for not positioning this post higher!

    5. Maggie Jefferson May 28, 2010 at 2:43 pm

      Hehe I am actually the only reply to this great article?!

    6. Cami Ferkovich July 11, 2010 at 8:24 pm

      I’m really proud of you

    7. auto poster August 20, 2010 at 4:11 am

      Dear admin, thnx for sharing this blog post. I found it wonderful. Best regards, Victoria…

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    *

    *


    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Enter your email address:

    Delivered by FeedBurner

    • Recent Posts

      • Bounty Huge Roll [Amazon Frustration-Free Packaging]
      • XML Introduction to XML VHS Video Training, 1 hr., 32 minutes.
      • The Basic Overview of Windows Mobile Development Asp.Net C#
      • Overview of Sql server extended properties Asp.Net C#
      • How to Use Sql Server Extended properties using visual studio Asp.Net C#
    • Search by Tags!

      Application AspNet Basic between Black Bluetooth Build Business Collection Consultants Design Development Downloading effective Excel Experts Generics Implement Installing Interview Logic Management Microsoft Minutes Object Outlook Professional Programmer Programming Project Projects Questions Ready Select Server Services Silverlight Source Strings Studio Through using Visual Website Wordpress
    • Archives

      • August 2011
      • June 2011
      • May 2011
      • April 2011
      • March 2011
      • February 2011
      • December 2010
      • November 2010
      • October 2010
      • September 2010
      • August 2010
      • July 2010
      • June 2010
      • May 2010
      • April 2010
      • March 2010
      • February 2010
      • January 2010
      • December 2009
      • November 2009
      • October 2009
      • September 2009

    Copyright © 2012 NetProgrammingHelp.com

    Δ Top