This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Validating the data using Oracle PL SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Validating the data using Oracle PL SQL" Watch "Validating the data using Oracle PL SQL" New topic
Author

Validating the data using Oracle PL SQL

Vinod Vijay
Ranch Hand

Joined: Sep 13, 2011
Posts: 137

Hi, I have written an Oracle PL SQL Function which accepts few IN paramters.

For e.g.

function abc(x IN Varchar2(200))

/

The parameter x accepts the order no. I want to make sure that x contains only order_number(always in numerics only) or order_number plus line_number(Order_Number-Line_Number -> for e.g 11101-1, 11102-34 in format etc separated by '-')

I have read regular expression that is used in javascript to validate the strings at front end but is there anything in Oracle that can be used just like regular expression to put strong validations?

Please advice.


Vinod Vijay Nair
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3606
    
  60

Google for pl/sql regular expressions. There are many examples and tutorials on the web.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Validating the data using Oracle PL SQL
 
Similar Threads
Testing a simple Oracle PL SQL function using toad sql client?
want to become oracle certified......
SQL injection?