Question

alphabetic check for Oracle SQL* Plus

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. Error Oracle SQL Statement
    I'm trying to run a SQL statement to get results for a report but keep getting an error: Error at Command Line:8 Column:15 Error report: SQL Error: ORA-00905: missing keyword 00905. 00000 - "missing keyword" *Cause: *Action: Please help.
  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 help - INNER JOIN to a select statement that…
    Hi EE, The SQL below IS giving me the results that i am looking for. I am coming from a Microsoft Access background, an am used to using a gui... so i need some ORACLE sql help, pls: a) this sql is joining a table to itself (STUDENT ATTRIBUTE table) because i'm looking for students 1) who are 4th year medical stude…
  4. 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?
  5. SQL STATEMENT WORKS SAME TIME
    Hi, I used the ;with cte as ( select tc1.PK_Field, col.Table_Name, col.Column_Name, col.Data_Type, col.Character_Maximum_Length from INFORMATION_SCHEMA.COLUMNS col INNER JOIN INFORMATION_SCHEMA.TABLES tab on col.Table_Name = tab.Table_Name LEFT JOIN (SELECT ccu.Column_Name as PK_Field, tc…

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:

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

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

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

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

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

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

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

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