Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Anywhere: Switching off view definition checks to allow creation of dependent views even if dependency does not yet exist. #4537

Merged
merged 5 commits into from Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -57,6 +57,11 @@ public Sql[] generateSql(CreateViewStatement statement, Database database, SqlGe

List<Sql> sql = new ArrayList<>();

if (database instanceof SybaseASADatabase) {
// Switching off view definition checks to allow creation of dependent views even if dependency does not yet exist.
sql.add(new UnparsedSql("SET TEMPORARY OPTION force_view_creation='ON'"));
}

StringClauses viewDefinition = SqlParser.parse(statement.getSelectQuery(), true, true);

if (!statement.isFullDefinition()) {
Expand Down
@@ -1,4 +1,5 @@
-- Database: asany
-- Change Parameter: selectQuery=SELECT id, name FROM person WHERE id > 10
-- Change Parameter: viewName=v_person
SET TEMPORARY OPTION force_view_creation='ON';
CREATE VIEW v_person AS SELECT id, name FROM person WHERE id > 10;