Skip to main content

Learn How To Avoid Exceptions in PL SQL Procedure

PL/SQL is procedural language, and the PL/SQL procedures you can call from any high level language. This is depending on your project requirement. The story I want to share with you is...

How to prevent some common errors or exceptions while writing PL/SQL procedures in your project.

The number one and primary one is assigning variables non-numeric to numeric.....This is one kind of area where you need to look in while writing PL/SQL procedure.

PL SQL Errors tips to avoid
PL SQL 

PL/SQL are nothing but an invitation for trouble. They are all centered on data types and implicit conversion.

What's implicit conversion?

Let's say you have number held in a varchar2 data type variable, v_value. You try assigning n_value, a number data type variable, that value with the following line of code:n_value := v_value;

That should work, right?
Yes, it should, but when it doesn't, because you don't actually have a numeric literal stored in variable v_value, the implicit data type conversion will raise an "unexpected" exception in your program unit.
Another most common issue is assigning DATE field to numeric field while writing PL/SQL procedure. Usually, it will not work, and it will through a conversion error.

You want pass a date value to a function that will return the time in seconds since midnight, January 1, 1980. The function requires the date be passed as a varchar2 parameter in the form DD-MON-YY.

```sql
d_value date := sysdate;
n_value number;
```

```sql
BEGIN
n_value := date_to_long(d_value);
```
Sample PL/SQL

Oracle's default date format is DD-MON-YY, so it will work fine, right?

Not exactly. If the current NLS_DATE_FORMAT for the session is DD-MON-YY (the default), it will work, but not if it is YYYYMMDD HH24MISS, as I set mine every time I log in to SQL*Plus.

The above two kinds of errors you can avoid as preventive measure while writing your PL/SQL procedure.

Also read:

Comments

Popular posts

Blue Prism complete tutorials download now

RPA blue prsim tutorial popular resources I have given in this post. You can download quickly.Learning Blue Prism is really good option if you are learner of Robotic process automation. The RPA is also called "Robotic Process Automation"- Real advantages are you can automate any business process and you can complete the customer requests in less time.

The Books Available on Blue Prism 
Blue Prism resourcesDavid chappal PDF bookBlue Prism BlogsVideo Training
RPA training The other Skills you need
Basic business skills and Domain skills are more than enough to be successful in this automation careerScripting languages like Perl/JSON/JavaScript/VBScript.  The interesting point is learning any RPA tool is not a problem. You can learn tool quickly. The real point is how quickly you apply your knowledge to implement automated tasks is important.


Also read
Robotic RPA Software developer skills you needBlue Prism tutorials download to learn quicklyPopular RPA tools functionality differen…

Three popular RPA tools functional differences

Robotic process automation is growing area and many IT developers across the board started up-skill in this popular area. I have written this post for the benefit of Software developers who are interested in RPA also called Robotic Process Automation.

In my previous post, I have described that total 12 tools are available in the market. Out of those 3 tools are most popular. Those are Automation anywhere, BluePrism and Uipath. Many programmers asked what are the differences between these tools. I have given differences of all these three RPA tools.

BluePrismBlue Prism has taken a simple concept, replicating user activity on the desktop, and made it enterprise strength. The technology is scalable, secure, resilient, and flexible and is supported by a comprehensive methodology, operational framework and provided as packaged software.The technology is developed and deployed within a “corridor of IT governance” and has sophisticated error handling and process modelling capabilities to ensu…

Robotic RPA Software developer skills you need

Robotic process automation is an upcoming and becoming most popular skill. As I said there are three popular tools. To become proficient in any one of the tool is really good to get a job in Developer role.
To get a job in this line, I found in my research that some programming skills and Hand-on training on any one of the tools is required. Also, try to to know differences in other popular rpa tools.

Most people are asking experience in tools like Automation anywhare, Blue Prism and Uipath. But, you cannot be proficient in all. So just know what are the differences. Ok...
You may ask a question like how to know. First join one good coaching institute and learn one tool perfectly. And start taking online training. Really good for you. Whatever you are lacking quickly you can learn online way.

To learn Uipath try here. Also, you can learn Automation anywhere tool online way.

The following are the list of IT skills commonly asking:
Automation anywhere/Blue Prism/Uipath.Net/C#/Java/SQL ski…