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.