Oracle快递包缺少右括号
我在调用此包中的函数时遇到缺少右括号错误,您能帮我吗?
create or replace package body "GESTIONRH" is
procedure CREATETABLES
as
begin
EXECUTE IMMEDIATE 'CREATE TABLE jobs
( job_id VARCHAR2(10)
, job_title VARCHAR2(35)
, min_salary NUMBER(6)
, max_salary NUMBER(6)
, constrataint pk_jobs primary key (job_id) ) ';
EXECUTE IMMEDIATE 'Create table departments
( department_id NUMBER(4)
, department_name VARCHAR2(30)
, manager_id NUMBER(6)
, location_id NUMBER(4)
, constraint pk_dep primary key(department_id) ) ';
EXECUTE IMMEDIATE 'CREATE TABLE employees
( employee_id NUMBER(6)
, first_name VARCHAR2(20)
, last_name VARCHAR2(25)
, email VARCHAR2(25)
, phone_number VARCHAR2(20)
, hire_date DATE
, job_id VARCHAR2(10)
, salary NUMBER(8,2)
, commission_pct NUMBER(2,2)
, manager_id NUMBER(6)
, department_id NUMBER(4)
, CONSTRAINT pk_employee primary key (employee_id) )';
EXECUTE IMMEDIATE 'CREATE TABLE job_history
( employee_id NUMBER(6)
, start_date DATE
, end_date DATE
, job_id VARCHAR2(10)
, department_id NUMBER(4)
, CONSTRAINT pk_job_history primary key (employee_id, start_date) )';
EXECUTE IMMEDIATE 'CREATE TABLE dependents
( Id NUMBER(6)
, FirstName VARCHAR2(20)
, LastName VARCHAR2(25)
, Birthdate Date
, Relation VARCHAR2(20)
, Gender VARCHAR2(2)
, RelativeId Number(6)
, CONSTRAINT pk_dependent primary key (Id))';
end CREATETABLES;
end GESTIONRH;
I'm getting missing right parenthesis error while calling the function in this package , could you please help me ?
create or replace package body "GESTIONRH" is
procedure CREATETABLES
as
begin
EXECUTE IMMEDIATE 'CREATE TABLE jobs
( job_id VARCHAR2(10)
, job_title VARCHAR2(35)
, min_salary NUMBER(6)
, max_salary NUMBER(6)
, constrataint pk_jobs primary key (job_id) ) ';
EXECUTE IMMEDIATE 'Create table departments
( department_id NUMBER(4)
, department_name VARCHAR2(30)
, manager_id NUMBER(6)
, location_id NUMBER(4)
, constraint pk_dep primary key(department_id) ) ';
EXECUTE IMMEDIATE 'CREATE TABLE employees
( employee_id NUMBER(6)
, first_name VARCHAR2(20)
, last_name VARCHAR2(25)
, email VARCHAR2(25)
, phone_number VARCHAR2(20)
, hire_date DATE
, job_id VARCHAR2(10)
, salary NUMBER(8,2)
, commission_pct NUMBER(2,2)
, manager_id NUMBER(6)
, department_id NUMBER(4)
, CONSTRAINT pk_employee primary key (employee_id) )';
EXECUTE IMMEDIATE 'CREATE TABLE job_history
( employee_id NUMBER(6)
, start_date DATE
, end_date DATE
, job_id VARCHAR2(10)
, department_id NUMBER(4)
, CONSTRAINT pk_job_history primary key (employee_id, start_date) )';
EXECUTE IMMEDIATE 'CREATE TABLE dependents
( Id NUMBER(6)
, FirstName VARCHAR2(20)
, LastName VARCHAR2(25)
, Birthdate Date
, Relation VARCHAR2(20)
, Gender VARCHAR2(2)
, RelativeId Number(6)
, CONSTRAINT pk_dependent primary key (Id))';
end CREATETABLES;
end GESTIONRH;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您在第一个 EXECUTE 语句中拼错了“constraint”。
You misspelled "constraint" in your first EXECUTE statement.
我没有 Oracle 数据库来测试这个。首先独立执行建表语句,看是否关心建表没有错误。那么你必须放弃一切。然后从过程中删除所有语句并进行测试。然后只添加一条语句并尝试。像这样尝试一次添加一个语句。您将看到哪一个给出了错误。你可能必须解决这个问题。
I dont have Oracle db to test this. First execute create table statement independently to see if they care create tables without error. Then you have to drop all. Then remove all of the statements from the procedure and test. Then add only one statement and try. Like that try to add one statement at a time. You will see which one is giving error. You may have to fix that.