Question

Asked on 2003-05-21 at 18:47:41ID: 25459809

alphabetic check for Oracle SQL* Plus

by: DebbieWaters125

Rating7.2Very Good

Hi,
I'm having problems with trying to constrain my SQL create table statement. I need to restrict a name to only having alphabetic characters. I have found out that isalphabetic returns 1 if true and 0 if false.
I have broken my create table statement down to the very basics, so I can figure out the problem. At the moment it is:


create table person(
    name VARCHAR(20) NOT NULL
    check(isalphabetic(name) = 1),
    primary key(name)
);
 This will not compile however. When I tried it in Oracle SQL*Plus (8i) it returned "invalid relational operator".
I'm assuming that the 'isalphabetic' function is not supported in Oracle 8i. I also know that square brackets are not supported, which eliminates the use of [a-zA-Z] as a check option.
Do ou have any ideas how I could enforce this restriction?
Thanks!

  1. SQL statement help
    I have created a table: LNO EMPNO TYPE AMNT 23 7499 M 20000.00 42 7499 C 2000.00 65 7844 M 3564.00 I wanted to remove all loans less than 3000. How would i do this, Would i have to use the ALTER command?
  2. ORACLE -- SQL Extract -- WHERE Statement ?
    How can I change the below so identical values do not get extracted since I don't need to see the Parent=1, Child=3 record in my resultSet since both NEW & OLD have a value of 10 ? Using the below WHERE statement does not work. SELECT nvl(o.parent,n.parent) parent ,nvl(o.child,n.child) child …
  3. SQL*Plus Report Problem (SQL Statement)
    Hi Experts, I am working on a project for my online class and am struggling with a SQL*Plus rpeort. It should be simple, but I don't understand what I am doing wrong. We have been asked to import a .csv file with 15 fields into an oracle database. I ran SQL*Loader and inserted the records in a table called "employee_personal" W…
  4. Spool SQL Plus to create a file name
    Hi All, I will need to spool the result of a 2 queris to two different .txt file The name of the file should be: C:\Temp\file1YYYYMMDD.txt (where YYYYMMDD is 20100126 for today) so for todays file the name of the file should be: C:\Temp\file120100126.txt The other one C:\Temp\sample220100126…
  5. SQL QUERY - CASE STATEMENT
    NOT SURE WHY CASE STATEMENT IS NOT WORKING...WHAT AM I MISSING? and case when :PATIENT_TYPE = 'DP' then 'and PLOC.transfer_reason in (40, 41, 42)' when :PATIENT_TYPE = 'NDP' then ' and PLOC.transfer_reason not in (40,41,42) ' when :PATIENT_TY…

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
oracle check isalphabetic alphabetic
Participating Experts
4
Solution Grade
A

Replies

 by:

Posted on 2003-05-21 at 20:38:02ID: 28239298

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: venkotch

Posted on 2003-05-21 at 20:50:35ID: 28239299

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: venkotch

Posted on 2003-05-21 at 21:25:11ID: 28239300

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: jpkemp

Posted on 2003-05-21 at 21:56:00ID: 28239301

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: venkotch

Posted on 2003-05-22 at 12:49:34ID: 28239302

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: venkotch

Posted on 2003-05-22 at 13:16:26ID: 28239303

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: TheLearnedOne

Posted on 2004-09-02 at 17:14:53ID: 28239304

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: ee_ai_construct

Posted on 2004-09-06 at 12:09:13ID: 28239305

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert