Consultor Eletrônico



Kbase 21657: Table/View/Synonym not found error when creating table which uses the check table statement
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/11/2009
Status: Unverified

SYMPTOM(s):

Table/View/Synonym not found (7519)

7519 error when creating a table which uses the "check" table constraint

FACT(s) (Environment):

UNIX
Windows
Progress 9.x
OpenEdge 10.x

CAUSE:

Schema (PUB) reference causing 7519 error. The SQL code example below demonstrates this problem:

CREATE TABLE PUB.bids (
bid_no VARCHAR(12) NOT NULL PRIMARY KEY,
cust_no VARCHAR(12),
job_name VARCHAR(50) NOT NULL,
job_address_1 VARCHAR(50),
job_address_2 VARCHAR(50),
job_address_3 VARCHAR(50),
job_city VARCHAR(20) NOT NULL,
job_state VARCHAR(2) NOT NULL REFERENCES PUB.states (state),
job_zip_code VARCHAR(10),
bid_date DATE DEFAULT SYSDATE,
win_date DATE,
start_date DATE,
************************PROBLEM STATEMENT*************************
first_order_date DATE check (PUB.bids.first_order_date > SYSDATE)
******************************************************************
first_invoice_date DATE,
first_ship_date DATE,
tsr_no VARCHAR(12) NOT NULL REFERENCES PUB.tsrs(tsr_no),
bid_amount NUMERIC (16,2),
bid_multiplier NUMERIC (6,6),
comments VARCHAR(1000));

FIX:

Remove the schema reference (ie. "PUB.") from the check expression as show in the updated SQL code example below:

CREATE TABLE PUB.bids (
bid_no VARCHAR(12) NOT NULL PRIMARY KEY,
cust_no VARCHAR(12),
job_name VARCHAR(50) NOT NULL,
job_address_1 VARCHAR(50),
job_address_2 VARCHAR(50),
job_address_3 VARCHAR(50),
job_city VARCHAR(20) NOT NULL,
job_state VARCHAR(2) NOT NULL REFERENCES PUB.states (state),
job_zip_code VARCHAR(10),
bid_date DATE DEFAULT SYSDATE,
win_date DATE,
start_date DATE,
**********************CORRECTED STATEMENT**********************
first_order_date DATE check (bids.first_order_date > SYSDATE),
***************************************************************
first_invoice_date DATE,
first_ship_date DATE,
tsr_no VARCHAR(12) NOT NULL REFERENCES PUB.tsrs(tsr_no),
bid_amount NUMERIC (16,2),
bid_multiplier NUMERIC (6,6),
comments VARCHAR(1000));

References to Written Documentation:
KBase 18813 "SQL-92 Error: Table/View/Synonym Not Found(7519)"