dynamobi/dynamobi — Issue #633: [FRG-239] Create or replace needs better error messages when there are dependency issues
Author: dynamobi-build
Created: 2011-12-30 03:39:38+00:00
State: open
Labels: Database, FRG

[reporter="elin", created="Thu, 7 Dec 2006 15:06:55 -0500 (GMT-05:00)"]
when you try to issue create or replace statement that fails during the integrity check, it would be helpful for the error to mention this. It would also be nice if we could refer to the dependent view/object that causes the problem.

For instance, if you run the following sql, the line and column numbers aren't particularly useful and you'd have to go dig around to try and find where the table SYS_MOCK_FOREIGN_DATA_SERVER.Relational.Schema is:

create or replace server sys_mock_foreign_data_server

foreign data wrapper sys_mdr

options(root_package_name 'CWM');

create schema s;

set schema 's';

create view v1 as

select c."name" as catalog_name, s."name" as schema_name

from

sys_cwm."Relational"."Catalog" c

inner join

sys_mock_foreign_data_server."Relational"."Schema" s

on c."mofId" = s."namespace";

create or replace server sys_mock_foreign_data_server

foreign data wrapper sys_mock_foreign;

Error: From line 3, column 12 to line 3, column 63: Table 'SYS_MOCK_FOREIGN_DATA_SERVER.Relational.Schema' not found (state=,code=0)

net.sf.farrago.jdbc.FarragoJdbcUtil$FarragoSqlException: From line 3, column 12 to line 3, column 63: Table 'SYS_MOCK_FOREIGN_DATA_SERVER.Relational.Schema' not found

at org.eigenbase.resource.EigenbaseResource$_Def10.ex(EigenbaseResource.java:803)

at org.eigenbase.sql.SqlUtil.newContextException(SqlUtil.java:729)

at net.sf.farrago.ddl.DdlHandler.adjustExceptionParserPosition(DdlHandler.java:524)

at net.sf.farrago.ddl.DdlRelationalHandler.validateViewImpl(DdlRelationalHandler.java:304)

at net.sf.farrago.ddl.DdlRelationalHandler.validateDefinition(DdlRelationalHandler.java:274)

at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.eigenbase.util.ReflectUtil.invokeVisitor(ReflectUtil.java:250)

at net.sf.farrago.ddl.DdlValidator.invokeHandler(DdlValidator.java:1311)

at net.sf.farrago.ddl.DdlValidator.validateAction(DdlValidator.java:1287)

at net.sf.farrago.ddl.DdlValidator.validate(DdlValidator.java:874)

at net.sf.farrago.db.FarragoDbSession.validateDdl(FarragoDbSession.java:1010)

at net.sf.farrago.db.FarragoDbSession.prepareImpl(FarragoDbSession.java:984)

at net.sf.farrago.db.FarragoDbSession.prepare(FarragoDbSession.java:893)

at net.sf.farrago.db.FarragoDbStmtContext.prepare(FarragoDbStmtContext.java:110)

at net.sf.farrago.jdbc.engine.FarragoJdbcEngineStatement.execute(FarragoJdbcEngineStatement.java:107)

at sqlline.SqlLine$Commands.execute(Unknown Source)

at sqlline.SqlLine$Commands.sql(Unknown Source)

at sqlline.SqlLine.dispatch(Unknown Source)

at sqlline.SqlLine.begin(Unknown Source)

at sqlline.SqlLine.mainWithInputRedirection(Unknown Source)

at sqlline.SqlLine.main(Unknown Source)

0: jdbc:luciddb:>