I have a tool (Enterprise Architect) that creates SQL scripts based upon the design we have built.
I am attempting to run these SQL scripts using OPS Navigator, and I'm running into a dilema. To avoid me having to explicitly define the schema (library) on each and every TABLE reference, I want to include the SQL statement: USE SCHEMA chicotest;
Unfortunately this command is not supported.
Does anyone know what syntax I can include to avoid me having to manually go in and update every TABLE reference?
Here's a very small sample:
-- --------------------------------------------------
-- Generated by Enterprise Architect Version 6.1.790
-- Created On : Wednesday, 17 May, 2006
-- --------------------------------------------------
USE SCHEMA chicotest; -- If this SQL statement worked I wouldn't have to qualify my schema (library) on every table definition.
-- Drop Tables
DROP TABLE jobJob
;
-- Create Tables
CREATE TABLE jobJob (
jobId bigint NOT NULL, -- This column is the unique identifier for a job.
name varchar(50), -- This column is the name of the job.
description varchar(50), -- This column is a brief description of the job.
status char(1), -- This column indicates the state of the job; running, paused, completed, or error.
startDateTime timestamp, -- This column indicates the date/time the job started.
userId bigint, -- This column is the unique identifier of the user that started the job.
environmentId integer, -- This column is the unique identifier of the environment where the job is currently running.
programName varchar(50), -- This column is the name of the program that runs the job.
functionId bigint -- This column is the unique identifier of the function that will be used to process the job.
)
;
COMMENT ON TABLE jobJob
IS 'This table contains all of the jobs in the system.'
;
COMMENT ON COLUMN jobJob.jobId
IS 'This column is the unique identifier for a job.'
;
COMMENT ON COLUMN jobJob.name
IS 'This column is the name of the job.'
;
COMMENT ON COLUMN jobJob.description
IS 'This column is a brief description of the job.'
;
COMMENT ON COLUMN jobJob.status
IS 'This column indicates the state of the job; running, paused, completed, or error.'
;
COMMENT ON COLUMN jobJob.startDateTime
IS 'This column indicates the date/time the job started.'
;
COMMENT ON COLUMN jobJob.userId
IS 'This column is the unique identifier of the user that started the job.'
;
COMMENT ON COLUMN jobJob.environmentId
IS 'This column is the unique identifier of the environment where the job is currently running.'
;
COMMENT ON COLUMN jobJob.programName
IS 'This column is the name of the program that runs the job.'
;
COMMENT ON COLUMN jobJob.functionId
IS 'This column is the unique identifier of the function that will be used to process the job.'
;
-- Create Primary Key Constraints
ALTER TABLE jobJob ADD CONSTRAINT PK_jobJob
PRIMARY KEY (jobId);
-- Create Indexes
ALTER TABLE jobJob
ADD CONSTRAINT UQ_jobJob_jobId UNIQUE (jobId);
-- End of script --
If there's no way around this then I will go in and do the qualifying, but if anyone has any suggestions, I would appreciate the help.
I am attempting to run these SQL scripts using OPS Navigator, and I'm running into a dilema. To avoid me having to explicitly define the schema (library) on each and every TABLE reference, I want to include the SQL statement: USE SCHEMA chicotest;
Unfortunately this command is not supported.
Does anyone know what syntax I can include to avoid me having to manually go in and update every TABLE reference?
Here's a very small sample:
-- --------------------------------------------------
-- Generated by Enterprise Architect Version 6.1.790
-- Created On : Wednesday, 17 May, 2006
-- --------------------------------------------------
USE SCHEMA chicotest; -- If this SQL statement worked I wouldn't have to qualify my schema (library) on every table definition.
-- Drop Tables
DROP TABLE jobJob
;
-- Create Tables
CREATE TABLE jobJob (
jobId bigint NOT NULL, -- This column is the unique identifier for a job.
name varchar(50), -- This column is the name of the job.
description varchar(50), -- This column is a brief description of the job.
status char(1), -- This column indicates the state of the job; running, paused, completed, or error.
startDateTime timestamp, -- This column indicates the date/time the job started.
userId bigint, -- This column is the unique identifier of the user that started the job.
environmentId integer, -- This column is the unique identifier of the environment where the job is currently running.
programName varchar(50), -- This column is the name of the program that runs the job.
functionId bigint -- This column is the unique identifier of the function that will be used to process the job.
)
;
COMMENT ON TABLE jobJob
IS 'This table contains all of the jobs in the system.'
;
COMMENT ON COLUMN jobJob.jobId
IS 'This column is the unique identifier for a job.'
;
COMMENT ON COLUMN jobJob.name
IS 'This column is the name of the job.'
;
COMMENT ON COLUMN jobJob.description
IS 'This column is a brief description of the job.'
;
COMMENT ON COLUMN jobJob.status
IS 'This column indicates the state of the job; running, paused, completed, or error.'
;
COMMENT ON COLUMN jobJob.startDateTime
IS 'This column indicates the date/time the job started.'
;
COMMENT ON COLUMN jobJob.userId
IS 'This column is the unique identifier of the user that started the job.'
;
COMMENT ON COLUMN jobJob.environmentId
IS 'This column is the unique identifier of the environment where the job is currently running.'
;
COMMENT ON COLUMN jobJob.programName
IS 'This column is the name of the program that runs the job.'
;
COMMENT ON COLUMN jobJob.functionId
IS 'This column is the unique identifier of the function that will be used to process the job.'
;
-- Create Primary Key Constraints
ALTER TABLE jobJob ADD CONSTRAINT PK_jobJob
PRIMARY KEY (jobId);
-- Create Indexes
ALTER TABLE jobJob
ADD CONSTRAINT UQ_jobJob_jobId UNIQUE (jobId);
-- End of script --
If there's no way around this then I will go in and do the qualifying, but if anyone has any suggestions, I would appreciate the help.



Comment