Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1041515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:21:52+00:00 2026-05-16T15:21:52+00:00

I’m attempting to create a table with an automatic column, the value of which

  • 0

I’m attempting to create a table with an automatic column, the value of which is computed using a function I’ve defined. However, when I try to create the table I keep getting ora-00907: Missing right parenthesis. Can anyone help?

Here is the CREATE code:

CREATE TABLE NEW_EMP2 (
SSN CHAR(9), 
EMP_NUM2 CHAR(5) automatic as newemp2id(SSN), 
Fname VARCHAR2(15), 
Lname VARCHAR2(15), 
Bdate DATE
)

Here is the code for the function newemp2id:

CREATE OR REPLACE FUNCTION newemp2id (i_ssn NCHAR) RETURN NCHAR
IS
BEGIN
RETURN 'E'||(1000+SUBSTR(i_ssn,6,4));
END

Any help on this would be greatly appreciated, thanks!

UPDATE: I’m using Oracle Express Edition on a Windows Vista machine, in case that makes any difference.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:21:53+00:00Added an answer on May 16, 2026 at 3:21 pm

    I hadn’t heard of the syntax prior to this, but all I could find is this PDF for Oracle RDB. RDB was/is a separate product for Oracle databases… Confirmed – not supported on 10g

    Use a BEFORE INSERT trigger instead, because I don’t believe the syntax you’re using is valid for Oracle Express (10g effectively) – there’s no mention in the CREATE TABLE or ALTER TABLE documentation.

    I’m not fond of using triggers, I’d prefer to have a single stored procedure for inserting into given table(s) & only allow anyone to use the procedure rather than direct table access…

    CREATE OR REPLACE TRIGGER newemp2_before_insert
    BEFORE INSERT
        ON new_mep2
        FOR EACH ROW
    BEGIN
    
        -- Update created_by field to the username of the person performing the INSERT
        :new.emp_num2 := newemp2id(new.ssn)
    END;
    

    Though frankly, this is overcomplicated when it could be handled in a view:

    CREATE VIEW vw_emp AS
      SELECT t.ssn,
             'E'||(1000+SUBSTR(i_ssn,6,4)) AS emp_num2
        FROM NEW_EMP2 t
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.