create a simple view error

Database

create a simple view error

HI,I use bteq create a view

CREATE VIEW emp
(emp,mgr,dept,job
,last
,first
,hire
,birth
,sal)
AS
SELECT
employee_number
,manager_employee_number
,department_number
,job_code
,last_name
,first_name
,hire_date
,birthdate
,salary_amount
FROM CUSTOMER_SERVICE.employee;

,hire
$
*** Failure 3707 Syntax error, expected something like ')' between ',' and
the 'first' keyword.
Statement# 1, Info =48
*** Total elapsed time was 1 second.

why syntax error?

Thanks
2 REPLIES
Teradata Employee

Re: create a simple view error

Hi

First is a reserve keyword in Teradata database, hence it cannot be used as column name. Replace First with some other name (for eg. first_name) then script will work.

You can also refer to SQL reference manual, to check list of keywords in Teradata.

Thanks
Ankit

Re: create a simple view error

I try to change the first to first1.and verything is ok.
Thank you very much.