Repository: felipebz/zpa Branch: main Commit: 5681ce11ba0e Files: 5068 Total size: 3.2 MB Directory structure: gitextract_qvtk4j1w/ ├── .editorconfig ├── .gitattributes ├── .github/ │ ├── renovate.json │ └── workflows/ │ └── build.yml ├── .gitignore ├── .gitmodules ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── LICENSE_HEADER ├── README.md ├── build-logic/ │ ├── build.gradle.kts │ ├── settings.gradle.kts │ └── src/ │ └── main/ │ └── kotlin/ │ └── com/ │ └── felipebz/ │ └── zpa/ │ ├── build-conventions.gradle.kts │ ├── jreleaser-conventions.gradle.kts │ ├── kotlin-conventions.gradle.kts │ ├── license-conventions.gradle.kts │ ├── publishing-conventions.gradle.kts │ ├── sonarqube-conventions.gradle.kts │ └── testing-conventions.gradle.kts ├── build.gradle.kts ├── gradle/ │ ├── libs.versions.toml │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── plsql-custom-rules/ │ ├── README.md │ ├── build.gradle.kts │ ├── gradle/ │ │ └── wrapper/ │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── pom.xml │ ├── settings.gradle.kts │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── company/ │ │ │ └── plsql/ │ │ │ ├── ForbiddenDmlCheck.java │ │ │ ├── PlSqlCustomRulesDefinition.java │ │ │ └── PlSqlCustomRulesPlugin.java │ │ └── resources/ │ │ └── META-INF/ │ │ └── extensions.idx │ └── test/ │ ├── java/ │ │ └── com/ │ │ └── company/ │ │ └── plsql/ │ │ ├── ForbiddenDmlCheckTest.java │ │ ├── PlSqlCustomRulesDefinitionTest.java │ │ └── PlSqlCustomRulesPluginTest.java │ └── resources/ │ └── forbidden-dml.sql ├── settings.gradle.kts ├── sonar-zpa-plugin/ │ ├── build.gradle.kts │ └── src/ │ ├── integrationTest/ │ │ ├── kotlin/ │ │ │ └── com/ │ │ │ └── felipebz/ │ │ │ └── zpa/ │ │ │ └── it/ │ │ │ ├── IssueTest.kt │ │ │ ├── MetricsTest.kt │ │ │ └── Tests.kt │ │ └── resources/ │ │ ├── com/ │ │ │ └── felipebz/ │ │ │ └── zpa/ │ │ │ └── it/ │ │ │ ├── empty-profile.xml │ │ │ └── it-profile.xml │ │ └── projects/ │ │ └── metrics/ │ │ ├── coverage.xml │ │ ├── src/ │ │ │ ├── betwnstr.sql │ │ │ ├── custom_rule.sql │ │ │ ├── source1.sql │ │ │ └── source2.sql │ │ ├── test/ │ │ │ └── test_betwnstr.sql │ │ └── test_results.xml │ ├── main/ │ │ └── kotlin/ │ │ └── com/ │ │ └── felipebz/ │ │ └── zpa/ │ │ ├── PlSql.kt │ │ ├── PlSqlPlugin.kt │ │ ├── PlSqlProfile.kt │ │ ├── PlSqlRuleRepository.kt │ │ ├── PlSqlSquidSensor.kt │ │ ├── SonarQubeUtils.kt │ │ ├── api/ │ │ │ └── CustomPlSqlRulesDefinition.kt │ │ ├── highlight/ │ │ │ └── PlSqlHighlighterVisitor.kt │ │ ├── log/ │ │ │ ├── SonarQubeLogger.kt │ │ │ └── SonarQubeLoggers.kt │ │ ├── metrics/ │ │ │ └── CpdVisitor.kt │ │ ├── rules/ │ │ │ ├── SonarQubeActiveRuleAdapter.kt │ │ │ ├── SonarQubeActiveRulesAdapter.kt │ │ │ ├── SonarQubeRepositoryAdapter.kt │ │ │ ├── SonarQubeRuleAdapter.kt │ │ │ ├── SonarQubeRuleKeyAdapter.kt │ │ │ ├── SonarQubeRuleMetadataLoader.kt │ │ │ └── SonarQubeRuleParamAdapter.kt │ │ ├── squid/ │ │ │ ├── PlSqlAstScanner.kt │ │ │ └── SonarQubePlSqlFile.kt │ │ ├── symbols/ │ │ │ ├── MappedObject.kt │ │ │ ├── ObjectLocator.kt │ │ │ └── SonarQubeSymbolTable.kt │ │ └── utplsql/ │ │ ├── AbstractReportImporter.kt │ │ ├── CoverageReport.kt │ │ ├── CoverageResultImporter.kt │ │ ├── TestExecutionReport.kt │ │ ├── TestResultImporter.kt │ │ └── UtPlSqlSensor.kt │ └── test/ │ ├── kotlin/ │ │ └── com/ │ │ └── felipebz/ │ │ └── zpa/ │ │ ├── CustomAnnotationBasedRulesDefinitionTest.kt │ │ ├── PlSqlChecksTest.kt │ │ ├── PlSqlPluginTest.kt │ │ ├── PlSqlProfileTest.kt │ │ ├── PlSqlSquidSensorTest.kt │ │ ├── PlSqlTest.kt │ │ ├── api/ │ │ │ └── CustomPlSqlRulesDefinitionTest.kt │ │ ├── highlight/ │ │ │ └── PlSqlHighlighterVisitorTest.kt │ │ ├── metrics/ │ │ │ └── CpdVisitorTest.kt │ │ ├── symbols/ │ │ │ └── SonarQubeSymbolTableTest.kt │ │ └── utplsql/ │ │ └── UtPlSqlSensorTest.kt │ └── resources/ │ ├── com/ │ │ └── felipebz/ │ │ └── zpa/ │ │ ├── code.sql │ │ ├── test.sql │ │ └── utplsql/ │ │ ├── award_bonus.sql │ │ ├── betwnstr.sql │ │ ├── coverage-report-all-uncovered.xml │ │ ├── coverage-report-with-paths.xml │ │ ├── coverage-report-without-paths.xml │ │ ├── test-report-with-paths.xml │ │ └── test-report-without-paths.xml │ ├── highlight/ │ │ └── highlight.sql │ ├── metrics/ │ │ └── cpd.sql │ └── org/ │ └── sonar/ │ └── l10n/ │ ├── languageKey/ │ │ └── rules/ │ │ ├── plsql/ │ │ │ └── ruleWithExternalInfo.html │ │ └── repoKey/ │ │ └── ruleWithExternalInfo.html │ ├── languageKey.properties │ └── languageWithoutBundle/ │ └── empty.txt ├── template/ │ └── changelog.tpl ├── zpa-checks/ │ ├── build.gradle.kts │ └── src/ │ ├── integrationTest/ │ │ ├── kotlin/ │ │ │ └── com/ │ │ │ └── felipebz/ │ │ │ └── zpa/ │ │ │ └── it/ │ │ │ ├── InputFile.kt │ │ │ ├── OracleDocsExtractor.kt │ │ │ └── PlSqlRulingTest.kt │ │ └── resources/ │ │ ├── expected/ │ │ │ ├── alexandria-plsql-utils/ │ │ │ │ ├── CharacterDatatypeUsageCheck.json │ │ │ │ ├── CollapsibleIfStatementsCheck.json │ │ │ │ ├── CommitRollbackCheck.json │ │ │ │ ├── ComparisonWithBooleanCheck.json │ │ │ │ ├── ComparisonWithNullCheck.json │ │ │ │ ├── ConcatenationWithNullCheck.json │ │ │ │ ├── DbmsOutputPutCheck.json │ │ │ │ ├── DeadCodeCheck.json │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── EmptyStringAssignmentCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── FunctionWithOutParameterCheck.json │ │ │ │ ├── IfWithExitCheck.json │ │ │ │ ├── InequalityUsageCheck.json │ │ │ │ ├── InsertWithoutColumnsCheck.json │ │ │ │ ├── NvlWithNullParameterCheck.json │ │ │ │ ├── ParsingErrorCheck.json │ │ │ │ ├── QueryWithoutExceptionHandlingCheck.json │ │ │ │ ├── SameBranchCheck.json │ │ │ │ ├── SelectAllColumnsCheck.json │ │ │ │ ├── UnnecessaryAliasInQueryCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── UnnecessaryNullStatementCheck.json │ │ │ │ ├── UnusedParameterCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ ├── UselessParenthesisCheck.json │ │ │ │ ├── VariableHidingCheck.json │ │ │ │ ├── VariableInitializationWithFunctionCallCheck.json │ │ │ │ └── VariableInitializationWithNullCheck.json │ │ │ ├── antlr-grammars-v4/ │ │ │ │ ├── AddParenthesesInNestedExpressionCheck.json │ │ │ │ ├── ColumnsShouldHaveTableNameCheck.json │ │ │ │ ├── CommitRollbackCheck.json │ │ │ │ ├── CursorBodyInPackageSpecCheck.json │ │ │ │ ├── DbmsOutputPutCheck.json │ │ │ │ ├── DeclareSectionWithoutDeclarationsCheck.json │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── IdenticalExpressionCheck.json │ │ │ │ ├── IfWithExitCheck.json │ │ │ │ ├── InequalityUsageCheck.json │ │ │ │ ├── InsertWithoutColumnsCheck.json │ │ │ │ ├── ParsingErrorCheck.json │ │ │ │ ├── QueryWithoutExceptionHandlingCheck.json │ │ │ │ ├── SelectAllColumnsCheck.json │ │ │ │ ├── ToDateWithoutFormatCheck.json │ │ │ │ ├── UnnecessaryAliasInQueryCheck.json │ │ │ │ ├── UnnecessaryLikeCheck.json │ │ │ │ ├── UnusedParameterCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ └── UselessParenthesisCheck.json │ │ │ ├── demo0001/ │ │ │ │ ├── CommitRollbackCheck.json │ │ │ │ ├── DeclareSectionWithoutDeclarationsCheck.json │ │ │ │ ├── EmptyStringAssignmentCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── InvalidReferenceToObjectCheck.json │ │ │ │ ├── QueryWithoutExceptionHandlingCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ ├── VariableInitializationWithFunctionCallCheck.json │ │ │ │ └── VariableInitializationWithNullCheck.json │ │ │ ├── demo0002/ │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ └── VariableInitializationWithFunctionCallCheck.json │ │ │ ├── demo0002_2/ │ │ │ │ └── EmptyBlockCheck.json │ │ │ ├── demo0003/ │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── InequalityUsageCheck.json │ │ │ │ └── VariableInitializationWithFunctionCallCheck.json │ │ │ ├── demo0004/ │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── InequalityUsageCheck.json │ │ │ │ ├── RaiseStandardExceptionCheck.json │ │ │ │ ├── ReturnOfBooleanExpressionCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ └── VariableInitializationWithFunctionCallCheck.json │ │ │ ├── demo0005/ │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── EmptyStringAssignmentCheck.json │ │ │ │ └── InvalidReferenceToObjectCheck.json │ │ │ ├── demo0006/ │ │ │ │ └── QueryWithoutExceptionHandlingCheck.json │ │ │ ├── demo0007/ │ │ │ │ └── InequalityUsageCheck.json │ │ │ ├── demo0008/ │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── InvalidReferenceToObjectCheck.json │ │ │ │ └── UnusedVariableCheck.json │ │ │ ├── demo0009/ │ │ │ │ ├── CharacterDatatypeUsageCheck.json │ │ │ │ ├── CollapsibleIfStatementsCheck.json │ │ │ │ ├── DeadCodeCheck.json │ │ │ │ ├── DeclareSectionWithoutDeclarationsCheck.json │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── EmptyStringAssignmentCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── IfWithExitCheck.json │ │ │ │ ├── SameBranchCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── UnusedParameterCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ ├── VariableHidingCheck.json │ │ │ │ └── VariableInitializationWithNullCheck.json │ │ │ ├── demo0010/ │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ └── VariableInitializationWithFunctionCallCheck.json │ │ │ ├── demo0011/ │ │ │ │ ├── CommitRollbackCheck.json │ │ │ │ ├── EmptyStringAssignmentCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── InvalidReferenceToObjectCheck.json │ │ │ │ ├── QueryWithoutExceptionHandlingCheck.json │ │ │ │ ├── SameBranchCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── VariableInitializationWithFunctionCallCheck.json │ │ │ │ └── VariableInitializationWithNullCheck.json │ │ │ ├── demo0012/ │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ └── VariableInitializationWithFunctionCallCheck.json │ │ │ ├── demo0013/ │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── VariableInitializationWithFunctionCallCheck.json │ │ │ │ ├── VariableInitializationWithNullCheck.json │ │ │ │ └── VariableNameCheck.json │ │ │ ├── demo0014/ │ │ │ │ ├── SameBranchCheck.json │ │ │ │ └── VariableInitializationWithFunctionCallCheck.json │ │ │ ├── demo0016/ │ │ │ │ ├── DeclareSectionWithoutDeclarationsCheck.json │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── InvalidReferenceToObjectCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ └── VariableInitializationWithFunctionCallCheck.json │ │ │ ├── demo0017/ │ │ │ │ ├── CharacterDatatypeUsageCheck.json │ │ │ │ ├── CollapsibleIfStatementsCheck.json │ │ │ │ ├── DuplicatedValueInInCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── InvalidReferenceToObjectCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── UnusedParameterCheck.json │ │ │ │ └── UnusedVariableCheck.json │ │ │ ├── demo0018/ │ │ │ │ └── InvalidReferenceToObjectCheck.json │ │ │ ├── oracle-database_23/ │ │ │ │ ├── AddParenthesesInNestedExpressionCheck.json │ │ │ │ ├── CharacterDatatypeUsageCheck.json │ │ │ │ ├── ColumnsShouldHaveTableNameCheck.json │ │ │ │ ├── CommitRollbackCheck.json │ │ │ │ ├── ComparisonWithBooleanCheck.json │ │ │ │ ├── ComparisonWithNullCheck.json │ │ │ │ ├── ConcatenationWithNullCheck.json │ │ │ │ ├── CursorBodyInPackageSpecCheck.json │ │ │ │ ├── DbmsOutputPutCheck.json │ │ │ │ ├── DeadCodeCheck.json │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── FunctionWithOutParameterCheck.json │ │ │ │ ├── IdenticalExpressionCheck.json │ │ │ │ ├── IfWithExitCheck.json │ │ │ │ ├── InequalityUsageCheck.json │ │ │ │ ├── InsertWithoutColumnsCheck.json │ │ │ │ ├── ParsingErrorCheck.json │ │ │ │ ├── QueryWithoutExceptionHandlingCheck.json │ │ │ │ ├── RaiseStandardExceptionCheck.json │ │ │ │ ├── SameBranchCheck.json │ │ │ │ ├── SameConditionCheck.json │ │ │ │ ├── SelectAllColumnsCheck.json │ │ │ │ ├── SelectWithRownumAndOrderByCheck.json │ │ │ │ ├── ToDateWithoutFormatCheck.json │ │ │ │ ├── UnhandledUserDefinedExceptionCheck.json │ │ │ │ ├── UnnecessaryAliasInQueryCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── UnnecessaryLikeCheck.json │ │ │ │ ├── UnusedCursorCheck.json │ │ │ │ ├── UnusedParameterCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ ├── VariableHidingCheck.json │ │ │ │ ├── VariableInitializationWithFunctionCallCheck.json │ │ │ │ ├── VariableInitializationWithNullCheck.json │ │ │ │ └── VariableNameCheck.json │ │ │ ├── pljson/ │ │ │ │ ├── CharacterDatatypeUsageCheck.json │ │ │ │ ├── CollapsibleIfStatementsCheck.json │ │ │ │ ├── ColumnsShouldHaveTableNameCheck.json │ │ │ │ ├── CommitRollbackCheck.json │ │ │ │ ├── ComparisonWithBooleanCheck.json │ │ │ │ ├── ComparisonWithNullCheck.json │ │ │ │ ├── DbmsOutputPutCheck.json │ │ │ │ ├── DeadCodeCheck.json │ │ │ │ ├── EmptyStringAssignmentCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── FunctionWithOutParameterCheck.json │ │ │ │ ├── IfWithExitCheck.json │ │ │ │ ├── InequalityUsageCheck.json │ │ │ │ ├── InsertWithoutColumnsCheck.json │ │ │ │ ├── QueryWithoutExceptionHandlingCheck.json │ │ │ │ ├── ReturnOfBooleanExpressionCheck.json │ │ │ │ ├── SameBranchCheck.json │ │ │ │ ├── SelectAllColumnsCheck.json │ │ │ │ ├── ToDateWithoutFormatCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── UnusedParameterCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ ├── VariableHidingCheck.json │ │ │ │ ├── VariableInitializationWithFunctionCallCheck.json │ │ │ │ └── VariableInitializationWithNullCheck.json │ │ │ ├── utPLSQL2/ │ │ │ │ ├── CharacterDatatypeUsageCheck.json │ │ │ │ ├── ColumnsShouldHaveTableNameCheck.json │ │ │ │ ├── CommitRollbackCheck.json │ │ │ │ ├── CursorBodyInPackageSpecCheck.json │ │ │ │ ├── DbmsOutputPutCheck.json │ │ │ │ ├── DeadCodeCheck.json │ │ │ │ ├── EmptyBlockCheck.json │ │ │ │ ├── ExplicitInParameterCheck.json │ │ │ │ ├── FunctionWithOutParameterCheck.json │ │ │ │ ├── IfWithExitCheck.json │ │ │ │ ├── InequalityUsageCheck.json │ │ │ │ ├── InsertWithoutColumnsCheck.json │ │ │ │ ├── ParsingErrorCheck.json │ │ │ │ ├── QueryWithoutExceptionHandlingCheck.json │ │ │ │ ├── RaiseStandardExceptionCheck.json │ │ │ │ ├── SameBranchCheck.json │ │ │ │ ├── SelectAllColumnsCheck.json │ │ │ │ ├── UnhandledUserDefinedExceptionCheck.json │ │ │ │ ├── UnnecessaryAliasInQueryCheck.json │ │ │ │ ├── UnnecessaryElseCheck.json │ │ │ │ ├── UnnecessaryNullStatementCheck.json │ │ │ │ ├── UnusedParameterCheck.json │ │ │ │ ├── UnusedVariableCheck.json │ │ │ │ ├── VariableHidingCheck.json │ │ │ │ ├── VariableInitializationWithFunctionCallCheck.json │ │ │ │ └── VariableInitializationWithNullCheck.json │ │ │ └── utPLSQL3/ │ │ │ ├── AddParenthesesInNestedExpressionCheck.json │ │ │ ├── CharacterDatatypeUsageCheck.json │ │ │ ├── CommitRollbackCheck.json │ │ │ ├── ComparisonWithBooleanCheck.json │ │ │ ├── ComparisonWithNullCheck.json │ │ │ ├── ConcatenationWithNullCheck.json │ │ │ ├── DbmsOutputPutCheck.json │ │ │ ├── EmptyBlockCheck.json │ │ │ ├── ExplicitInParameterCheck.json │ │ │ ├── FunctionWithOutParameterCheck.json │ │ │ ├── IdenticalExpressionCheck.json │ │ │ ├── InequalityUsageCheck.json │ │ │ ├── InsertWithoutColumnsCheck.json │ │ │ ├── ParsingErrorCheck.json │ │ │ ├── QueryWithoutExceptionHandlingCheck.json │ │ │ ├── RaiseStandardExceptionCheck.json │ │ │ ├── SameBranchCheck.json │ │ │ ├── SelectAllColumnsCheck.json │ │ │ ├── ToDateWithoutFormatCheck.json │ │ │ ├── UnhandledUserDefinedExceptionCheck.json │ │ │ ├── UnnecessaryAliasInQueryCheck.json │ │ │ ├── UnnecessaryElseCheck.json │ │ │ ├── UnnecessaryLikeCheck.json │ │ │ ├── UnnecessaryNullStatementCheck.json │ │ │ ├── UnusedParameterCheck.json │ │ │ ├── UnusedVariableCheck.json │ │ │ ├── VariableHidingCheck.json │ │ │ ├── VariableInitializationWithFunctionCallCheck.json │ │ │ └── VariableInitializationWithNullCheck.json │ │ └── sources/ │ │ ├── Doag-Forms-extracted/ │ │ │ ├── README.md │ │ │ ├── demo0001/ │ │ │ │ └── WEBUTIL_DEMO/ │ │ │ │ ├── ABOUT/ │ │ │ │ │ └── ABOUT__ABOUT_BUTTON__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── BROWSER/ │ │ │ │ │ ├── BROWSER__APPLET_PARAMS__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BROWSER__BROWSER_MESSAGE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── BROWSER__SEPARATE_FRAME__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── BUILTINS/ │ │ │ │ │ ├── BUILTINS__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BUILTINS__GET_TOOL_ENV__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BUILTINS__READ_IMAGE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── BUILTINS__TEXT_IO_BUTTON__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── CLIENTINFO/ │ │ │ │ │ └── CLIENTINFO__ACTION__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── CLIENT_GETENV.pcd │ │ │ │ ├── CLIENT_READIMAGE.pcd │ │ │ │ ├── CLIENT_TEXTIO.pcd │ │ │ │ ├── CTL/ │ │ │ │ │ ├── CTL__ACKNOWLEDGE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT10__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT1__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT2__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT3__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT4__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT5__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT6__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT7__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT8__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── CTL__EXIT9__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── C_API/ │ │ │ │ │ ├── C_API__CALL_C_API__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── C_API__LOCKSTATION__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── DOWNLOAD/ │ │ │ │ │ ├── DOWNLOAD__DOWNLOAD_AS__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── DOWNLOAD__DOWNLOAD_DB__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── DOWNLOAD__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── DOWNLOAD_AS.pcd │ │ │ │ ├── DOWNLOAD_DB.pcd │ │ │ │ ├── FILES/ │ │ │ │ │ ├── FILES__COPY_FILE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__DELETE_FILE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__FILE_INFO__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__FILE_OPEN__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__FILE_SAVE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__LIST_DIRS__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── FILES__LIST_FILES__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── FILES_WBP.pcd │ │ │ │ ├── F_GET_TIMER_VALUE.fun │ │ │ │ ├── GET_APPLET_PARAMETERS.pcd │ │ │ │ ├── GET_CLIENTINFO.pcd │ │ │ │ ├── GET_CLIENT_FILENAME.pcd │ │ │ │ ├── HOST/ │ │ │ │ │ ├── HOST__HOST_CALLBACK.tgg │ │ │ │ │ └── HOST__RUN_HOST__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── SEPARATE_FRAME_OPTIONS.pcd │ │ │ │ ├── SET_BROWSER_MESSAGE.pcd │ │ │ │ ├── UPLOAD/ │ │ │ │ │ ├── UPLOAD__CREATE_TABLE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── UPLOAD__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── UPLOAD__UPLOAD_AS__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── UPLOAD__UPLOAD_DB__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── UPLOAD_AS.pcd │ │ │ │ ├── UPLOAD_DB.pcd │ │ │ │ ├── WEBUTIL/ │ │ │ │ │ ├── WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ └── WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ ├── WEBUTIL_DEMO/ │ │ │ │ │ ├── PRE-FORM.tgg │ │ │ │ │ ├── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ │ ├── WHEN-TAB-PAGE-CHANGED.tgg │ │ │ │ │ └── WHEN-TIMER-EXPIRED.tgg │ │ │ │ └── metadata.json │ │ │ ├── demo0002/ │ │ │ │ ├── DEMO0002/ │ │ │ │ │ ├── BL_EMPLOYEES.pkb │ │ │ │ │ ├── BL_EMPLOYEES.pks │ │ │ │ │ ├── BL_MAINBLOCK.pkb │ │ │ │ │ ├── BL_MAINBLOCK.pks │ │ │ │ │ ├── CONST_LOCAL.pks │ │ │ │ │ ├── CONTROL/ │ │ │ │ │ │ ├── CONTROL__BT_EXIT__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ │ └── CONTROL__BT_WIKI__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── DEMO0002/ │ │ │ │ │ │ └── WHEN-TIMER-EXPIRED.tgg │ │ │ │ │ ├── EMPLOYEES/ │ │ │ │ │ │ └── EMPLOYEES__PRE-QUERY.tgg │ │ │ │ │ ├── FILTER/ │ │ │ │ │ │ ├── FILTER__BT_QUERY__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ │ └── FILTER__WHEN-VALIDATE-ITEM.tgg │ │ │ │ │ ├── VERSION_FRW_FORMS.fun │ │ │ │ │ ├── WHEN_TIMER_EXPIRED.pcd │ │ │ │ │ ├── WNB.pcd │ │ │ │ │ ├── WNF.pcd │ │ │ │ │ ├── WNI.pcd │ │ │ │ │ ├── WNR.pcd │ │ │ │ │ └── metadata.json │ │ │ │ └── FRW_REF/ │ │ │ │ ├── FRW_REF/ │ │ │ │ │ ├── ON-ERROR.tgg │ │ │ │ │ ├── WHEN-NEW-BLOCK-INSTANCE.tgg │ │ │ │ │ ├── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ │ ├── WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ └── WHEN-NEW-RECORD-INSTANCE.tgg │ │ │ │ ├── WNB.pcd │ │ │ │ ├── WNF.pcd │ │ │ │ ├── WNI.pcd │ │ │ │ ├── WNR.pcd │ │ │ │ └── metadata.json │ │ │ ├── demo0003/ │ │ │ │ └── DEMO0003/ │ │ │ │ ├── BL_MAINBLOCK.pkb │ │ │ │ ├── BL_MAINBLOCK.pks │ │ │ │ ├── CONST_LOCAL.pks │ │ │ │ ├── CONTROL/ │ │ │ │ │ ├── CONTROL__BT_EXIT__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CONTROL__BT_ONE_TIME_TIMER__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CONTROL__BT_UNDO__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CONTROL__BT_WIKI__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── CONTROL__BT__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── DEMO0003/ │ │ │ │ │ └── WHEN-TIMER-EXPIRED.tgg │ │ │ │ ├── EMPLOYEES_CONTROL/ │ │ │ │ │ ├── EMPLOYEES_CONTROL__BT_UNDO__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── EMPLOYEES_CONTROL__ITEM47__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── EMPLOYEES_LI/ │ │ │ │ │ └── EMPLOYEES_LI__PRE-QUERY.tgg │ │ │ │ ├── EMPLOYEES_LI_CONTROL/ │ │ │ │ │ └── EMPLOYEES_LI_CONTROL__BT_EXIT__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── UNDO.pcd │ │ │ │ ├── VERSION_FRW_FORMS.fun │ │ │ │ ├── WHEN_TIMER_EXPIRED.pcd │ │ │ │ ├── WNB.pcd │ │ │ │ ├── WNF.pcd │ │ │ │ ├── WNI.pcd │ │ │ │ ├── WNR.pcd │ │ │ │ └── metadata.json │ │ │ ├── demo0004/ │ │ │ │ └── RELEASE_LOCKS/ │ │ │ │ ├── ERRORMESSAGE.pcd │ │ │ │ ├── IS_DBA.fun │ │ │ │ ├── KILL_SESSION.pcd │ │ │ │ ├── LOG_SYSTEM_SCHLIESSEN.pcd │ │ │ │ ├── REFRESH.pcd │ │ │ │ ├── RELEASE_LOCKS/ │ │ │ │ │ ├── POST-FORM.tgg │ │ │ │ │ └── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ ├── STEUERBLOCK/ │ │ │ │ │ ├── STEUERBLOCK__PB_CANCEL__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── STEUERBLOCK__PB_CONNECT__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── STEUERBLOCK__PB_EXIT__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── STEUERBLOCK__PB_REFRESH__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── V$LOCK/ │ │ │ │ │ └── V$LOCK__POST-QUERY.tgg │ │ │ │ ├── V$SESSION/ │ │ │ │ │ └── V$SESSION__PB_KILL_SESSION__WHEN-BUTTON-PRESSED.tgg │ │ │ │ └── metadata.json │ │ │ ├── demo0005/ │ │ │ │ └── TIMEOUTPJC_TEST/ │ │ │ │ ├── PL_RESET_FORMSTIMER_ITEMS.pcd │ │ │ │ ├── PL_START.pcd │ │ │ │ ├── PL_WHEN_CUSTOM_ITEM_EVENT.pcd │ │ │ │ ├── TEST/ │ │ │ │ │ ├── TEST__DEBUG__WHEN-CHECKBOX-CHANGED.tgg │ │ │ │ │ ├── TEST__FORMSTIMER500__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__FORMSTIMER60000__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__FORMS_TIMER1000__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__FORMS_TIMER5000__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__ITEM28__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__PRESET1__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__PRESET2__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__PRESET3__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__PRESET4__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__PRESET5__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__PRESET6__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── TEST__PRESET7__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── TEST__STARTTIMER__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── TIMEOUTPJC_TEST/ │ │ │ │ │ ├── ON-LOGON.tgg │ │ │ │ │ ├── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ │ ├── WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ └── WHEN-TIMER-EXPIRED.tgg │ │ │ │ ├── WEBUTIL/ │ │ │ │ │ ├── WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ └── WEBUTIL__WEBUTIL_TIMER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ └── metadata.json │ │ │ ├── demo0006/ │ │ │ │ └── TIMEOUT_SYS_CLIENT_IDL/ │ │ │ │ ├── DEMOBLOCK/ │ │ │ │ │ ├── DEMOBLOCK__BUT_CLOSE_FORM__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── DEMOBLOCK__DEMO_1__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── DEMOBLOCK__DEMO_2__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── DEMOBLOCK__DEMO_3__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── F_GET_TIMER_VALUE.fun │ │ │ │ ├── P_CLEAR_DIAGNOSTIC_ITEMS.pcd │ │ │ │ ├── TIMEOUT_SYS_CLIENT_IDL/ │ │ │ │ │ └── PRE-FORM.tgg │ │ │ │ └── metadata.json │ │ │ ├── demo0007/ │ │ │ │ └── CD_DEMO_EXCEL/ │ │ │ │ ├── ALL_OBJECTS/ │ │ │ │ │ ├── ALL_OBJECTS__BT_ALL__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── ALL_OBJECTS__BT_PACKAGES__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── ALL_OBJECTS__BT_TABLES__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── ALL_OBJECTS__CALL_EXCEL__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── CD_DEMO_EXCEL/ │ │ │ │ │ ├── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ │ └── WHEN-WINDOW-CLOSED.tgg │ │ │ │ ├── P_GET_BLOB.pcd │ │ │ │ ├── WEBUTIL/ │ │ │ │ │ ├── WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ └── WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ └── metadata.json │ │ │ ├── demo0008/ │ │ │ │ └── LATENCY_TEST/ │ │ │ │ ├── F_GET_CURRENT_TIME_MS.fun │ │ │ │ ├── LATENCY_TEST/ │ │ │ │ │ ├── ON-LOGON.tgg │ │ │ │ │ ├── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ │ └── WHEN-TIMER-EXPIRED.tgg │ │ │ │ ├── P_DOWNLOAD_DOKUMENT_AS.pcd │ │ │ │ ├── P_WAIT_AND_EXIT.pcd │ │ │ │ ├── P_WHEN_NEW_FORM_INSTANCE.pcd │ │ │ │ ├── WEBUTIL/ │ │ │ │ │ ├── WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ └── WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ ├── WEBUTIL_GET_AS_TMP_DIR.fun │ │ │ │ ├── WEBUTIL_GET_LATENCY.fun │ │ │ │ ├── WEBUTIL_PREPARE_TESTFILE.pcd │ │ │ │ └── metadata.json │ │ │ ├── demo0009/ │ │ │ │ └── FORMSAPI_WIZARD_2905/ │ │ │ │ ├── BLK_HANDLG/ │ │ │ │ │ ├── BLK_HANDLG__BT_CHECK_SINGLE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BLK_HANDLG__BT_COMPILE_SINGLE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BLK_HANDLG__BT_MIGRATE_SINGLE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BLK_HANDLG__BT_SELECT__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BLK_HANDLG__BT_VIEW_CHECK__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BLK_HANDLG__BT_VIEW_COMPILE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BLK_HANDLG__BT_VIEW_MIGRATE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BLK_HANDLG__CBOX_FAM_ACTION__WHEN-LIST-CHANGED.tgg │ │ │ │ │ ├── BLK_HANDLG__CB__WHEN-CHECKBOX-CHANGED.tgg │ │ │ │ │ └── BLK_HANDLG__POST-QUERY.tgg │ │ │ │ ├── CTL_BASIC/ │ │ │ │ │ ├── CTL_BASIC__BT_ALL__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL_BASIC__BT_CHECK__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL_BASIC__BT_COMPILE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL_BASIC__BT_CONFIGURE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── CTL_BASIC__BT_MIGRATE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── CTL_INIT/ │ │ │ │ │ └── CTL_INIT__BT_CLOSE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── FNC_FILE_EXISTS_HOST.fun │ │ │ │ ├── FNC_GET_FILE_SEPARATOR.fun │ │ │ │ ├── FNC_GET_TIMER_VALUE.fun │ │ │ │ ├── FORMSAPI_WIZARD_2905/ │ │ │ │ │ ├── MODULE_FEATURES.tgg │ │ │ │ │ ├── ON-LOGON.tgg │ │ │ │ │ ├── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ │ ├── WHEN-TIMER-EXPIRED.tgg │ │ │ │ │ └── WHEN-WINDOW-CLOSED.tgg │ │ │ │ ├── G.pkb │ │ │ │ ├── G.pks │ │ │ │ ├── PKG_BLK_DATA.pkb │ │ │ │ ├── PKG_BLK_DATA.pks │ │ │ │ ├── PKG_CONFIG.pkb │ │ │ │ ├── PKG_CONFIG.pks │ │ │ │ ├── PKG_FAM_RUN_SCRIPT.pkb │ │ │ │ ├── PKG_FAM_RUN_SCRIPT.pks │ │ │ │ ├── PRC_ABORT.pcd │ │ │ │ ├── PRC_CHECK_FAM.pcd │ │ │ │ ├── PRC_CMD_HOST_CLIENT.pcd │ │ │ │ ├── PRC_CNG_MONTH_TIME.pcd │ │ │ │ ├── PRC_COMPILATION.pcd │ │ │ │ ├── PRC_CONFIGURATION.pcd │ │ │ │ ├── PRC_COPY_FILE.pcd │ │ │ │ ├── PRC_COPY_FILE_HOST.pcd │ │ │ │ ├── PRC_ERROR.pcd │ │ │ │ ├── PRC_EXCEPTION.pcd │ │ │ │ ├── PRC_FILE_MERGE.pcd │ │ │ │ ├── PRC_FILE_MERGE_HOST.pcd │ │ │ │ ├── PRC_FLOG.pcd │ │ │ │ ├── PRC_GET_CHK_REF_INFO.pcd │ │ │ │ ├── PRC_GET_CONNECT_INFO.pcd │ │ │ │ ├── PRC_INFO.pcd │ │ │ │ ├── PRC_MIGRATION.pcd │ │ │ │ ├── PRC_MSG.pcd │ │ │ │ ├── PRC_SET_COMPILE_RESULT.pcd │ │ │ │ ├── PRC_SET_INFOS.pcd │ │ │ │ ├── PRC_SET_MIGRATE_RESULT.pcd │ │ │ │ ├── PRC_SET_STATISTIK.pcd │ │ │ │ ├── PRC_SET_STATISTIK_SINGLE.pcd │ │ │ │ ├── PRC_SET_USERHOME.pcd │ │ │ │ ├── PRC_SHOW_DURATION.pcd │ │ │ │ ├── PRC_SHOW_INIT.pcd │ │ │ │ ├── PRC_VIEW_FILE.pcd │ │ │ │ ├── PRC_WRITE_SCRIPT.pcd │ │ │ │ ├── WEBUTIL/ │ │ │ │ │ ├── WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ └── WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ └── metadata.json │ │ │ ├── demo0010/ │ │ │ │ └── CHK_MYFFI_SAMPLE5/ │ │ │ │ ├── BLK/ │ │ │ │ │ ├── BLK__PB_WEB_FFI__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── BLK__URL__WHEN-MOUSE-CLICK.tgg │ │ │ │ ├── CHK_MYFFI_SAMPLE5/ │ │ │ │ │ └── ON-LOGON.tgg │ │ │ │ ├── FNC_BOOL.fun │ │ │ │ ├── PRC_SHOW.pcd │ │ │ │ ├── WEBUTIL/ │ │ │ │ │ ├── WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ └── WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ └── metadata.json │ │ │ ├── demo0011/ │ │ │ │ └── WEBUTIL_DEMO/ │ │ │ │ ├── ABOUT/ │ │ │ │ │ └── ABOUT__ABOUT_BUTTON__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── BROWSER/ │ │ │ │ │ ├── BROWSER__APPLET_PARAMS__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BROWSER__BROWSER_MESSAGE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── BROWSER__SEPARATE_FRAME__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── BUILTINS/ │ │ │ │ │ ├── BUILTINS__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BUILTINS__GET_TOOL_ENV__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BUILTINS__READ_IMAGE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── BUILTINS__TEXT_IO_BUTTON__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── CLIENTINFO/ │ │ │ │ │ └── CLIENTINFO__ACTION__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── CLIENT_GETENV.pcd │ │ │ │ ├── CLIENT_READIMAGE.pcd │ │ │ │ ├── CLIENT_TEXTIO.pcd │ │ │ │ ├── CTL/ │ │ │ │ │ ├── CTL__ACKNOWLEDGE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT10__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT1__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT2__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT3__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT4__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT5__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT6__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT7__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CTL__EXIT8__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── CTL__EXIT9__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── C_API/ │ │ │ │ │ ├── C_API__CALL_C_API__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── C_API__LOCKSTATION__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── DOWNLOAD/ │ │ │ │ │ ├── DOWNLOAD__DOWNLOAD_AS__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── DOWNLOAD__DOWNLOAD_DB__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── DOWNLOAD__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── DOWNLOAD_AS.pcd │ │ │ │ ├── DOWNLOAD_DB.pcd │ │ │ │ ├── FILES/ │ │ │ │ │ ├── FILES__COPY_FILE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__DELETE_FILE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__FILE_INFO__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__FILE_OPEN__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__FILE_SAVE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── FILES__LIST_DIRS__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── FILES__LIST_FILES__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── FILES_WBP.pcd │ │ │ │ ├── GET_APPLET_PARAMETERS.pcd │ │ │ │ ├── GET_CLIENTINFO.pcd │ │ │ │ ├── GET_CLIENT_FILENAME.pcd │ │ │ │ ├── HOST/ │ │ │ │ │ ├── HOST__HOST_CALLBACK.tgg │ │ │ │ │ └── HOST__RUN_HOST__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── OLE/ │ │ │ │ │ ├── OLE__SAVEFILE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── OLE__WRITE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── OLE_WRITE.pcd │ │ │ │ ├── SEPARATE_FRAME_OPTIONS.pcd │ │ │ │ ├── SET_BROWSER_MESSAGE.pcd │ │ │ │ ├── UPLOAD/ │ │ │ │ │ ├── UPLOAD__CREATE_TABLE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── UPLOAD__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── UPLOAD__UPLOAD_AS__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── UPLOAD__UPLOAD_DB__WHEN-BUTTON-PRESSED.tgg │ │ │ │ ├── UPLOAD_AS.pcd │ │ │ │ ├── UPLOAD_DB.pcd │ │ │ │ ├── WEBUTIL/ │ │ │ │ │ ├── WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── WEBUTIL__WEBUTIL_OLE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ └── WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ ├── WEBUTIL_DEMO/ │ │ │ │ │ ├── KEY-EXIT.tgg │ │ │ │ │ ├── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ │ ├── WHEN-TAB-PAGE-CHANGED.tgg │ │ │ │ │ ├── WHEN-TIMER-EXPIRED.tgg │ │ │ │ │ └── WHEN-WINDOW-CLOSED.tgg │ │ │ │ └── metadata.json │ │ │ ├── demo0012/ │ │ │ │ └── PDFVIEWER/ │ │ │ │ ├── PDFVIEWER/ │ │ │ │ │ ├── ON-LOGON.tgg │ │ │ │ │ ├── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ │ └── WHEN-TIMER-EXPIRED.tgg │ │ │ │ └── metadata.json │ │ │ ├── demo0013/ │ │ │ │ └── COLOR_SLIDER/ │ │ │ │ ├── BL1/ │ │ │ │ │ ├── BL1__B__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── BL1__G__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── BL1__R__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── BL1__VB__POST-TEXT-ITEM.tgg │ │ │ │ │ ├── BL1__VG__POST-TEXT-ITEM.tgg │ │ │ │ │ └── BL1__VR__POST-TEXT-ITEM.tgg │ │ │ │ ├── COLOR_SLIDER/ │ │ │ │ │ ├── ON-LOGON.tgg │ │ │ │ │ └── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ ├── PKG_SLIDER.pkb │ │ │ │ ├── PKG_SLIDER.pks │ │ │ │ └── metadata.json │ │ │ ├── demo0014/ │ │ │ │ ├── ACCORDION/ │ │ │ │ │ ├── ACCORDION/ │ │ │ │ │ │ └── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ │ ├── B/ │ │ │ │ │ │ ├── B__B2__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ │ ├── B__B3__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ │ ├── B__B4__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ │ └── B__B__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BL_TREE/ │ │ │ │ │ │ ├── BL_TREE__IT_TREE__WHEN-TREE-NODE-EXPANDED.tgg │ │ │ │ │ │ └── BL_TREE__IT_TREE__WHEN-TREE-NODE-SELECTED.tgg │ │ │ │ │ ├── DEPARTMENTS/ │ │ │ │ │ │ └── DEPARTMENTS__WHEN-NEW-RECORD-INSTANCE.tgg │ │ │ │ │ ├── OTHRS/ │ │ │ │ │ │ └── OTHRS__EMAIL__WHEN-CHECKBOX-CHANGED.tgg │ │ │ │ │ ├── PK_ACCORDION.pkb │ │ │ │ │ ├── PK_ACCORDION.pks │ │ │ │ │ ├── PK_TREE.pkb │ │ │ │ │ ├── PK_TREE.pks │ │ │ │ │ ├── PR_INIT_BY_DEPT.pcd │ │ │ │ │ ├── PR_INIT_BY_OTHERS.pcd │ │ │ │ │ ├── PR_INIT_BY_SAL.pcd │ │ │ │ │ ├── PR_INIT_BY_TREE.pcd │ │ │ │ │ ├── SAL/ │ │ │ │ │ │ └── SAL__SAL__WHEN-RADIO-CHANGED.tgg │ │ │ │ │ └── metadata.json │ │ │ │ └── ACCORDION2/ │ │ │ │ ├── ACCORDION2/ │ │ │ │ │ └── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ ├── PK_ACCORDION.pkb │ │ │ │ ├── PK_ACCORDION.pks │ │ │ │ └── metadata.json │ │ │ ├── demo0015/ │ │ │ │ └── MODERNIZE/ │ │ │ │ ├── CONTROL/ │ │ │ │ │ ├── CONTROL__CHECK_BOX_BACK_COLOR__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CONTROL__ERROR_STACK__WHEN-CUSTOM-ITEM-EVENT.tgg │ │ │ │ │ ├── CONTROL__RADIO_BACK_COLOR__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CONTROL__SHOW_ERROR__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CONTROL__SHOW_INFO__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CONTROL__SHOW_WARNING__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CONTROL__TEXT_FIELD_BACK_COLOR__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── CONTROL__TEXT_FIELD_ENABLE__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ └── CONTROL__WHEN-NEW-RECORD-INSTANCE.tgg │ │ │ │ ├── MODERNIZE/ │ │ │ │ │ └── WHEN-WINDOW-CLOSED.tgg │ │ │ │ ├── RecordGroups/ │ │ │ │ │ └── LOV9.sql │ │ │ │ └── metadata.json │ │ │ ├── demo0016/ │ │ │ │ └── CHK_CBOX3/ │ │ │ │ ├── C/ │ │ │ │ │ ├── C__CBOX__KEY-NEXT-ITEM.tgg │ │ │ │ │ ├── C__CBOX__POST-CHANGE.tgg │ │ │ │ │ ├── C__CBOX__WHEN-LIST-CHANGED.tgg │ │ │ │ │ ├── C__DUMMY__KEY-NEXT-ITEM.tgg │ │ │ │ │ └── C__DUMMY__KEY-PREV-ITEM.tgg │ │ │ │ ├── CBX/ │ │ │ │ │ ├── CBX__LABEL__KEY-NEXT-ITEM.tgg │ │ │ │ │ ├── CBX__LABEL__KEY-PREV-ITEM.tgg │ │ │ │ │ ├── CBX__LABEL__WHEN-MOUSE-CLICK.tgg │ │ │ │ │ └── CBX__ON-ERROR.tgg │ │ │ │ ├── CHK_CBOX3/ │ │ │ │ │ ├── WHEN-NEW-BLOCK-INSTANCE.tgg │ │ │ │ │ └── WHEN-TIMER-EXPIRED.tgg │ │ │ │ ├── PKG_CBOX.pkb │ │ │ │ ├── PKG_CBOX.pks │ │ │ │ └── metadata.json │ │ │ ├── demo0017/ │ │ │ │ └── POC_ACCOUNT/ │ │ │ │ ├── BLK_ACCOUNT/ │ │ │ │ │ ├── BLK_ACCOUNT__ANSWER__WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ ├── BLK_ACCOUNT__ANSWER__WHEN-VALIDATE-ITEM.tgg │ │ │ │ │ ├── BLK_ACCOUNT__BT_COMMIT__WHEN-BUTTON-PRESSED.tgg │ │ │ │ │ ├── BLK_ACCOUNT__CLOSE__WHEN-MOUSE-CLICK.tgg │ │ │ │ │ ├── BLK_ACCOUNT__EMAIL2__WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ ├── BLK_ACCOUNT__EMAIL2__WHEN-VALIDATE-ITEM.tgg │ │ │ │ │ ├── BLK_ACCOUNT__EMAIL__WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ ├── BLK_ACCOUNT__EMAIL__WHEN-VALIDATE-ITEM.tgg │ │ │ │ │ ├── BLK_ACCOUNT__FULLNAME__WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ ├── BLK_ACCOUNT__FULLNAME__WHEN-VALIDATE-ITEM.tgg │ │ │ │ │ ├── BLK_ACCOUNT__PASSWORD_RETRY__WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ ├── BLK_ACCOUNT__PASSWORD_RETRY__WHEN-VALIDATE-ITEM.tgg │ │ │ │ │ ├── BLK_ACCOUNT__PASSWORD__WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ ├── BLK_ACCOUNT__PASSWORD__WHEN-VALIDATE-ITEM.tgg │ │ │ │ │ ├── BLK_ACCOUNT__QUERY__WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ ├── BLK_ACCOUNT__QUERY__WHEN-VALIDATE-ITEM.tgg │ │ │ │ │ ├── BLK_ACCOUNT__START_DEMO__WHEN-MOUSE-CLICK.tgg │ │ │ │ │ ├── BLK_ACCOUNT__USERNAME__WHEN-NEW-ITEM-INSTANCE.tgg │ │ │ │ │ └── BLK_ACCOUNT__USERNAME__WHEN-VALIDATE-ITEM.tgg │ │ │ │ ├── FNC_MSG_QUERY.fun │ │ │ │ ├── FNC_VALIDATE.fun │ │ │ │ ├── PKG_ITEM.pkb │ │ │ │ ├── PKG_ITEM.pks │ │ │ │ ├── POC_ACCOUNT/ │ │ │ │ │ ├── KEY-EXIT.tgg │ │ │ │ │ ├── ON-ERROR.tgg │ │ │ │ │ ├── ON-MESSAGE.tgg │ │ │ │ │ └── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ │ ├── POP_CHECK/ │ │ │ │ │ └── CHECK_ALL/ │ │ │ │ │ └── POP_CHECK__CHECK_ALL.sql │ │ │ │ ├── PRC_CHK_ITEM_SEQUENCE.pcd │ │ │ │ ├── PRC_INFO.pcd │ │ │ │ ├── PRC_SET_ITEMS.pcd │ │ │ │ ├── V#R#FY_PW$001.fun │ │ │ │ └── metadata.json │ │ │ └── demo0018/ │ │ │ └── TEST/ │ │ │ ├── TEST/ │ │ │ │ ├── TEST__BUTTON1__WHEN-BUTTON-PRESSED.tgg │ │ │ │ └── WHEN-NEW-FORM-INSTANCE.tgg │ │ │ └── metadata.json │ │ ├── antlr-grammars-v4/ │ │ │ ├── README.md │ │ │ ├── examples/ │ │ │ │ ├── administer_key_management.sql │ │ │ │ ├── aggregate_functions.sql │ │ │ │ ├── alter_analytic_view.sql │ │ │ │ ├── alter_attribute_dimension.sql │ │ │ │ ├── alter_audit_policy.sql │ │ │ │ ├── alter_database.sql │ │ │ │ ├── alter_dimension.sql │ │ │ │ ├── alter_diskgroup.sql │ │ │ │ ├── alter_flashback_archive.sql │ │ │ │ ├── alter_function.sql │ │ │ │ ├── alter_hierarchy.sql │ │ │ │ ├── alter_inmemory_join_group.sql │ │ │ │ ├── alter_java.sql │ │ │ │ ├── alter_library.sql │ │ │ │ ├── alter_lockdown_profile.sql │ │ │ │ ├── alter_materialized_zonemap.sql │ │ │ │ ├── alter_mv.sql │ │ │ │ ├── alter_mv_log.sql │ │ │ │ ├── alter_operator.sql │ │ │ │ ├── alter_outline.sql │ │ │ │ ├── alter_pmem_filestore.sql │ │ │ │ ├── alter_resource_cost.sql │ │ │ │ ├── alter_role.sql │ │ │ │ ├── alter_rollback_segment.sql │ │ │ │ ├── alter_session.sql │ │ │ │ ├── alter_synonym01.sql │ │ │ │ ├── alter_table.sql │ │ │ │ ├── alter_table_inmemory.sql │ │ │ │ ├── alter_table_modify_partition_by_range.sql │ │ │ │ ├── alter_table_modify_partition_shrink.sql │ │ │ │ ├── alter_tablespace_set.sql │ │ │ │ ├── alter_tablespaces.sql │ │ │ │ ├── alter_view.sql │ │ │ │ ├── analytic_query.sql │ │ │ │ ├── analyze.sql │ │ │ │ ├── associate_statistics.sql │ │ │ │ ├── audit.sql │ │ │ │ ├── bindvar01.sql │ │ │ │ ├── bindvar02.sql │ │ │ │ ├── bindvar03.sql │ │ │ │ ├── bindvar04.sql │ │ │ │ ├── bindvar05.sql │ │ │ │ ├── block01.sql │ │ │ │ ├── block02.sql │ │ │ │ ├── bulk_collect_fetch_clause01.sql │ │ │ │ ├── call.sql │ │ │ │ ├── case_when01.sql │ │ │ │ ├── case_when02.sql │ │ │ │ ├── case_when03.sql │ │ │ │ ├── case_when04.sql │ │ │ │ ├── case_when05.sql │ │ │ │ ├── case_when06.sql │ │ │ │ ├── case_when07.sql │ │ │ │ ├── case_when08.sql │ │ │ │ ├── cast.sql │ │ │ │ ├── cast_multiset01.sql │ │ │ │ ├── cast_multiset02.sql │ │ │ │ ├── cast_multiset03.sql │ │ │ │ ├── cast_multiset04.sql │ │ │ │ ├── cast_multiset05.sql │ │ │ │ ├── cast_multiset06.sql │ │ │ │ ├── cast_multiset08.sql │ │ │ │ ├── cluster.sql │ │ │ │ ├── collection_method_invocation.sql │ │ │ │ ├── columns01.sql │ │ │ │ ├── comment_on.sql │ │ │ │ ├── comments.sql │ │ │ │ ├── commit.sql │ │ │ │ ├── concatenation-double_asterisk.sql │ │ │ │ ├── concatenation-mod.sql │ │ │ │ ├── condition01.sql │ │ │ │ ├── condition02.sql │ │ │ │ ├── condition03.sql │ │ │ │ ├── condition04.sql │ │ │ │ ├── condition05.sql │ │ │ │ ├── condition06.sql │ │ │ │ ├── condition07.sql │ │ │ │ ├── condition08.sql │ │ │ │ ├── condition09.sql │ │ │ │ ├── condition10.sql │ │ │ │ ├── condition11.sql │ │ │ │ ├── condition12.sql │ │ │ │ ├── condition14.sql │ │ │ │ ├── condition15.sql │ │ │ │ ├── condition16.sql │ │ │ │ ├── connect_by01.sql │ │ │ │ ├── connect_by02.sql │ │ │ │ ├── connect_by03.sql │ │ │ │ ├── connect_by04.sql │ │ │ │ ├── connect_by05.sql │ │ │ │ ├── context.sql │ │ │ │ ├── create_analytic_view.sql │ │ │ │ ├── create_attribute_dimension.sql │ │ │ │ ├── create_audit_policy.sql │ │ │ │ ├── create_controlfile.sql │ │ │ │ ├── create_database.sql │ │ │ │ ├── create_dimension.sql │ │ │ │ ├── create_directory.sql │ │ │ │ ├── create_diskgroup.sql │ │ │ │ ├── create_edition.sql │ │ │ │ ├── create_flashback_archive.sql │ │ │ │ ├── create_function01.sql │ │ │ │ ├── create_function02.sql │ │ │ │ ├── create_function03.sql │ │ │ │ ├── create_function04.sql │ │ │ │ ├── create_function05.sql │ │ │ │ ├── create_function06.sql │ │ │ │ ├── create_hierarchy.sql │ │ │ │ ├── create_index.sql │ │ │ │ ├── create_inmemory_join_group.sql │ │ │ │ ├── create_java.sql │ │ │ │ ├── create_library.sql │ │ │ │ ├── create_lockdown_profile.sql │ │ │ │ ├── create_materialized_zonemap.sql │ │ │ │ ├── create_operator.sql │ │ │ │ ├── create_outline.sql │ │ │ │ ├── create_package.sql.tree │ │ │ │ ├── create_package01.sql │ │ │ │ ├── create_package02.sql │ │ │ │ ├── create_package03.sql │ │ │ │ ├── create_package04.sql │ │ │ │ ├── create_package05.sql │ │ │ │ ├── create_pmem_filestore.sql │ │ │ │ ├── create_procedure01.sql │ │ │ │ ├── create_procedure01.sql.tree │ │ │ │ ├── create_procedure02.sql │ │ │ │ ├── create_procedure03.sql │ │ │ │ ├── create_profile.sql │ │ │ │ ├── create_restore_point.sql │ │ │ │ ├── create_role.sql │ │ │ │ ├── create_rollback_segment.sql │ │ │ │ ├── create_spfile.sql │ │ │ │ ├── create_synonym01.sql │ │ │ │ ├── create_synonym02.sql │ │ │ │ ├── create_synonym03.sql │ │ │ │ ├── create_table.sql │ │ │ │ ├── create_tablespace.sql │ │ │ │ ├── create_tablespace_set.sql │ │ │ │ ├── create_trigger01.sql │ │ │ │ ├── create_trigger02.sql │ │ │ │ ├── create_type.sql │ │ │ │ ├── create_view.sql │ │ │ │ ├── ctas.sql │ │ │ │ ├── datetime01.sql │ │ │ │ ├── datetime03.sql │ │ │ │ ├── datetime04.sql │ │ │ │ ├── datetime05.sql │ │ │ │ ├── dblink.sql │ │ │ │ ├── dblink01.sql │ │ │ │ ├── directory.sql │ │ │ │ ├── disassociate_statistics.sql │ │ │ │ ├── drop_analytic_view.sql │ │ │ │ ├── drop_attribute_dimension.sql │ │ │ │ ├── drop_audit_policy.sql │ │ │ │ ├── drop_cluster.sql │ │ │ │ ├── drop_context.sql │ │ │ │ ├── drop_database.sql │ │ │ │ ├── drop_directory.sql │ │ │ │ ├── drop_diskgroup.sql │ │ │ │ ├── drop_edition.sql │ │ │ │ ├── drop_flashback_archive.sql │ │ │ │ ├── drop_hierarchy.sql │ │ │ │ ├── drop_indextype.sql │ │ │ │ ├── drop_inmemory_join_group.sql │ │ │ │ ├── drop_java.sql │ │ │ │ ├── drop_library.sql │ │ │ │ ├── drop_lockdown_profile.sql │ │ │ │ ├── drop_materialized_view.sql │ │ │ │ ├── drop_materialized_view.sql.tree │ │ │ │ ├── drop_materialized_zonemap.sql │ │ │ │ ├── drop_operator.sql │ │ │ │ ├── drop_outline.sql │ │ │ │ ├── drop_pmem_filestore.sql │ │ │ │ ├── drop_restore_point.sql │ │ │ │ ├── drop_role.sql │ │ │ │ ├── drop_rollback_segment.sql │ │ │ │ ├── drop_synonym01.sql │ │ │ │ ├── drop_table.sql │ │ │ │ ├── drop_tablespace.sql │ │ │ │ ├── drop_tablespace_set.sql │ │ │ │ ├── drop_user.sql │ │ │ │ ├── drop_view.sql │ │ │ │ ├── editionable_function.sql │ │ │ │ ├── editionable_packagebody_function.sql │ │ │ │ ├── editionable_packagespec_function.sql │ │ │ │ ├── explain01.sql │ │ │ │ ├── fetch_clause01.sql │ │ │ │ ├── fetch_clause02.sql │ │ │ │ ├── fetch_clause03.sql │ │ │ │ ├── fetch_clause04.sql │ │ │ │ ├── fetch_statement.sql │ │ │ │ ├── flashback01.sql │ │ │ │ ├── flashback_table.sql │ │ │ │ ├── for_update01.sql │ │ │ │ ├── for_update02.sql │ │ │ │ ├── for_update03.sql │ │ │ │ ├── for_update04.sql │ │ │ │ ├── for_update05.sql │ │ │ │ ├── for_update06.sql │ │ │ │ ├── for_update07.sql │ │ │ │ ├── for_update08.sql │ │ │ │ ├── forall_bulk_rowcount.sql │ │ │ │ ├── forall_indices_of.sql │ │ │ │ ├── forall_statement_and_exception_handling.sql │ │ │ │ ├── function01.sql │ │ │ │ ├── function02.sql │ │ │ │ ├── function03.sql │ │ │ │ ├── function04.sql │ │ │ │ ├── function05.sql │ │ │ │ ├── function06.sql │ │ │ │ ├── function07.sql │ │ │ │ ├── general_element_part.sql │ │ │ │ ├── groupby01.sql │ │ │ │ ├── groupby02.sql │ │ │ │ ├── groupby03.sql │ │ │ │ ├── groupby04.sql │ │ │ │ ├── groupby05.sql │ │ │ │ ├── groupby06.sql │ │ │ │ ├── groupby07.sql │ │ │ │ ├── index.sql │ │ │ │ ├── insert_statement.sql │ │ │ │ ├── interval01.sql │ │ │ │ ├── interval02.sql │ │ │ │ ├── interval03.sql │ │ │ │ ├── interval04.sql │ │ │ │ ├── join01.sql │ │ │ │ ├── join02.sql │ │ │ │ ├── join03.sql │ │ │ │ ├── join04.sql │ │ │ │ ├── join05.sql │ │ │ │ ├── join06.sql │ │ │ │ ├── join07.sql │ │ │ │ ├── join08.sql │ │ │ │ ├── join09.sql │ │ │ │ ├── join10.sql │ │ │ │ ├── join11.sql │ │ │ │ ├── join12.sql │ │ │ │ ├── join13.sql │ │ │ │ ├── join14.sql │ │ │ │ ├── join15.sql │ │ │ │ ├── join16.sql │ │ │ │ ├── join17.sql │ │ │ │ ├── join18.sql │ │ │ │ ├── join19.sql │ │ │ │ ├── join20.sql │ │ │ │ ├── join21.sql │ │ │ │ ├── join22.sql │ │ │ │ ├── join23.sql │ │ │ │ ├── json_query.sql │ │ │ │ ├── json_query.sql.tree │ │ │ │ ├── json_sql.sql │ │ │ │ ├── keywordasidentifier01.sql │ │ │ │ ├── keywordasidentifier02.sql │ │ │ │ ├── keywordasidentifier03.sql │ │ │ │ ├── keywordasidentifier04.sql │ │ │ │ ├── keywordasidentifier05.sql │ │ │ │ ├── keywordasidentifier06.sql │ │ │ │ ├── least_greatest.sql │ │ │ │ ├── lexer01.sql │ │ │ │ ├── lexer02.sql │ │ │ │ ├── lexer02.sql.tree │ │ │ │ ├── lexer03.sql │ │ │ │ ├── lexer04.sql │ │ │ │ ├── lexer05.sql │ │ │ │ ├── like01.sql │ │ │ │ ├── lob-item.sql │ │ │ │ ├── lob-item.sql.tree │ │ │ │ ├── materialized_views.sql │ │ │ │ ├── max_001.sql │ │ │ │ ├── merge01.sql │ │ │ │ ├── merge02.sql │ │ │ │ ├── merge03.sql │ │ │ │ ├── merge04.sql │ │ │ │ ├── merge05.sql │ │ │ │ ├── model_clause01.sql │ │ │ │ ├── model_clause02.sql │ │ │ │ ├── model_clause03.sql │ │ │ │ ├── model_clause04.sql │ │ │ │ ├── model_clause05.sql │ │ │ │ ├── multiset_operators.sql │ │ │ │ ├── noaudit_statement.sql │ │ │ │ ├── numbers01.sql │ │ │ │ ├── nvl_001.sql │ │ │ │ ├── object_access01.sql │ │ │ │ ├── object_access_expressions.sql │ │ │ │ ├── offset_clause.sql │ │ │ │ ├── order_by01.sql │ │ │ │ ├── order_by02.sql │ │ │ │ ├── order_by03.sql │ │ │ │ ├── order_by04.sql │ │ │ │ ├── order_by05.sql │ │ │ │ ├── order_by06.sql │ │ │ │ ├── package_body.sql │ │ │ │ ├── package_body.sql.tree │ │ │ │ ├── packagebody_function.sql │ │ │ │ ├── packagespec_function.sql │ │ │ │ ├── partitioned_tables.sql │ │ │ │ ├── pivot01.sql │ │ │ │ ├── pivot02.sql │ │ │ │ ├── pivot03.sql │ │ │ │ ├── pivot04.sql │ │ │ │ ├── pivot05.sql │ │ │ │ ├── pivot06.sql │ │ │ │ ├── pivot07.sql │ │ │ │ ├── pivot08.sql │ │ │ │ ├── pivot09.sql │ │ │ │ ├── pivot10.sql │ │ │ │ ├── pivot11.sql │ │ │ │ ├── pivot12.sql │ │ │ │ ├── pivot13.sql │ │ │ │ ├── purge_statement.sql │ │ │ │ ├── query_factoring01.sql │ │ │ │ ├── query_factoring02.sql │ │ │ │ ├── query_factoring03.sql │ │ │ │ ├── query_factoring04.sql │ │ │ │ ├── query_factoring05.sql │ │ │ │ ├── query_factoring06.sql │ │ │ │ ├── query_factoring08.sql │ │ │ │ ├── query_factoring09.sql │ │ │ │ ├── query_factoring10.sql │ │ │ │ ├── query_factoring11.sql │ │ │ │ ├── quntitative_expression.sql │ │ │ │ ├── rename_objects.sql │ │ │ │ ├── revoke_statement.sql │ │ │ │ ├── round_001.sql │ │ │ │ ├── round_decode_001.sql │ │ │ │ ├── row_number_001.sql │ │ │ │ ├── sample01.sql │ │ │ │ ├── select_all_some_any.sql │ │ │ │ ├── select_analytic_view.sql │ │ │ │ ├── select_cte.sql │ │ │ │ ├── select_dense_rank.sql │ │ │ │ ├── select_flashback_query.sql │ │ │ │ ├── select_hierarchical_query.sql │ │ │ │ ├── select_package_function.sql │ │ │ │ ├── select_time.sql │ │ │ │ ├── select_without_from.sql │ │ │ │ ├── seq_token_error.sql │ │ │ │ ├── simple02.sql │ │ │ │ ├── simple03.sql │ │ │ │ ├── simple04.sql │ │ │ │ ├── simple05.sql │ │ │ │ ├── simple06.sql │ │ │ │ ├── simple07.sql │ │ │ │ ├── simple08.sql │ │ │ │ ├── simple09.sql │ │ │ │ ├── simple10.sql │ │ │ │ ├── simple11.sql │ │ │ │ ├── simple12.sql │ │ │ │ ├── simple13.sql │ │ │ │ ├── single_statement.sql │ │ │ │ ├── string01.sql │ │ │ │ ├── timing.sql │ │ │ │ ├── timing.sql.tree │ │ │ │ ├── to_binary_double.sql │ │ │ │ ├── to_binary_float.sql │ │ │ │ ├── to_char.sql │ │ │ │ ├── to_char_001.sql │ │ │ │ ├── to_char_002.sql │ │ │ │ ├── to_date.sql │ │ │ │ ├── to_dsinterval.sql │ │ │ │ ├── to_number.sql │ │ │ │ ├── to_timestamp.sql │ │ │ │ ├── to_timestamp_tz.sql │ │ │ │ ├── to_yminterval.sql │ │ │ │ ├── truncate_cluster.sql │ │ │ │ ├── truncate_table.sql │ │ │ │ ├── unified.sql │ │ │ │ ├── union01.sql │ │ │ │ ├── union02.sql │ │ │ │ ├── union03.sql │ │ │ │ ├── union04.sql │ │ │ │ ├── union05.sql │ │ │ │ ├── union06.sql │ │ │ │ ├── union07.sql │ │ │ │ ├── union08.sql │ │ │ │ ├── union09.sql │ │ │ │ ├── union10.sql │ │ │ │ ├── validate_conversion.sql │ │ │ │ ├── values_clause.sql │ │ │ │ ├── varray_type_def.sql │ │ │ │ ├── views.sql │ │ │ │ ├── whenever_sqlerror.sql │ │ │ │ ├── whenever_sqlerror.sql.tree │ │ │ │ ├── xml_function.sql │ │ │ │ ├── xmltable01.sql │ │ │ │ ├── xmltable02.sql │ │ │ │ └── xmltable03.sql │ │ │ ├── examples-sql-script/ │ │ │ │ ├── anonymous_block.sql │ │ │ │ ├── cursor-attributes-with-spaces.sql │ │ │ │ ├── declare_procedure_no_args.sql │ │ │ │ ├── delete_as_regular_id.pkb │ │ │ │ ├── deterministic_function.pks │ │ │ │ ├── e_in_out_parameters.pks │ │ │ │ ├── grants.sql │ │ │ │ ├── green_run.sql │ │ │ │ ├── green_table.sql │ │ │ │ ├── green_tools.pkb │ │ │ │ ├── green_tools.pks │ │ │ │ ├── green_tools_review.sql │ │ │ │ ├── in_out_parameters.pks │ │ │ │ ├── key_word_as_param.pkb │ │ │ │ ├── logical_expressions.sql │ │ │ │ ├── package_body_null.pkb │ │ │ │ ├── package_with_cursor.sql │ │ │ │ ├── package_with_schema.pkb │ │ │ │ ├── package_with_schema.pks │ │ │ │ ├── package_with_simple_init_block.pkb │ │ │ │ ├── pipe_row.pkb │ │ │ │ ├── pltables.sql │ │ │ │ ├── pragma_autonomous_transaction.sql │ │ │ │ ├── pragma_exception_init.pkb │ │ │ │ ├── pragma_exception_init.pks │ │ │ │ ├── proc_over_dblink_as_nvl_param.pkb │ │ │ │ ├── procedure_with_cursor_and_limit.sql │ │ │ │ ├── result_cache_function.pks │ │ │ │ ├── select_into.sql │ │ │ │ ├── show_errors.pks │ │ │ │ ├── substr_as_regular_id.pkb │ │ │ │ ├── synonym_with_database_link.sql │ │ │ │ ├── trigger_examples.sql │ │ │ │ ├── type_body_elements.sql │ │ │ │ ├── user.sql │ │ │ │ └── with_clause_in_exists_block_in_procedure.sql │ │ │ ├── hw-examples/ │ │ │ │ ├── alter_operator.sql │ │ │ │ ├── alter_outline.sql │ │ │ │ ├── drop_operator.sql │ │ │ │ ├── keywordasidentifier02.sql │ │ │ │ ├── lexer01.sql │ │ │ │ ├── lexer02.sql │ │ │ │ ├── lexer03.sql │ │ │ │ ├── lexer04.sql │ │ │ │ ├── lexer05.sql │ │ │ │ ├── simple11.sql │ │ │ │ └── truncate_table.sql │ │ │ └── long-running/ │ │ │ ├── aggregate01.sql │ │ │ ├── cast_multiset07.sql │ │ │ ├── datetime02.sql │ │ │ ├── order_by07.sql │ │ │ └── query_factoring07.sql │ │ └── oracle-database_23/ │ │ ├── adjsn/ │ │ │ ├── adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-0.sql │ │ │ ├── adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-1.sql │ │ │ ├── adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-2.sql │ │ │ ├── adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-3.sql │ │ │ ├── adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-4.sql │ │ │ ├── adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-5.sql │ │ │ ├── change-triggers-data-guide-enabled-search-index-0.sql │ │ │ ├── change-triggers-data-guide-enabled-search-index-1.sql │ │ │ ├── columns-clause-sql-json-function-json_table-3.sql │ │ │ ├── creating-b-tree-indexes-json_value-0.sql │ │ │ ├── creating-b-tree-indexes-json_value-1.sql │ │ │ ├── creating-b-tree-indexes-json_value-2.sql │ │ │ ├── creating-b-tree-indexes-json_value-3.sql │ │ │ ├── creating-bitmap-indexes-json_value-0.sql │ │ │ ├── creating-multivalue-function-based-indexes-json_exists-0.sql │ │ │ ├── creating-multivalue-function-based-indexes-json_exists-1.sql │ │ │ ├── creating-multivalue-function-based-indexes-json_exists-2.sql │ │ │ ├── creating-view-json-data-based-data-guide-information-2.sql │ │ │ ├── creating-view-json-data-based-data-guide-information-3.sql │ │ │ ├── creating-view-json-data-using-json_table-0.sql │ │ │ ├── creating-view-json-data-using-json_table-1.sql │ │ │ ├── data-type-considerations-json_value-indexing-and-querying-0.sql │ │ │ ├── data-type-considerations-json_value-indexing-and-querying-1.sql │ │ │ ├── data-type-considerations-json_value-indexing-and-querying-2.sql │ │ │ ├── error-clause-sql-query-functions-and-conditions-0.sql │ │ │ ├── error-clause-sql-query-functions-and-conditions-1.sql │ │ │ ├── error-clause-sql-query-functions-and-conditions-3.sql │ │ │ ├── handling-dependent-objects-0.sql │ │ │ ├── handling-dependent-objects-1.sql │ │ │ ├── handling-dependent-objects-2.sql │ │ │ ├── handling-input-values-sql-json-generation-functions-0.sql │ │ │ ├── handling-input-values-sql-json-generation-functions-1.sql │ │ │ ├── handling-input-values-sql-json-generation-functions-2.sql │ │ │ ├── indexing-multiple-json-fields-using-composite-b-tree-index-1.sql │ │ │ ├── json-collections-2.sql │ │ │ ├── json-collections-3.sql │ │ │ ├── json-collections-4.sql │ │ │ ├── json-data-type-2.sql │ │ │ ├── json-data-type-3.sql │ │ │ ├── json-data-type-4.sql │ │ │ ├── json-data-type-5.sql │ │ │ ├── json-data-type-6.sql │ │ │ ├── json-data-type-7.sql │ │ │ ├── json-data-type-8.sql │ │ │ ├── json-data-type-9.sql │ │ │ ├── json-query-rewrite-use-materialized-view-json_table-0.sql │ │ │ ├── json-query-rewrite-use-materialized-view-json_table-2.sql │ │ │ ├── json-schema-1.sql │ │ │ ├── json-schema-10.sql │ │ │ ├── json-schema-11.sql │ │ │ ├── json-schema-13.sql │ │ │ ├── json-schema-14.sql │ │ │ ├── json-schema-16.sql │ │ │ ├── json-schema-18.sql │ │ │ ├── json-schema-2.sql │ │ │ ├── json-schema-22.sql │ │ │ ├── json-schema-24.sql │ │ │ ├── json-schema-25.sql │ │ │ ├── json-schema-3.sql │ │ │ ├── json-schema-4.sql │ │ │ ├── json-schema-5.sql │ │ │ ├── json-schema-7.sql │ │ │ ├── json-schema-9.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-0.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-1.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-10.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-2.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-3.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-5.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-6.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-7.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-8.sql │ │ │ ├── json-search-index-ad-hoc-queries-and-full-text-search-9.sql │ │ │ ├── json_table-generalizes-sql-json-query-functions-and-conditions-0.sql │ │ │ ├── json_table-generalizes-sql-json-query-functions-and-conditions-1.sql │ │ │ ├── json_transform-operation-handlers-0.sql │ │ │ ├── json_transform-operation-handlers-1.sql │ │ │ ├── json_transform-operation-handlers-2.sql │ │ │ ├── json_transform-operation-handlers-3.sql │ │ │ ├── json_transform-operation-handlers-4.sql │ │ │ ├── json_transform-operation-handlers-5.sql │ │ │ ├── json_transform-operation-handlers-6.sql │ │ │ ├── json_transform-operator-0.sql │ │ │ ├── json_transform-operator-append-0.sql │ │ │ ├── json_transform-operator-append-2.sql │ │ │ ├── json_transform-operator-append-3.sql │ │ │ ├── json_transform-operator-append-5.sql │ │ │ ├── json_transform-operator-copy-0.sql │ │ │ ├── json_transform-operator-insert-0.sql │ │ │ ├── json_transform-operator-insert-1.sql │ │ │ ├── json_transform-operator-insert-2.sql │ │ │ ├── json_transform-operator-intersect-0.sql │ │ │ ├── json_transform-operator-intersect-1.sql │ │ │ ├── json_transform-operator-keep-0.sql │ │ │ ├── json_transform-operator-keep-1.sql │ │ │ ├── json_transform-operator-merge-0.sql │ │ │ ├── json_transform-operator-nested-path-3.sql │ │ │ ├── json_transform-operator-prepend-0.sql │ │ │ ├── json_transform-operator-prepend-1.sql │ │ │ ├── json_transform-operator-prepend-3.sql │ │ │ ├── json_transform-operator-remove-0.sql │ │ │ ├── json_transform-operator-rename-0.sql │ │ │ ├── json_transform-operator-replace-0.sql │ │ │ ├── json_transform-operator-set-0.sql │ │ │ ├── json_transform-operator-set-1.sql │ │ │ ├── json_transform-operator-set-2.sql │ │ │ ├── json_transform-operator-set-4.sql │ │ │ ├── json_transform-operator-set-5.sql │ │ │ ├── json_transform-operator-set-6.sql │ │ │ ├── json_transform-operator-set-7.sql │ │ │ ├── json_transform-operator-sort-0.sql │ │ │ ├── json_transform-operator-sort-3.sql │ │ │ ├── json_transform-operator-union-0.sql │ │ │ ├── json_transform-right-hand-side-rhs-path-expressions-0.sql │ │ │ ├── json_transform-right-hand-side-rhs-path-expressions-1.sql │ │ │ ├── json_transform-right-hand-side-rhs-path-expressions-2.sql │ │ │ ├── json_transform-right-hand-side-rhs-path-expressions-4.sql │ │ │ ├── json_transform-right-hand-side-rhs-path-expressions-5.sql │ │ │ ├── json_transform-right-hand-side-rhs-path-expressions-9.sql │ │ │ ├── loading-external-json-data-0.sql │ │ │ ├── loading-external-json-data-1.sql │ │ │ ├── loading-external-json-data-2.sql │ │ │ ├── loading-external-json-data-3.sql │ │ │ ├── loading-external-json-data-4.sql │ │ │ ├── mismatch-clause-sql-json-query-functions-0.sql │ │ │ ├── mismatch-clause-sql-json-query-functions-1.sql │ │ │ ├── mismatch-clause-sql-json-query-functions-2.sql │ │ │ ├── mismatch-clause-sql-json-query-functions-3.sql │ │ │ ├── multiple-data-guides-document-set-0.sql │ │ │ ├── multiple-data-guides-document-set-1.sql │ │ │ ├── multiple-data-guides-document-set-2.sql │ │ │ ├── oracle-sql-condition-json_textcontains-0.sql │ │ │ ├── oracle-sql-condition-json_textcontains-1.sql │ │ │ ├── oracle-sql-function-json_mergepatch-2.sql │ │ │ ├── oracle-sql-function-json_mergepatch-3.sql │ │ │ ├── oracle-sql-function-json_transform-0.sql │ │ │ ├── oracle-sql-function-json_transform-1.sql │ │ │ ├── oracle-sql-function-json_transform-4.sql │ │ │ ├── overview-json-generation-0.sql │ │ │ ├── overview-json-generation-2.sql │ │ │ ├── overview-json-generation-3.sql │ │ │ ├── overview-json-oracle-database-0.sql │ │ │ ├── overview-memory-json-data-0.sql │ │ │ ├── partitioning-json-data-0.sql │ │ │ ├── partitioning-json-data-1.sql │ │ │ ├── passing-clause-sql-functions-and-conditions-0.sql │ │ │ ├── passing-clause-sql-functions-and-conditions-1.sql │ │ │ ├── performing-migration-check-1.sql │ │ │ ├── persistent-data-guide-information-part-json-search-index-0.sql │ │ │ ├── persistent-data-guide-information-part-json-search-index-1.sql │ │ │ ├── persistent-data-guide-information-part-json-search-index-2.sql │ │ │ ├── persistent-data-guide-information-part-json-search-index-3.sql │ │ │ ├── populate-json-type-column-querying-textual-json-0.sql │ │ │ ├── populate-json-type-column-querying-textual-json-1.sql │ │ │ ├── populate-json-type-column-querying-textual-json-2.sql │ │ │ ├── populating-json-data-memory-column-store-0.sql │ │ │ ├── populating-json-data-memory-column-store-1.sql │ │ │ ├── querying-data-guide-0.sql │ │ │ ├── querying-data-guide-1.sql │ │ │ ├── read-only-views-based-json-generation-0.sql │ │ │ ├── read-only-views-based-json-generation-1.sql │ │ │ ├── read-only-views-based-json-generation-2.sql │ │ │ ├── simple-dot-notation-access-json-data-0.sql │ │ │ ├── simple-dot-notation-access-json-data-1.sql │ │ │ ├── simple-dot-notation-access-json-data-2.sql │ │ │ ├── simple-dot-notation-access-json-data-3.sql │ │ │ ├── simple-dot-notation-access-json-data-4.sql │ │ │ ├── simple-dot-notation-access-json-data-5.sql │ │ │ ├── simple-dot-notation-access-json-data-6.sql │ │ │ ├── simple-dot-notation-access-json-data-7.sql │ │ │ ├── simple-dot-notation-access-json-data-8.sql │ │ │ ├── specifying-preferred-name-field-column-0.sql │ │ │ ├── sql-json-condition-json_exists-0.sql │ │ │ ├── sql-json-condition-json_exists-1.sql │ │ │ ├── sql-json-conditions-is-json-and-is-not-json-6.sql │ │ │ ├── sql-json-function-json_array-0.sql │ │ │ ├── sql-json-function-json_array-1.sql │ │ │ ├── sql-json-function-json_array-3.sql │ │ │ ├── sql-json-function-json_arrayagg-0.sql │ │ │ ├── sql-json-function-json_arrayagg-1.sql │ │ │ ├── sql-json-function-json_object-0.sql │ │ │ ├── sql-json-function-json_object-10.sql │ │ │ ├── sql-json-function-json_object-11.sql │ │ │ ├── sql-json-function-json_object-13.sql │ │ │ ├── sql-json-function-json_object-14.sql │ │ │ ├── sql-json-function-json_object-16.sql │ │ │ ├── sql-json-function-json_object-18.sql │ │ │ ├── sql-json-function-json_object-19.sql │ │ │ ├── sql-json-function-json_object-21.sql │ │ │ ├── sql-json-function-json_object-7.sql │ │ │ ├── sql-json-function-json_object-8.sql │ │ │ ├── sql-json-function-json_objectagg-0.sql │ │ │ ├── sql-json-function-json_query-0.sql │ │ │ ├── sql-json-function-json_query-1.sql │ │ │ ├── sql-json-function-json_table-2.sql │ │ │ ├── sql-json-function-json_table-3.sql │ │ │ ├── sql-json-path-expression-item-methods-0.sql │ │ │ ├── sql-json-path-expression-item-methods-1.sql │ │ │ ├── sql-json-path-expression-item-methods-2.sql │ │ │ ├── sql-json-path-expression-item-methods-3.sql │ │ │ ├── sql-json-path-expression-item-methods-4.sql │ │ │ ├── sql-json-path-expression-item-methods-5.sql │ │ │ ├── sql-json-path-expression-item-methods-6.sql │ │ │ ├── sql-json-path-expression-syntax-2.sql │ │ │ ├── sql-json-path-expression-syntax-4.sql │ │ │ ├── sql-json-path-expression-syntax-7.sql │ │ │ ├── sql-nested-clause-instead-json_table-2.sql │ │ │ ├── sql-nested-clause-instead-json_table-4.sql │ │ │ ├── tables-json-columns-0.sql │ │ │ ├── tables-json-columns-1.sql │ │ │ ├── tables-json-columns-2.sql │ │ │ ├── tables-json-columns-3.sql │ │ │ ├── type-clause-sql-functions-and-conditions-0.sql │ │ │ ├── type-clause-sql-functions-and-conditions-1.sql │ │ │ ├── type-clause-sql-functions-and-conditions-2.sql │ │ │ ├── type-clause-sql-functions-and-conditions-3.sql │ │ │ ├── type-clause-sql-functions-and-conditions-4.sql │ │ │ ├── type-clause-sql-functions-and-conditions-5.sql │ │ │ ├── type-clause-sql-functions-and-conditions-6.sql │ │ │ ├── types-filter-condition-comparisons-0.sql │ │ │ ├── use-bind-variables-json_transform-0.sql │ │ │ ├── use-bind-variables-json_transform-1.sql │ │ │ ├── use-bind-variables-json_transform-2.sql │ │ │ ├── using-filters-json_exists-0.sql │ │ │ ├── using-filters-json_exists-1.sql │ │ │ ├── using-filters-json_exists-2.sql │ │ │ ├── using-filters-json_exists-3.sql │ │ │ ├── using-filters-json_exists-4.sql │ │ │ ├── using-geojson-geographic-data-0.sql │ │ │ ├── using-geojson-geographic-data-1.sql │ │ │ ├── using-geojson-geographic-data-3.sql │ │ │ ├── using-geojson-geographic-data-5.sql │ │ │ ├── using-geojson-geographic-data-6.sql │ │ │ ├── using-json_table-json-arrays-0.sql │ │ │ ├── using-json_table-json-arrays-1.sql │ │ │ ├── using-json_table-json-arrays-2.sql │ │ │ ├── using-json_table-json-arrays-4.sql │ │ │ ├── using-json_value-function-based-index-json_exists-queries-0.sql │ │ │ ├── using-json_value-function-based-index-json_exists-queries-1.sql │ │ │ ├── using-json_value-function-based-index-json_exists-queries-2.sql │ │ │ ├── using-json_value-function-based-index-json_exists-queries-3.sql │ │ │ ├── using-json_value-function-based-index-json_table-queries-0.sql │ │ │ ├── using-multivalue-function-based-index-0.sql │ │ │ ├── using-multivalue-function-based-index-1.sql │ │ │ ├── using-multivalue-function-based-index-2.sql │ │ │ ├── using-multivalue-function-based-index-3.sql │ │ │ ├── using-online-redefinition-migrate-json-data-type-0.sql │ │ │ ├── using-online-redefinition-migrate-json-data-type-1.sql │ │ │ ├── using-online-redefinition-migrate-json-data-type-2.sql │ │ │ ├── using-online-redefinition-migrate-json-data-type-3.sql │ │ │ ├── using-online-redefinition-migrate-json-data-type-4.sql │ │ │ ├── using-online-redefinition-migrate-json-data-type-7.sql │ │ │ ├── using-oracle-data-pump-migrate-json-data-type-0.sql │ │ │ ├── using-pl-sql-object-types-json-0.sql │ │ │ ├── using-pl-sql-object-types-json-1.sql │ │ │ ├── using-pl-sql-object-types-json-2.sql │ │ │ ├── using-sql-json-function-json_value-boolean-json-value-0.sql │ │ │ ├── using-sql-json-function-json_value-boolean-json-value-1.sql │ │ │ └── using-sql-json-function-json_value-boolean-json-value-3.sql │ │ ├── lnpls/ │ │ │ ├── ALTER-FUNCTION-statement-0.sql │ │ │ ├── ALTER-LIBRARY-statement-0.sql │ │ │ ├── ALTER-PACKAGE-statement-0.sql │ │ │ ├── ALTER-PACKAGE-statement-1.sql │ │ │ ├── ALTER-PROCEDURE-statement-0.sql │ │ │ ├── ALTER-TRIGGER-statement-0.sql │ │ │ ├── ALTER-TRIGGER-statement-1.sql │ │ │ ├── ALTER-TYPE-statement-0.sql │ │ │ ├── ALTER-TYPE-statement-1.sql │ │ │ ├── ALTER-TYPE-statement-10.sql │ │ │ ├── ALTER-TYPE-statement-11.sql │ │ │ ├── ALTER-TYPE-statement-12.sql │ │ │ ├── ALTER-TYPE-statement-13.sql │ │ │ ├── ALTER-TYPE-statement-14.sql │ │ │ ├── ALTER-TYPE-statement-2.sql │ │ │ ├── ALTER-TYPE-statement-3.sql │ │ │ ├── ALTER-TYPE-statement-4.sql │ │ │ ├── ALTER-TYPE-statement-5.sql │ │ │ ├── ALTER-TYPE-statement-6.sql │ │ │ ├── ALTER-TYPE-statement-7.sql │ │ │ ├── ALTER-TYPE-statement-8.sql │ │ │ ├── ALTER-TYPE-statement-9.sql │ │ │ ├── CONTINUE-statement-0.sql │ │ │ ├── CONTINUE-statement-2.sql │ │ │ ├── COVERAGE-pragma-3.sql │ │ │ ├── CREATE-FUNCTION-statement-0.sql │ │ │ ├── CREATE-FUNCTION-statement-1.sql │ │ │ ├── CREATE-FUNCTION-statement-2.sql │ │ │ ├── CREATE-FUNCTION-statement-3.sql │ │ │ ├── CREATE-FUNCTION-statement-4.sql │ │ │ ├── CREATE-FUNCTION-statement-5.sql │ │ │ ├── CREATE-FUNCTION-statement-6.sql │ │ │ ├── CREATE-FUNCTION-statement-7.sql │ │ │ ├── CREATE-FUNCTION-statement-8.sql │ │ │ ├── CREATE-LIBRARY-statement-0.sql │ │ │ ├── CREATE-LIBRARY-statement-1.sql │ │ │ ├── CREATE-LIBRARY-statement-2.sql │ │ │ ├── CREATE-LIBRARY-statement-3.sql │ │ │ ├── CREATE-LIBRARY-statement-4.sql │ │ │ ├── CREATE-PACKAGE-BODY-statement-0.sql │ │ │ ├── CREATE-PACKAGE-statement-0.sql │ │ │ ├── CREATE-PROCEDURE-statement-0.sql │ │ │ ├── CREATE-PROCEDURE-statement-1.sql │ │ │ ├── CREATE-PROCEDURE-statement-2.sql │ │ │ ├── CREATE-PROCEDURE-statement-3.sql │ │ │ ├── CREATE-PROCEDURE-statement-5.sql │ │ │ ├── CREATE-PROCEDURE-statement-6.sql │ │ │ ├── CREATE-TYPE-statement-0.sql │ │ │ ├── CREATE-TYPE-statement-1.sql │ │ │ ├── CREATE-TYPE-statement-10.sql │ │ │ ├── CREATE-TYPE-statement-11.sql │ │ │ ├── CREATE-TYPE-statement-12.sql │ │ │ ├── CREATE-TYPE-statement-13.sql │ │ │ ├── CREATE-TYPE-statement-15.sql │ │ │ ├── CREATE-TYPE-statement-16.sql │ │ │ ├── CREATE-TYPE-statement-17.sql │ │ │ ├── CREATE-TYPE-statement-2.sql │ │ │ ├── CREATE-TYPE-statement-3.sql │ │ │ ├── CREATE-TYPE-statement-4.sql │ │ │ ├── CREATE-TYPE-statement-6.sql │ │ │ ├── CREATE-TYPE-statement-7.sql │ │ │ ├── CREATE-TYPE-statement-8.sql │ │ │ ├── CREATE-TYPE-statement-9.sql │ │ │ ├── DEPRECATE-pragma-0.sql │ │ │ ├── DEPRECATE-pragma-1.sql │ │ │ ├── DEPRECATE-pragma-10.sql │ │ │ ├── DEPRECATE-pragma-13.sql │ │ │ ├── DEPRECATE-pragma-18.sql │ │ │ ├── DEPRECATE-pragma-3.sql │ │ │ ├── DEPRECATE-pragma-32.sql │ │ │ ├── DEPRECATE-pragma-34.sql │ │ │ ├── DEPRECATE-pragma-6.sql │ │ │ ├── DEPRECATE-pragma-8.sql │ │ │ ├── DROP-FUNCTION-statement-0.sql │ │ │ ├── DROP-LIBRARY-statement-0.sql │ │ │ ├── DROP-PACKAGE-statement-0.sql │ │ │ ├── DROP-PROCEDURE-statement-0.sql │ │ │ ├── DROP-TRIGGER-statement-0.sql │ │ │ ├── DROP-TYPE-BODY-statement-0.sql │ │ │ ├── DROP-TYPE-statement-0.sql │ │ │ ├── EXECUTE-IMMEDIATE-statement-0.sql │ │ │ ├── EXIT-statement-0.sql │ │ │ ├── EXIT-statement-2.sql │ │ │ ├── FOR-LOOP-statement-0.sql │ │ │ ├── FOR-LOOP-statement-1.sql │ │ │ ├── FOR-LOOP-statement-2.sql │ │ │ ├── GOTO-statement-0.sql │ │ │ ├── GOTO-statement-4.sql │ │ │ ├── GOTO-statement-5.sql │ │ │ ├── GOTO-statement-7.sql │ │ │ ├── PIPELINED-clause-1.sql │ │ │ ├── SQLERRM-function-1.sql │ │ │ ├── SQLERRM-function-4.sql │ │ │ ├── SQL_MACRO-clause-1.sql │ │ │ ├── SQL_MACRO-clause-11.sql │ │ │ ├── SQL_MACRO-clause-13.sql │ │ │ ├── SQL_MACRO-clause-14.sql │ │ │ ├── SQL_MACRO-clause-16.sql │ │ │ ├── SQL_MACRO-clause-17.sql │ │ │ ├── SQL_MACRO-clause-19.sql │ │ │ ├── SQL_MACRO-clause-2.sql │ │ │ ├── SQL_MACRO-clause-20.sql │ │ │ ├── SQL_MACRO-clause-22.sql │ │ │ ├── SQL_MACRO-clause-24.sql │ │ │ ├── SQL_MACRO-clause-25.sql │ │ │ ├── SQL_MACRO-clause-27.sql │ │ │ ├── SQL_MACRO-clause-29.sql │ │ │ ├── SQL_MACRO-clause-3.sql │ │ │ ├── SQL_MACRO-clause-31.sql │ │ │ ├── SQL_MACRO-clause-4.sql │ │ │ ├── SQL_MACRO-clause-5.sql │ │ │ ├── SQL_MACRO-clause-6.sql │ │ │ ├── SQL_MACRO-clause-7.sql │ │ │ ├── SQL_MACRO-clause-9.sql │ │ │ ├── Supresses-warning-pragma-6009-0.sql │ │ │ ├── Supresses-warning-pragma-6009-1.sql │ │ │ ├── Supresses-warning-pragma-6009-10.sql │ │ │ ├── Supresses-warning-pragma-6009-11.sql │ │ │ ├── Supresses-warning-pragma-6009-2.sql │ │ │ ├── Supresses-warning-pragma-6009-3.sql │ │ │ ├── Supresses-warning-pragma-6009-4.sql │ │ │ ├── Supresses-warning-pragma-6009-5.sql │ │ │ ├── Supresses-warning-pragma-6009-6.sql │ │ │ ├── Supresses-warning-pragma-6009-7.sql │ │ │ ├── Supresses-warning-pragma-6009-8.sql │ │ │ ├── Supresses-warning-pragma-6009-9.sql │ │ │ ├── WHILE-LOOP-statement-0.sql │ │ │ ├── assigning-values-collection-variables-0.sql │ │ │ ├── assigning-values-collection-variables-2.sql │ │ │ ├── assigning-values-collection-variables-4.sql │ │ │ ├── assigning-values-record-variables-1.sql │ │ │ ├── assigning-values-record-variables-10.sql │ │ │ ├── assigning-values-record-variables-12.sql │ │ │ ├── assigning-values-record-variables-13.sql │ │ │ ├── assigning-values-record-variables-15.sql │ │ │ ├── assigning-values-record-variables-17.sql │ │ │ ├── assigning-values-record-variables-3.sql │ │ │ ├── assigning-values-record-variables-5.sql │ │ │ ├── assigning-values-record-variables-7.sql │ │ │ ├── assigning-values-record-variables-9.sql │ │ │ ├── assigning-values-variables-1.sql │ │ │ ├── assigning-values-variables-3.sql │ │ │ ├── assigning-values-variables-5.sql │ │ │ ├── assigning-values-variables-7.sql │ │ │ ├── autonomous-transactions-0.sql │ │ │ ├── autonomous-transactions-1.sql │ │ │ ├── autonomous-transactions-2.sql │ │ │ ├── autonomous-transactions-3.sql │ │ │ ├── autonomous-transactions-4.sql │ │ │ ├── autonomous-transactions-6.sql │ │ │ ├── autonomous-transactions-7.sql │ │ │ ├── autonomous-transactions-9.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-0.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-10.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-2.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-3.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-4.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-5.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-6.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-7.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-8.sql │ │ │ ├── avoiding-inner-capture-select-and-dml-statements-9.sql │ │ │ ├── basic-LOOP-statement-0.sql │ │ │ ├── basic-LOOP-statement-2.sql │ │ │ ├── bulk-sql-and-bulk-binding-0.sql │ │ │ ├── bulk-sql-and-bulk-binding-1.sql │ │ │ ├── bulk-sql-and-bulk-binding-10.sql │ │ │ ├── bulk-sql-and-bulk-binding-12.sql │ │ │ ├── bulk-sql-and-bulk-binding-14.sql │ │ │ ├── bulk-sql-and-bulk-binding-15.sql │ │ │ ├── bulk-sql-and-bulk-binding-17.sql │ │ │ ├── bulk-sql-and-bulk-binding-19.sql │ │ │ ├── bulk-sql-and-bulk-binding-2.sql │ │ │ ├── bulk-sql-and-bulk-binding-22.sql │ │ │ ├── bulk-sql-and-bulk-binding-24.sql │ │ │ ├── bulk-sql-and-bulk-binding-26.sql │ │ │ ├── bulk-sql-and-bulk-binding-28.sql │ │ │ ├── bulk-sql-and-bulk-binding-3.sql │ │ │ ├── bulk-sql-and-bulk-binding-30.sql │ │ │ ├── bulk-sql-and-bulk-binding-32.sql │ │ │ ├── bulk-sql-and-bulk-binding-34.sql │ │ │ ├── bulk-sql-and-bulk-binding-37.sql │ │ │ ├── bulk-sql-and-bulk-binding-38.sql │ │ │ ├── bulk-sql-and-bulk-binding-40.sql │ │ │ ├── bulk-sql-and-bulk-binding-42.sql │ │ │ ├── bulk-sql-and-bulk-binding-43.sql │ │ │ ├── bulk-sql-and-bulk-binding-45.sql │ │ │ ├── bulk-sql-and-bulk-binding-47.sql │ │ │ ├── bulk-sql-and-bulk-binding-48.sql │ │ │ ├── bulk-sql-and-bulk-binding-5.sql │ │ │ ├── bulk-sql-and-bulk-binding-50.sql │ │ │ ├── bulk-sql-and-bulk-binding-52.sql │ │ │ ├── bulk-sql-and-bulk-binding-53.sql │ │ │ ├── bulk-sql-and-bulk-binding-55.sql │ │ │ ├── bulk-sql-and-bulk-binding-57.sql │ │ │ ├── bulk-sql-and-bulk-binding-59.sql │ │ │ ├── bulk-sql-and-bulk-binding-6.sql │ │ │ ├── bulk-sql-and-bulk-binding-61.sql │ │ │ ├── bulk-sql-and-bulk-binding-63.sql │ │ │ ├── bulk-sql-and-bulk-binding-65.sql │ │ │ ├── bulk-sql-and-bulk-binding-67.sql │ │ │ ├── bulk-sql-and-bulk-binding-8.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-0.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-1.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-10.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-12.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-13.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-14.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-16.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-17.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-18.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-2.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-21.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-23.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-3.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-4.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-6.sql │ │ │ ├── chaining-pipelined-table-functions-multiple-transformations-8.sql │ │ │ ├── collection-comparisons-0.sql │ │ │ ├── collection-comparisons-2.sql │ │ │ ├── collection-comparisons-4.sql │ │ │ ├── collection-methods-1.sql │ │ │ ├── collection-methods-11.sql │ │ │ ├── collection-methods-13.sql │ │ │ ├── collection-methods-15.sql │ │ │ ├── collection-methods-17.sql │ │ │ ├── collection-methods-19.sql │ │ │ ├── collection-methods-21.sql │ │ │ ├── collection-methods-23.sql │ │ │ ├── collection-methods-25.sql │ │ │ ├── collection-methods-27.sql │ │ │ ├── collection-methods-29.sql │ │ │ ├── collection-methods-3.sql │ │ │ ├── collection-methods-5.sql │ │ │ ├── collection-methods-7.sql │ │ │ ├── collection-methods-9.sql │ │ │ ├── collection-types-defined-package-specifications-0.sql │ │ │ ├── collection-types-defined-package-specifications-2.sql │ │ │ ├── column-name-precedence-0.sql │ │ │ ├── column-name-precedence-2.sql │ │ │ ├── column-name-precedence-4.sql │ │ │ ├── column-name-precedence-6.sql │ │ │ ├── compile-time-warnings-1.sql │ │ │ ├── compile-time-warnings-11.sql │ │ │ ├── compile-time-warnings-13.sql │ │ │ ├── compile-time-warnings-2.sql │ │ │ ├── compile-time-warnings-3.sql │ │ │ ├── compile-time-warnings-4.sql │ │ │ ├── compile-time-warnings-5.sql │ │ │ ├── compile-time-warnings-6.sql │ │ │ ├── compile-time-warnings-7.sql │ │ │ ├── compile-time-warnings-8.sql │ │ │ ├── compile-time-warnings-9.sql │ │ │ ├── compiling-pl-sql-units-native-execution-0.sql │ │ │ ├── compiling-pl-sql-units-native-execution-1.sql │ │ │ ├── compiling-pl-sql-units-native-execution-2.sql │ │ │ ├── compiling-pl-sql-units-native-execution-3.sql │ │ │ ├── compiling-pl-sql-units-native-execution-4.sql │ │ │ ├── compiling-pl-sql-units-native-execution-5.sql │ │ │ ├── conditional-compilation1-10.sql │ │ │ ├── conditional-compilation1-12.sql │ │ │ ├── conditional-compilation1-13.sql │ │ │ ├── conditional-compilation1-14.sql │ │ │ ├── conditional-compilation1-18.sql │ │ │ ├── conditional-compilation1-20.sql │ │ │ ├── conditional-compilation1-21.sql │ │ │ ├── conditional-compilation1-23.sql │ │ │ ├── conditional-compilation1-25.sql │ │ │ ├── conditional-selection-statements-10.sql │ │ │ ├── conditional-selection-statements-14.sql │ │ │ ├── conditional-selection-statements-16.sql │ │ │ ├── conditional-selection-statements-19.sql │ │ │ ├── conditional-selection-statements-21.sql │ │ │ ├── conditional-selection-statements-24.sql │ │ │ ├── conditional-selection-statements-26.sql │ │ │ ├── conditional-selection-statements-5.sql │ │ │ ├── conditional-selection-statements-8.sql │ │ │ ├── continuing-execution-handling-exceptions-0.sql │ │ │ ├── continuing-execution-handling-exceptions-2.sql │ │ │ ├── correlation-names-and-pseudorecords-11.sql │ │ │ ├── correlation-names-and-pseudorecords-13.sql │ │ │ ├── correlation-names-and-pseudorecords-15.sql │ │ │ ├── correlation-names-and-pseudorecords-16.sql │ │ │ ├── correlation-names-and-pseudorecords-17.sql │ │ │ ├── correlation-names-and-pseudorecords-19.sql │ │ │ ├── correlation-names-and-pseudorecords-2.sql │ │ │ ├── correlation-names-and-pseudorecords-20.sql │ │ │ ├── correlation-names-and-pseudorecords-22.sql │ │ │ ├── correlation-names-and-pseudorecords-3.sql │ │ │ ├── correlation-names-and-pseudorecords-4.sql │ │ │ ├── correlation-names-and-pseudorecords-6.sql │ │ │ ├── correlation-names-and-pseudorecords-8.sql │ │ │ ├── correlation-names-and-pseudorecords-9.sql │ │ │ ├── cursor-expressions-1.sql │ │ │ ├── cursor-variables-1.sql │ │ │ ├── cursor-variables-10.sql │ │ │ ├── cursor-variables-12.sql │ │ │ ├── cursor-variables-14.sql │ │ │ ├── cursor-variables-15.sql │ │ │ ├── cursor-variables-16.sql │ │ │ ├── cursor-variables-17.sql │ │ │ ├── cursor-variables-18.sql │ │ │ ├── cursor-variables-19.sql │ │ │ ├── cursor-variables-2.sql │ │ │ ├── cursor-variables-3.sql │ │ │ ├── cursor-variables-5.sql │ │ │ ├── cursor-variables-8.sql │ │ │ ├── cursors-overview-0.sql │ │ │ ├── cursors-overview-10.sql │ │ │ ├── cursors-overview-12.sql │ │ │ ├── cursors-overview-14.sql │ │ │ ├── cursors-overview-16.sql │ │ │ ├── cursors-overview-18.sql │ │ │ ├── cursors-overview-2.sql │ │ │ ├── cursors-overview-20.sql │ │ │ ├── cursors-overview-22.sql │ │ │ ├── cursors-overview-24.sql │ │ │ ├── cursors-overview-25.sql │ │ │ ├── cursors-overview-27.sql │ │ │ ├── cursors-overview-29.sql │ │ │ ├── cursors-overview-6.sql │ │ │ ├── cursors-overview-7.sql │ │ │ ├── cursors-overview-8.sql │ │ │ ├── dbms_sql-package-1.sql │ │ │ ├── dbms_sql-package-4.sql │ │ │ ├── dbms_sql-package-6.sql │ │ │ ├── dbms_sql-package-7.sql │ │ │ ├── declarations-0.sql │ │ │ ├── declarations-1.sql │ │ │ ├── declarations-11.sql │ │ │ ├── declarations-2.sql │ │ │ ├── declarations-3.sql │ │ │ ├── declarations-4.sql │ │ │ ├── declarations-5.sql │ │ │ ├── declarations-9.sql │ │ │ ├── description-static-sql-0.sql │ │ │ ├── description-static-sql-2.sql │ │ │ ├── dml-triggers-0.sql │ │ │ ├── dml-triggers-1.sql │ │ │ ├── dml-triggers-10.sql │ │ │ ├── dml-triggers-12.sql │ │ │ ├── dml-triggers-13.sql │ │ │ ├── dml-triggers-15.sql │ │ │ ├── dml-triggers-17.sql │ │ │ ├── dml-triggers-18.sql │ │ │ ├── dml-triggers-2.sql │ │ │ ├── dml-triggers-20.sql │ │ │ ├── dml-triggers-23.sql │ │ │ ├── dml-triggers-24.sql │ │ │ ├── dml-triggers-25.sql │ │ │ ├── dml-triggers-27.sql │ │ │ ├── dml-triggers-28.sql │ │ │ ├── dml-triggers-30.sql │ │ │ ├── dml-triggers-32.sql │ │ │ ├── dml-triggers-33.sql │ │ │ ├── dml-triggers-34.sql │ │ │ ├── dml-triggers-35.sql │ │ │ ├── dml-triggers-36.sql │ │ │ ├── dml-triggers-37.sql │ │ │ ├── dml-triggers-38.sql │ │ │ ├── dml-triggers-39.sql │ │ │ ├── dml-triggers-4.sql │ │ │ ├── dml-triggers-40.sql │ │ │ ├── dml-triggers-41.sql │ │ │ ├── dml-triggers-42.sql │ │ │ ├── dml-triggers-43.sql │ │ │ ├── dml-triggers-44.sql │ │ │ ├── dml-triggers-45.sql │ │ │ ├── dml-triggers-47.sql │ │ │ ├── dml-triggers-49.sql │ │ │ ├── dml-triggers-50.sql │ │ │ ├── dml-triggers-51.sql │ │ │ ├── dml-triggers-52.sql │ │ │ ├── dml-triggers-54.sql │ │ │ ├── dml-triggers-56.sql │ │ │ ├── dml-triggers-6.sql │ │ │ ├── dml-triggers-8.sql │ │ │ ├── exception-handling-triggers-0.sql │ │ │ ├── exception-handling-triggers-1.sql │ │ │ ├── exception-propagation-0.sql │ │ │ ├── exception-propagation-1.sql │ │ │ ├── exception-propagation-11.sql │ │ │ ├── exception-propagation-13.sql │ │ │ ├── exception-propagation-15.sql │ │ │ ├── exception-propagation-3.sql │ │ │ ├── exception-propagation-5.sql │ │ │ ├── exception-propagation-7.sql │ │ │ ├── exception-propagation-9.sql │ │ │ ├── expressions-0.sql │ │ │ ├── expressions-10.sql │ │ │ ├── expressions-12.sql │ │ │ ├── expressions-13.sql │ │ │ ├── expressions-15.sql │ │ │ ├── expressions-17.sql │ │ │ ├── expressions-19.sql │ │ │ ├── expressions-2.sql │ │ │ ├── expressions-21.sql │ │ │ ├── expressions-23.sql │ │ │ ├── expressions-24.sql │ │ │ ├── expressions-26.sql │ │ │ ├── expressions-28.sql │ │ │ ├── expressions-35.sql │ │ │ ├── expressions-37.sql │ │ │ ├── expressions-39.sql │ │ │ ├── expressions-4.sql │ │ │ ├── expressions-41.sql │ │ │ ├── expressions-43.sql │ │ │ ├── expressions-46.sql │ │ │ ├── expressions-48.sql │ │ │ ├── expressions-50.sql │ │ │ ├── expressions-52.sql │ │ │ ├── expressions-54.sql │ │ │ ├── expressions-57.sql │ │ │ ├── expressions-59.sql │ │ │ ├── expressions-6.sql │ │ │ ├── expressions-62.sql │ │ │ ├── expressions-8.sql │ │ │ ├── external-subprograms-1.sql │ │ │ ├── external-subprograms-2.sql │ │ │ ├── external-subprograms-4.sql │ │ │ ├── external-subprograms-5.sql │ │ │ ├── forward-declaration-0.sql │ │ │ ├── inserting-records-tables-0.sql │ │ │ ├── invokers-rights-and-definers-rights-authid-property-0.sql │ │ │ ├── invokers-rights-and-definers-rights-authid-property-2.sql │ │ │ ├── invokers-rights-and-definers-rights-authid-property-3.sql │ │ │ ├── lexical-units-0.sql │ │ │ ├── lexical-units-10.sql │ │ │ ├── lexical-units-12.sql │ │ │ ├── lexical-units-15.sql │ │ │ ├── lexical-units-17.sql │ │ │ ├── lexical-units-20.sql │ │ │ ├── lexical-units-23.sql │ │ │ ├── lexical-units-25.sql │ │ │ ├── lexical-units-4.sql │ │ │ ├── lexical-units-6.sql │ │ │ ├── lexical-units-8.sql │ │ │ ├── loop-statements-0.sql │ │ │ ├── loop-statements-10.sql │ │ │ ├── loop-statements-13.sql │ │ │ ├── loop-statements-15.sql │ │ │ ├── loop-statements-17.sql │ │ │ ├── loop-statements-19.sql │ │ │ ├── loop-statements-2.sql │ │ │ ├── loop-statements-25.sql │ │ │ ├── loop-statements-27.sql │ │ │ ├── loop-statements-31.sql │ │ │ ├── loop-statements-33.sql │ │ │ ├── loop-statements-37.sql │ │ │ ├── loop-statements-39.sql │ │ │ ├── loop-statements-4.sql │ │ │ ├── loop-statements-6.sql │ │ │ ├── loop-statements-8.sql │ │ │ ├── main-features-pl-sql-1.sql │ │ │ ├── minimizing-cpu-overhead-0.sql │ │ │ ├── minimizing-cpu-overhead-2.sql │ │ │ ├── multidimensional-collections-0.sql │ │ │ ├── multidimensional-collections-2.sql │ │ │ ├── multidimensional-collections-3.sql │ │ │ ├── native-dynamic-sql-0.sql │ │ │ ├── native-dynamic-sql-1.sql │ │ │ ├── native-dynamic-sql-11.sql │ │ │ ├── native-dynamic-sql-12.sql │ │ │ ├── native-dynamic-sql-13.sql │ │ │ ├── native-dynamic-sql-15.sql │ │ │ ├── native-dynamic-sql-16.sql │ │ │ ├── native-dynamic-sql-17.sql │ │ │ ├── native-dynamic-sql-18.sql │ │ │ ├── native-dynamic-sql-19.sql │ │ │ ├── native-dynamic-sql-3.sql │ │ │ ├── native-dynamic-sql-5.sql │ │ │ ├── native-dynamic-sql-7.sql │ │ │ ├── native-dynamic-sql-9.sql │ │ │ ├── overloaded-subprograms-0.sql │ │ │ ├── overloaded-subprograms-10.sql │ │ │ ├── overloaded-subprograms-11.sql │ │ │ ├── overloaded-subprograms-12.sql │ │ │ ├── overloaded-subprograms-13.sql │ │ │ ├── overloaded-subprograms-15.sql │ │ │ ├── overloaded-subprograms-5.sql │ │ │ ├── overloaded-subprograms-6.sql │ │ │ ├── overloaded-subprograms-7.sql │ │ │ ├── overloaded-subprograms-8.sql │ │ │ ├── overloaded-subprograms-9.sql │ │ │ ├── overview-exception-handling-1.sql │ │ │ ├── overview-exception-handling-2.sql │ │ │ ├── overview-exception-handling-4.sql │ │ │ ├── overview-exception-handling-6.sql │ │ │ ├── overview-polymorphic-table-functions-0.sql │ │ │ ├── overview-polymorphic-table-functions-1.sql │ │ │ ├── overview-polymorphic-table-functions-10.sql │ │ │ ├── overview-polymorphic-table-functions-12.sql │ │ │ ├── overview-polymorphic-table-functions-14.sql │ │ │ ├── overview-polymorphic-table-functions-16.sql │ │ │ ├── overview-polymorphic-table-functions-17.sql │ │ │ ├── overview-polymorphic-table-functions-18.sql │ │ │ ├── overview-polymorphic-table-functions-19.sql │ │ │ ├── overview-polymorphic-table-functions-2.sql │ │ │ ├── overview-polymorphic-table-functions-21.sql │ │ │ ├── overview-polymorphic-table-functions-23.sql │ │ │ ├── overview-polymorphic-table-functions-25.sql │ │ │ ├── overview-polymorphic-table-functions-27.sql │ │ │ ├── overview-polymorphic-table-functions-29.sql │ │ │ ├── overview-polymorphic-table-functions-30.sql │ │ │ ├── overview-polymorphic-table-functions-31.sql │ │ │ ├── overview-polymorphic-table-functions-4.sql │ │ │ ├── overview-polymorphic-table-functions-5.sql │ │ │ ├── overview-polymorphic-table-functions-6.sql │ │ │ ├── overview-polymorphic-table-functions-8.sql │ │ │ ├── package-body-0.sql │ │ │ ├── package-body-2.sql │ │ │ ├── package-body-4.sql │ │ │ ├── package-example-0.sql │ │ │ ├── package-specification-1.sql │ │ │ ├── package-specification-2.sql │ │ │ ├── package-writing-guidelines-0.sql │ │ │ ├── package-writing-guidelines-1.sql │ │ │ ├── package-writing-guidelines-2.sql │ │ │ ├── package-writing-guidelines-4.sql │ │ │ ├── pl-sql-function-result-cache-0.sql │ │ │ ├── pl-sql-function-result-cache-1.sql │ │ │ ├── pl-sql-function-result-cache-10.sql │ │ │ ├── pl-sql-function-result-cache-11.sql │ │ │ ├── pl-sql-function-result-cache-12.sql │ │ │ ├── pl-sql-function-result-cache-13.sql │ │ │ ├── pl-sql-function-result-cache-15.sql │ │ │ ├── pl-sql-function-result-cache-16.sql │ │ │ ├── pl-sql-function-result-cache-17.sql │ │ │ ├── pl-sql-function-result-cache-18.sql │ │ │ ├── pl-sql-function-result-cache-19.sql │ │ │ ├── pl-sql-function-result-cache-20.sql │ │ │ ├── pl-sql-function-result-cache-4.sql │ │ │ ├── pl-sql-function-result-cache-5.sql │ │ │ ├── pl-sql-function-result-cache-6.sql │ │ │ ├── pl-sql-function-result-cache-7.sql │ │ │ ├── pl-sql-function-result-cache-9.sql │ │ │ ├── pls_integer-and-binary_integer-data-types-0.sql │ │ │ ├── pls_integer-and-binary_integer-data-types-2.sql │ │ │ ├── pls_integer-and-binary_integer-data-types-4.sql │ │ │ ├── pls_integer-and-binary_integer-data-types-6.sql │ │ │ ├── plsql-program-limits-0.sql │ │ │ ├── plsql-program-limits-1.sql │ │ │ ├── plsql-program-limits-2.sql │ │ │ ├── predefined-exceptions-0.sql │ │ │ ├── predefined-exceptions-2.sql │ │ │ ├── predefined-exceptions-3.sql │ │ │ ├── predefined-exceptions-4.sql │ │ │ ├── processing-query-result-sets-0.sql │ │ │ ├── processing-query-result-sets-10.sql │ │ │ ├── processing-query-result-sets-2.sql │ │ │ ├── processing-query-result-sets-4.sql │ │ │ ├── processing-query-result-sets-6.sql │ │ │ ├── processing-query-result-sets-8.sql │ │ │ ├── qualified-names-and-dot-notation-6.sql │ │ │ ├── raising-exceptions-explicitly-0.sql │ │ │ ├── raising-exceptions-explicitly-2.sql │ │ │ ├── raising-exceptions-explicitly-3.sql │ │ │ ├── raising-exceptions-explicitly-5.sql │ │ │ ├── raising-exceptions-explicitly-9.sql │ │ │ ├── record-variables-0.sql │ │ │ ├── record-variables-1.sql │ │ │ ├── record-variables-11.sql │ │ │ ├── record-variables-14.sql │ │ │ ├── record-variables-16.sql │ │ │ ├── record-variables-19.sql │ │ │ ├── record-variables-21.sql │ │ │ ├── record-variables-22.sql │ │ │ ├── record-variables-24.sql │ │ │ ├── record-variables-26.sql │ │ │ ├── record-variables-28.sql │ │ │ ├── record-variables-3.sql │ │ │ ├── record-variables-30.sql │ │ │ ├── record-variables-5.sql │ │ │ ├── record-variables-7.sql │ │ │ ├── record-variables-9.sql │ │ │ ├── recursive-subprograms-1.sql │ │ │ ├── recursive-subprograms-3.sql │ │ │ ├── redeclared-predefined-exceptions-0.sql │ │ │ ├── redeclared-predefined-exceptions-1.sql │ │ │ ├── redeclared-predefined-exceptions-3.sql │ │ │ ├── redeclared-predefined-exceptions-5.sql │ │ │ ├── references-identifiers-0.sql │ │ │ ├── release-changes-0.sql │ │ │ ├── release-changes-2.sql │ │ │ ├── release-changes-3.sql │ │ │ ├── release-changes-4.sql │ │ │ ├── retrieving-error-code-and-error-message-0.sql │ │ │ ├── retrying-transactions-handling-exceptions-0.sql │ │ │ ├── scope-and-visibility-identifiers-0.sql │ │ │ ├── scope-and-visibility-identifiers-1.sql │ │ │ ├── scope-and-visibility-identifiers-11.sql │ │ │ ├── scope-and-visibility-identifiers-3.sql │ │ │ ├── scope-and-visibility-identifiers-5.sql │ │ │ ├── scope-and-visibility-identifiers-7.sql │ │ │ ├── scope-and-visibility-identifiers-9.sql │ │ │ ├── sequential-control-statements-0.sql │ │ │ ├── sequential-control-statements-1.sql │ │ │ ├── sequential-control-statements-2.sql │ │ │ ├── serially_reusable-packages-0.sql │ │ │ ├── serially_reusable-packages-1.sql │ │ │ ├── serially_reusable-packages-3.sql │ │ │ ├── serially_reusable-packages-4.sql │ │ │ ├── serially_reusable-packages-6.sql │ │ │ ├── sql-data-types-1.sql │ │ │ ├── sql-data-types-10.sql │ │ │ ├── sql-data-types-12.sql │ │ │ ├── sql-data-types-14.sql │ │ │ ├── sql-data-types-16.sql │ │ │ ├── sql-data-types-18.sql │ │ │ ├── sql-data-types-20.sql │ │ │ ├── sql-data-types-22.sql │ │ │ ├── sql-data-types-24.sql │ │ │ ├── sql-data-types-26.sql │ │ │ ├── sql-data-types-29.sql │ │ │ ├── sql-data-types-3.sql │ │ │ ├── sql-data-types-31.sql │ │ │ ├── sql-data-types-32.sql │ │ │ ├── sql-data-types-34.sql │ │ │ ├── sql-data-types-36.sql │ │ │ ├── sql-data-types-38.sql │ │ │ ├── sql-data-types-4.sql │ │ │ ├── sql-data-types-42.sql │ │ │ ├── sql-data-types-44.sql │ │ │ ├── sql-data-types-46.sql │ │ │ ├── sql-data-types-48.sql │ │ │ ├── sql-data-types-50.sql │ │ │ ├── sql-data-types-52.sql │ │ │ ├── sql-data-types-6.sql │ │ │ ├── sql-data-types-8.sql │ │ │ ├── sql-injection-0.sql │ │ │ ├── sql-injection-1.sql │ │ │ ├── sql-injection-10.sql │ │ │ ├── sql-injection-12.sql │ │ │ ├── sql-injection-13.sql │ │ │ ├── sql-injection-14.sql │ │ │ ├── sql-injection-16.sql │ │ │ ├── sql-injection-18.sql │ │ │ ├── sql-injection-19.sql │ │ │ ├── sql-injection-2.sql │ │ │ ├── sql-injection-21.sql │ │ │ ├── sql-injection-23.sql │ │ │ ├── sql-injection-24.sql │ │ │ ├── sql-injection-26.sql │ │ │ ├── sql-injection-28.sql │ │ │ ├── sql-injection-30.sql │ │ │ ├── sql-injection-31.sql │ │ │ ├── sql-injection-4.sql │ │ │ ├── sql-injection-6.sql │ │ │ ├── sql-injection-7.sql │ │ │ ├── sql-injection-9.sql │ │ │ ├── subprogram-invocation-resolution-0.sql │ │ │ ├── subprogram-parameters-10.sql │ │ │ ├── subprogram-parameters-12.sql │ │ │ ├── subprogram-parameters-13.sql │ │ │ ├── subprogram-parameters-15.sql │ │ │ ├── subprogram-parameters-17.sql │ │ │ ├── subprogram-parameters-19.sql │ │ │ ├── subprogram-parameters-2.sql │ │ │ ├── subprogram-parameters-21.sql │ │ │ ├── subprogram-parameters-24.sql │ │ │ ├── subprogram-parameters-26.sql │ │ │ ├── subprogram-parameters-27.sql │ │ │ ├── subprogram-parameters-29.sql │ │ │ ├── subprogram-parameters-30.sql │ │ │ ├── subprogram-parameters-32.sql │ │ │ ├── subprogram-parameters-33.sql │ │ │ ├── subprogram-parameters-36.sql │ │ │ ├── subprogram-parameters-37.sql │ │ │ ├── subprogram-parameters-4.sql │ │ │ ├── subprogram-parameters-6.sql │ │ │ ├── subprogram-parameters-8.sql │ │ │ ├── subprogram-parts-0.sql │ │ │ ├── subprogram-parts-11.sql │ │ │ ├── subprogram-parts-2.sql │ │ │ ├── subprogram-parts-4.sql │ │ │ ├── subprogram-parts-6.sql │ │ │ ├── subprogram-parts-7.sql │ │ │ ├── subprogram-parts-9.sql │ │ │ ├── subprograms-invoked-triggers-0.sql │ │ │ ├── system-triggers-0.sql │ │ │ ├── system-triggers-1.sql │ │ │ ├── system-triggers-2.sql │ │ │ ├── system-triggers-3.sql │ │ │ ├── transaction-processing-and-control-0.sql │ │ │ ├── transaction-processing-and-control-1.sql │ │ │ ├── transaction-processing-and-control-11.sql │ │ │ ├── transaction-processing-and-control-2.sql │ │ │ ├── transaction-processing-and-control-3.sql │ │ │ ├── transaction-processing-and-control-5.sql │ │ │ ├── transaction-processing-and-control-6.sql │ │ │ ├── transaction-processing-and-control-7.sql │ │ │ ├── transaction-processing-and-control-8.sql │ │ │ ├── transaction-processing-and-control-9.sql │ │ │ ├── trigger-design-guidelines-0.sql │ │ │ ├── trigger-design-guidelines-1.sql │ │ │ ├── trigger-restrictions-0.sql │ │ │ ├── trigger-restrictions-11.sql │ │ │ ├── trigger-restrictions-12.sql │ │ │ ├── trigger-restrictions-14.sql │ │ │ ├── trigger-restrictions-2.sql │ │ │ ├── trigger-restrictions-4.sql │ │ │ ├── trigger-restrictions-6.sql │ │ │ ├── trigger-restrictions-7.sql │ │ │ ├── trigger-restrictions-9.sql │ │ │ ├── triggers-publishing-events-0.sql │ │ │ ├── triggers-publishing-events-10.sql │ │ │ ├── triggers-publishing-events-12.sql │ │ │ ├── triggers-publishing-events-14.sql │ │ │ ├── triggers-publishing-events-16.sql │ │ │ ├── triggers-publishing-events-18.sql │ │ │ ├── triggers-publishing-events-2.sql │ │ │ ├── triggers-publishing-events-20.sql │ │ │ ├── triggers-publishing-events-24.sql │ │ │ ├── triggers-publishing-events-28.sql │ │ │ ├── triggers-publishing-events-30.sql │ │ │ ├── triggers-publishing-events-34.sql │ │ │ ├── triggers-publishing-events-36.sql │ │ │ ├── triggers-publishing-events-38.sql │ │ │ ├── triggers-publishing-events-4.sql │ │ │ ├── triggers-publishing-events-42.sql │ │ │ ├── triggers-publishing-events-48.sql │ │ │ ├── triggers-publishing-events-50.sql │ │ │ ├── triggers-publishing-events-52.sql │ │ │ ├── triggers-publishing-events-6.sql │ │ │ ├── triggers-publishing-events-8.sql │ │ │ ├── updating-rows-records-0.sql │ │ │ ├── user-defined-pl-sql-subtypes-2.sql │ │ │ ├── user-defined-pl-sql-subtypes-5.sql │ │ │ ├── user-defined-pl-sql-subtypes-7.sql │ │ │ ├── user-defined-pl-sql-subtypes-9.sql │ │ │ ├── views-information-triggers-0.sql │ │ │ ├── views-information-triggers-1.sql │ │ │ ├── views-information-triggers-2.sql │ │ │ ├── views-information-triggers-4.sql │ │ │ ├── views-information-triggers-5.sql │ │ │ ├── what-is-capture-0.sql │ │ │ ├── what-is-capture-1.sql │ │ │ ├── what-is-capture-2.sql │ │ │ ├── wrapping-pl-sql-source-text-dbms_ddl-subprograms-0.sql │ │ │ ├── wrapping-pl-sql-source-text-dbms_ddl-subprograms-1.sql │ │ │ ├── wrapping-pl-sql-source-text-dbms_ddl-subprograms-2.sql │ │ │ ├── wrapping-pl-sql-source-text-dbms_ddl-subprograms-3.sql │ │ │ ├── wrapping-pl-sql-source-text-pl-sql-wrapper-utility-4.sql │ │ │ └── wrapping-pl-sql-source-text-pl-sql-wrapper-utility-7.sql │ │ └── sqlrf/ │ │ ├── ABS-0.sql │ │ ├── ACOS-0.sql │ │ ├── ADD_MONTHS-0.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-10.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-11.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-12.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-13.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-14.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-15.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-16.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-17.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-18.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-19.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-2.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-20.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-21.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-22.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-23.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-24.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-25.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-26.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-27.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-28.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-29.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-3.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-30.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-31.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-32.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-33.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-34.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-35.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-36.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-37.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-6.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-7.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-8.sql │ │ ├── ADMINISTER-KEY-MANAGEMENT-9.sql │ │ ├── ALTER-ANALYTIC-VIEW-0.sql │ │ ├── ALTER-ANALYTIC-VIEW-1.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-0.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-1.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-10.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-11.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-12.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-13.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-14.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-2.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-3.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-4.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-5.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-6.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-7.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-8.sql │ │ ├── ALTER-AUDIT-POLICY-Unified-Auditing-9.sql │ │ ├── ALTER-CLUSTER-0.sql │ │ ├── ALTER-CLUSTER-1.sql │ │ ├── ALTER-CLUSTER-2.sql │ │ ├── ALTER-CLUSTER-3.sql │ │ ├── ALTER-CLUSTER-4.sql │ │ ├── ALTER-CLUSTER-5.sql │ │ ├── ALTER-CLUSTER-6.sql │ │ ├── ALTER-CLUSTER-7.sql │ │ ├── ALTER-DATABASE-0.sql │ │ ├── ALTER-DATABASE-1.sql │ │ ├── ALTER-DATABASE-10.sql │ │ ├── ALTER-DATABASE-11.sql │ │ ├── ALTER-DATABASE-12.sql │ │ ├── ALTER-DATABASE-13.sql │ │ ├── ALTER-DATABASE-14.sql │ │ ├── ALTER-DATABASE-15.sql │ │ ├── ALTER-DATABASE-16.sql │ │ ├── ALTER-DATABASE-17.sql │ │ ├── ALTER-DATABASE-18.sql │ │ ├── ALTER-DATABASE-19.sql │ │ ├── ALTER-DATABASE-2.sql │ │ ├── ALTER-DATABASE-20.sql │ │ ├── ALTER-DATABASE-21.sql │ │ ├── ALTER-DATABASE-22.sql │ │ ├── ALTER-DATABASE-23.sql │ │ ├── ALTER-DATABASE-24.sql │ │ ├── ALTER-DATABASE-25.sql │ │ ├── ALTER-DATABASE-26.sql │ │ ├── ALTER-DATABASE-27.sql │ │ ├── ALTER-DATABASE-28.sql │ │ ├── ALTER-DATABASE-3.sql │ │ ├── ALTER-DATABASE-4.sql │ │ ├── ALTER-DATABASE-5.sql │ │ ├── ALTER-DATABASE-6.sql │ │ ├── ALTER-DATABASE-7.sql │ │ ├── ALTER-DATABASE-8.sql │ │ ├── ALTER-DATABASE-9.sql │ │ ├── ALTER-DATABASE-LINK-0.sql │ │ ├── ALTER-DIMENSION-0.sql │ │ ├── ALTER-DISKGROUP-1.sql │ │ ├── ALTER-DISKGROUP-10.sql │ │ ├── ALTER-DISKGROUP-11.sql │ │ ├── ALTER-DISKGROUP-12.sql │ │ ├── ALTER-DISKGROUP-13.sql │ │ ├── ALTER-DISKGROUP-14.sql │ │ ├── ALTER-DISKGROUP-15.sql │ │ ├── ALTER-DISKGROUP-16.sql │ │ ├── ALTER-DISKGROUP-2.sql │ │ ├── ALTER-DISKGROUP-3.sql │ │ ├── ALTER-DISKGROUP-4.sql │ │ ├── ALTER-DISKGROUP-5.sql │ │ ├── ALTER-DISKGROUP-6.sql │ │ ├── ALTER-DISKGROUP-7.sql │ │ ├── ALTER-DISKGROUP-8.sql │ │ ├── ALTER-DISKGROUP-9.sql │ │ ├── ALTER-HIERARCHY-0.sql │ │ ├── ALTER-INDEX-0.sql │ │ ├── ALTER-INDEX-1.sql │ │ ├── ALTER-INDEX-10.sql │ │ ├── ALTER-INDEX-11.sql │ │ ├── ALTER-INDEX-12.sql │ │ ├── ALTER-INDEX-2.sql │ │ ├── ALTER-INDEX-3.sql │ │ ├── ALTER-INDEX-4.sql │ │ ├── ALTER-INDEX-5.sql │ │ ├── ALTER-INDEX-6.sql │ │ ├── ALTER-INDEX-7.sql │ │ ├── ALTER-INDEX-8.sql │ │ ├── ALTER-INDEX-9.sql │ │ ├── ALTER-INDEXTYPE-0.sql │ │ ├── ALTER-INMEMORY-JOIN-GROUP-0.sql │ │ ├── ALTER-INMEMORY-JOIN-GROUP-1.sql │ │ ├── ALTER-JAVA-0.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-10.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-11.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-12.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-13.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-14.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-15.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-16.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-17.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-18.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-19.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-2.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-20.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-21.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-22.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-23.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-24.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-25.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-3.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-4.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-5.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-6.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-7.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-8.sql │ │ ├── ALTER-LOCKDOWN-PROFILE-9.sql │ │ ├── ALTER-MATERIALIZED-VIEW-0.sql │ │ ├── ALTER-MATERIALIZED-VIEW-1.sql │ │ ├── ALTER-MATERIALIZED-VIEW-2.sql │ │ ├── ALTER-MATERIALIZED-VIEW-3.sql │ │ ├── ALTER-MATERIALIZED-VIEW-4.sql │ │ ├── ALTER-MATERIALIZED-VIEW-5.sql │ │ ├── ALTER-MATERIALIZED-VIEW-6.sql │ │ ├── ALTER-MATERIALIZED-VIEW-7.sql │ │ ├── ALTER-MATERIALIZED-VIEW-LOG-0.sql │ │ ├── ALTER-MATERIALIZED-VIEW-LOG-1.sql │ │ ├── ALTER-MATERIALIZED-ZONEMAP-0.sql │ │ ├── ALTER-MATERIALIZED-ZONEMAP-1.sql │ │ ├── ALTER-MATERIALIZED-ZONEMAP-2.sql │ │ ├── ALTER-MATERIALIZED-ZONEMAP-3.sql │ │ ├── ALTER-MATERIALIZED-ZONEMAP-4.sql │ │ ├── ALTER-MATERIALIZED-ZONEMAP-5.sql │ │ ├── ALTER-OPERATOR-0.sql │ │ ├── ALTER-OUTLINE-0.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-0.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-1.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-10.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-11.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-12.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-13.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-14.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-15.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-16.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-17.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-18.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-19.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-2.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-20.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-21.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-3.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-6.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-7.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-8.sql │ │ ├── ALTER-PLUGGABLE-DATABASE-9.sql │ │ ├── ALTER-PROFILE-0.sql │ │ ├── ALTER-PROFILE-1.sql │ │ ├── ALTER-PROFILE-2.sql │ │ ├── ALTER-PROFILE-3.sql │ │ ├── ALTER-PROFILE-4.sql │ │ ├── ALTER-PROFILE-5.sql │ │ ├── ALTER-PROFILE-6.sql │ │ ├── ALTER-PROFILE-7.sql │ │ ├── ALTER-PROFILE-8.sql │ │ ├── ALTER-PROFILE-9.sql │ │ ├── ALTER-RESOURCE-COST-0.sql │ │ ├── ALTER-RESOURCE-COST-2.sql │ │ ├── ALTER-ROLE-0.sql │ │ ├── ALTER-ROLE-1.sql │ │ ├── ALTER-ROLE-2.sql │ │ ├── ALTER-ROLLBACK-SEGMENT-0.sql │ │ ├── ALTER-ROLLBACK-SEGMENT-1.sql │ │ ├── ALTER-SEQUENCE-0.sql │ │ ├── ALTER-SEQUENCE-1.sql │ │ ├── ALTER-SESSION-0.sql │ │ ├── ALTER-SESSION-1.sql │ │ ├── ALTER-SESSION-13.sql │ │ ├── ALTER-SESSION-14.sql │ │ ├── ALTER-SESSION-15.sql │ │ ├── ALTER-SESSION-16.sql │ │ ├── ALTER-SESSION-17.sql │ │ ├── ALTER-SESSION-18.sql │ │ ├── ALTER-SESSION-19.sql │ │ ├── ALTER-SESSION-2.sql │ │ ├── ALTER-SESSION-20.sql │ │ ├── ALTER-SESSION-21.sql │ │ ├── ALTER-SESSION-22.sql │ │ ├── ALTER-SESSION-23.sql │ │ ├── ALTER-SESSION-24.sql │ │ ├── ALTER-SESSION-25.sql │ │ ├── ALTER-SYNONYM-0.sql │ │ ├── ALTER-SYNONYM-1.sql │ │ ├── ALTER-SYNONYM-2.sql │ │ ├── ALTER-SYSTEM-0.sql │ │ ├── ALTER-SYSTEM-1.sql │ │ ├── ALTER-SYSTEM-10.sql │ │ ├── ALTER-SYSTEM-11.sql │ │ ├── ALTER-SYSTEM-12.sql │ │ ├── ALTER-SYSTEM-13.sql │ │ ├── ALTER-SYSTEM-14.sql │ │ ├── ALTER-SYSTEM-15.sql │ │ ├── ALTER-SYSTEM-16.sql │ │ ├── ALTER-SYSTEM-17.sql │ │ ├── ALTER-SYSTEM-18.sql │ │ ├── ALTER-SYSTEM-19.sql │ │ ├── ALTER-SYSTEM-20.sql │ │ ├── ALTER-SYSTEM-21.sql │ │ ├── ALTER-SYSTEM-22.sql │ │ ├── ALTER-SYSTEM-23.sql │ │ ├── ALTER-SYSTEM-24.sql │ │ ├── ALTER-SYSTEM-25.sql │ │ ├── ALTER-SYSTEM-26.sql │ │ ├── ALTER-SYSTEM-27.sql │ │ ├── ALTER-SYSTEM-28.sql │ │ ├── ALTER-SYSTEM-3.sql │ │ ├── ALTER-SYSTEM-4.sql │ │ ├── ALTER-SYSTEM-5.sql │ │ ├── ALTER-SYSTEM-7.sql │ │ ├── ALTER-SYSTEM-8.sql │ │ ├── ALTER-SYSTEM-9.sql │ │ ├── ALTER-TABLE-0.sql │ │ ├── ALTER-TABLE-10.sql │ │ ├── ALTER-TABLE-100.sql │ │ ├── ALTER-TABLE-101.sql │ │ ├── ALTER-TABLE-102.sql │ │ ├── ALTER-TABLE-103.sql │ │ ├── ALTER-TABLE-104.sql │ │ ├── ALTER-TABLE-105.sql │ │ ├── ALTER-TABLE-106.sql │ │ ├── ALTER-TABLE-107.sql │ │ ├── ALTER-TABLE-108.sql │ │ ├── ALTER-TABLE-109.sql │ │ ├── ALTER-TABLE-11.sql │ │ ├── ALTER-TABLE-110.sql │ │ ├── ALTER-TABLE-111.sql │ │ ├── ALTER-TABLE-112.sql │ │ ├── ALTER-TABLE-113.sql │ │ ├── ALTER-TABLE-114.sql │ │ ├── ALTER-TABLE-115.sql │ │ ├── ALTER-TABLE-116.sql │ │ ├── ALTER-TABLE-117.sql │ │ ├── ALTER-TABLE-118.sql │ │ ├── ALTER-TABLE-119.sql │ │ ├── ALTER-TABLE-12.sql │ │ ├── ALTER-TABLE-120.sql │ │ ├── ALTER-TABLE-121.sql │ │ ├── ALTER-TABLE-122.sql │ │ ├── ALTER-TABLE-123.sql │ │ ├── ALTER-TABLE-124.sql │ │ ├── ALTER-TABLE-125.sql │ │ ├── ALTER-TABLE-126.sql │ │ ├── ALTER-TABLE-127.sql │ │ ├── ALTER-TABLE-128.sql │ │ ├── ALTER-TABLE-129.sql │ │ ├── ALTER-TABLE-13.sql │ │ ├── ALTER-TABLE-14.sql │ │ ├── ALTER-TABLE-15.sql │ │ ├── ALTER-TABLE-16.sql │ │ ├── ALTER-TABLE-17.sql │ │ ├── ALTER-TABLE-18.sql │ │ ├── ALTER-TABLE-19.sql │ │ ├── ALTER-TABLE-20.sql │ │ ├── ALTER-TABLE-21.sql │ │ ├── ALTER-TABLE-22.sql │ │ ├── ALTER-TABLE-23.sql │ │ ├── ALTER-TABLE-24.sql │ │ ├── ALTER-TABLE-25.sql │ │ ├── ALTER-TABLE-26.sql │ │ ├── ALTER-TABLE-27.sql │ │ ├── ALTER-TABLE-28.sql │ │ ├── ALTER-TABLE-29.sql │ │ ├── ALTER-TABLE-30.sql │ │ ├── ALTER-TABLE-31.sql │ │ ├── ALTER-TABLE-32.sql │ │ ├── ALTER-TABLE-33.sql │ │ ├── ALTER-TABLE-34.sql │ │ ├── ALTER-TABLE-35.sql │ │ ├── ALTER-TABLE-36.sql │ │ ├── ALTER-TABLE-37.sql │ │ ├── ALTER-TABLE-38.sql │ │ ├── ALTER-TABLE-39.sql │ │ ├── ALTER-TABLE-4.sql │ │ ├── ALTER-TABLE-40.sql │ │ ├── ALTER-TABLE-41.sql │ │ ├── ALTER-TABLE-42.sql │ │ ├── ALTER-TABLE-43.sql │ │ ├── ALTER-TABLE-44.sql │ │ ├── ALTER-TABLE-45.sql │ │ ├── ALTER-TABLE-46.sql │ │ ├── ALTER-TABLE-47.sql │ │ ├── ALTER-TABLE-48.sql │ │ ├── ALTER-TABLE-49.sql │ │ ├── ALTER-TABLE-5.sql │ │ ├── ALTER-TABLE-50.sql │ │ ├── ALTER-TABLE-51.sql │ │ ├── ALTER-TABLE-52.sql │ │ ├── ALTER-TABLE-53.sql │ │ ├── ALTER-TABLE-54.sql │ │ ├── ALTER-TABLE-55.sql │ │ ├── ALTER-TABLE-56.sql │ │ ├── ALTER-TABLE-57.sql │ │ ├── ALTER-TABLE-58.sql │ │ ├── ALTER-TABLE-59.sql │ │ ├── ALTER-TABLE-6.sql │ │ ├── ALTER-TABLE-60.sql │ │ ├── ALTER-TABLE-61.sql │ │ ├── ALTER-TABLE-62.sql │ │ ├── ALTER-TABLE-63.sql │ │ ├── ALTER-TABLE-64.sql │ │ ├── ALTER-TABLE-65.sql │ │ ├── ALTER-TABLE-66.sql │ │ ├── ALTER-TABLE-67.sql │ │ ├── ALTER-TABLE-68.sql │ │ ├── ALTER-TABLE-69.sql │ │ ├── ALTER-TABLE-7.sql │ │ ├── ALTER-TABLE-70.sql │ │ ├── ALTER-TABLE-71.sql │ │ ├── ALTER-TABLE-72.sql │ │ ├── ALTER-TABLE-73.sql │ │ ├── ALTER-TABLE-74.sql │ │ ├── ALTER-TABLE-75.sql │ │ ├── ALTER-TABLE-76.sql │ │ ├── ALTER-TABLE-77.sql │ │ ├── ALTER-TABLE-78.sql │ │ ├── ALTER-TABLE-79.sql │ │ ├── ALTER-TABLE-8.sql │ │ ├── ALTER-TABLE-80.sql │ │ ├── ALTER-TABLE-81.sql │ │ ├── ALTER-TABLE-82.sql │ │ ├── ALTER-TABLE-83.sql │ │ ├── ALTER-TABLE-84.sql │ │ ├── ALTER-TABLE-85.sql │ │ ├── ALTER-TABLE-86.sql │ │ ├── ALTER-TABLE-87.sql │ │ ├── ALTER-TABLE-88.sql │ │ ├── ALTER-TABLE-89.sql │ │ ├── ALTER-TABLE-9.sql │ │ ├── ALTER-TABLE-90.sql │ │ ├── ALTER-TABLE-91.sql │ │ ├── ALTER-TABLE-92.sql │ │ ├── ALTER-TABLE-93.sql │ │ ├── ALTER-TABLE-94.sql │ │ ├── ALTER-TABLE-95.sql │ │ ├── ALTER-TABLE-96.sql │ │ ├── ALTER-TABLE-97.sql │ │ ├── ALTER-TABLE-98.sql │ │ ├── ALTER-TABLE-99.sql │ │ ├── ALTER-TABLESPACE-0.sql │ │ ├── ALTER-TABLESPACE-1.sql │ │ ├── ALTER-TABLESPACE-10.sql │ │ ├── ALTER-TABLESPACE-11.sql │ │ ├── ALTER-TABLESPACE-12.sql │ │ ├── ALTER-TABLESPACE-13.sql │ │ ├── ALTER-TABLESPACE-14.sql │ │ ├── ALTER-TABLESPACE-15.sql │ │ ├── ALTER-TABLESPACE-16.sql │ │ ├── ALTER-TABLESPACE-2.sql │ │ ├── ALTER-TABLESPACE-3.sql │ │ ├── ALTER-TABLESPACE-4.sql │ │ ├── ALTER-TABLESPACE-5.sql │ │ ├── ALTER-TABLESPACE-6.sql │ │ ├── ALTER-TABLESPACE-7.sql │ │ ├── ALTER-TABLESPACE-8.sql │ │ ├── ALTER-TABLESPACE-9.sql │ │ ├── ALTER-TABLESPACE-SET-0.sql │ │ ├── ALTER-USER-0.sql │ │ ├── ALTER-USER-1.sql │ │ ├── ALTER-USER-10.sql │ │ ├── ALTER-USER-11.sql │ │ ├── ALTER-USER-12.sql │ │ ├── ALTER-USER-13.sql │ │ ├── ALTER-USER-14.sql │ │ ├── ALTER-USER-15.sql │ │ ├── ALTER-USER-2.sql │ │ ├── ALTER-USER-4.sql │ │ ├── ALTER-USER-5.sql │ │ ├── ALTER-USER-6.sql │ │ ├── ALTER-USER-7.sql │ │ ├── ALTER-USER-8.sql │ │ ├── ALTER-USER-9.sql │ │ ├── ALTER-VIEW-0.sql │ │ ├── ALTER-VIEW-1.sql │ │ ├── ANALYZE-0.sql │ │ ├── ANALYZE-1.sql │ │ ├── ANALYZE-2.sql │ │ ├── ANALYZE-3.sql │ │ ├── ANALYZE-4.sql │ │ ├── ANALYZE-5.sql │ │ ├── ANALYZE-6.sql │ │ ├── ANALYZE-7.sql │ │ ├── ANY_VALUE-0.sql │ │ ├── APPROX_COUNT-0.sql │ │ ├── APPROX_COUNT_DISTINCT-0.sql │ │ ├── APPROX_COUNT_DISTINCT-1.sql │ │ ├── APPROX_COUNT_DISTINCT_DETAIL-0.sql │ │ ├── APPROX_COUNT_DISTINCT_DETAIL-1.sql │ │ ├── APPROX_COUNT_DISTINCT_DETAIL-2.sql │ │ ├── APPROX_COUNT_DISTINCT_DETAIL-3.sql │ │ ├── APPROX_COUNT_DISTINCT_DETAIL-4.sql │ │ ├── APPROX_COUNT_DISTINCT_DETAIL-5.sql │ │ ├── APPROX_MEDIAN-0.sql │ │ ├── APPROX_MEDIAN-1.sql │ │ ├── APPROX_MEDIAN-2.sql │ │ ├── APPROX_MEDIAN-3.sql │ │ ├── APPROX_PERCENTILE-0.sql │ │ ├── APPROX_PERCENTILE-1.sql │ │ ├── APPROX_PERCENTILE-2.sql │ │ ├── APPROX_PERCENTILE-3.sql │ │ ├── APPROX_PERCENTILE_DETAIL-0.sql │ │ ├── APPROX_PERCENTILE_DETAIL-1.sql │ │ ├── APPROX_PERCENTILE_DETAIL-2.sql │ │ ├── APPROX_PERCENTILE_DETAIL-3.sql │ │ ├── APPROX_PERCENTILE_DETAIL-4.sql │ │ ├── APPROX_PERCENTILE_DETAIL-5.sql │ │ ├── APPROX_PERCENTILE_DETAIL-6.sql │ │ ├── APPROX_PERCENTILE_DETAIL-7.sql │ │ ├── APPROX_PERCENTILE_DETAIL-8.sql │ │ ├── APPROX_RANK-0.sql │ │ ├── APPROX_SUM-0.sql │ │ ├── ASCII-0.sql │ │ ├── ASCIISTR-0.sql │ │ ├── ASIN-0.sql │ │ ├── ASSOCIATE-STATISTICS-0.sql │ │ ├── ASSOCIATE-STATISTICS-1.sql │ │ ├── ATAN-0.sql │ │ ├── ATAN2-0.sql │ │ ├── AUDIT-Unified-Auditing-0.sql │ │ ├── AUDIT-Unified-Auditing-1.sql │ │ ├── AUDIT-Unified-Auditing-2.sql │ │ ├── AUDIT-Unified-Auditing-3.sql │ │ ├── AUDIT-Unified-Auditing-4.sql │ │ ├── AUDIT-Unified-Auditing-5.sql │ │ ├── AUDIT-Unified-Auditing-6.sql │ │ ├── AUDIT-Unified-Auditing-7.sql │ │ ├── AUDIT-Unified-Auditing-8.sql │ │ ├── AVG-0.sql │ │ ├── AVG-1.sql │ │ ├── About-SQL-Expressions-2.sql │ │ ├── About-SQL-Expressions-3.sql │ │ ├── About-User-Defined-Functions-1.sql │ │ ├── About-User-Defined-Functions-2.sql │ │ ├── About-User-Defined-Functions-4.sql │ │ ├── Aggregate-Functions-0.sql │ │ ├── Arithmetic-Operators-0.sql │ │ ├── Arithmetic-Operators-1.sql │ │ ├── Arithmetic-Operators-2.sql │ │ ├── Automatic-Locks-in-DML-Operations-0.sql │ │ ├── BETWEEN-Condition-5.sql │ │ ├── BFILENAME-0.sql │ │ ├── BIN_TO_NUM-0.sql │ │ ├── BIN_TO_NUM-1.sql │ │ ├── BITAND-0.sql │ │ ├── BITAND-1.sql │ │ ├── BITAND-2.sql │ │ ├── BIT_AND_AGG-0.sql │ │ ├── BIT_AND_AGG-1.sql │ │ ├── CALL-0.sql │ │ ├── CALL-1.sql │ │ ├── CALL-2.sql │ │ ├── CALL-3.sql │ │ ├── CALL-4.sql │ │ ├── CARDINALITY-0.sql │ │ ├── CASE-Expressions-0.sql │ │ ├── CASE-Expressions-1.sql │ │ ├── CAST-0.sql │ │ ├── CAST-1.sql │ │ ├── CAST-10.sql │ │ ├── CAST-11.sql │ │ ├── CAST-12.sql │ │ ├── CAST-13.sql │ │ ├── CAST-14.sql │ │ ├── CAST-15.sql │ │ ├── CAST-16.sql │ │ ├── CAST-17.sql │ │ ├── CAST-18.sql │ │ ├── CAST-2.sql │ │ ├── CAST-3.sql │ │ ├── CAST-4.sql │ │ ├── CAST-5.sql │ │ ├── CAST-6.sql │ │ ├── CAST-7.sql │ │ ├── CAST-8.sql │ │ ├── CAST-9.sql │ │ ├── CEIL-0.sql │ │ ├── CHARTOROWID-0.sql │ │ ├── CHR-0.sql │ │ ├── CHR-1.sql │ │ ├── CHR-2.sql │ │ ├── CHR-3.sql │ │ ├── CHR-4.sql │ │ ├── CHR-5.sql │ │ ├── CLUSTER_DETAILS-0.sql │ │ ├── CLUSTER_DETAILS-1.sql │ │ ├── CLUSTER_DISTANCE-0.sql │ │ ├── CLUSTER_ID-0.sql │ │ ├── CLUSTER_ID-1.sql │ │ ├── CLUSTER_PROBABILITY-0.sql │ │ ├── CLUSTER_SET-0.sql │ │ ├── COALESCE-4.sql │ │ ├── COLLATE-Operator-0.sql │ │ ├── COLLATION-0.sql │ │ ├── COLLECT-0.sql │ │ ├── COLLECT-1.sql │ │ ├── COLUMN_VALUE-Pseudocolumn-0.sql │ │ ├── COLUMN_VALUE-Pseudocolumn-1.sql │ │ ├── COLUMN_VALUE-Pseudocolumn-2.sql │ │ ├── COLUMN_VALUE-Pseudocolumn-3.sql │ │ ├── COLUMN_VALUE-Pseudocolumn-4.sql │ │ ├── COMMENT-0.sql │ │ ├── COMMENT-1.sql │ │ ├── COMMIT-0.sql │ │ ├── COMMIT-1.sql │ │ ├── COMMIT-2.sql │ │ ├── COMMIT-3.sql │ │ ├── COMPOSE-0.sql │ │ ├── CONCAT-0.sql │ │ ├── CONVERT-0.sql │ │ ├── CONVERT-1.sql │ │ ├── CON_DBID_TO_ID-0.sql │ │ ├── CON_DBID_TO_ID-1.sql │ │ ├── CON_GUID_TO_ID-0.sql │ │ ├── CON_GUID_TO_ID-1.sql │ │ ├── CON_NAME_TO_ID-0.sql │ │ ├── CON_NAME_TO_ID-1.sql │ │ ├── CON_UID_TO_ID-0.sql │ │ ├── CON_UID_TO_ID-1.sql │ │ ├── CORR-1.sql │ │ ├── CORR-2.sql │ │ ├── CORR_A-0.sql │ │ ├── CORR_A-1.sql │ │ ├── COS-0.sql │ │ ├── COSH-0.sql │ │ ├── COUNT-0.sql │ │ ├── COUNT-1.sql │ │ ├── COVAR_POP-1.sql │ │ ├── COVAR_POP-2.sql │ │ ├── CREATE-ANALYTIC-VIEW-0.sql │ │ ├── CREATE-ANALYTIC-VIEW-1.sql │ │ ├── CREATE-ATTRIBUTE-DIMENSION-0.sql │ │ ├── CREATE-ATTRIBUTE-DIMENSION-1.sql │ │ ├── CREATE-ATTRIBUTE-DIMENSION-2.sql │ │ ├── CREATE-ATTRIBUTE-DIMENSION-3.sql │ │ ├── CREATE-ATTRIBUTE-DIMENSION-4.sql │ │ ├── CREATE-ATTRIBUTE-DIMENSION-5.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-1.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-10.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-11.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-14.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-15.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-16.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-17.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-18.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-19.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-2.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-20.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-21.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-22.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-23.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-24.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-25.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-26.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-27.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-28.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-3.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-30.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-4.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-5.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-6.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-7.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-8.sql │ │ ├── CREATE-AUDIT-POLICY-Unified-Auditing-9.sql │ │ ├── CREATE-CLUSTER-0.sql │ │ ├── CREATE-CLUSTER-1.sql │ │ ├── CREATE-CLUSTER-10.sql │ │ ├── CREATE-CLUSTER-11.sql │ │ ├── CREATE-CLUSTER-12.sql │ │ ├── CREATE-CLUSTER-13.sql │ │ ├── CREATE-CLUSTER-2.sql │ │ ├── CREATE-CLUSTER-3.sql │ │ ├── CREATE-CLUSTER-4.sql │ │ ├── CREATE-CLUSTER-5.sql │ │ ├── CREATE-CLUSTER-6.sql │ │ ├── CREATE-CLUSTER-7.sql │ │ ├── CREATE-CLUSTER-8.sql │ │ ├── CREATE-CLUSTER-9.sql │ │ ├── CREATE-CONTEXT-0.sql │ │ ├── CREATE-CONTEXT-1.sql │ │ ├── CREATE-CONTROLFILE-0.sql │ │ ├── CREATE-DATABASE-0.sql │ │ ├── CREATE-DATABASE-1.sql │ │ ├── CREATE-DATABASE-LINK-0.sql │ │ ├── CREATE-DATABASE-LINK-1.sql │ │ ├── CREATE-DATABASE-LINK-2.sql │ │ ├── CREATE-DATABASE-LINK-3.sql │ │ ├── CREATE-DATABASE-LINK-4.sql │ │ ├── CREATE-DATABASE-LINK-5.sql │ │ ├── CREATE-DATABASE-LINK-6.sql │ │ ├── CREATE-DATABASE-LINK-7.sql │ │ ├── CREATE-DIMENSION-0.sql │ │ ├── CREATE-DIMENSION-1.sql │ │ ├── CREATE-DIMENSION-2.sql │ │ ├── CREATE-DIRECTORY-1.sql │ │ ├── CREATE-DIRECTORY-2.sql │ │ ├── CREATE-DIRECTORY-3.sql │ │ ├── CREATE-DIRECTORY-4.sql │ │ ├── CREATE-DISKGROUP-0.sql │ │ ├── CREATE-EDITION-0.sql │ │ ├── CREATE-EDITION-1.sql │ │ ├── CREATE-EDITION-2.sql │ │ ├── CREATE-EDITION-3.sql │ │ ├── CREATE-EDITION-4.sql │ │ ├── CREATE-EDITION-5.sql │ │ ├── CREATE-EDITION-6.sql │ │ ├── CREATE-EDITION-7.sql │ │ ├── CREATE-FLASHBACK-ARCHIVE-0.sql │ │ ├── CREATE-FLASHBACK-ARCHIVE-2.sql │ │ ├── CREATE-FLASHBACK-ARCHIVE-3.sql │ │ ├── CREATE-FLASHBACK-ARCHIVE-4.sql │ │ ├── CREATE-HIERARCHY-0.sql │ │ ├── CREATE-HIERARCHY-1.sql │ │ ├── CREATE-HIERARCHY-2.sql │ │ ├── CREATE-INDEX-0.sql │ │ ├── CREATE-INDEX-10.sql │ │ ├── CREATE-INDEX-11.sql │ │ ├── CREATE-INDEX-12.sql │ │ ├── CREATE-INDEX-13.sql │ │ ├── CREATE-INDEX-14.sql │ │ ├── CREATE-INDEX-15.sql │ │ ├── CREATE-INDEX-16.sql │ │ ├── CREATE-INDEX-17.sql │ │ ├── CREATE-INDEX-18.sql │ │ ├── CREATE-INDEX-19.sql │ │ ├── CREATE-INDEX-20.sql │ │ ├── CREATE-INDEX-21.sql │ │ ├── CREATE-INDEX-22.sql │ │ ├── CREATE-INDEX-23.sql │ │ ├── CREATE-INDEX-24.sql │ │ ├── CREATE-INDEX-25.sql │ │ ├── CREATE-INDEX-26.sql │ │ ├── CREATE-INDEX-27.sql │ │ ├── CREATE-INDEX-28.sql │ │ ├── CREATE-INDEX-29.sql │ │ ├── CREATE-INDEX-4.sql │ │ ├── CREATE-INDEX-5.sql │ │ ├── CREATE-INDEX-6.sql │ │ ├── CREATE-INDEX-7.sql │ │ ├── CREATE-INDEX-8.sql │ │ ├── CREATE-INDEX-9.sql │ │ ├── CREATE-INDEXTYPE-0.sql │ │ ├── CREATE-INMEMORY-JOIN-GROUP-0.sql │ │ ├── CREATE-INMEMORY-JOIN-GROUP-1.sql │ │ ├── CREATE-JAVA-0.sql │ │ ├── CREATE-JAVA-1.sql │ │ ├── CREATE-JAVA-2.sql │ │ ├── CREATE-JAVA-3.sql │ │ ├── CREATE-LOCKDOWN-PROFILE-0.sql │ │ ├── CREATE-MATERIALIZED-VIEW-0.sql │ │ ├── CREATE-MATERIALIZED-VIEW-1.sql │ │ ├── CREATE-MATERIALIZED-VIEW-10.sql │ │ ├── CREATE-MATERIALIZED-VIEW-11.sql │ │ ├── CREATE-MATERIALIZED-VIEW-12.sql │ │ ├── CREATE-MATERIALIZED-VIEW-2.sql │ │ ├── CREATE-MATERIALIZED-VIEW-3.sql │ │ ├── CREATE-MATERIALIZED-VIEW-4.sql │ │ ├── CREATE-MATERIALIZED-VIEW-5.sql │ │ ├── CREATE-MATERIALIZED-VIEW-6.sql │ │ ├── CREATE-MATERIALIZED-VIEW-7.sql │ │ ├── CREATE-MATERIALIZED-VIEW-8.sql │ │ ├── CREATE-MATERIALIZED-VIEW-9.sql │ │ ├── CREATE-MATERIALIZED-VIEW-LOG-1.sql │ │ ├── CREATE-MATERIALIZED-VIEW-LOG-2.sql │ │ ├── CREATE-MATERIALIZED-VIEW-LOG-3.sql │ │ ├── CREATE-MATERIALIZED-VIEW-LOG-4.sql │ │ ├── CREATE-MATERIALIZED-VIEW-LOG-5.sql │ │ ├── CREATE-MATERIALIZED-VIEW-LOG-6.sql │ │ ├── CREATE-MATERIALIZED-VIEW-LOG-7.sql │ │ ├── CREATE-MATERIALIZED-VIEW-LOG-8.sql │ │ ├── CREATE-MATERIALIZED-ZONEMAP-4.sql │ │ ├── CREATE-MATERIALIZED-ZONEMAP-5.sql │ │ ├── CREATE-MATERIALIZED-ZONEMAP-6.sql │ │ ├── CREATE-MATERIALIZED-ZONEMAP-7.sql │ │ ├── CREATE-MATERIALIZED-ZONEMAP-8.sql │ │ ├── CREATE-OPERATOR-0.sql │ │ ├── CREATE-OUTLINE-0.sql │ │ ├── CREATE-OUTLINE-1.sql │ │ ├── CREATE-OUTLINE-2.sql │ │ ├── CREATE-PFILE-0.sql │ │ ├── CREATE-PLUGGABLE-DATABASE-10.sql │ │ ├── CREATE-PLUGGABLE-DATABASE-11.sql │ │ ├── CREATE-PLUGGABLE-DATABASE-3.sql │ │ ├── CREATE-PLUGGABLE-DATABASE-4.sql │ │ ├── CREATE-PLUGGABLE-DATABASE-6.sql │ │ ├── CREATE-PLUGGABLE-DATABASE-9.sql │ │ ├── CREATE-PROFILE-1.sql │ │ ├── CREATE-PROFILE-2.sql │ │ ├── CREATE-PROFILE-4.sql │ │ ├── CREATE-PROFILE-5.sql │ │ ├── CREATE-PROFILE-6.sql │ │ ├── CREATE-PROFILE-7.sql │ │ ├── CREATE-RESTORE-POINT-0.sql │ │ ├── CREATE-ROLE-1.sql │ │ ├── CREATE-ROLE-2.sql │ │ ├── CREATE-ROLE-3.sql │ │ ├── CREATE-ROLE-4.sql │ │ ├── CREATE-ROLE-5.sql │ │ ├── CREATE-ROLE-6.sql │ │ ├── CREATE-ROLE-7.sql │ │ ├── CREATE-ROLLBACK-SEGMENT-0.sql │ │ ├── CREATE-ROLLBACK-SEGMENT-1.sql │ │ ├── CREATE-SCHEMA-0.sql │ │ ├── CREATE-SEQUENCE-2.sql │ │ ├── CREATE-SEQUENCE-3.sql │ │ ├── CREATE-SEQUENCE-4.sql │ │ ├── CREATE-SPFILE-0.sql │ │ ├── CREATE-SPFILE-1.sql │ │ ├── CREATE-SPFILE-2.sql │ │ ├── CREATE-SPFILE-4.sql │ │ ├── CREATE-SYNONYM-0.sql │ │ ├── CREATE-SYNONYM-1.sql │ │ ├── CREATE-SYNONYM-2.sql │ │ ├── CREATE-SYNONYM-3.sql │ │ ├── CREATE-SYNONYM-4.sql │ │ ├── CREATE-SYNONYM-5.sql │ │ ├── CREATE-TABLE-0.sql │ │ ├── CREATE-TABLE-1.sql │ │ ├── CREATE-TABLE-10.sql │ │ ├── CREATE-TABLE-11.sql │ │ ├── CREATE-TABLE-12.sql │ │ ├── CREATE-TABLE-13.sql │ │ ├── CREATE-TABLE-14.sql │ │ ├── CREATE-TABLE-15.sql │ │ ├── CREATE-TABLE-16.sql │ │ ├── CREATE-TABLE-17.sql │ │ ├── CREATE-TABLE-18.sql │ │ ├── CREATE-TABLE-19.sql │ │ ├── CREATE-TABLE-20.sql │ │ ├── CREATE-TABLE-21.sql │ │ ├── CREATE-TABLE-22.sql │ │ ├── CREATE-TABLE-23.sql │ │ ├── CREATE-TABLE-24.sql │ │ ├── CREATE-TABLE-25.sql │ │ ├── CREATE-TABLE-26.sql │ │ ├── CREATE-TABLE-27.sql │ │ ├── CREATE-TABLE-28.sql │ │ ├── CREATE-TABLE-29.sql │ │ ├── CREATE-TABLE-30.sql │ │ ├── CREATE-TABLE-31.sql │ │ ├── CREATE-TABLE-32.sql │ │ ├── CREATE-TABLE-33.sql │ │ ├── CREATE-TABLE-34.sql │ │ ├── CREATE-TABLE-35.sql │ │ ├── CREATE-TABLE-36.sql │ │ ├── CREATE-TABLE-37.sql │ │ ├── CREATE-TABLE-38.sql │ │ ├── CREATE-TABLE-39.sql │ │ ├── CREATE-TABLE-40.sql │ │ ├── CREATE-TABLE-41.sql │ │ ├── CREATE-TABLE-42.sql │ │ ├── CREATE-TABLE-43.sql │ │ ├── CREATE-TABLE-44.sql │ │ ├── CREATE-TABLE-45.sql │ │ ├── CREATE-TABLE-46.sql │ │ ├── CREATE-TABLE-47.sql │ │ ├── CREATE-TABLE-48.sql │ │ ├── CREATE-TABLE-49.sql │ │ ├── CREATE-TABLE-5.sql │ │ ├── CREATE-TABLE-50.sql │ │ ├── CREATE-TABLE-51.sql │ │ ├── CREATE-TABLE-52.sql │ │ ├── CREATE-TABLE-53.sql │ │ ├── CREATE-TABLE-54.sql │ │ ├── CREATE-TABLE-55.sql │ │ ├── CREATE-TABLE-56.sql │ │ ├── CREATE-TABLE-57.sql │ │ ├── CREATE-TABLE-58.sql │ │ ├── CREATE-TABLE-59.sql │ │ ├── CREATE-TABLE-6.sql │ │ ├── CREATE-TABLE-60.sql │ │ ├── CREATE-TABLE-61.sql │ │ ├── CREATE-TABLE-62.sql │ │ ├── CREATE-TABLE-63.sql │ │ ├── CREATE-TABLE-64.sql │ │ ├── CREATE-TABLE-65.sql │ │ ├── CREATE-TABLE-66.sql │ │ ├── CREATE-TABLE-67.sql │ │ ├── CREATE-TABLE-69.sql │ │ ├── CREATE-TABLE-7.sql │ │ ├── CREATE-TABLE-70.sql │ │ ├── CREATE-TABLE-71.sql │ │ ├── CREATE-TABLE-72.sql │ │ ├── CREATE-TABLE-73.sql │ │ ├── CREATE-TABLE-74.sql │ │ ├── CREATE-TABLE-75.sql │ │ ├── CREATE-TABLE-8.sql │ │ ├── CREATE-TABLE-9.sql │ │ ├── CREATE-TABLESPACE-0.sql │ │ ├── CREATE-TABLESPACE-1.sql │ │ ├── CREATE-TABLESPACE-10.sql │ │ ├── CREATE-TABLESPACE-11.sql │ │ ├── CREATE-TABLESPACE-12.sql │ │ ├── CREATE-TABLESPACE-14.sql │ │ ├── CREATE-TABLESPACE-15.sql │ │ ├── CREATE-TABLESPACE-16.sql │ │ ├── CREATE-TABLESPACE-2.sql │ │ ├── CREATE-TABLESPACE-3.sql │ │ ├── CREATE-TABLESPACE-4.sql │ │ ├── CREATE-TABLESPACE-5.sql │ │ ├── CREATE-TABLESPACE-6.sql │ │ ├── CREATE-TABLESPACE-7.sql │ │ ├── CREATE-TABLESPACE-8.sql │ │ ├── CREATE-TABLESPACE-9.sql │ │ ├── CREATE-TABLESPACE-SET-0.sql │ │ ├── CREATE-USER-0.sql │ │ ├── CREATE-USER-1.sql │ │ ├── CREATE-USER-2.sql │ │ ├── CREATE-USER-3.sql │ │ ├── CREATE-USER-4.sql │ │ ├── CREATE-USER-5.sql │ │ ├── CREATE-USER-6.sql │ │ ├── CREATE-USER-7.sql │ │ ├── CREATE-USER-8.sql │ │ ├── CREATE-USER-9.sql │ │ ├── CREATE-VIEW-1.sql │ │ ├── CREATE-VIEW-10.sql │ │ ├── CREATE-VIEW-11.sql │ │ ├── CREATE-VIEW-12.sql │ │ ├── CREATE-VIEW-13.sql │ │ ├── CREATE-VIEW-14.sql │ │ ├── CREATE-VIEW-15.sql │ │ ├── CREATE-VIEW-2.sql │ │ ├── CREATE-VIEW-3.sql │ │ ├── CREATE-VIEW-4.sql │ │ ├── CREATE-VIEW-5.sql │ │ ├── CREATE-VIEW-6.sql │ │ ├── CREATE-VIEW-7.sql │ │ ├── CREATE-VIEW-8.sql │ │ ├── CREATE-VIEW-9.sql │ │ ├── CUBE_TABLE-1.sql │ │ ├── CUBE_TABLE-2.sql │ │ ├── CUME_DIST-0.sql │ │ ├── CUME_DIST-1.sql │ │ ├── CURRENT_DATE-0.sql │ │ ├── CURRENT_TIMESTAMP-0.sql │ │ ├── CURRENT_TIMESTAMP-1.sql │ │ ├── CURRENT_TIMESTAMP-2.sql │ │ ├── CURRENT_TIMESTAMP-3.sql │ │ ├── CURSOR-Expressions-0.sql │ │ ├── CURSOR-Expressions-1.sql │ │ ├── CURSOR-Expressions-2.sql │ │ ├── CV-0.sql │ │ ├── Comments-0.sql │ │ ├── Comments-1.sql │ │ ├── Comments-10.sql │ │ ├── Comments-12.sql │ │ ├── Comments-13.sql │ │ ├── Comments-15.sql │ │ ├── Comments-16.sql │ │ ├── Comments-17.sql │ │ ├── Comments-18.sql │ │ ├── Comments-19.sql │ │ ├── Comments-2.sql │ │ ├── Comments-20.sql │ │ ├── Comments-21.sql │ │ ├── Comments-22.sql │ │ ├── Comments-23.sql │ │ ├── Comments-24.sql │ │ ├── Comments-25.sql │ │ ├── Comments-26.sql │ │ ├── Comments-27.sql │ │ ├── Comments-28.sql │ │ ├── Comments-29.sql │ │ ├── Comments-3.sql │ │ ├── Comments-30.sql │ │ ├── Comments-31.sql │ │ ├── Comments-32.sql │ │ ├── Comments-33.sql │ │ ├── Comments-34.sql │ │ ├── Comments-35.sql │ │ ├── Comments-36.sql │ │ ├── Comments-37.sql │ │ ├── Comments-38.sql │ │ ├── Comments-39.sql │ │ ├── Comments-4.sql │ │ ├── Comments-41.sql │ │ ├── Comments-42.sql │ │ ├── Comments-43.sql │ │ ├── Comments-44.sql │ │ ├── Comments-45.sql │ │ ├── Comments-46.sql │ │ ├── Comments-48.sql │ │ ├── Comments-49.sql │ │ ├── Comments-5.sql │ │ ├── Comments-50.sql │ │ ├── Comments-51.sql │ │ ├── Comments-52.sql │ │ ├── Comments-53.sql │ │ ├── Comments-56.sql │ │ ├── Comments-57.sql │ │ ├── Comments-58.sql │ │ ├── Comments-59.sql │ │ ├── Comments-6.sql │ │ ├── Comments-60.sql │ │ ├── Comments-61.sql │ │ ├── Comments-62.sql │ │ ├── Comments-63.sql │ │ ├── Comments-64.sql │ │ ├── Comments-7.sql │ │ ├── Comments-8.sql │ │ ├── Comments-9.sql │ │ ├── Comparison-Conditions-0.sql │ │ ├── Comparison-Conditions-1.sql │ │ ├── Comparison-Conditions-2.sql │ │ ├── Comparison-Conditions-3.sql │ │ ├── Comparison-Conditions-4.sql │ │ ├── Comparison-Conditions-5.sql │ │ ├── Concatenation-Operator-0.sql │ │ ├── Concatenation-Operator-1.sql │ │ ├── DBTIMEZONE-0.sql │ │ ├── DECODE-0.sql │ │ ├── DECOMPOSE-0.sql │ │ ├── DELETE-0.sql │ │ ├── DELETE-1.sql │ │ ├── DELETE-10.sql │ │ ├── DELETE-11.sql │ │ ├── DELETE-12.sql │ │ ├── DELETE-13.sql │ │ ├── DELETE-14.sql │ │ ├── DELETE-2.sql │ │ ├── DELETE-3.sql │ │ ├── DELETE-4.sql │ │ ├── DELETE-5.sql │ │ ├── DELETE-6.sql │ │ ├── DELETE-7.sql │ │ ├── DELETE-8.sql │ │ ├── DENSE_RANK-0.sql │ │ ├── DENSE_RANK-1.sql │ │ ├── DEPTH-0.sql │ │ ├── DEREF-0.sql │ │ ├── DISASSOCIATE-STATISTICS-0.sql │ │ ├── DROP-ANALYTIC-VIEW-0.sql │ │ ├── DROP-ATTRIBUTE-DIMENSION-0.sql │ │ ├── DROP-AUDIT-POLICY-Unified-Auditing-0.sql │ │ ├── DROP-CLUSTER-0.sql │ │ ├── DROP-CLUSTER-1.sql │ │ ├── DROP-CONTEXT-0.sql │ │ ├── DROP-DATABASE-0.sql │ │ ├── DROP-DATABASE-LINK-0.sql │ │ ├── DROP-DIMENSION-0.sql │ │ ├── DROP-DIRECTORY-0.sql │ │ ├── DROP-DISKGROUP-0.sql │ │ ├── DROP-FUNCTION-0.sql │ │ ├── DROP-HIERARCHY-0.sql │ │ ├── DROP-INDEX-0.sql │ │ ├── DROP-INDEXTYPE-0.sql │ │ ├── DROP-INMEMORY-JOIN-GROUP-0.sql │ │ ├── DROP-JAVA-0.sql │ │ ├── DROP-LIBRARY-0.sql │ │ ├── DROP-LOCKDOWN-PROFILE-0.sql │ │ ├── DROP-MATERIALIZED-VIEW-0.sql │ │ ├── DROP-MATERIALIZED-VIEW-1.sql │ │ ├── DROP-MATERIALIZED-VIEW-LOG-0.sql │ │ ├── DROP-MATERIALIZED-ZONEMAP-0.sql │ │ ├── DROP-OPERATOR-0.sql │ │ ├── DROP-OUTLINE-0.sql │ │ ├── DROP-PACKAGE-0.sql │ │ ├── DROP-PLUGGABLE-DATABASE-1.sql │ │ ├── DROP-PROCEDURE-0.sql │ │ ├── DROP-PROFILE-0.sql │ │ ├── DROP-RESTORE-POINT-0.sql │ │ ├── DROP-ROLE-0.sql │ │ ├── DROP-ROLLBACK-SEGMENT-0.sql │ │ ├── DROP-SEQUENCE-0.sql │ │ ├── DROP-SYNONYM-0.sql │ │ ├── DROP-TABLE-0.sql │ │ ├── DROP-TABLESPACE-0.sql │ │ ├── DROP-TABLESPACE-3.sql │ │ ├── DROP-TABLESPACE-SET-0.sql │ │ ├── DROP-TRIGGER-0.sql │ │ ├── DROP-TYPE-0.sql │ │ ├── DROP-TYPE-BODY-0.sql │ │ ├── DROP-USER-0.sql │ │ ├── DROP-USER-1.sql │ │ ├── DROP-VIEW-0.sql │ │ ├── DUMP-0.sql │ │ ├── Data-Type-Comparison-Rules-2.sql │ │ ├── Data-Type-Comparison-Rules-3.sql │ │ ├── Data-Type-Comparison-Rules-4.sql │ │ ├── Data-Types-11.sql │ │ ├── Data-Types-12.sql │ │ ├── Data-Types-13.sql │ │ ├── Data-Types-14.sql │ │ ├── Data-Types-15.sql │ │ ├── Data-Types-16.sql │ │ ├── Data-Types-17.sql │ │ ├── Data-Types-18.sql │ │ ├── Data-Types-19.sql │ │ ├── Data-Types-20.sql │ │ ├── Data-Types-21.sql │ │ ├── Data-Types-22.sql │ │ ├── Data-Types-23.sql │ │ ├── Data-Types-24.sql │ │ ├── Data-Types-25.sql │ │ ├── Data-Types-26.sql │ │ ├── Data-Types-27.sql │ │ ├── Data-Types-28.sql │ │ ├── Data-Types-29.sql │ │ ├── Data-Types-3.sql │ │ ├── Data-Types-30.sql │ │ ├── Data-Types-31.sql │ │ ├── Data-Types-32.sql │ │ ├── Data-Types-33.sql │ │ ├── Data-Types-34.sql │ │ ├── Data-Types-35.sql │ │ ├── Data-Types-36.sql │ │ ├── Data-Types-4.sql │ │ ├── Data-Types-40.sql │ │ ├── Data-Types-41.sql │ │ ├── Data-Types-42.sql │ │ ├── Data-Types-5.sql │ │ ├── Datetime-Expressions-0.sql │ │ ├── EMPTY_BLOB-EMPTY_CLOB-0.sql │ │ ├── EXISTS-Condition-1.sql │ │ ├── EXISTSNODE-0.sql │ │ ├── EXP-0.sql │ │ ├── EXPLAIN-PLAN-0.sql │ │ ├── EXPLAIN-PLAN-1.sql │ │ ├── EXPLAIN-PLAN-3.sql │ │ ├── EXPLAIN-PLAN-4.sql │ │ ├── EXTRACT-XML-0.sql │ │ ├── EXTRACT-datetime-0.sql │ │ ├── EXTRACT-datetime-1.sql │ │ ├── EXTRACT-datetime-2.sql │ │ ├── EXTRACT-datetime-3.sql │ │ ├── EXTRACTVALUE-0.sql │ │ ├── Expression-Lists-1.sql │ │ ├── Expression-Lists-2.sql │ │ ├── Expression-Lists-3.sql │ │ ├── FEATURE_COMPARE-0.sql │ │ ├── FEATURE_COMPARE-1.sql │ │ ├── FEATURE_DETAILS-0.sql │ │ ├── FEATURE_DETAILS-1.sql │ │ ├── FEATURE_ID-0.sql │ │ ├── FEATURE_SET-0.sql │ │ ├── FEATURE_VALUE-0.sql │ │ ├── FIRST-0.sql │ │ ├── FIRST-1.sql │ │ ├── FIRST_VALUE-0.sql │ │ ├── FIRST_VALUE-1.sql │ │ ├── FIRST_VALUE-2.sql │ │ ├── FIRST_VALUE-3.sql │ │ ├── FLASHBACK-DATABASE-0.sql │ │ ├── FLASHBACK-DATABASE-1.sql │ │ ├── FLASHBACK-TABLE-0.sql │ │ ├── FLASHBACK-TABLE-1.sql │ │ ├── FLASHBACK-TABLE-10.sql │ │ ├── FLASHBACK-TABLE-2.sql │ │ ├── FLASHBACK-TABLE-3.sql │ │ ├── FLASHBACK-TABLE-4.sql │ │ ├── FLASHBACK-TABLE-5.sql │ │ ├── FLASHBACK-TABLE-6.sql │ │ ├── FLASHBACK-TABLE-7.sql │ │ ├── FLASHBACK-TABLE-8.sql │ │ ├── FLASHBACK-TABLE-9.sql │ │ ├── FLOOR-0.sql │ │ ├── FROM_TZ-0.sql │ │ ├── Floating-Point-Conditions-1.sql │ │ ├── Floating-Point-Conditions-3.sql │ │ ├── Format-Models-0.sql │ │ ├── Format-Models-47.sql │ │ ├── Format-Models-48.sql │ │ ├── Format-Models-49.sql │ │ ├── Format-Models-50.sql │ │ ├── Format-Models-51.sql │ │ ├── Format-Models-52.sql │ │ ├── Format-Models-53.sql │ │ ├── Format-Models-54.sql │ │ ├── Format-Models-56.sql │ │ ├── Format-Models-57.sql │ │ ├── Format-Models-58.sql │ │ ├── GRANT-0.sql │ │ ├── GRANT-1.sql │ │ ├── GRANT-10.sql │ │ ├── GRANT-11.sql │ │ ├── GRANT-12.sql │ │ ├── GRANT-13.sql │ │ ├── GRANT-14.sql │ │ ├── GRANT-2.sql │ │ ├── GRANT-3.sql │ │ ├── GRANT-4.sql │ │ ├── GRANT-5.sql │ │ ├── GRANT-6.sql │ │ ├── GRANT-7.sql │ │ ├── GRANT-8.sql │ │ ├── GRANT-9.sql │ │ ├── GREATEST-0.sql │ │ ├── GREATEST-1.sql │ │ ├── GROUPING-0.sql │ │ ├── GROUPING_ID-0.sql │ │ ├── GROUP_ID-0.sql │ │ ├── Graphic-Syntax-Diagrams-0.sql │ │ ├── Graphic-Syntax-Diagrams-2.sql │ │ ├── HEXTORAW-0.sql │ │ ├── HEXTORAW-1.sql │ │ ├── Hierarchical-Queries-2.sql │ │ ├── Hierarchical-Queries-3.sql │ │ ├── Hierarchical-Queries-4.sql │ │ ├── Hierarchical-Queries-5.sql │ │ ├── Hierarchical-Queries-6.sql │ │ ├── Hierarchical-Queries-7.sql │ │ ├── Hierarchical-Queries-8.sql │ │ ├── Hierarchical-Queries-9.sql │ │ ├── Hierarchical-Query-Pseudocolumns-0.sql │ │ ├── IN-Condition-1.sql │ │ ├── IN-Condition-3.sql │ │ ├── IN-Condition-4.sql │ │ ├── IN-Condition-5.sql │ │ ├── IN-Condition-7.sql │ │ ├── IN-Condition-8.sql │ │ ├── IN-Condition-9.sql │ │ ├── INITCAP-0.sql │ │ ├── INSERT-10.sql │ │ ├── INSERT-11.sql │ │ ├── INSERT-12.sql │ │ ├── INSERT-13.sql │ │ ├── INSERT-14.sql │ │ ├── INSERT-15.sql │ │ ├── INSERT-16.sql │ │ ├── INSERT-17.sql │ │ ├── INSERT-18.sql │ │ ├── INSERT-19.sql │ │ ├── INSERT-20.sql │ │ ├── INSERT-21.sql │ │ ├── INSERT-24.sql │ │ ├── INSERT-25.sql │ │ ├── INSERT-26.sql │ │ ├── INSERT-27.sql │ │ ├── INSERT-28.sql │ │ ├── INSERT-29.sql │ │ ├── INSERT-30.sql │ │ ├── INSERT-31.sql │ │ ├── INSERT-32.sql │ │ ├── INSERT-33.sql │ │ ├── INSERT-34.sql │ │ ├── INSERT-35.sql │ │ ├── INSERT-36.sql │ │ ├── INSERT-37.sql │ │ ├── INSERT-38.sql │ │ ├── INSERT-39.sql │ │ ├── INSERT-40.sql │ │ ├── INSERT-41.sql │ │ ├── INSERT-42.sql │ │ ├── INSERT-5.sql │ │ ├── INSERT-6.sql │ │ ├── INSERT-7.sql │ │ ├── INSERT-8.sql │ │ ├── INSERT-9.sql │ │ ├── INSTR-0.sql │ │ ├── INSTR-1.sql │ │ ├── INSTR-2.sql │ │ ├── IS-OF-type-Condition-0.sql │ │ ├── ITERATION_NUMBER-0.sql │ │ ├── Interval-Expressions-0.sql │ │ ├── JSON-Object-Access-Expressions-0.sql │ │ ├── JSON-Object-Access-Expressions-1.sql │ │ ├── JSON-Object-Access-Expressions-2.sql │ │ ├── JSON_ARRAY-0.sql │ │ ├── JSON_ARRAYAGG-0.sql │ │ ├── JSON_ARRAYAGG-1.sql │ │ ├── JSON_DATAGUIDE-0.sql │ │ ├── JSON_OBJECT-0.sql │ │ ├── JSON_OBJECT-1.sql │ │ ├── JSON_OBJECT-10.sql │ │ ├── JSON_OBJECT-11.sql │ │ ├── JSON_OBJECT-3.sql │ │ ├── JSON_OBJECT-4.sql │ │ ├── JSON_OBJECT-9.sql │ │ ├── JSON_OBJECTAGG-0.sql │ │ ├── JSON_QUERY-0.sql │ │ ├── JSON_QUERY-1.sql │ │ ├── JSON_QUERY-10.sql │ │ ├── JSON_QUERY-11.sql │ │ ├── JSON_QUERY-2.sql │ │ ├── JSON_QUERY-3.sql │ │ ├── JSON_QUERY-4.sql │ │ ├── JSON_QUERY-5.sql │ │ ├── JSON_QUERY-6.sql │ │ ├── JSON_QUERY-7.sql │ │ ├── JSON_QUERY-8.sql │ │ ├── JSON_QUERY-9.sql │ │ ├── JSON_SERIALIZE-0.sql │ │ ├── JSON_TABLE-0.sql │ │ ├── JSON_TABLE-1.sql │ │ ├── JSON_TABLE-10.sql │ │ ├── JSON_TABLE-11.sql │ │ ├── JSON_TABLE-12.sql │ │ ├── JSON_TABLE-13.sql │ │ ├── JSON_TABLE-14.sql │ │ ├── JSON_TABLE-15.sql │ │ ├── JSON_TABLE-16.sql │ │ ├── JSON_TABLE-2.sql │ │ ├── JSON_TABLE-4.sql │ │ ├── JSON_TABLE-5.sql │ │ ├── JSON_TABLE-6.sql │ │ ├── JSON_TABLE-8.sql │ │ ├── JSON_TABLE-9.sql │ │ ├── JSON_TRANSFORM-0.sql │ │ ├── JSON_TRANSFORM-1.sql │ │ ├── JSON_VALUE-10.sql │ │ ├── JSON_VALUE-11.sql │ │ ├── JSON_VALUE-12.sql │ │ ├── JSON_VALUE-3.sql │ │ ├── JSON_VALUE-4.sql │ │ ├── JSON_VALUE-5.sql │ │ ├── JSON_VALUE-6.sql │ │ ├── JSON_VALUE-7.sql │ │ ├── JSON_VALUE-8.sql │ │ ├── JSON_VALUE-9.sql │ │ ├── Joins-0.sql │ │ ├── Joins-1.sql │ │ ├── Joins-3.sql │ │ ├── LAG-0.sql │ │ ├── LAST_DAY-0.sql │ │ ├── LAST_DAY-1.sql │ │ ├── LAST_VALUE-0.sql │ │ ├── LAST_VALUE-1.sql │ │ ├── LAST_VALUE-2.sql │ │ ├── LAST_VALUE-3.sql │ │ ├── LEAD-0.sql │ │ ├── LEAST-0.sql │ │ ├── LEAST-1.sql │ │ ├── LENGTH-0.sql │ │ ├── LENGTH-1.sql │ │ ├── LISTAGG-0.sql │ │ ├── LISTAGG-1.sql │ │ ├── LISTAGG-2.sql │ │ ├── LISTAGG-3.sql │ │ ├── LN-0.sql │ │ ├── LNNVL-0.sql │ │ ├── LNNVL-1.sql │ │ ├── LOCALTIMESTAMP-0.sql │ │ ├── LOCALTIMESTAMP-1.sql │ │ ├── LOCALTIMESTAMP-2.sql │ │ ├── LOCALTIMESTAMP-3.sql │ │ ├── LOCK-TABLE-1.sql │ │ ├── LOCK-TABLE-2.sql │ │ ├── LOG-0.sql │ │ ├── LOWER-0.sql │ │ ├── LPAD-0.sql │ │ ├── LTRIM-0.sql │ │ ├── Lexical-Conventions-0.sql │ │ ├── Literals-10.sql │ │ ├── Literals-11.sql │ │ ├── Literals-12.sql │ │ ├── Literals-15.sql │ │ ├── Literals-16.sql │ │ ├── Literals-17.sql │ │ ├── Literals-18.sql │ │ ├── Literals-19.sql │ │ ├── Literals-20.sql │ │ ├── Literals-27.sql │ │ ├── Literals-3.sql │ │ ├── Literals-4.sql │ │ ├── Literals-5.sql │ │ ├── Literals-6.sql │ │ ├── Literals-9.sql │ │ ├── Logical-Conditions-1.sql │ │ ├── Logical-Conditions-3.sql │ │ ├── Logical-Conditions-5.sql │ │ ├── Logical-Conditions-6.sql │ │ ├── Logical-Conditions-7.sql │ │ ├── MAKE_REF-0.sql │ │ ├── MAX-0.sql │ │ ├── MAX-1.sql │ │ ├── MAX-2.sql │ │ ├── MEDIAN-1.sql │ │ ├── MEDIAN-2.sql │ │ ├── MERGE-0.sql │ │ ├── MERGE-1.sql │ │ ├── MERGE-10.sql │ │ ├── MERGE-11.sql │ │ ├── MERGE-12.sql │ │ ├── MERGE-13.sql │ │ ├── MERGE-2.sql │ │ ├── MERGE-3.sql │ │ ├── MERGE-4.sql │ │ ├── MERGE-5.sql │ │ ├── MERGE-6.sql │ │ ├── MERGE-7.sql │ │ ├── MERGE-8.sql │ │ ├── MERGE-9.sql │ │ ├── MIN-0.sql │ │ ├── MIN-1.sql │ │ ├── MOD-0.sql │ │ ├── MONTHS_BETWEEN-0.sql │ │ ├── Model-Conditions-0.sql │ │ ├── Model-Conditions-1.sql │ │ ├── Model-Expressions-0.sql │ │ ├── Multiset-Conditions-0.sql │ │ ├── Multiset-Conditions-1.sql │ │ ├── Multiset-Conditions-2.sql │ │ ├── Multiset-Conditions-3.sql │ │ ├── Multiset-Operators-0.sql │ │ ├── Multiset-Operators-1.sql │ │ ├── Multiset-Operators-2.sql │ │ ├── Multiset-Operators-3.sql │ │ ├── Multiset-Operators-4.sql │ │ ├── Multiset-Operators-5.sql │ │ ├── Multiset-Operators-6.sql │ │ ├── NANVL-0.sql │ │ ├── NANVL-1.sql │ │ ├── NCHR-0.sql │ │ ├── NEW_TIME-0.sql │ │ ├── NEXT_DAY-0.sql │ │ ├── NLSSORT-1.sql │ │ ├── NLSSORT-2.sql │ │ ├── NLSSORT-3.sql │ │ ├── NLS_CHARSET_DECL_LEN-0.sql │ │ ├── NLS_CHARSET_ID-0.sql │ │ ├── NLS_CHARSET_NAME-0.sql │ │ ├── NLS_COLLATION_ID-0.sql │ │ ├── NLS_COLLATION_NAME-0.sql │ │ ├── NLS_COLLATION_NAME-1.sql │ │ ├── NLS_COLLATION_NAME-2.sql │ │ ├── NLS_INITCAP-1.sql │ │ ├── NLS_LOWER-0.sql │ │ ├── NLS_UPPER-0.sql │ │ ├── NOAUDIT-Traditional-Auditing-0.sql │ │ ├── NOAUDIT-Traditional-Auditing-1.sql │ │ ├── NOAUDIT-Traditional-Auditing-2.sql │ │ ├── NOAUDIT-Traditional-Auditing-3.sql │ │ ├── NOAUDIT-Traditional-Auditing-4.sql │ │ ├── NOAUDIT-Unified-Auditing-0.sql │ │ ├── NOAUDIT-Unified-Auditing-1.sql │ │ ├── NOAUDIT-Unified-Auditing-2.sql │ │ ├── NOAUDIT-Unified-Auditing-3.sql │ │ ├── NOAUDIT-Unified-Auditing-4.sql │ │ ├── NOAUDIT-Unified-Auditing-5.sql │ │ ├── NOAUDIT-Unified-Auditing-6.sql │ │ ├── NOAUDIT-Unified-Auditing-7.sql │ │ ├── NTH_VALUE-0.sql │ │ ├── NTILE-0.sql │ │ ├── NULLIF-1.sql │ │ ├── NUMTODSINTERVAL-0.sql │ │ ├── NUMTOYMINTERVAL-0.sql │ │ ├── NVL-0.sql │ │ ├── NVL2-0.sql │ │ ├── Null-Conditions-1.sql │ │ ├── ORA_DM_PARTITION_NAME-0.sql │ │ ├── ORA_HASH-0.sql │ │ ├── ORA_INVOKING_USER-0.sql │ │ ├── ORA_INVOKING_USERID-0.sql │ │ ├── ORA_ROWSCN-Pseudocolumn-0.sql │ │ ├── Object-Access-Expressions-0.sql │ │ ├── PERCENTILE_CONT-1.sql │ │ ├── PERCENTILE_CONT-2.sql │ │ ├── PERCENTILE_DISC-0.sql │ │ ├── PERCENT_RANK-0.sql │ │ ├── PERCENT_RANK-1.sql │ │ ├── POWER-0.sql │ │ ├── POWERMULTISET-0.sql │ │ ├── POWERMULTISET-1.sql │ │ ├── POWERMULTISET_BY_CARDINALITY-0.sql │ │ ├── POWERMULTISET_BY_CARDINALITY-1.sql │ │ ├── POWERMULTISET_BY_CARDINALITY-2.sql │ │ ├── PREDICTION-0.sql │ │ ├── PREDICTION-2.sql │ │ ├── PREDICTION_BOUNDS-0.sql │ │ ├── PREDICTION_COST-2.sql │ │ ├── PREDICTION_DETAILS-0.sql │ │ ├── PREDICTION_DETAILS-1.sql │ │ ├── PREDICTION_PROBABILITY-0.sql │ │ ├── PREDICTION_PROBABILITY-1.sql │ │ ├── PREDICTION_SET-0.sql │ │ ├── PRESENTNNV-0.sql │ │ ├── PRESENTV-0.sql │ │ ├── PREVIOUS-0.sql │ │ ├── PURGE-0.sql │ │ ├── PURGE-1.sql │ │ ├── PURGE-2.sql │ │ ├── PURGE-3.sql │ │ ├── Pattern-matching-Conditions-1.sql │ │ ├── Pattern-matching-Conditions-10.sql │ │ ├── Pattern-matching-Conditions-11.sql │ │ ├── Pattern-matching-Conditions-12.sql │ │ ├── Pattern-matching-Conditions-2.sql │ │ ├── Pattern-matching-Conditions-3.sql │ │ ├── Pattern-matching-Conditions-4.sql │ │ ├── Pattern-matching-Conditions-9.sql │ │ ├── RANK-0.sql │ │ ├── RANK-1.sql │ │ ├── RANK-2.sql │ │ ├── RATIO_TO_REPORT-0.sql │ │ ├── RAWTOHEX-0.sql │ │ ├── RAWTONHEX-0.sql │ │ ├── REF-1.sql │ │ ├── REFTOHEX-0.sql │ │ ├── REGEXP_COUNT-0.sql │ │ ├── REGEXP_COUNT-1.sql │ │ ├── REGEXP_COUNT-10.sql │ │ ├── REGEXP_COUNT-11.sql │ │ ├── REGEXP_COUNT-12.sql │ │ ├── REGEXP_COUNT-13.sql │ │ ├── REGEXP_COUNT-14.sql │ │ ├── REGEXP_COUNT-15.sql │ │ ├── REGEXP_COUNT-16.sql │ │ ├── REGEXP_COUNT-17.sql │ │ ├── REGEXP_COUNT-2.sql │ │ ├── REGEXP_COUNT-3.sql │ │ ├── REGEXP_COUNT-4.sql │ │ ├── REGEXP_COUNT-5.sql │ │ ├── REGEXP_COUNT-6.sql │ │ ├── REGEXP_COUNT-7.sql │ │ ├── REGEXP_COUNT-8.sql │ │ ├── REGEXP_COUNT-9.sql │ │ ├── REGEXP_INSTR-1.sql │ │ ├── REGEXP_INSTR-2.sql │ │ ├── REGEXP_INSTR-3.sql │ │ ├── REGEXP_INSTR-4.sql │ │ ├── REGEXP_INSTR-5.sql │ │ ├── REGEXP_INSTR-6.sql │ │ ├── REGEXP_INSTR-7.sql │ │ ├── REGEXP_REPLACE-0.sql │ │ ├── REGEXP_REPLACE-1.sql │ │ ├── REGEXP_REPLACE-10.sql │ │ ├── REGEXP_REPLACE-11.sql │ │ ├── REGEXP_REPLACE-12.sql │ │ ├── REGEXP_REPLACE-2.sql │ │ ├── REGEXP_REPLACE-3.sql │ │ ├── REGEXP_REPLACE-4.sql │ │ ├── REGEXP_REPLACE-5.sql │ │ ├── REGEXP_REPLACE-6.sql │ │ ├── REGEXP_REPLACE-7.sql │ │ ├── REGEXP_REPLACE-8.sql │ │ ├── REGEXP_REPLACE-9.sql │ │ ├── REGEXP_SUBSTR-0.sql │ │ ├── REGEXP_SUBSTR-1.sql │ │ ├── REGEXP_SUBSTR-2.sql │ │ ├── REGEXP_SUBSTR-3.sql │ │ ├── REGEXP_SUBSTR-4.sql │ │ ├── REGEXP_SUBSTR-5.sql │ │ ├── REGEXP_SUBSTR-6.sql │ │ ├── REGEXP_SUBSTR-7.sql │ │ ├── REGEXP_SUBSTR-8.sql │ │ ├── REGR_-Linear-Regression-Functions-10.sql │ │ ├── REGR_-Linear-Regression-Functions-11.sql │ │ ├── REGR_-Linear-Regression-Functions-12.sql │ │ ├── REGR_-Linear-Regression-Functions-13.sql │ │ ├── REGR_-Linear-Regression-Functions-8.sql │ │ ├── REGR_-Linear-Regression-Functions-9.sql │ │ ├── REMAINDER-0.sql │ │ ├── RENAME-0.sql │ │ ├── RENAME-1.sql │ │ ├── REPLACE-0.sql │ │ ├── REVOKE-0.sql │ │ ├── REVOKE-1.sql │ │ ├── REVOKE-10.sql │ │ ├── REVOKE-11.sql │ │ ├── REVOKE-12.sql │ │ ├── REVOKE-13.sql │ │ ├── REVOKE-14.sql │ │ ├── REVOKE-15.sql │ │ ├── REVOKE-16.sql │ │ ├── REVOKE-17.sql │ │ ├── REVOKE-18.sql │ │ ├── REVOKE-19.sql │ │ ├── REVOKE-2.sql │ │ ├── REVOKE-3.sql │ │ ├── REVOKE-4.sql │ │ ├── REVOKE-5.sql │ │ ├── REVOKE-6.sql │ │ ├── REVOKE-7.sql │ │ ├── REVOKE-8.sql │ │ ├── REVOKE-9.sql │ │ ├── ROLLBACK-0.sql │ │ ├── ROLLBACK-1.sql │ │ ├── ROLLBACK-2.sql │ │ ├── ROUND-date-0.sql │ │ ├── ROUND-number-1.sql │ │ ├── ROUND-number-2.sql │ │ ├── ROUND_TIES_TO_EVEN-number-1.sql │ │ ├── ROWID-Pseudocolumn-0.sql │ │ ├── ROWIDTOCHAR-0.sql │ │ ├── ROWIDTONCHAR-0.sql │ │ ├── ROWNUM-Pseudocolumn-0.sql │ │ ├── ROWNUM-Pseudocolumn-1.sql │ │ ├── ROWNUM-Pseudocolumn-2.sql │ │ ├── ROWNUM-Pseudocolumn-3.sql │ │ ├── ROWNUM-Pseudocolumn-4.sql │ │ ├── ROW_NUMBER-0.sql │ │ ├── ROW_NUMBER-1.sql │ │ ├── RPAD-0.sql │ │ ├── RTRIM-0.sql │ │ ├── SAVEPOINT-0.sql │ │ ├── SCN_TO_TIMESTAMP-0.sql │ │ ├── SCN_TO_TIMESTAMP-1.sql │ │ ├── SCN_TO_TIMESTAMP-2.sql │ │ ├── SELECT-10.sql │ │ ├── SELECT-100.sql │ │ ├── SELECT-101.sql │ │ ├── SELECT-102.sql │ │ ├── SELECT-103.sql │ │ ├── SELECT-105.sql │ │ ├── SELECT-106.sql │ │ ├── SELECT-107.sql │ │ ├── SELECT-108.sql │ │ ├── SELECT-109.sql │ │ ├── SELECT-11.sql │ │ ├── SELECT-110.sql │ │ ├── SELECT-111.sql │ │ ├── SELECT-112.sql │ │ ├── SELECT-113.sql │ │ ├── SELECT-114.sql │ │ ├── SELECT-115.sql │ │ ├── SELECT-116.sql │ │ ├── SELECT-117.sql │ │ ├── SELECT-118.sql │ │ ├── SELECT-12.sql │ │ ├── SELECT-13.sql │ │ ├── SELECT-14.sql │ │ ├── SELECT-15.sql │ │ ├── SELECT-17.sql │ │ ├── SELECT-18.sql │ │ ├── SELECT-19.sql │ │ ├── SELECT-20.sql │ │ ├── SELECT-21.sql │ │ ├── SELECT-22.sql │ │ ├── SELECT-23.sql │ │ ├── SELECT-24.sql │ │ ├── SELECT-25.sql │ │ ├── SELECT-26.sql │ │ ├── SELECT-27.sql │ │ ├── SELECT-28.sql │ │ ├── SELECT-29.sql │ │ ├── SELECT-30.sql │ │ ├── SELECT-31.sql │ │ ├── SELECT-33.sql │ │ ├── SELECT-35.sql │ │ ├── SELECT-37.sql │ │ ├── SELECT-39.sql │ │ ├── SELECT-4.sql │ │ ├── SELECT-40.sql │ │ ├── SELECT-41.sql │ │ ├── SELECT-42.sql │ │ ├── SELECT-43.sql │ │ ├── SELECT-44.sql │ │ ├── SELECT-45.sql │ │ ├── SELECT-46.sql │ │ ├── SELECT-47.sql │ │ ├── SELECT-48.sql │ │ ├── SELECT-49.sql │ │ ├── SELECT-5.sql │ │ ├── SELECT-50.sql │ │ ├── SELECT-51.sql │ │ ├── SELECT-52.sql │ │ ├── SELECT-53.sql │ │ ├── SELECT-54.sql │ │ ├── SELECT-55.sql │ │ ├── SELECT-56.sql │ │ ├── SELECT-57.sql │ │ ├── SELECT-58.sql │ │ ├── SELECT-59.sql │ │ ├── SELECT-60.sql │ │ ├── SELECT-61.sql │ │ ├── SELECT-62.sql │ │ ├── SELECT-63.sql │ │ ├── SELECT-64.sql │ │ ├── SELECT-65.sql │ │ ├── SELECT-66.sql │ │ ├── SELECT-67.sql │ │ ├── SELECT-68.sql │ │ ├── SELECT-69.sql │ │ ├── SELECT-70.sql │ │ ├── SELECT-71.sql │ │ ├── SELECT-72.sql │ │ ├── SELECT-73.sql │ │ ├── SELECT-74.sql │ │ ├── SELECT-75.sql │ │ ├── SELECT-76.sql │ │ ├── SELECT-77.sql │ │ ├── SELECT-79.sql │ │ ├── SELECT-80.sql │ │ ├── SELECT-81.sql │ │ ├── SELECT-82.sql │ │ ├── SELECT-83.sql │ │ ├── SELECT-85.sql │ │ ├── SELECT-86.sql │ │ ├── SELECT-87.sql │ │ ├── SELECT-88.sql │ │ ├── SELECT-89.sql │ │ ├── SELECT-90.sql │ │ ├── SELECT-91.sql │ │ ├── SELECT-92.sql │ │ ├── SELECT-93.sql │ │ ├── SELECT-94.sql │ │ ├── SELECT-95.sql │ │ ├── SELECT-96.sql │ │ ├── SELECT-97.sql │ │ ├── SELECT-98.sql │ │ ├── SELECT-99.sql │ │ ├── SESSIONTIMEZONE-0.sql │ │ ├── SET-0.sql │ │ ├── SET-CONSTRAINTS-0.sql │ │ ├── SET-CONSTRAINTS-1.sql │ │ ├── SET-ROLE-0.sql │ │ ├── SET-ROLE-1.sql │ │ ├── SET-ROLE-2.sql │ │ ├── SET-ROLE-3.sql │ │ ├── SET-TRANSACTION-0.sql │ │ ├── SIGN-0.sql │ │ ├── SIN-0.sql │ │ ├── SINH-0.sql │ │ ├── SOUNDEX-1.sql │ │ ├── SQL-JSON-Conditions-0.sql │ │ ├── SQL-JSON-Conditions-1.sql │ │ ├── SQL-JSON-Conditions-10.sql │ │ ├── SQL-JSON-Conditions-11.sql │ │ ├── SQL-JSON-Conditions-13.sql │ │ ├── SQL-JSON-Conditions-14.sql │ │ ├── SQL-JSON-Conditions-15.sql │ │ ├── SQL-JSON-Conditions-16.sql │ │ ├── SQL-JSON-Conditions-17.sql │ │ ├── SQL-JSON-Conditions-18.sql │ │ ├── SQL-JSON-Conditions-19.sql │ │ ├── SQL-JSON-Conditions-20.sql │ │ ├── SQL-JSON-Conditions-21.sql │ │ ├── SQL-JSON-Conditions-22.sql │ │ ├── SQL-JSON-Conditions-23.sql │ │ ├── SQL-JSON-Conditions-28.sql │ │ ├── SQL-JSON-Conditions-29.sql │ │ ├── SQL-JSON-Conditions-3.sql │ │ ├── SQL-JSON-Conditions-30.sql │ │ ├── SQL-JSON-Conditions-31.sql │ │ ├── SQL-JSON-Conditions-32.sql │ │ ├── SQL-JSON-Conditions-33.sql │ │ ├── SQL-JSON-Conditions-34.sql │ │ ├── SQL-JSON-Conditions-35.sql │ │ ├── SQL-JSON-Conditions-36.sql │ │ ├── SQL-JSON-Conditions-37.sql │ │ ├── SQL-JSON-Conditions-38.sql │ │ ├── SQL-JSON-Conditions-39.sql │ │ ├── SQL-JSON-Conditions-40.sql │ │ ├── SQL-JSON-Conditions-41.sql │ │ ├── SQL-JSON-Conditions-42.sql │ │ ├── SQL-JSON-Conditions-43.sql │ │ ├── SQL-JSON-Conditions-5.sql │ │ ├── SQL-JSON-Conditions-7.sql │ │ ├── SQL-JSON-Conditions-8.sql │ │ ├── SQL-JSON-Conditions-9.sql │ │ ├── SQRT-0.sql │ │ ├── STATS_BINOMIAL_TEST-0.sql │ │ ├── STATS_CROSSTAB-0.sql │ │ ├── STATS_F_TEST-0.sql │ │ ├── STATS_KS_TEST-0.sql │ │ ├── STATS_MODE-0.sql │ │ ├── STATS_MODE-1.sql │ │ ├── STATS_MODE-2.sql │ │ ├── STATS_MW_TEST-0.sql │ │ ├── STATS_ONE_WAY_ANOVA-0.sql │ │ ├── STATS_T_TEST_-0.sql │ │ ├── STATS_T_TEST_-1.sql │ │ ├── STATS_T_TEST_-2.sql │ │ ├── STDDEV-0.sql │ │ ├── STDDEV-1.sql │ │ ├── STDDEV_POP-0.sql │ │ ├── STDDEV_POP-1.sql │ │ ├── STDDEV_SAMP-0.sql │ │ ├── SUBSTR-0.sql │ │ ├── SUBSTR-1.sql │ │ ├── SUM-0.sql │ │ ├── SUM-1.sql │ │ ├── SYSDATE-0.sql │ │ ├── SYSTIMESTAMP-0.sql │ │ ├── SYSTIMESTAMP-1.sql │ │ ├── SYSTIMESTAMP-2.sql │ │ ├── SYS_CONNECT_BY_PATH-0.sql │ │ ├── SYS_CONTEXT-0.sql │ │ ├── SYS_CONTEXT-1.sql │ │ ├── SYS_CONTEXT-2.sql │ │ ├── SYS_DBURIGEN-0.sql │ │ ├── SYS_EXTRACT_UTC-0.sql │ │ ├── SYS_GUID-0.sql │ │ ├── SYS_OP_ZONE_ID-0.sql │ │ ├── SYS_OP_ZONE_ID-1.sql │ │ ├── SYS_OP_ZONE_ID-2.sql │ │ ├── SYS_OP_ZONE_ID-3.sql │ │ ├── SYS_TYPEID-0.sql │ │ ├── SYS_TYPEID-1.sql │ │ ├── SYS_XMLAGG-0.sql │ │ ├── SYS_XMLGEN-0.sql │ │ ├── Sequence-Pseudocolumns-3.sql │ │ ├── Sequence-Pseudocolumns-4.sql │ │ ├── Sequence-Pseudocolumns-5.sql │ │ ├── Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-0.sql │ │ ├── Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-2.sql │ │ ├── Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-3.sql │ │ ├── Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-4.sql │ │ ├── Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-5.sql │ │ ├── Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-6.sql │ │ ├── TAN-0.sql │ │ ├── TANH-0.sql │ │ ├── TIMESTAMP_TO_SCN-0.sql │ │ ├── TO_BINARY_DOUBLE-0.sql │ │ ├── TO_BINARY_DOUBLE-1.sql │ │ ├── TO_BINARY_DOUBLE-2.sql │ │ ├── TO_BINARY_DOUBLE-3.sql │ │ ├── TO_BINARY_FLOAT-0.sql │ │ ├── TO_BINARY_FLOAT-1.sql │ │ ├── TO_BLOB-bfile-0.sql │ │ ├── TO_BLOB-raw-0.sql │ │ ├── TO_CHAR-bfile-blob-0.sql │ │ ├── TO_CHAR-character-0.sql │ │ ├── TO_CHAR-character-1.sql │ │ ├── TO_CHAR-character-2.sql │ │ ├── TO_CHAR-character-3.sql │ │ ├── TO_CHAR-datetime-1.sql │ │ ├── TO_CHAR-datetime-10.sql │ │ ├── TO_CHAR-datetime-11.sql │ │ ├── TO_CHAR-datetime-2.sql │ │ ├── TO_CHAR-datetime-3.sql │ │ ├── TO_CHAR-datetime-4.sql │ │ ├── TO_CHAR-datetime-5.sql │ │ ├── TO_CHAR-datetime-6.sql │ │ ├── TO_CHAR-datetime-7.sql │ │ ├── TO_CHAR-datetime-8.sql │ │ ├── TO_CHAR-datetime-9.sql │ │ ├── TO_CHAR-number-1.sql │ │ ├── TO_CHAR-number-2.sql │ │ ├── TO_CHAR-number-3.sql │ │ ├── TO_CHAR-number-4.sql │ │ ├── TO_CHAR-number-5.sql │ │ ├── TO_CHAR-number-6.sql │ │ ├── TO_CLOB-bfile-blob-0.sql │ │ ├── TO_CLOB-character-0.sql │ │ ├── TO_DATE-1.sql │ │ ├── TO_DATE-2.sql │ │ ├── TO_DATE-3.sql │ │ ├── TO_DSINTERVAL-0.sql │ │ ├── TO_DSINTERVAL-1.sql │ │ ├── TO_DSINTERVAL-2.sql │ │ ├── TO_MULTI_BYTE-0.sql │ │ ├── TO_NCHAR-character-0.sql │ │ ├── TO_NCHAR-datetime-0.sql │ │ ├── TO_NCHAR-number-0.sql │ │ ├── TO_NCLOB-0.sql │ │ ├── TO_NUMBER-0.sql │ │ ├── TO_NUMBER-1.sql │ │ ├── TO_NUMBER-2.sql │ │ ├── TO_SINGLE_BYTE-0.sql │ │ ├── TO_TIMESTAMP-0.sql │ │ ├── TO_TIMESTAMP-1.sql │ │ ├── TO_TIMESTAMP_TZ-0.sql │ │ ├── TO_TIMESTAMP_TZ-1.sql │ │ ├── TO_TIMESTAMP_TZ-2.sql │ │ ├── TO_UTC_TIMESTAMP_TZ-0.sql │ │ ├── TO_UTC_TIMESTAMP_TZ-1.sql │ │ ├── TO_UTC_TIMESTAMP_TZ-2.sql │ │ ├── TO_UTC_TIMESTAMP_TZ-3.sql │ │ ├── TO_YMINTERVAL-0.sql │ │ ├── TO_YMINTERVAL-1.sql │ │ ├── TO_YMINTERVAL-2.sql │ │ ├── TRANSLATE-0.sql │ │ ├── TRANSLATE-USING-0.sql │ │ ├── TREAT-0.sql │ │ ├── TRIM-0.sql │ │ ├── TRUNC-date-0.sql │ │ ├── TRUNC-date-1.sql │ │ ├── TRUNC-date-2.sql │ │ ├── TRUNC-date-3.sql │ │ ├── TRUNC-date-4.sql │ │ ├── TRUNC-number-0.sql │ │ ├── TRUNCATE-CLUSTER-0.sql │ │ ├── TRUNCATE-TABLE-0.sql │ │ ├── TRUNCATE-TABLE-1.sql │ │ ├── TZ_OFFSET-0.sql │ │ ├── The-UNION-ALL-INTERSECT-MINUS-Operators-0.sql │ │ ├── The-UNION-ALL-INTERSECT-MINUS-Operators-1.sql │ │ ├── The-UNION-ALL-INTERSECT-MINUS-Operators-2.sql │ │ ├── The-UNION-ALL-INTERSECT-MINUS-Operators-3.sql │ │ ├── The-UNION-ALL-INTERSECT-MINUS-Operators-4.sql │ │ ├── The-UNION-ALL-INTERSECT-MINUS-Operators-5.sql │ │ ├── The-UNION-ALL-INTERSECT-MINUS-Operators-6.sql │ │ ├── The-UNION-ALL-INTERSECT-MINUS-Operators-7.sql │ │ ├── Type-Constructor-Expressions-0.sql │ │ ├── Type-Constructor-Expressions-1.sql │ │ ├── UID-0.sql │ │ ├── UNISTR-0.sql │ │ ├── UPDATE-0.sql │ │ ├── UPDATE-1.sql │ │ ├── UPDATE-2.sql │ │ ├── UPDATE-3.sql │ │ ├── UPDATE-4.sql │ │ ├── UPDATE-5.sql │ │ ├── UPDATE-6.sql │ │ ├── UPDATE-7.sql │ │ ├── UPDATE-8.sql │ │ ├── UPDATE-9.sql │ │ ├── UPPER-0.sql │ │ ├── USER-0.sql │ │ ├── USERENV-1.sql │ │ ├── Unnesting-of-Nested-Subqueries-0.sql │ │ ├── Unnesting-of-Nested-Subqueries-1.sql │ │ ├── Unnesting-of-Nested-Subqueries-2.sql │ │ ├── Using-Extensible-Indexing-0.sql │ │ ├── Using-Extensible-Indexing-1.sql │ │ ├── Using-Extensible-Indexing-2.sql │ │ ├── Using-Extensible-Indexing-3.sql │ │ ├── Using-Extensible-Indexing-4.sql │ │ ├── Using-Extensible-Indexing-6.sql │ │ ├── Using-Extensible-Indexing-8.sql │ │ ├── Using-XML-in-SQL-Statements-0.sql │ │ ├── Using-XML-in-SQL-Statements-1.sql │ │ ├── Using-XML-in-SQL-Statements-2.sql │ │ ├── Using-XML-in-SQL-Statements-3.sql │ │ ├── Using-XML-in-SQL-Statements-4.sql │ │ ├── Using-XML-in-SQL-Statements-5.sql │ │ ├── Using-XML-in-SQL-Statements-6.sql │ │ ├── Using-XML-in-SQL-Statements-7.sql │ │ ├── Using-XML-in-SQL-Statements-8.sql │ │ ├── Using-XML-in-SQL-Statements-9.sql │ │ ├── VALIDATE_CONVERSION-0.sql │ │ ├── VALIDATE_CONVERSION-1.sql │ │ ├── VALIDATE_CONVERSION-2.sql │ │ ├── VALUE-0.sql │ │ ├── VARIANCE-0.sql │ │ ├── VARIANCE-1.sql │ │ ├── VAR_POP-1.sql │ │ ├── VAR_POP-2.sql │ │ ├── VAR_SAMP-1.sql │ │ ├── VSIZE-0.sql │ │ ├── WIDTH_BUCKET-0.sql │ │ ├── XML-Conditions-0.sql │ │ ├── XML-Conditions-1.sql │ │ ├── XMLAGG-0.sql │ │ ├── XMLAGG-1.sql │ │ ├── XMLCDATA-1.sql │ │ ├── XMLCOLATTVAL-0.sql │ │ ├── XMLCOMMENT-1.sql │ │ ├── XMLCONCAT-0.sql │ │ ├── XMLDATA-Pseudocolumn-0.sql │ │ ├── XMLDATA-Pseudocolumn-1.sql │ │ ├── XMLDATA-Pseudocolumn-2.sql │ │ ├── XMLDIFF-0.sql │ │ ├── XMLELEMENT-0.sql │ │ ├── XMLELEMENT-1.sql │ │ ├── XMLELEMENT-2.sql │ │ ├── XMLFOREST-0.sql │ │ ├── XMLPARSE-0.sql │ │ ├── XMLPATCH-0.sql │ │ ├── XMLPI-1.sql │ │ ├── XMLQUERY-0.sql │ │ ├── XMLSEQUENCE-0.sql │ │ ├── XMLSERIALIZE-0.sql │ │ ├── XMLTABLE-2.sql │ │ ├── XMLTRANSFORM-0.sql │ │ ├── XMLTRANSFORM-1.sql │ │ ├── alter-domain-0.sql │ │ ├── alter-domain-1.sql │ │ ├── alter-domain-2.sql │ │ ├── alter-domain-3.sql │ │ ├── alter-domain-4.sql │ │ ├── alter-domain-5.sql │ │ ├── alter-domain-6.sql │ │ ├── alter-mle-env-0.sql │ │ ├── alter-mle-module-0.sql │ │ ├── analytic-view-measure-expressions-5.sql │ │ ├── annotations_clause-0.sql │ │ ├── annotations_clause-1.sql │ │ ├── annotations_clause-2.sql │ │ ├── annotations_clause-3.sql │ │ ├── annotations_clause-4.sql │ │ ├── annotations_clause-5.sql │ │ ├── boolean_and_agg-0.sql │ │ ├── boolean_and_agg-1.sql │ │ ├── boolean_and_agg-2.sql │ │ ├── boolean_and_agg-3.sql │ │ ├── boolean_and_agg-4.sql │ │ ├── boolean_and_agg-5.sql │ │ ├── boolean_and_agg-6.sql │ │ ├── boolean_or_agg-0.sql │ │ ├── boolean_or_agg-1.sql │ │ ├── boolean_or_agg-2.sql │ │ ├── boolean_or_agg-3.sql │ │ ├── boolean_or_agg-4.sql │ │ ├── boolean_or_agg-5.sql │ │ ├── boolean_or_agg-6.sql │ │ ├── ceil-datetime-0.sql │ │ ├── ceil-datetime-1.sql │ │ ├── ceil-datetime-2.sql │ │ ├── ceil-interval-0.sql │ │ ├── ceil-interval-1.sql │ │ ├── ceil-interval-2.sql │ │ ├── ceil-interval-3.sql │ │ ├── con_id_to_con_name-0.sql │ │ ├── con_id_to_con_name-1.sql │ │ ├── con_id_to_dbid-0.sql │ │ ├── con_id_to_dbid-1.sql │ │ ├── con_id_to_guid-0.sql │ │ ├── con_id_to_guid-1.sql │ │ ├── con_id_to_uid-0.sql │ │ ├── con_id_to_uid-1.sql │ │ ├── constraint-0.sql │ │ ├── constraint-1.sql │ │ ├── constraint-10.sql │ │ ├── constraint-11.sql │ │ ├── constraint-12.sql │ │ ├── constraint-13.sql │ │ ├── constraint-14.sql │ │ ├── constraint-15.sql │ │ ├── constraint-16.sql │ │ ├── constraint-17.sql │ │ ├── constraint-19.sql │ │ ├── constraint-2.sql │ │ ├── constraint-21.sql │ │ ├── constraint-22.sql │ │ ├── constraint-23.sql │ │ ├── constraint-24.sql │ │ ├── constraint-25.sql │ │ ├── constraint-26.sql │ │ ├── constraint-27.sql │ │ ├── constraint-28.sql │ │ ├── constraint-29.sql │ │ ├── constraint-3.sql │ │ ├── constraint-30.sql │ │ ├── constraint-31.sql │ │ ├── constraint-32.sql │ │ ├── constraint-33.sql │ │ ├── constraint-4.sql │ │ ├── constraint-5.sql │ │ ├── constraint-6.sql │ │ ├── constraint-7.sql │ │ ├── constraint-8.sql │ │ ├── constraint-9.sql │ │ ├── create-domain-10.sql │ │ ├── create-domain-11.sql │ │ ├── create-domain-12.sql │ │ ├── create-domain-13.sql │ │ ├── create-domain-14.sql │ │ ├── create-domain-15.sql │ │ ├── create-domain-16.sql │ │ ├── create-domain-17.sql │ │ ├── create-domain-18.sql │ │ ├── create-domain-19.sql │ │ ├── create-domain-20.sql │ │ ├── create-domain-21.sql │ │ ├── create-domain-22.sql │ │ ├── create-domain-24.sql │ │ ├── create-domain-25.sql │ │ ├── create-domain-27.sql │ │ ├── create-domain-28.sql │ │ ├── create-domain-29.sql │ │ ├── create-domain-30.sql │ │ ├── create-domain-32.sql │ │ ├── create-domain-33.sql │ │ ├── create-domain-35.sql │ │ ├── create-domain-36.sql │ │ ├── create-domain-38.sql │ │ ├── create-domain-4.sql │ │ ├── create-domain-40.sql │ │ ├── create-domain-41.sql │ │ ├── create-domain-43.sql │ │ ├── create-domain-5.sql │ │ ├── create-domain-6.sql │ │ ├── create-domain-7.sql │ │ ├── create-domain-8.sql │ │ ├── create-domain-9.sql │ │ ├── create-mle-env-0.sql │ │ ├── create-mle-env-1.sql │ │ ├── create-property-graph-0.sql │ │ ├── create-property-graph-1.sql │ │ ├── create-property-graph-10.sql │ │ ├── create-property-graph-11.sql │ │ ├── create-property-graph-12.sql │ │ ├── create-property-graph-13.sql │ │ ├── create-property-graph-14.sql │ │ ├── create-property-graph-16.sql │ │ ├── create-property-graph-17.sql │ │ ├── create-property-graph-18.sql │ │ ├── create-property-graph-19.sql │ │ ├── create-property-graph-2.sql │ │ ├── create-property-graph-23.sql │ │ ├── create-property-graph-3.sql │ │ ├── create-property-graph-4.sql │ │ ├── create-property-graph-7.sql │ │ ├── create-property-graph-8.sql │ │ ├── create-property-graph-9.sql │ │ ├── create-vector-index-0.sql │ │ ├── create-vector-index-1.sql │ │ ├── create-vector-index-2.sql │ │ ├── create-vector-index-3.sql │ │ ├── domain_check-0.sql │ │ ├── domain_check-1.sql │ │ ├── domain_check-10.sql │ │ ├── domain_check-11.sql │ │ ├── domain_check-2.sql │ │ ├── domain_check-3.sql │ │ ├── domain_check-4.sql │ │ ├── domain_check-5.sql │ │ ├── domain_check-6.sql │ │ ├── domain_check-7.sql │ │ ├── domain_check-9.sql │ │ ├── domain_check_type-0.sql │ │ ├── domain_check_type-1.sql │ │ ├── domain_check_type-10.sql │ │ ├── domain_check_type-2.sql │ │ ├── domain_check_type-3.sql │ │ ├── domain_check_type-4.sql │ │ ├── domain_check_type-5.sql │ │ ├── domain_check_type-6.sql │ │ ├── domain_check_type-8.sql │ │ ├── domain_check_type-9.sql │ │ ├── domain_display-0.sql │ │ ├── domain_display-1.sql │ │ ├── domain_display-2.sql │ │ ├── domain_display-3.sql │ │ ├── domain_display-5.sql │ │ ├── domain_display-6.sql │ │ ├── domain_display-7.sql │ │ ├── domain_name-0.sql │ │ ├── domain_name-1.sql │ │ ├── domain_name-2.sql │ │ ├── domain_name-3.sql │ │ ├── domain_name-5.sql │ │ ├── domain_name-6.sql │ │ ├── domain_name-7.sql │ │ ├── domain_order-0.sql │ │ ├── domain_order-1.sql │ │ ├── domain_order-2.sql │ │ ├── domain_order-3.sql │ │ ├── domain_order-5.sql │ │ ├── domain_order-6.sql │ │ ├── domain_order-7.sql │ │ ├── drop-domain-0.sql │ │ ├── drop-domain-1.sql │ │ ├── drop-domain-2.sql │ │ ├── drop-pmem-filestore-0.sql │ │ ├── file_specification-0.sql │ │ ├── file_specification-1.sql │ │ ├── file_specification-2.sql │ │ ├── file_specification-3.sql │ │ ├── file_specification-4.sql │ │ ├── file_specification-5.sql │ │ ├── floor-datetime-0.sql │ │ ├── floor-datetime-1.sql │ │ ├── floor-datetime-2.sql │ │ ├── floor-interval-0.sql │ │ ├── floor-interval-1.sql │ │ ├── floor-interval-2.sql │ │ ├── from_vector-0.sql │ │ ├── from_vector-1.sql │ │ ├── from_vector-2.sql │ │ ├── from_vector-3.sql │ │ ├── from_vector-4.sql │ │ ├── from_vector-5.sql │ │ ├── from_vector-6.sql │ │ ├── from_vector-7.sql │ │ ├── graph-pattern-0.sql │ │ ├── graph-pattern-10.sql │ │ ├── graph-pattern-11.sql │ │ ├── graph-pattern-13.sql │ │ ├── graph-pattern-15.sql │ │ ├── graph-pattern-17.sql │ │ ├── graph-pattern-19.sql │ │ ├── graph-pattern-2.sql │ │ ├── graph-pattern-21.sql │ │ ├── graph-pattern-23.sql │ │ ├── graph-pattern-25.sql │ │ ├── graph-pattern-27.sql │ │ ├── graph-pattern-29.sql │ │ ├── graph-pattern-3.sql │ │ ├── graph-pattern-31.sql │ │ ├── graph-pattern-33.sql │ │ ├── graph-pattern-35.sql │ │ ├── graph-pattern-37.sql │ │ ├── graph-pattern-38.sql │ │ ├── graph-pattern-40.sql │ │ ├── graph-pattern-42.sql │ │ ├── graph-pattern-44.sql │ │ ├── graph-pattern-5.sql │ │ ├── graph-pattern-7.sql │ │ ├── graph-pattern-9.sql │ │ ├── graph-reference-0.sql │ │ ├── graph-reference-2.sql │ │ ├── graph-reference-3.sql │ │ ├── graph-reference-4.sql │ │ ├── graph-reference-5.sql │ │ ├── graph-table-shape-0.sql │ │ ├── graph-table-shape-10.sql │ │ ├── graph-table-shape-2.sql │ │ ├── graph-table-shape-4.sql │ │ ├── graph-table-shape-6.sql │ │ ├── graph-table-shape-8.sql │ │ ├── graph_table-operator-0.sql │ │ ├── graph_table-operator-1.sql │ │ ├── graph_table-operator-2.sql │ │ ├── graph_table-operator-3.sql │ │ ├── graph_table-operator-4.sql │ │ ├── graph_table-operator-5.sql │ │ ├── is_uuid-0.sql │ │ ├── is_uuid-2.sql │ │ ├── ora_shardspace_name-pseudocolumn-0.sql │ │ ├── ora_shardspace_name-pseudocolumn-1.sql │ │ ├── raw_to_uuid-0.sql │ │ ├── round-interval-0.sql │ │ ├── round-interval-1.sql │ │ ├── round-interval-2.sql │ │ ├── round-interval-3.sql │ │ ├── shard_chunk_id-operator-2.sql │ │ ├── storage_clause-0.sql │ │ ├── storage_clause-1.sql │ │ ├── sys_row_etag-0.sql │ │ ├── time_bucket-datetime-0.sql │ │ ├── to_boolean-0.sql │ │ ├── to_boolean-2.sql │ │ ├── to_vector-0.sql │ │ ├── to_vector-1.sql │ │ ├── to_vector-2.sql │ │ ├── trunc-interval-0.sql │ │ ├── trunc-interval-1.sql │ │ ├── trunc-interval-2.sql │ │ ├── uuid-0.sql │ │ ├── uuid_to_raw-0.sql │ │ ├── uuid_to_raw-2.sql │ │ ├── value-expressions-graph_table-0.sql │ │ ├── value-expressions-graph_table-10.sql │ │ ├── value-expressions-graph_table-12.sql │ │ ├── value-expressions-graph_table-13.sql │ │ ├── value-expressions-graph_table-14.sql │ │ ├── value-expressions-graph_table-16.sql │ │ ├── value-expressions-graph_table-17.sql │ │ ├── value-expressions-graph_table-19.sql │ │ ├── value-expressions-graph_table-2.sql │ │ ├── value-expressions-graph_table-20.sql │ │ ├── value-expressions-graph_table-21.sql │ │ ├── value-expressions-graph_table-23.sql │ │ ├── value-expressions-graph_table-25.sql │ │ ├── value-expressions-graph_table-27.sql │ │ ├── value-expressions-graph_table-4.sql │ │ ├── value-expressions-graph_table-6.sql │ │ ├── value-expressions-graph_table-8.sql │ │ ├── vector-0.sql │ │ ├── vector-1.sql │ │ ├── vector_chunks-1.sql │ │ ├── vector_chunks-2.sql │ │ ├── vector_dimension_count-0.sql │ │ ├── vector_dimension_format-0.sql │ │ ├── vector_embedding-0.sql │ │ ├── vector_norm-0.sql │ │ ├── vector_serialize-0.sql │ │ ├── vector_serialize-1.sql │ │ ├── vector_serialize-2.sql │ │ ├── vector_serialize-3.sql │ │ └── vector_serialize-4.sql │ ├── main/ │ │ ├── kotlin/ │ │ │ └── com/ │ │ │ └── felipebz/ │ │ │ └── zpa/ │ │ │ └── checks/ │ │ │ ├── AbstractBaseCheck.kt │ │ │ ├── AddParenthesesInNestedExpressionCheck.kt │ │ │ ├── CharacterDatatypeUsageCheck.kt │ │ │ ├── CheckList.kt │ │ │ ├── CheckUtils.kt │ │ │ ├── CollapsibleIfStatementsCheck.kt │ │ │ ├── ColumnsShouldHaveTableNameCheck.kt │ │ │ ├── CommitRollbackCheck.kt │ │ │ ├── ComparisonWithBooleanCheck.kt │ │ │ ├── ComparisonWithNullCheck.kt │ │ │ ├── ConcatenationWithNullCheck.kt │ │ │ ├── CursorBodyInPackageSpecCheck.kt │ │ │ ├── DbmsOutputPutCheck.kt │ │ │ ├── DeadCodeCheck.kt │ │ │ ├── DeclareSectionWithoutDeclarationsCheck.kt │ │ │ ├── DisabledTestCheck.kt │ │ │ ├── DuplicateConditionIfElsifCheck.kt │ │ │ ├── DuplicatedValueInInCheck.kt │ │ │ ├── EmptyBlockCheck.kt │ │ │ ├── EmptyStringAssignmentCheck.kt │ │ │ ├── ExplicitInParameterCheck.kt │ │ │ ├── FunctionWithOutParameterCheck.kt │ │ │ ├── IdenticalExpressionCheck.kt │ │ │ ├── IfWithExitCheck.kt │ │ │ ├── InequalityUsageCheck.kt │ │ │ ├── InsertWithoutColumnsCheck.kt │ │ │ ├── InvalidReferenceToObjectCheck.kt │ │ │ ├── NotASelectedExpressionCheck.kt │ │ │ ├── NotFoundCheck.kt │ │ │ ├── NvlWithNullParameterCheck.kt │ │ │ ├── ParsingErrorCheck.kt │ │ │ ├── QueryWithoutExceptionHandlingCheck.kt │ │ │ ├── RaiseStandardExceptionCheck.kt │ │ │ ├── RedundantExpectationCheck.kt │ │ │ ├── ReturnOfBooleanExpressionCheck.kt │ │ │ ├── SameBranchCheck.kt │ │ │ ├── SameConditionCheck.kt │ │ │ ├── SelectAllColumnsCheck.kt │ │ │ ├── SelectWithRownumAndOrderByCheck.kt │ │ │ ├── Tags.kt │ │ │ ├── ToCharInOrderByCheck.kt │ │ │ ├── ToDateWithoutFormatCheck.kt │ │ │ ├── TooManyRowsHandlerCheck.kt │ │ │ ├── UnhandledUserDefinedExceptionCheck.kt │ │ │ ├── UnnecessaryAliasInQueryCheck.kt │ │ │ ├── UnnecessaryElseCheck.kt │ │ │ ├── UnnecessaryLikeCheck.kt │ │ │ ├── UnnecessaryNullStatementCheck.kt │ │ │ ├── UnusedCursorCheck.kt │ │ │ ├── UnusedParameterCheck.kt │ │ │ ├── UnusedVariableCheck.kt │ │ │ ├── UselessParenthesisCheck.kt │ │ │ ├── VariableHidingCheck.kt │ │ │ ├── VariableInCountCheck.kt │ │ │ ├── VariableInitializationWithFunctionCallCheck.kt │ │ │ ├── VariableInitializationWithNullCheck.kt │ │ │ ├── VariableNameCheck.kt │ │ │ └── XPathCheck.kt │ │ └── resources/ │ │ └── org/ │ │ └── sonar/ │ │ └── l10n/ │ │ ├── plsqlopen/ │ │ │ └── rules/ │ │ │ └── plsql/ │ │ │ ├── AddParenthesesInNestedExpression.html │ │ │ ├── CharacterDatatypeUsage.html │ │ │ ├── CollapsibleIfStatements.html │ │ │ ├── ColumnsShouldHaveTableName.html │ │ │ ├── CommitRollback.html │ │ │ ├── ComparisonWithBoolean.html │ │ │ ├── ComparisonWithNull.html │ │ │ ├── ConcatenationWithNull.html │ │ │ ├── CursorBodyInPackageSpec.html │ │ │ ├── DbmsOutputPut.html │ │ │ ├── DeadCode.html │ │ │ ├── DeclareSectionWithoutDeclarations.html │ │ │ ├── DisabledTest.html │ │ │ ├── DuplicateConditionIfElsif.html │ │ │ ├── DuplicatedValueInIn.html │ │ │ ├── EmptyBlock.html │ │ │ ├── EmptyStringAssignment.html │ │ │ ├── ExplicitInParameter.html │ │ │ ├── FunctionWithOutParameter.html │ │ │ ├── IdenticalExpression.html │ │ │ ├── IfWithExit.html │ │ │ ├── InequalityUsage.html │ │ │ ├── InsertWithoutColumns.html │ │ │ ├── InvalidReferenceToObject.html │ │ │ ├── NotASelectedExpression.html │ │ │ ├── NotFound.html │ │ │ ├── NvlWithNullParameter.html │ │ │ ├── ParsingError.html │ │ │ ├── QueryWithoutExceptionHandling.html │ │ │ ├── RaiseStandardException.html │ │ │ ├── RedundantExpectation.html │ │ │ ├── ReturnOfBooleanExpression.html │ │ │ ├── SameBranch.html │ │ │ ├── SameCondition.html │ │ │ ├── SelectAllColumns.html │ │ │ ├── SelectWithRownumAndOrderBy.html │ │ │ ├── ToCharInOrderBy.html │ │ │ ├── ToDateWithoutFormat.html │ │ │ ├── TooManyRowsHandler.html │ │ │ ├── UnhandledUserDefinedException.html │ │ │ ├── UnnecessaryAliasInQuery.html │ │ │ ├── UnnecessaryElse.html │ │ │ ├── UnnecessaryLike.html │ │ │ ├── UnnecessaryNullStatement.html │ │ │ ├── UnusedCursor.html │ │ │ ├── UnusedParameter.html │ │ │ ├── UnusedVariable.html │ │ │ ├── UselessParenthesis.html │ │ │ ├── VariableHiding.html │ │ │ ├── VariableInCount.html │ │ │ ├── VariableInitializationWithFunctionCall.html │ │ │ ├── VariableInitializationWithNull.html │ │ │ ├── VariableName.html │ │ │ └── XPath.html │ │ ├── plsqlopen.properties │ │ ├── plsqlopen_pt_BR/ │ │ │ └── rules/ │ │ │ └── plsql/ │ │ │ ├── AddParenthesesInNestedExpression.html │ │ │ ├── CharacterDatatypeUsage.html │ │ │ ├── CollapsibleIfStatements.html │ │ │ ├── ColumnsShouldHaveTableName.html │ │ │ ├── CommitRollback.html │ │ │ ├── ComparisonWithBoolean.html │ │ │ ├── ComparisonWithNull.html │ │ │ ├── ConcatenationWithNull.html │ │ │ ├── CursorBodyInPackageSpec.html │ │ │ ├── DbmsOutputPut.html │ │ │ ├── DeadCode.html │ │ │ ├── DeclareSectionWithoutDeclarations.html │ │ │ ├── DisabledTest.html │ │ │ ├── DuplicateConditionIfElsif.html │ │ │ ├── DuplicatedValueInIn.html │ │ │ ├── EmptyBlock.html │ │ │ ├── EmptyStringAssignment.html │ │ │ ├── ExplicitInParameter.html │ │ │ ├── FunctionWithOutParameter.html │ │ │ ├── IdenticalExpression.html │ │ │ ├── IfWithExit.html │ │ │ ├── InequalityUsage.html │ │ │ ├── InsertWithoutColumns.html │ │ │ ├── InvalidReferenceToObject.html │ │ │ ├── NotASelectedExpression.html │ │ │ ├── NotFound.html │ │ │ ├── NvlWithNullParameter.html │ │ │ ├── ParsingError.html │ │ │ ├── QueryWithoutExceptionHandling.html │ │ │ ├── RaiseStandardException.html │ │ │ ├── RedundantExpectation.html │ │ │ ├── ReturnOfBooleanExpression.html │ │ │ ├── SameBranch.html │ │ │ ├── SameCondition.html │ │ │ ├── SelectAllColumns.html │ │ │ ├── SelectWithRownumAndOrderBy.html │ │ │ ├── ToCharInOrderBy.html │ │ │ ├── ToDateWithoutFormat.html │ │ │ ├── TooManyRowsHandler.html │ │ │ ├── UnhandledUserDefinedException.html │ │ │ ├── UnnecessaryAliasInQuery.html │ │ │ ├── UnnecessaryElse.html │ │ │ ├── UnnecessaryLike.html │ │ │ ├── UnnecessaryNullStatement.html │ │ │ ├── UnusedCursor.html │ │ │ ├── UnusedParameter.html │ │ │ ├── UnusedVariable.html │ │ │ ├── UselessParenthesis.html │ │ │ ├── VariableHiding.html │ │ │ ├── VariableInCount.html │ │ │ ├── VariableInitializationWithFunctionCall.html │ │ │ ├── VariableInitializationWithNull.html │ │ │ ├── VariableName.html │ │ │ └── XPath.html │ │ └── plsqlopen_pt_BR.properties │ └── test/ │ ├── kotlin/ │ │ └── com/ │ │ └── felipebz/ │ │ └── zpa/ │ │ └── checks/ │ │ ├── AddParenthesesInNestedExpressionCheckTest.kt │ │ ├── BaseCheckTest.kt │ │ ├── CharacterDatatypeUsageCheckTest.kt │ │ ├── CheckListTest.kt │ │ ├── CollapsibleIfStatementsCheckTest.kt │ │ ├── ColumnsShouldHaveTableNameCheckTest.kt │ │ ├── CommitRollbackCheckTest.kt │ │ ├── ComparisonWithBooleanCheckTest.kt │ │ ├── ComparisonWithNullCheckTest.kt │ │ ├── ConcatenationWithNullCheckTest.kt │ │ ├── CursorBodyInPackageSpecCheckTest.kt │ │ ├── DbmsOutputPutCheckTest.kt │ │ ├── DeadCodeCheckTest.kt │ │ ├── DeclareSectionWithoutDeclarationsCheckTest.kt │ │ ├── DisabledTestCheckTest.kt │ │ ├── DuplicateConditionIfElsifCheckTest.kt │ │ ├── DuplicatedValueInInCheckTest.kt │ │ ├── EmptyBlockCheckTest.kt │ │ ├── EmptyStringAssignmentCheckTest.kt │ │ ├── ExplicitInParameterCheckTest.kt │ │ ├── FunctionWithOutParameterCheckTest.kt │ │ ├── IdenticalExpressionCheckTest.kt │ │ ├── IfWithExitCheckTest.kt │ │ ├── InequalityUsageCheckTest.kt │ │ ├── InsertWithoutColumnsCheckTest.kt │ │ ├── InvalidReferenceToObjectCheckTest.kt │ │ ├── NotASelectedExpressionCheckTest.kt │ │ ├── NotFoundCheckTest.kt │ │ ├── NvlWithNullParameterCheckTest.kt │ │ ├── ParsingErrorCheckTest.kt │ │ ├── QueryWithoutExceptionHandlingCheckTest.kt │ │ ├── RaiseStandardExceptionCheckTest.kt │ │ ├── RedundantExpectationCheckTest.kt │ │ ├── ReturnOfBooleanExpressionCheckTest.kt │ │ ├── SameBranchCheckTest.kt │ │ ├── SameConditionCheckTest.kt │ │ ├── SelectAllColumnsCheckTest.kt │ │ ├── SelectWithRownumAndOrderByCheckTest.kt │ │ ├── ToCharInOrderByCheckTest.kt │ │ ├── ToDateWithoutFormatCheckTest.kt │ │ ├── TooManyRowsHandlerCheckTest.kt │ │ ├── UnhandledUserDefinedExceptionCheckTest.kt │ │ ├── UnnecessaryAliasInQueryCheckTest.kt │ │ ├── UnnecessaryElseCheckTest.kt │ │ ├── UnnecessaryLikeCheckTest.kt │ │ ├── UnnecessaryNullStatementCheckTest.kt │ │ ├── UnusedCursorCheckTest.kt │ │ ├── UnusedParameterCheckTest.kt │ │ ├── UnusedVariableCheckTest.kt │ │ ├── UselessParenthesisCheckTest.kt │ │ ├── VariableHidingCheckTest.kt │ │ ├── VariableInCountCheckTest.kt │ │ ├── VariableInitializationWithFunctionCallCheckTest.kt │ │ ├── VariableInitializationWithNullCheckTest.kt │ │ ├── VariableNameCheckTest.kt │ │ └── XPathCheckTest.kt │ └── resources/ │ └── checks/ │ ├── add_parentheses_in_nested_expression.sql │ ├── character_datatype_usage.sql │ ├── collapsible_if_statements.sql │ ├── columns_should_have_table_name.sql │ ├── commit_rollback.sql │ ├── comparison_with_boolean.sql │ ├── comparison_with_null.sql │ ├── concatenation_with_null.sql │ ├── cursor_body_in_package_spec.sql │ ├── dbms_output_put.sql │ ├── dead_code.sql │ ├── declare_section_without_declarations.sql │ ├── disabled_test.sql │ ├── duplicate_condition_if_elsif.sql │ ├── duplicated_value_in_in.sql │ ├── empty_block.sql │ ├── empty_string_assignment.sql │ ├── explicit_in_parameter.sql │ ├── function_with_out_parameter.sql │ ├── identical_expression.sql │ ├── if_with_exit.sql │ ├── inequality_usage_check.sql │ ├── insert_without_columns.sql │ ├── invalid_reference_to_object.sql │ ├── not_a_selected_expression.sql │ ├── not_found.sql │ ├── nvl_with_null_parameter.sql │ ├── parsing_error.sql │ ├── query_without_exception_handling.sql │ ├── query_without_exception_handling_no_strict.sql │ ├── raise_standard_exception.sql │ ├── redundant_expectation.sql │ ├── return_of_boolean_expression.sql │ ├── same_branch.sql │ ├── same_condition.sql │ ├── select_all_columns.sql │ ├── select_with_rownum_and_order_by.sql │ ├── to_char_in_order_by.sql │ ├── to_date_without_format.sql │ ├── too_many_rows_handler.sql │ ├── unhandled_user_defined_exception.sql │ ├── unnecessary_alias_in_query.sql │ ├── unnecessary_alias_in_query_custom_length.sql │ ├── unnecessary_else.sql │ ├── unnecessary_like.sql │ ├── unnecessary_null_statement.sql │ ├── unused_cursor.sql │ ├── unused_parameter.sql │ ├── unused_parameter_ignore_methods.sql │ ├── unused_variable.sql │ ├── useless_parenthesis.sql │ ├── variable_hiding.sql │ ├── variable_in_count.sql │ ├── variable_initialization_with_function_call.sql │ ├── variable_initialization_with_null.sql │ ├── variable_name.sql │ ├── variable_name_alternative.sql │ ├── xpath.sql │ ├── xpath_count_statement.sql │ └── xpath_statement.sql ├── zpa-checks-testkit/ │ ├── build.gradle.kts │ └── src/ │ ├── main/ │ │ └── kotlin/ │ │ └── com/ │ │ └── felipebz/ │ │ └── zpa/ │ │ └── checks/ │ │ └── verifier/ │ │ ├── PlSqlCheckVerifier.kt │ │ └── TestIssue.kt │ └── test/ │ ├── kotlin/ │ │ └── com/ │ │ └── felipebz/ │ │ └── zpa/ │ │ └── checks/ │ │ └── verifier/ │ │ └── PlSqlCheckVerifierTest.kt │ └── resources/ │ ├── check_verifier.sql │ ├── check_verifier_incorrect_attribute.sql │ ├── check_verifier_incorrect_attribute2.sql │ ├── check_verifier_incorrect_comment.sql │ ├── check_verifier_incorrect_secondary_location.sql │ ├── check_verifier_incorrect_secondary_location2.sql │ ├── check_verifier_incorrect_shift.sql │ ├── check_verifier_no_issue.sql │ ├── check_verifier_unexpected_precise_location.sql │ └── check_verifier_unexpected_precise_location2.sql ├── zpa-core/ │ ├── build.gradle.kts │ └── src/ │ ├── main/ │ │ └── kotlin/ │ │ └── com/ │ │ └── felipebz/ │ │ └── zpa/ │ │ ├── AstNodeExtensions.kt │ │ ├── CustomAnnotationBasedRulesDefinition.kt │ │ ├── FormsMetadataAwareCheck.kt │ │ ├── PlSqlChecks.kt │ │ ├── TestPlSqlVisitorRunner.kt │ │ ├── api/ │ │ │ ├── AggregateSqlFunctionsGrammar.kt │ │ │ ├── ConditionsGrammar.kt │ │ │ ├── DclGrammar.kt │ │ │ ├── DdlGrammar.kt │ │ │ ├── DmlGrammar.kt │ │ │ ├── GrammarRuleBuilderExtensions.kt │ │ │ ├── PlSqlFile.kt │ │ │ ├── PlSqlGrammar.kt │ │ │ ├── PlSqlKeyword.kt │ │ │ ├── PlSqlPunctuator.kt │ │ │ ├── PlSqlTokenType.kt │ │ │ ├── PlSqlVisitorContext.kt │ │ │ ├── SessionControlGrammar.kt │ │ │ ├── SingleRowSqlFunctionsGrammar.kt │ │ │ ├── SqlPlusGrammar.kt │ │ │ ├── TclGrammar.kt │ │ │ ├── ZpaRulesDefinition.kt │ │ │ ├── annotations/ │ │ │ │ ├── ActivatedByDefault.kt │ │ │ │ ├── ConstantRemediation.kt │ │ │ │ ├── Priority.kt │ │ │ │ ├── Rule.kt │ │ │ │ ├── RuleInfo.kt │ │ │ │ ├── RuleProperty.kt │ │ │ │ └── RuleTemplate.kt │ │ │ ├── checks/ │ │ │ │ ├── PlSqlCheck.kt │ │ │ │ └── PlSqlVisitor.kt │ │ │ ├── matchers/ │ │ │ │ ├── MethodMatcher.kt │ │ │ │ └── NameCriteria.kt │ │ │ ├── squid/ │ │ │ │ ├── PlSqlCommentAnalyzer.kt │ │ │ │ └── SemanticAstNode.kt │ │ │ └── symbols/ │ │ │ ├── PlSqlType.kt │ │ │ ├── Scope.kt │ │ │ ├── Symbol.kt │ │ │ ├── SymbolTable.kt │ │ │ └── datatype/ │ │ │ ├── AssociativeArrayDatatype.kt │ │ │ ├── BooleanDatatype.kt │ │ │ ├── CharacterDatatype.kt │ │ │ ├── DateDatatype.kt │ │ │ ├── ExceptionDatatype.kt │ │ │ ├── JsonDatatype.kt │ │ │ ├── LobDatatype.kt │ │ │ ├── NullDatatype.kt │ │ │ ├── NumericDatatype.kt │ │ │ ├── PlSqlDatatype.kt │ │ │ ├── RecordDatatype.kt │ │ │ ├── RowtypeDatatype.kt │ │ │ └── UnknownDatatype.kt │ │ ├── checks/ │ │ │ └── IssueLocation.kt │ │ ├── grammar/ │ │ │ └── ExecutePlSqlBufferExpression.kt │ │ ├── lexer/ │ │ │ ├── CommentChannel.kt │ │ │ ├── DateChannel.kt │ │ │ ├── DiscardWhitespaceChannel.kt │ │ │ ├── IdentifierChannel.kt │ │ │ ├── IntegerChannel.kt │ │ │ ├── NumericChannel.kt │ │ │ ├── PlSqlLexer.kt │ │ │ ├── QuotedIdentifierChannel.kt │ │ │ └── StringChannel.kt │ │ ├── metadata/ │ │ │ └── FormsMetadata.kt │ │ ├── metrics/ │ │ │ ├── ComplexityVisitor.kt │ │ │ ├── FunctionComplexityVisitor.kt │ │ │ └── MetricsVisitor.kt │ │ ├── parser/ │ │ │ └── PlSqlParser.kt │ │ ├── rules/ │ │ │ ├── ActiveRule.kt │ │ │ ├── ActiveRuleConfiguration.kt │ │ │ ├── ActiveRuleConfigurer.kt │ │ │ ├── ActiveRules.kt │ │ │ ├── Repository.kt │ │ │ ├── Rule.kt │ │ │ ├── RuleData.kt │ │ │ ├── RuleKey.kt │ │ │ ├── RuleMetadataLoader.kt │ │ │ ├── RuleParam.kt │ │ │ ├── RulePropertyData.kt │ │ │ ├── RuleStatus.kt │ │ │ ├── RulesDefinitionAnnotationLoader.kt │ │ │ ├── ZpaActiveRule.kt │ │ │ ├── ZpaActiveRules.kt │ │ │ ├── ZpaChecks.kt │ │ │ ├── ZpaRepository.kt │ │ │ ├── ZpaRule.kt │ │ │ ├── ZpaRuleKey.kt │ │ │ └── ZpaRuleParam.kt │ │ ├── squid/ │ │ │ ├── AnalysisException.kt │ │ │ ├── AstScanner.kt │ │ │ ├── AstScannerResult.kt │ │ │ ├── PlSqlAstWalker.kt │ │ │ ├── PlSqlConfiguration.kt │ │ │ └── ProgressReport.kt │ │ ├── sslr/ │ │ │ ├── ElseClause.kt │ │ │ ├── ElsifClause.kt │ │ │ ├── IfStatement.kt │ │ │ ├── NullStatement.kt │ │ │ ├── PlSqlGrammarBuilder.kt │ │ │ ├── RaiseStatement.kt │ │ │ ├── Statements.kt │ │ │ ├── Tree.kt │ │ │ ├── TreeImpl.kt │ │ │ └── TreeWithStatements.kt │ │ ├── symbols/ │ │ │ ├── DefaultTypeSolver.kt │ │ │ ├── ScopeImpl.kt │ │ │ ├── SymbolTableImpl.kt │ │ │ └── SymbolVisitor.kt │ │ └── utils/ │ │ ├── ReflectionUtils.kt │ │ └── log/ │ │ ├── Logger.kt │ │ ├── Loggers.kt │ │ ├── ZpaLogger.kt │ │ └── ZpaLoggers.kt │ └── test/ │ ├── kotlin/ │ │ └── com/ │ │ └── felipebz/ │ │ └── zpa/ │ │ ├── CustomAnnotationBasedRulesDefinitionTest.kt │ │ ├── PlSqlChecksTest.kt │ │ ├── api/ │ │ │ ├── AnchoredDatatypeTest.kt │ │ │ ├── DatatypeTest.kt │ │ │ ├── HostAndIndicatorVariableTest.kt │ │ │ ├── IdentifierNameTest.kt │ │ │ ├── InquiryDirectiveTest.kt │ │ │ ├── IntervalLiteralTest.kt │ │ │ ├── OperatorsTest.kt │ │ │ ├── RefDatatypeTest.kt │ │ │ ├── RuleTest.kt │ │ │ ├── conditions/ │ │ │ │ ├── IsJsonConditionTest.kt │ │ │ │ ├── IsOfConditionTest.kt │ │ │ │ ├── JsonEqualConditionTest.kt │ │ │ │ ├── JsonExistsConditionTest.kt │ │ │ │ └── JsonTextContainsConditionTest.kt │ │ │ ├── dcl/ │ │ │ │ └── GrantStatementTest.kt │ │ │ ├── ddl/ │ │ │ │ ├── AlterFunctionUnitTest.kt │ │ │ │ ├── AlterPackageUnitTest.kt │ │ │ │ ├── AlterProcedureUnitTest.kt │ │ │ │ ├── AlterTableTest.kt │ │ │ │ ├── AlterTriggerUnitTest.kt │ │ │ │ ├── CreateDirectoryTest.kt │ │ │ │ ├── CreateSequenceTest.kt │ │ │ │ ├── CreateSynonymTest.kt │ │ │ │ ├── CreateTableTest.kt │ │ │ │ ├── DdlCommentTest.kt │ │ │ │ ├── DropCommandTest.kt │ │ │ │ ├── DropDirectoryTest.kt │ │ │ │ ├── InlineConstraintTest.kt │ │ │ │ ├── OutOfLineConstraintTest.kt │ │ │ │ ├── TableColumnDefinitionTest.kt │ │ │ │ └── TruncateTableTest.kt │ │ │ ├── declarations/ │ │ │ │ ├── CallSpecificationTest.kt │ │ │ │ ├── CursorDeclarationTest.kt │ │ │ │ ├── CustomSubtypeTest.kt │ │ │ │ ├── FunctionDeclarationTest.kt │ │ │ │ ├── ParameterDeclarationTest.kt │ │ │ │ ├── PragmaDeclarationTest.kt │ │ │ │ ├── ProcedureDeclarationTest.kt │ │ │ │ ├── RecordDeclarationTest.kt │ │ │ │ ├── RefCursorDeclarationTest.kt │ │ │ │ ├── TableOfDeclarationTest.kt │ │ │ │ ├── VariableDeclarationTest.kt │ │ │ │ └── VarrayDeclarationTest.kt │ │ │ ├── expressions/ │ │ │ │ ├── AtTimeZoneExpressionTest.kt │ │ │ │ ├── BetweenExpressionTest.kt │ │ │ │ ├── BooleanExpressionTest.kt │ │ │ │ ├── CaseExpressionTest.kt │ │ │ │ ├── CastExpressionTest.kt │ │ │ │ ├── CharacterExpressionTest.kt │ │ │ │ ├── CollectExpressionTest.kt │ │ │ │ ├── CursorExpressionTest.kt │ │ │ │ ├── DateExpressionTest.kt │ │ │ │ ├── ExtractDatetimeExpressionTest.kt │ │ │ │ ├── JsonArrayAggTest.kt │ │ │ │ ├── JsonArrayTest.kt │ │ │ │ ├── JsonConstructorTest.kt │ │ │ │ ├── JsonDataguideExpressionTest.kt │ │ │ │ ├── JsonMergepatchExpressionTest.kt │ │ │ │ ├── JsonObjectAggExpressionTest.kt │ │ │ │ ├── JsonObjectExpressionTest.kt │ │ │ │ ├── JsonQueryExpressionTest.kt │ │ │ │ ├── JsonScalarTest.kt │ │ │ │ ├── JsonSerializeTest.kt │ │ │ │ ├── JsonTableTest.kt │ │ │ │ ├── JsonTransformExpressionTest.kt │ │ │ │ ├── JsonValueTest.kt │ │ │ │ ├── LikeExpressionTest.kt │ │ │ │ ├── ListAggExpressionTest.kt │ │ │ │ ├── MultisetExpressionsTest.kt │ │ │ │ ├── NewObjectExpressionTest.kt │ │ │ │ ├── NotExpressionTest.kt │ │ │ │ ├── NumericExpressionTest.kt │ │ │ │ ├── OtherExpressionTest.kt │ │ │ │ ├── QalifiedExpressionTest.kt │ │ │ │ ├── RelationalExpressionTest.kt │ │ │ │ ├── SetExpressionTest.kt │ │ │ │ ├── TableExpressionTest.kt │ │ │ │ ├── TheExpressionTest.kt │ │ │ │ ├── ToBinaryDoubleExpressionTest.kt │ │ │ │ ├── ToBinaryFloatExpressionTest.kt │ │ │ │ ├── ToBooleanExpressionTest.kt │ │ │ │ ├── ToDateExpressionTest.kt │ │ │ │ ├── ToDsintervalExpressionTest.kt │ │ │ │ ├── ToNumberExpressionTest.kt │ │ │ │ ├── ToTimestampExpressionTest.kt │ │ │ │ ├── ToTimestampTzExpressionTest.kt │ │ │ │ ├── ToYmintervalExpressionTest.kt │ │ │ │ ├── TreatAsExpressionTest.kt │ │ │ │ ├── TrimExpressionTest.kt │ │ │ │ ├── XmlAggExpressionTest.kt │ │ │ │ ├── XmlAttributesExpressionTest.kt │ │ │ │ ├── XmlCastExpressionTest.kt │ │ │ │ ├── XmlColattvalExpressionTest.kt │ │ │ │ ├── XmlElementExpressionTest.kt │ │ │ │ ├── XmlExistsExpressionTest.kt │ │ │ │ ├── XmlForestExpressionTest.kt │ │ │ │ ├── XmlParseExpressionTest.kt │ │ │ │ ├── XmlPiExpressionTest.kt │ │ │ │ ├── XmlQueryExpressionTest.kt │ │ │ │ ├── XmlRootExpressionTest.kt │ │ │ │ ├── XmlSerializeExpressionTest.kt │ │ │ │ └── XmlTableExpressionTest.kt │ │ │ ├── matchers/ │ │ │ │ ├── MethodMatcherTest.kt │ │ │ │ └── MethodMatcherWithTypesTest.kt │ │ │ ├── session/ │ │ │ │ └── SessionControlGrammarTest.kt │ │ │ ├── sql/ │ │ │ │ ├── AnalyticClauseTest.kt │ │ │ │ ├── ConnectByClauseTest.kt │ │ │ │ ├── DmlTableExpressionClauseTest.kt │ │ │ │ ├── ForUpdateClauseTest.kt │ │ │ │ ├── GroupByClauseTest.kt │ │ │ │ ├── HavingClauseTest.kt │ │ │ │ ├── HierarchicalQueryClauseTest.kt │ │ │ │ ├── IntoClauseTest.kt │ │ │ │ ├── JoinClauseTest.kt │ │ │ │ ├── KeepClauseTest.kt │ │ │ │ ├── OrderByClauseTest.kt │ │ │ │ ├── PivotClauseTest.kt │ │ │ │ ├── RowLimitingClauseTest.kt │ │ │ │ ├── SelectColumnTest.kt │ │ │ │ ├── SelectExpressionTest.kt │ │ │ │ ├── StartWithClauseTest.kt │ │ │ │ ├── UnpivotClauseTest.kt │ │ │ │ ├── WhereClauseTest.kt │ │ │ │ └── WithClauseTest.kt │ │ │ ├── statements/ │ │ │ │ ├── AssignmentStatementTest.kt │ │ │ │ ├── BlockStatementTest.kt │ │ │ │ ├── CaseStatementTest.kt │ │ │ │ ├── CloseStatementTest.kt │ │ │ │ ├── CommitStatementTest.kt │ │ │ │ ├── ContinueStatementTest.kt │ │ │ │ ├── DeleteStatementTest.kt │ │ │ │ ├── ExecuteImmediateStatementTest.kt │ │ │ │ ├── ExitStatementTest.kt │ │ │ │ ├── FetchStatementTest.kt │ │ │ │ ├── ForStatementTest.kt │ │ │ │ ├── ForallStatementTest.kt │ │ │ │ ├── GotoStatementTest.kt │ │ │ │ ├── IfStatementTest.kt │ │ │ │ ├── InlinePragmaStatementTest.kt │ │ │ │ ├── InsertStatementTest.kt │ │ │ │ ├── LoopStatementTest.kt │ │ │ │ ├── MergeStatementTest.kt │ │ │ │ ├── OpenForStatementTest.kt │ │ │ │ ├── OpenStatementTest.kt │ │ │ │ ├── PipeRowStatementTest.kt │ │ │ │ ├── RaiseStatementTest.kt │ │ │ │ ├── ReturnStatementTest.kt │ │ │ │ ├── RollbackStatementTest.kt │ │ │ │ ├── SavepointStatementTest.kt │ │ │ │ ├── SetTransactionStatementTest.kt │ │ │ │ ├── UpdateStatementTest.kt │ │ │ │ └── WhileStatementTest.kt │ │ │ ├── symbols/ │ │ │ │ └── SymbolTest.kt │ │ │ └── units/ │ │ │ ├── AnonymousBlockTest.kt │ │ │ ├── CreateFunctionTest.kt │ │ │ ├── CreatePackageBodyTest.kt │ │ │ ├── CreatePackageTest.kt │ │ │ ├── CreateProcedureTest.kt │ │ │ ├── CreateTriggerTest.kt │ │ │ ├── CreateTypeBodyTest.kt │ │ │ ├── CreateTypeTest.kt │ │ │ ├── CreateViewTest.kt │ │ │ ├── RecoveryTest.kt │ │ │ └── SimpleDmlTriggerTest.kt │ │ ├── checks/ │ │ │ └── IssueLocationTest.kt │ │ ├── lexer/ │ │ │ ├── PlSqlLexerTest.kt │ │ │ └── QuotedIdentifierChannelTest.kt │ │ ├── metadata/ │ │ │ └── FormsMetadataTest.kt │ │ ├── metrics/ │ │ │ └── MetricsVisitorTest.kt │ │ ├── squid/ │ │ │ └── ProgressReportTest.kt │ │ ├── sslr/ │ │ │ ├── IfStatementTest.kt │ │ │ └── TreeTest.kt │ │ └── symbols/ │ │ ├── DefaultTypeSolverTest.kt │ │ ├── ScopeImplTest.kt │ │ ├── SymbolTableImplTest.kt │ │ └── SymbolVisitorTest.kt │ └── resources/ │ ├── metadata/ │ │ └── metadata.json │ ├── metrics/ │ │ ├── comments.sql │ │ ├── lines.sql │ │ ├── lines_of_code.sql │ │ ├── methods.sql │ │ ├── no_sonar.sql │ │ └── statements.sql │ └── org/ │ └── sonar/ │ └── l10n/ │ ├── languageKey/ │ │ └── rules/ │ │ ├── plsql/ │ │ │ └── ruleWithExternalInfo.html │ │ └── repoKey/ │ │ └── ruleWithExternalInfo.html │ ├── languageKey.properties │ └── languageWithoutBundle/ │ └── empty.txt └── zpa-toolkit/ ├── build.gradle.kts └── src/ ├── main/ │ └── kotlin/ │ └── com/ │ └── felipebz/ │ ├── flr/ │ │ ├── internal/ │ │ │ └── toolkit/ │ │ │ ├── ConfigurationPropertyPanel.kt │ │ │ ├── LineOffsets.kt │ │ │ ├── NoWrapJTextPane.kt │ │ │ ├── SourceCodeModel.kt │ │ │ ├── SourceCodeStyler.kt │ │ │ ├── ToolkitPresenter.kt │ │ │ ├── ToolkitView.kt │ │ │ └── ToolkitViewImpl.kt │ │ └── toolkit/ │ │ └── Toolkit.kt │ └── zpa/ │ └── toolkit/ │ ├── ZpaConfigurationModel.kt │ └── ZpaToolkit.kt └── test/ ├── kotlin/ │ └── com/ │ └── felipebz/ │ ├── flr/ │ │ └── internal/ │ │ └── toolkit/ │ │ ├── LineOffsetsTest.kt │ │ └── ToolkitPresenterTest.kt │ └── zpa/ │ └── toolkit/ │ └── ZpaConfigurationModelTest.kt └── resources/ ├── mockito-extensions/ │ └── org.mockito.plugins.MockMaker └── parse_error.txt ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ root = true [*] charset=utf-8 insert_final_newline=true indent_style=space indent_size=4 [*.xml] indent_size=2 [*.yml] indent_size=2 [*.html] indent_size=2 [*.properties] charset=latin1 [*.sql] indent_size=2 [*.json] indent_size=2 [zpa-checks/src/integrationTest/resources/expected/**/*.json] insert_final_newline = false ij_any_space_before_colon = true ================================================ FILE: .gitattributes ================================================ *.sql linguist-language=PLSQL zpa-checks/src/integrationTest/resources/sources/** linguist-vendored ================================================ FILE: .github/renovate.json ================================================ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:best-practices", ":automergePatch", "schedule:weekly" ], "mode": "full", "ignoreDeps": [ "org.sonarsource.sonarqube:sonar-plugin-api-impl", "org.sonarsource.api.plugin:sonar-plugin-api", "org.sonarsource.sonarqube:sonar-ws" ] } ================================================ FILE: .github/workflows/build.yml ================================================ name: Build on: push: branches: - "*" pull_request: branches: - main env: JAVA_VERSION: 21 permissions: contents: read jobs: build: name: Build runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: submodules: true - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: distribution: temurin java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6 - name: Build with Gradle run: ./gradlew build jreleaserAssemble publishToMavenLocal - name: Run zpa-checks integration tests run: | ./gradlew :zpa-checks:integrationTest --rerun cat zpa-checks/build/integrationTest/progress-summary.md >> $GITHUB_STEP_SUMMARY - name: Build custom rules example run: ./gradlew build -p plsql-custom-rules - name: Upload build artifacts uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: build-artifacts path: | **/build/ zpa-checks/tools/ retention-days: 1 integration-tests: name: IT needs: build if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest strategy: fail-fast: false matrix: sqVersion: - 26.2.0.119303 - 26.3.0.120487 - 26.4.0.121862 - 26.5-SNAPSHOT steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: distribution: temurin java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6 - name: Download build artifacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: build-artifacts - name: Run plugin integration test run: | if [[ "$SQ_VERSION" == *"SNAPSHOT"* ]]; then FOLDER="snapshots" else FOLDER="releases" fi FILE_NAME="sonar-application-${SQ_VERSION}.zip" DOWNLOAD_URL="https://$OCI_NAMESPACE.objectstorage.sa-saopaulo-1.oci.customer-oci.com/p/$OCI_PAR/n/$OCI_NAMESPACE/b/build-artifacts/o/${FOLDER}/${FILE_NAME}" curl -s -L -f -o "sonar-zpa-plugin/${FILE_NAME}" "$DOWNLOAD_URL" ./gradlew :sonar-zpa-plugin:integrationTest -Dsonar.zipFile=$FILE_NAME --rerun --info env: SQ_VERSION: ${{ matrix.sqVersion }} OCI_NAMESPACE: ${{ secrets.OCI_NAMESPACE }} OCI_PAR: ${{ secrets.OCI_PAR }} release: name: Release permissions: contents: write needs: integration-tests if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: distribution: temurin java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6 - name: Download build artifacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: build-artifacts - name: Generate plsql-custom-rules archive run: git archive --format=zip -o build/plsql-custom-rules.zip HEAD:plsql-custom-rules - name: Create local Maven repository run: ./gradlew publish - name: Run SonarQube Scanner run: ./gradlew sonar --info env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - name: Release artifacts run: ./gradlew jreleaserFullRelease env: JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVEN_USERNAME }} JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} JRELEASER_NEXUS2_USERNAME: ${{ secrets.MAVEN_USERNAME }} JRELEASER_NEXUS2_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASSWORD }} dependency-submission: runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Generate and submit dependency graph uses: gradle/actions/dependency-submission@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6 ================================================ FILE: .gitignore ================================================ *.pydevproject .metadata bin/ tmp/ *.tmp *.bak *.swp *~.nib local.properties .settings/ .loadpath target/ dependency-reduced-pom.xml # Eclipse Core .project # External tool builders .externalToolBuilders/ # Locally stored "Eclipse launch configurations" *.launch # CDT-specific .cproject # JDT-specific (Eclipse Java Development Tools) .classpath # Java annotation processor (APT) .factorypath # PDT-specific .buildpath # sbteclipse plugin .target # TeXlipse plugin .texlipse .sonar # IntelliJ IDEA .idea *.iml # SonarQube .scannerwork # ---- Gradle .gradle **/build/ !src/**/build/ # Ignore Gradle GUI config gradle-app.setting # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) !gradle-wrapper.jar # Cache of project .gradletasknamecache .kotlin/ zpa-checks/tools/ ================================================ FILE: .gitmodules ================================================ [submodule "its/sources/pljson"] path = zpa-checks/src/integrationTest/resources/sources/pljson url = https://github.com/pljson/pljson.git ignore = dirty [submodule "its/sources/alexandria-plsql-utils"] path = zpa-checks/src/integrationTest/resources/sources/alexandria-plsql-utils url = https://github.com/mortenbra/alexandria-plsql-utils.git ignore = dirty [submodule "its/sources/utPLSQL"] path = zpa-checks/src/integrationTest/resources/sources/utPLSQL2 url = https://github.com/utPLSQL/utPLSQL.git ignore = dirty [submodule "its/sources/utPLSQL3"] path = zpa-checks/src/integrationTest/resources/sources/utPLSQL3 url = https://github.com/utPLSQL/utPLSQL/ ignore = dirty [submodule "its/sources/Doag-Forms"] path = zpa-checks/src/integrationTest/resources/sources/Doag-Forms url = https://github.com/Doag/Forms.git ignore = dirty ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at felipe@felipezorzo.com.br. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html [Mozilla CoC]: https://github.com/mozilla/diversity [FAQ]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing Thank you for your interest in contributing to our project! We appreciate your time and effort. ## How to report a bug or issue If you find a bug or issue, please report it by [opening an issue](https://github.com/felipebz/zpa/issues/new) on GitHub. Please include as much detail as possible, including: - Steps to reproduce the issue - Expected behavior - Actual behavior - Screenshots (if applicable) ## How to suggest a new feature If you have an idea for a new feature, please [open an issue](https://github.com/felipebz/zpa/issues/new) on GitHub. Please include as much detail as possible, including: - A description of the feature - Why you think it would be useful - Any potential drawbacks or limitations ## Pull Requests Currently, we are not currently accepting pull requests for new features. We appreciate your interest in contributing, but we have limited resources and cannot maintain additional features at this time. We will accept pull requests for minor bug fixes. Please include a detailed description of the bug and the steps to reproduce it. ## Code of Conduct Please note that we have a [code of conduct](CODE_OF_CONDUCT.md) in place to ensure that our community is welcoming and inclusive. Please read the code of conduct before contributing. ## License By contributing to this project, you agree to license your contributions under the [LGPL-3.0 license](LICENSE). ================================================ FILE: LICENSE ================================================ GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. ================================================ FILE: LICENSE_HEADER ================================================ Z PL/SQL Analyzer Copyright (C) 2015-${year} Felipe Zorzo mailto:felipe AT felipezorzo DOT com DOT br This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ================================================ FILE: README.md ================================================ # ZPA [![Latest release](https://img.shields.io/github/release/felipebz/zpa.svg) ](https://github.com/felipebz/zpa/releases/latest) [![Build](https://github.com/felipebz/zpa/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/felipebz/zpa/actions/workflows/build.yml) [![Quality Gate Status](https://sonarqube.felipebz.com/api/project_badges/measure?project=com.felipebz.zpa%3Azpa&metric=alert_status)](https://sonarqube.felipebz.com/dashboard?id=com.felipebz.zpa%3Azpa) ZPA is parser and static code analysis tool for PL/SQL and Oracle SQL. You can use it in a [SonarQube](https://www.sonarqube.org) on-premise instance. SonarQube is an open platform to manage code quality. See some examples in our [SonarQube instance](https://sonarqube.felipebz.com/projects?languages=plsqlopen)! Do you want to use this analyzer in a project hosted on [SonarCloud](https://sonarcloud.io)? Try the [zpa-cli](https://github.com/felipebz/zpa-cli)! ## Installation - Download the [latest sonar-zpa-plugin release](https://github.com/felipebz/zpa/releases/latest) and copy to the SONARQUBE_HOME/extensions/plugins directory; - Restart your SonarQube server; - Navigate to the Marketplace (SONARQUBE_URL/marketplace?filter=installed). It should list "ZPA" on the tab "Installed Plugins"; - Run an analysis with [SonarScanner](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/overview/). ## Compatibility matrix | ZPA version | SonarQube version (min/max) | |------------------------|-----------------------------| | 4.1.0 | 25.8 / 26.4 | | 4.2.0 (in development) | 26.2 / 26.5 | ## ZPA Toolkit The ZPA Toolkit is visual tool to review the AST (abstract syntax tree) and the symbol table generated by the parser. ![](https://raw.githubusercontent.com/wiki/felipebz/zpa/img/zpa-toolkit.png) The latest ZPA Toolkit can be downloaded from the [releases page](https://github.com/felipebz/zpa/releases/latest) and it requires JDK 11 or newer. ## Contribute Everyone is welcome to contribute. Please read our [contribution guidelines](CONTRIBUTING.md) for more information. There are a few things you need to know about the code. It is divided in these modules: - `plsql-custom-rules` - Demo project showing how to extend ZPA with custom coding rules. - `sonar-zpa-plugin` - The SonarQube plugin itself, this module contains all the code necessary to integrate with the SonarQube platform. - `zpa-checks` - The built-in coding rules provided by ZPA. - `zpa-checks-testkit` - Test helper for coding rules, it can be used to test custom rules. - `zpa-core` - The heart of this project. It contains the lexer, the parser and the code required to understand and process PL/SQL code. - `zpa-toolkit` - A visual tool to review the AST (abstract syntax tree) generated by the parser. The API exposed to custom plugins must be located in the package `org.sonar.plugins.plsqlopen.api` (it's a requirement from the SonarQube server). The classes located outside this package are not prepared for external consumption, so if you use them, your code can break without any further notice. ### Running the integration tests There are two sets of integration tests: - [sonar-zpa-plugin/integrationTest](https://github.com/felipebz/zpa/tree/main/sonar-zpa-plugin/src/integrationTest): checks if the metrics are imported correctly in SonarQube - [zpa-checks/integrationTest](https://github.com/felipebz/zpa/tree/main/zpa-checks/src/integrationTest): checks the quality of parser and rules against real-world code To run the integrations tests, first update the submodules: git submodule update --init --recursive Build the main plugin and the custom rules example: ./gradlew build publishToMavenLocal ./gradlew build -p plsql-custom-rules Then run the tests: ./gradlew integrationTest By default, the tests will be executed using SonarQube Community Build 25.8. You can change the SonarQube version using the property `sonar.runtimeVersion`, passing a value in the format `LATEST_RELEASE[number]`, like `LATEST_RELEASE[25.3]`, or `a.b.c.d` for an exact release including build number: ./gradlew integrationTest -Dsonar.runtimeVersion=LATEST_RELEASE[25.8] ================================================ FILE: build-logic/build.gradle.kts ================================================ plugins { `kotlin-dsl` } repositories { gradlePluginPortal() mavenCentral() } dependencies { implementation(libs.kotlin.gradle.plugin) implementation(libs.license.gradle.plugin) implementation(libs.dokka.javadoc.plugin) implementation(libs.jreleaser.gradle.plugin) implementation(libs.sonarqube.gradle.plugin) } ================================================ FILE: build-logic/settings.gradle.kts ================================================ dependencyResolutionManagement { // Reuse version catalog from the main build. versionCatalogs { create("libs", { from(files("../gradle/libs.versions.toml")) }) } } rootProject.name = "build-logic" ================================================ FILE: build-logic/src/main/kotlin/com/felipebz/zpa/build-conventions.gradle.kts ================================================ package com.felipebz.zpa plugins { id("com.felipebz.zpa.kotlin-conventions") id("com.felipebz.zpa.testing-conventions") id("com.felipebz.zpa.license-conventions") id("com.felipebz.zpa.publishing-conventions") } ================================================ FILE: build-logic/src/main/kotlin/com/felipebz/zpa/jreleaser-conventions.gradle.kts ================================================ package com.felipebz.zpa plugins { id("org.jreleaser") } jreleaser { project { description.set("ZPA - Parser and static code analysis tool for PL/SQL and Oracle SQL") authors.set(listOf("felipebz")) license.set("LGPL-3.0") links { homepage.set("https://zpa.felipebz.com") } inceptionYear.set("2015") snapshot { fullChangelog.set(true) } } release { github { overwrite.set(true) tagName.set("{{projectVersion}}") draft.set(true) changelog { formatted.set(org.jreleaser.model.Active.ALWAYS) preset.set("conventional-commits") contentTemplate.set(file("template/changelog.tpl")) contributors { enabled.set(false) } hide { uncategorized.set(true) } } } } distributions { listOf("sonar-zpa-plugin", "zpa-toolkit").forEach { create(it) { artifact { path.set(file("{{distributionName}}/build/libs/{{distributionName}}-{{projectVersion}}.jar")) } } } create("plsql-custom-rules") { artifact { path.set(file("build/{{distributionName}}.zip")) } } } signing { active.set(org.jreleaser.model.Active.ALWAYS) armored.set(true) } deploy { maven { mavenCentral { create("sonatype") { active.set(org.jreleaser.model.Active.RELEASE) snapshotSupported.set(true) url.set("https://central.sonatype.com/api/v1/publisher") stagingRepository("build/staging-deploy") } } nexus2 { create("snapshot-deploy") { active.set(org.jreleaser.model.Active.SNAPSHOT) url.set("https://central.sonatype.com/repository/maven-snapshots") snapshotUrl.set("https://central.sonatype.com/repository/maven-snapshots") applyMavenCentralRules.set(true) snapshotSupported.set(true) closeRepository.set(true) releaseRepository.set(true) stagingRepository("build/staging-deploy") } } } } } ================================================ FILE: build-logic/src/main/kotlin/com/felipebz/zpa/kotlin-conventions.gradle.kts ================================================ package com.felipebz.zpa plugins { id("java") id("org.jetbrains.kotlin.jvm") } repositories { mavenCentral() mavenLocal() maven { setUrl("https://central.sonatype.com/repository/maven-snapshots/") } } kotlin { compilerOptions { freeCompilerArgs = listOf("-Xconsistent-data-class-copy-visibility") } } java { withSourcesJar() toolchain { languageVersion = JavaLanguageVersion.of(21) } } ================================================ FILE: build-logic/src/main/kotlin/com/felipebz/zpa/license-conventions.gradle.kts ================================================ package com.felipebz.zpa import com.hierynomus.gradle.license.tasks.LicenseCheck import com.hierynomus.gradle.license.tasks.LicenseFormat import java.io.File import java.util.* plugins { id("com.github.hierynomus.license") } tasks.withType().configureEach { extra.set("year", Calendar.getInstance().get(Calendar.YEAR)) header = File(this.project.rootDir, "LICENSE_HEADER") include("**/*.kt") } tasks.withType().configureEach { extra.set("year", Calendar.getInstance().get(Calendar.YEAR)) header = File(this.project.rootDir, "LICENSE_HEADER") include("**/*.kt") } ================================================ FILE: build-logic/src/main/kotlin/com/felipebz/zpa/publishing-conventions.gradle.kts ================================================ package com.felipebz.zpa import org.gradle.api.publish.maven.MavenPublication import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.get import org.gradle.kotlin.dsl.provideDelegate import org.gradle.kotlin.dsl.register plugins { id("maven-publish") id("org.jetbrains.dokka-javadoc") id("signing") } val dokka by tasks.register("dokka") { dependsOn(tasks.dokkaGenerateModuleJavadoc) from(tasks.dokkaGenerateModuleJavadoc.flatMap { it.outputDirectory }) archiveClassifier.set("javadoc") } signing { setRequired({ gradle.taskGraph.hasTask("publish") }) val signingKey: String? by project val signingPassword: String? by project useInMemoryPgpKeys(signingKey, signingPassword) sign(publishing.publications) } publishing { repositories { maven { url = rootProject.layout.buildDirectory.dir("staging-deploy").get().asFile.toURI() } } publications { create("maven") { from(components["java"]) artifact(dokka) pom { name.set(provider { project.description }) description.set(provider { project.description }) url.set("https://zpa.felipebz.com") organization { name.set("Felipe Zorzo") url.set("https://felipezorzo.com.br") } licenses { license { name.set("GNU LGPL 3") url.set("https://www.gnu.org/licenses/lgpl.txt") distribution.set("repo") } } scm { url.set("https://github.com/felipebz/zpa") connection.set("scm:git:https://github.com/felipebz/zpa.git") developerConnection.set("scm:git:https://github.com/felipebz/zpa.git") } developers { developer { id.set("felipebz") name.set("Felipe Zorzo") url.set("https://felipezorzo.com.br") email.set("felipe@felipezorzo.com.br") } } } } } } ================================================ FILE: build-logic/src/main/kotlin/com/felipebz/zpa/sonarqube-conventions.gradle.kts ================================================ package com.felipebz.zpa plugins { id("org.sonarqube") } sonarqube { properties { property("sonar.projectName", "ZPA") } } ================================================ FILE: build-logic/src/main/kotlin/com/felipebz/zpa/testing-conventions.gradle.kts ================================================ package com.felipebz.zpa plugins { id("com.felipebz.zpa.kotlin-conventions") id("jacoco") } val libs = extensions.getByType(VersionCatalogsExtension::class.java).named("libs") dependencies { testImplementation(libs.findLibrary("assertj").get()) testImplementation(libs.findLibrary("mockito").get()) testImplementation(libs.findLibrary("mockito-kotlin").get()) } configurations { // include compileOnly dependencies during test testImplementation { extendsFrom(configurations.compileOnly.get()) } } testing { suites { val test by getting(JvmTestSuite::class) { useJUnitJupiter(libs.findVersion("junit").get().requiredVersion) } } } tasks.test { finalizedBy(tasks.jacocoTestReport) } tasks.jacocoTestReport { dependsOn(tasks.test) // tests are required to run before generating the report } jacoco { toolVersion = "0.8.14" } tasks.jacocoTestReport { reports { xml.required.set(true) } } ================================================ FILE: build.gradle.kts ================================================ plugins { base id("com.felipebz.zpa.jreleaser-conventions") id("com.felipebz.zpa.sonarqube-conventions") } ================================================ FILE: gradle/libs.versions.toml ================================================ [versions] kotlin = "2.3.21" dokka = "2.2.0" download = "5.7.0" jreleaser = "1.23.0" license = "0.16.1" shadow = "9.4.1" sonarscanner = "7.2.3.7755" # libs flatlaf = "3.7.1" flr = "1.5.0" jackson = "2.21.3" jsoup = "1.22.2" min-sonarqube = "25.8.0.111929" min-sonarqubeapi = "13.0.0.3026" woodstox = "7.1.1" # testing assertj = "3.27.7" junit = "6.0.3" mockito = "5.23.0" mockito-kotlin = "6.3.0" sonarqube-orchestrator = "6.1.0.3962" [libraries] assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } flatlaf = { module = "com.formdev:flatlaf", version.ref = "flatlaf" } flr-core = { module = "com.felipebz.flr:flr-core", version.ref = "flr" } flr-testing-harness = { module = "com.felipebz.flr:flr-testing-harness", version.ref = "flr" } flr-toolkit = { module = "com.felipebz.flr:flr-toolkit", version.ref = "flr" } flr-xpath = { module = "com.felipebz.flr:flr-xpath", version.ref = "flr" } jackson = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } jackson-xml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-xml", version.ref = "jackson" } jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" } junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" } mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" } mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito-kotlin" } woodstox = { module = "com.fasterxml.woodstox:woodstox-core", version.ref = "woodstox" } sonar-plugin-api = { module = "org.sonarsource.api.plugin:sonar-plugin-api", version.ref = "min-sonarqubeapi" } sonar-plugin-api-impl = { module = "org.sonarsource.sonarqube:sonar-plugin-api-impl", version.ref = "min-sonarqube" } sonar-ws = { module = "org.sonarsource.sonarqube:sonar-ws", version.ref = "min-sonarqube" } sonar-orchestrator = { module = "org.sonarsource.orchestrator:sonar-orchestrator-junit5", version.ref = "sonarqube-orchestrator" } dokka-javadoc-plugin = { module = "org.jetbrains.dokka-javadoc:org.jetbrains.dokka-javadoc.gradle.plugin", version.ref = "dokka" } kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } license-gradle-plugin = { module = "com.github.hierynomus.license:com.github.hierynomus.license.gradle.plugin", version.ref = "license" } jreleaser-gradle-plugin = { module = "org.jreleaser:org.jreleaser.gradle.plugin", version.ref = "jreleaser" } sonarqube-gradle-plugin = { module = "org.sonarqube:org.sonarqube.gradle.plugin", version.ref = "sonarscanner" } [plugins] download = { id = "de.undercouch.download", version.ref = "download" } shadow = { id = "com.gradleup.shadow", version.ref = "shadow" } ================================================ FILE: gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip networkTimeout=10000 retries=0 retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists ================================================ FILE: gradle.properties ================================================ group=com.felipebz.zpa version=4.2.0-SNAPSHOT # Workaround for Dokka issue: https://github.com/Kotlin/dokka/issues/1405 org.gradle.jvmargs=-XX:MaxMetaspaceSize=1G systemProp.sonar.gradle.skipCompile=true org.gradle.parallel=false org.gradle.configuration-cache=false org.gradle.caching=true ================================================ FILE: gradlew ================================================ #!/bin/sh # # Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 # ############################################################################## # # Gradle start up script for POSIX generated by Gradle. # # Important for running: # # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is # noncompliant, but you have some other compliant shell such as ksh or # bash, then to run this script, type that shell name before the whole # command line, like: # # ksh Gradle # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: # * functions; # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», # «${var#prefix}», «${var%suffix}», and «$( cmd )»; # * compound commands having a testable exit status, especially «case»; # * various built-in commands including «command», «set», and «ulimit». # # Important for patching: # # (2) This script targets any POSIX shell, so it avoids extensions provided # by Bash, Ksh, etc; in particular arrays are avoided. # # The "traditional" practice of packing multiple parameters into a # space-separated string is a well documented source of bugs and security # problems, so this is (mostly) avoided, by progressively accumulating # options in "$@", and eventually passing that to Java. # # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; # see the in-line comments for details. # # There are tweaks for specific operating systems such as AIX, CygWin, # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template # https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. # ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link app_path=$0 # Need this for daisy-chained symlinks. while APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path [ -h "$app_path" ] do ls=$( ls -ld "$app_path" ) link=${ls#*' -> '} case $link in #( /*) app_path=$link ;; #( *) app_path=$APP_HOME$link ;; esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { echo "$*" } >&2 die () { echo echo "$*" echo exit 1 } >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "$( uname )" in #( CYGWIN* ) cygwin=true ;; #( Darwin* ) darwin=true ;; #( MSYS* | MINGW* ) msys=true ;; #( NONSTOP* ) nonstop=true ;; esac # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD=$JAVA_HOME/jre/sh/java else JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD=java if ! command -v java >/dev/null 2>&1 then die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi # Collect all arguments for the java command, stacking in reverse order: # * args from the command line # * the main class name # * -classpath # * -D...appname settings # * --module-path (only if needed) # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) # Now convert the arguments - kludge to limit ourselves to /bin/sh for arg do if case $arg in #( -*) false ;; # don't mess with options #( /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath [ -e "$t" ] ;; #( *) false ;; esac then arg=$( cygpath --path --ignore --mixed "$arg" ) fi # Roll the args list around exactly as many times as the number of # args, so each arg winds up back in the position where it started, but # possibly modified. # # NB: a `for` loop captures its iteration list before it begins, so # changing the positional parameters here affects neither the number of # iterations, nor the values presented in `arg`. shift # remove old arg set -- "$@" "$arg" # push replacement arg done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then die "xargs is not available" fi # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. # # In Bash we could simply go: # # readarray ARGS < <( xargs -n1 <<<"$var" ) && # set -- "${ARGS[@]}" "$@" # # but POSIX shell has neither arrays nor command substitution, so instead we # post-process each arg (as a line of input to sed) to backslash-escape any # character that might be a shell metacharacter, then use eval to reverse # that process (while maintaining the separation between arguments), and wrap # the whole thing up as a single "set" statement. # # This will of course break if any of these variables contains a newline or # an unmatched quote. # eval "set -- $( printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | xargs -n1 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | tr '\n' ' ' )" '"$@"' exec "$JAVACMD" "$@" ================================================ FILE: gradlew.bat ================================================ @rem @rem Copyright 2015 the original author or authors. @rem @rem Licensed under the Apache License, Version 2.0 (the "License"); @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem @rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem @rem SPDX-License-Identifier: Apache-2.0 @rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables, and ensure extensions are enabled setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Resolve any "." and ".." in APP_HOME to make it shorter. for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute echo. 1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 "%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute echo. 1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 "%COMSPEC%" /c exit 1 :execute @rem Setup the command line @rem Execute Gradle @rem endlocal doesn't take effect until after the line is parsed and variables are expanded @rem which allows us to clear the local environment before executing the java command endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel :exitWithErrorLevel @rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts "%COMSPEC%" /c exit %ERRORLEVEL% ================================================ FILE: plsql-custom-rules/README.md ================================================ # plsql-custom-rules This repository contains examples of custom rules for PL/SQL code analysis using SonarQube. The examples are available as both Gradle and Maven projects. The purpose of this README is to provide information on how to customize and use the examples. ## Getting Started ## Customizing the pom.xml (if you're using Maven) Properties such as `groupId`, `artifactId`, `version`, `name` and `description` can be freely modified. It is important to note that the `sonar-packaging-maven-plugin` is required and it contains the entry point of the plugin, as provided in the property `pluginClass`. If you refactor the code or rename the class extending `org.sonar.api.SonarPlugin`, you will have to change this configuration. ## Customizing the build.gradle.kts (if you're using Gradle) Properties such as `group`, `version` and `description` can be freely modified. It is important to note that you'll may need to update the values in [attributes map](build.gradle.kts#L52) of the `jar` task. ## Dependencies The plugin requires two dependencies: `sonar-plugin-api` and `sonar-zpa-plugin`. The `sonar-plugin-api` dependency represents the minimum version of SonarQube your plugin will support. Additionally, a dependency on `zpa-checks-testkit` can be added to make testing easier. These dependencies are already included in the `pom.xml` and `build.gradle.kts` files. ## Compatibility with zpa-cli To make the plugin compatible with [zpa-cli](https://github.com/felipebz/zpa-cli), you need to adjust the content of [extensions.idx](src/main/resources/META-INF/extensions.idx) to match your `CustomPlSqlRulesDefinition` subclass. ================================================ FILE: plsql-custom-rules/build.gradle.kts ================================================ import java.time.ZoneId import java.time.format.DateTimeFormatter import java.util.* plugins { java } repositories { mavenCentral() mavenLocal() maven { url = uri("https://central.sonatype.com/repository/maven-snapshots/") } } java { toolchain { languageVersion.set(JavaLanguageVersion.of(21)) } } val minSonarQubeVersion = "25.8.0.111929" val minSonarQubeApiVersion = "13.0.0.3026" val junitVersion = "6.0.3" val zpaVersion = "4.2.0-SNAPSHOT" dependencies { compileOnly("org.sonarsource.api.plugin:sonar-plugin-api:$minSonarQubeApiVersion") compileOnly("com.felipebz.zpa:sonar-zpa-plugin:$zpaVersion") testImplementation("org.sonarsource.sonarqube:sonar-plugin-api-impl:$minSonarQubeVersion") testImplementation("com.felipebz.zpa:zpa-checks-testkit:$zpaVersion") testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion") testRuntimeOnly("org.junit.platform:junit-platform-launcher") } configurations { // include compileOnly dependencies during test testImplementation { extendsFrom(configurations.compileOnly.get()) } } tasks.named("test") { useJUnitPlatform() testLogging { events("passed", "skipped", "failed") } } tasks.jar { manifest { val buildDate = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ").withZone(ZoneId.systemDefault()).format( Date().toInstant()) attributes(mapOf( "Plugin-BuildDate" to buildDate, "Plugin-ChildFirstClassLoader" to "false", "Plugin-Class" to "com.company.plsql.PlSqlCustomRulesPlugin", "Plugin-Description" to "PL/SQL Custom Rules", "Plugin-Developers" to "", "Plugin-Display-Version" to project.version, "Plugin-Key" to "myrules", "Plugin-License" to "", "Plugin-Name" to "Company PL/SQL Rules", "Plugin-Version" to project.version, "Sonar-Version" to minSonarQubeApiVersion, "SonarLint-Supported" to "false", "Plugin-RequiredForLanguages" to "plsqlopen" )) } } group = "com.company" version = "1.0-SNAPSHOT" description = "Company PL/SQL Rules" tasks.withType() { options.encoding = "UTF-8" } ================================================ FILE: plsql-custom-rules/gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip networkTimeout=10000 retries=0 retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists ================================================ FILE: plsql-custom-rules/gradlew ================================================ #!/bin/sh # # Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 # ############################################################################## # # Gradle start up script for POSIX generated by Gradle. # # Important for running: # # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is # noncompliant, but you have some other compliant shell such as ksh or # bash, then to run this script, type that shell name before the whole # command line, like: # # ksh Gradle # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: # * functions; # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», # «${var#prefix}», «${var%suffix}», and «$( cmd )»; # * compound commands having a testable exit status, especially «case»; # * various built-in commands including «command», «set», and «ulimit». # # Important for patching: # # (2) This script targets any POSIX shell, so it avoids extensions provided # by Bash, Ksh, etc; in particular arrays are avoided. # # The "traditional" practice of packing multiple parameters into a # space-separated string is a well documented source of bugs and security # problems, so this is (mostly) avoided, by progressively accumulating # options in "$@", and eventually passing that to Java. # # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; # see the in-line comments for details. # # There are tweaks for specific operating systems such as AIX, CygWin, # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template # https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. # ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link app_path=$0 # Need this for daisy-chained symlinks. while APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path [ -h "$app_path" ] do ls=$( ls -ld "$app_path" ) link=${ls#*' -> '} case $link in #( /*) app_path=$link ;; #( *) app_path=$APP_HOME$link ;; esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { echo "$*" } >&2 die () { echo echo "$*" echo exit 1 } >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "$( uname )" in #( CYGWIN* ) cygwin=true ;; #( Darwin* ) darwin=true ;; #( MSYS* | MINGW* ) msys=true ;; #( NONSTOP* ) nonstop=true ;; esac # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD=$JAVA_HOME/jre/sh/java else JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD=java if ! command -v java >/dev/null 2>&1 then die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi # Collect all arguments for the java command, stacking in reverse order: # * args from the command line # * the main class name # * -classpath # * -D...appname settings # * --module-path (only if needed) # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) # Now convert the arguments - kludge to limit ourselves to /bin/sh for arg do if case $arg in #( -*) false ;; # don't mess with options #( /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath [ -e "$t" ] ;; #( *) false ;; esac then arg=$( cygpath --path --ignore --mixed "$arg" ) fi # Roll the args list around exactly as many times as the number of # args, so each arg winds up back in the position where it started, but # possibly modified. # # NB: a `for` loop captures its iteration list before it begins, so # changing the positional parameters here affects neither the number of # iterations, nor the values presented in `arg`. shift # remove old arg set -- "$@" "$arg" # push replacement arg done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then die "xargs is not available" fi # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. # # In Bash we could simply go: # # readarray ARGS < <( xargs -n1 <<<"$var" ) && # set -- "${ARGS[@]}" "$@" # # but POSIX shell has neither arrays nor command substitution, so instead we # post-process each arg (as a line of input to sed) to backslash-escape any # character that might be a shell metacharacter, then use eval to reverse # that process (while maintaining the separation between arguments), and wrap # the whole thing up as a single "set" statement. # # This will of course break if any of these variables contains a newline or # an unmatched quote. # eval "set -- $( printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | xargs -n1 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | tr '\n' ' ' )" '"$@"' exec "$JAVACMD" "$@" ================================================ FILE: plsql-custom-rules/gradlew.bat ================================================ @rem @rem Copyright 2015 the original author or authors. @rem @rem Licensed under the Apache License, Version 2.0 (the "License"); @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem @rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem @rem SPDX-License-Identifier: Apache-2.0 @rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables, and ensure extensions are enabled setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Resolve any "." and ".." in APP_HOME to make it shorter. for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute echo. 1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 "%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute echo. 1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 "%COMSPEC%" /c exit 1 :execute @rem Setup the command line @rem Execute Gradle @rem endlocal doesn't take effect until after the line is parsed and variables are expanded @rem which allows us to clear the local environment before executing the java command endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel :exitWithErrorLevel @rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts "%COMSPEC%" /c exit %ERRORLEVEL% ================================================ FILE: plsql-custom-rules/pom.xml ================================================ 4.0.0 com.company plsql-custom-rules 1.0-SNAPSHOT sonar-plugin Company PL/SQL Rules PL/SQL Custom Rules UTF-8 4.2.0-SNAPSHOT 13.0.0.3026 25.8.0.111929 org.sonarsource.api.plugin sonar-plugin-api ${sonarqube.api.min.version} provided org.sonarsource.sonarqube sonar-plugin-api-impl ${sonarqube.min.version} test com.felipebz.zpa sonar-zpa-plugin ${zpa.version} provided com.felipebz.zpa zpa-checks-testkit ${zpa.version} test org.junit.jupiter junit-jupiter 6.0.3 test org.sonarsource.sonar-packaging-maven-plugin sonar-packaging-maven-plugin 1.25.1.3002 true com.company.plsql.PlSqlCustomRulesPlugin my-rules plsqlopen false ${sonarqube.api.min.version} org.apache.maven.plugins maven-compiler-plugin 3.15.0 21 maven-surefire-plugin 3.5.5 public_feed https://central.sonatype.com/repository/maven-snapshots/ true true ================================================ FILE: plsql-custom-rules/settings.gradle.kts ================================================ rootProject.name = "plsql-custom-rules" ================================================ FILE: plsql-custom-rules/src/main/java/com/company/plsql/ForbiddenDmlCheck.java ================================================ package com.company.plsql; import org.sonar.plugins.plsqlopen.api.annotations.Priority; import org.sonar.plugins.plsqlopen.api.annotations.Rule; import org.sonar.plugins.plsqlopen.api.DmlGrammar; import org.sonar.plugins.plsqlopen.api.annotations.ActivatedByDefault; import org.sonar.plugins.plsqlopen.api.annotations.ConstantRemediation; import org.sonar.plugins.plsqlopen.api.checks.PlSqlCheck; import org.sonar.plugins.plsqlopen.api.sslr.AstNode; @Rule( name = "Avoid DML on table USER", description = "You should use the functions from the USER_WRAPPER package.", key = "ForbiddenDmlCheck", priority = Priority.MAJOR ) @ConstantRemediation("10min") @ActivatedByDefault public class ForbiddenDmlCheck extends PlSqlCheck { @Override public void init() { subscribeTo(DmlGrammar.DML_TABLE_EXPRESSION_CLAUSE); } @Override public void visitNode(AstNode node) { AstNode table = node.getFirstChildOrNull(DmlGrammar.TABLE_REFERENCE); if (table != null && table.getTokenOriginalValue().equalsIgnoreCase("user")) { addIssue(table, "Replace this query by a function of the USER_WRAPPER package."); } } } ================================================ FILE: plsql-custom-rules/src/main/java/com/company/plsql/PlSqlCustomRulesDefinition.java ================================================ package com.company.plsql; import org.sonar.plugins.plsqlopen.api.CustomPlSqlRulesDefinition; public class PlSqlCustomRulesDefinition extends CustomPlSqlRulesDefinition { @Override public String repositoryName() { return "Company"; } @Override public String repositoryKey() { return "my-rules"; } @Override public Class[] checkClasses() { return new Class[] { ForbiddenDmlCheck.class }; } } ================================================ FILE: plsql-custom-rules/src/main/java/com/company/plsql/PlSqlCustomRulesPlugin.java ================================================ package com.company.plsql; import org.sonar.api.Plugin; public class PlSqlCustomRulesPlugin implements Plugin { @Override public void define(Plugin.Context context) { context.addExtension(PlSqlCustomRulesDefinition.class); } } ================================================ FILE: plsql-custom-rules/src/main/resources/META-INF/extensions.idx ================================================ com.company.plsql.PlSqlCustomRulesDefinition ================================================ FILE: plsql-custom-rules/src/test/java/com/company/plsql/ForbiddenDmlCheckTest.java ================================================ package com.company.plsql; import org.junit.jupiter.api.Test; import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier; public class ForbiddenDmlCheckTest { @Test public void test() { PlSqlCheckVerifier.verify("src/test/resources/forbidden-dml.sql", new ForbiddenDmlCheck()); } } ================================================ FILE: plsql-custom-rules/src/test/java/com/company/plsql/PlSqlCustomRulesDefinitionTest.java ================================================ package com.company.plsql; import org.junit.jupiter.api.Test; import org.sonar.api.Plugin; import org.sonar.api.SonarEdition; import org.sonar.api.SonarQubeSide; import org.sonar.api.internal.SonarRuntimeImpl; import org.sonar.api.utils.Version; import static org.junit.jupiter.api.Assertions.assertEquals; public class PlSqlCustomRulesDefinitionTest { @Test public void test() { Plugin.Context context = new Plugin.Context(SonarRuntimeImpl.forSonarQube(Version.create(6, 0), SonarQubeSide.SERVER, SonarEdition.COMMUNITY)); PlSqlCustomRulesPlugin plugin = new PlSqlCustomRulesPlugin(); plugin.define(context); assertEquals(1, context.getExtensions().size()); } } ================================================ FILE: plsql-custom-rules/src/test/java/com/company/plsql/PlSqlCustomRulesPluginTest.java ================================================ package com.company.plsql; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; public class PlSqlCustomRulesPluginTest { @Test public void testRepository() { PlSqlCustomRulesDefinition plugin = new PlSqlCustomRulesDefinition(); assertEquals("Company", plugin.repositoryName()); assertEquals("my-rules", plugin.repositoryKey()); assertEquals(1, plugin.checkClasses().length); } } ================================================ FILE: plsql-custom-rules/src/test/resources/forbidden-dml.sql ================================================ select * from user u inner join profile p on (u.id = p.user_id); -- Noncompliant {{Replace this query by a function of the USER_WRAPPER package.}} -- ^^^^ select * from (select * from user) -- Noncompliant -- ^^^^ ================================================ FILE: settings.gradle.kts ================================================ pluginManagement { includeBuild("build-logic") } rootProject.name = "zpa" include(":sonar-zpa-plugin") include(":zpa-checks") include(":zpa-checks-testkit") include(":zpa-core") include(":zpa-toolkit") ================================================ FILE: sonar-zpa-plugin/build.gradle.kts ================================================ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import groovy.util.Node import groovy.util.NodeList import java.time.ZoneId import java.time.format.DateTimeFormatter import java.util.* plugins { id("com.felipebz.zpa.build-conventions") alias(libs.plugins.shadow) } dependencies { implementation(libs.flr.core) implementation(libs.jackson.xml) implementation(libs.woodstox) implementation(project(":zpa-core")) implementation(project(":zpa-checks")) implementation(project(":zpa-checks-testkit")) compileOnly(libs.sonar.plugin.api) compileOnly(libs.sonar.plugin.api.impl) } testing { suites { register("integrationTest") { dependencies { implementation(libs.assertj) implementation(libs.sonar.ws) implementation(libs.sonar.orchestrator) } targets { all { testTask.configure { val zipFile = System.getProperty("sonar.zipFile") val launcher = javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(21)) } javaLauncher.set(launcher) environment("JAVA_HOME", launcher.get().metadata.installationPath.asFile.toString()) systemProperty("java.awt.headless", "true") if (zipFile != null) { systemProperty("sonar.zipFile", zipFile) } outputs.upToDateWhen { false } } } } } } } val shadowJar = tasks.named("shadowJar") { relocate("com.felipebz.flr.api", "org.sonar.plugins.plsqlopen.api.sslr") relocate("com.felipebz.zpa.api", "org.sonar.plugins.plsqlopen.api") archiveClassifier.set("") manifest { val buildDate = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ").withZone(ZoneId.systemDefault()).format(Date().toInstant()) attributes(mapOf( "Plugin-BuildDate" to buildDate, "Plugin-ChildFirstClassLoader" to "false", "Plugin-Class" to "com.felipebz.zpa.PlSqlPlugin", "Plugin-Description" to "Enables analysis and reporting on PL/SQL projects.", "Plugin-Developers" to "Felipe Zorzo", "Plugin-Display-Version" to project.version, "Plugin-Homepage" to "https://zpa.felipebz.com", "Plugin-IssueTrackerUrl" to "https://github.com/felipebz/zpa/issues", "Plugin-Key" to "plsqlopen", "Plugin-License" to "GNU LGPL 3", "Plugin-Name" to "ZPA Plugin for SonarQube", "Plugin-Organization" to "Felipe Zorzo", "Plugin-OrganizationUrl" to "https://felipezorzo.com.br", "Plugin-SourcesUrl" to "https://github.com/felipebz/zpa", "Plugin-Version" to project.version, "Sonar-Version" to libs.versions.min.sonarqubeapi, "SonarLint-Supported" to "false", "Plugin-RequiredForLanguages" to "plsqlopen" )) } } tasks.build { dependsOn(shadowJar) } tasks.jar { enabled = false } // Disable Gradle module metadata as it lists wrong dependencies tasks.withType { enabled = false } publishing { publications.withType { this.pom.withXml { val pomNode = asNode() val dependencyNodes = pomNode.get("dependencies") as NodeList dependencyNodes.forEach { (it as Node).parent().remove(it) } } artifact(shadowJar) } } description = "ZPA Plugin for SonarQube" ================================================ FILE: sonar-zpa-plugin/src/integrationTest/kotlin/com/felipebz/zpa/it/IssueTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.it import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.tuple import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.RegisterExtension import org.sonarqube.ws.client.issues.SearchRequest import java.io.File class IssueTest { @Test fun issues() { val issues = Tests.newWsClient(orchestrator) .issues() .search(SearchRequest().setComponentKeys(listOf(PROJECT_KEY))) .issuesList assertThat(issues).extracting("rule", "component") .containsExactlyInAnyOrder( tuple("plsql:EmptyBlock", "$PROJECT_KEY:src/source1.sql"), tuple("my-rules:ForbiddenDmlCheck", "$PROJECT_KEY:src/custom_rule.sql")) } companion object { private const val PROJECT_KEY = "issue" @JvmField @RegisterExtension val orchestrator = Tests.ORCHESTRATOR @JvmStatic @BeforeAll fun init() { orchestrator.server.provisionProject(PROJECT_KEY, PROJECT_KEY) orchestrator.server.associateProjectToQualityProfile(PROJECT_KEY, "plsqlopen", "it-profile") val build = Tests.createSonarScanner() .setProjectDir(File("src/integrationTest/resources/projects/metrics/")) .setProjectKey(PROJECT_KEY) .setProjectName(PROJECT_KEY) .setProjectVersion("1.0") .setSourceDirs("src") .setProperty("sonar.sourceEncoding", "UTF-8") orchestrator.executeBuild(build) } } } ================================================ FILE: sonar-zpa-plugin/src/integrationTest/kotlin/com/felipebz/zpa/it/MetricsTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.it import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertAll import org.junit.jupiter.api.extension.RegisterExtension import org.sonarqube.ws.Measures import org.sonarqube.ws.client.measures.ComponentRequest import java.io.File class MetricsTest { @Test fun project_level() { // Size assertAll( // Size { assertThat(getMeasureAsInteger(PROJECT_KEY, "ncloc")).isEqualTo(32) }, { assertThat(getMeasureAsInteger(PROJECT_KEY, "lines")).isEqualTo(33) }, { assertThat(getMeasureAsInteger(PROJECT_KEY, "files")).isEqualTo(4) }, { assertThat(getMeasureAsInteger(PROJECT_KEY, "statements")).isEqualTo(7) }, // Documentation { assertThat(getMeasureAsInteger(PROJECT_KEY, "comment_lines")).isEqualTo(1) }, { assertThat(getMeasureAsDouble(PROJECT_KEY, "comment_lines_density")).isEqualTo(3.0) }, { assertThat(getMeasureAsString(PROJECT_KEY, "public_documented_api_density")).isNull() }, // Duplication { assertThat(getMeasureAsDouble(PROJECT_KEY, "duplicated_lines")).isZero }, { assertThat(getMeasureAsDouble(PROJECT_KEY, "duplicated_blocks")).isZero }, { assertThat(getMeasureAsDouble(PROJECT_KEY, "duplicated_files")).isZero }, { assertThat(getMeasureAsDouble(PROJECT_KEY, "duplicated_lines_density")).isZero }, // Rules { assertThat(getMeasureAsDouble(PROJECT_KEY, "violations")).isZero }, // Tests { assertThat(getMeasureAsInteger(PROJECT_KEY, "tests")).isEqualTo(6) }, { assertThat(getMeasureAsInteger(PROJECT_KEY, "skipped_tests")).isEqualTo(1) }, { assertThat(getMeasureAsInteger(PROJECT_KEY, "test_failures")).isEqualTo(1) }, { assertThat(getMeasureAsInteger(PROJECT_KEY, "test_errors")).isEqualTo(1) }, { assertThat(getMeasureAsDouble(PROJECT_KEY, "test_success_density")).isEqualTo(66.7) }, { assertThat(getMeasureAsDouble(PROJECT_KEY, "test_execution_time")).isEqualTo(15.0) }, // Coverage { assertThat(getMeasureAsDouble(PROJECT_KEY, "coverage")).isEqualTo(50.0) }, { assertThat(getMeasureAsDouble(PROJECT_KEY, "line_coverage")).isEqualTo(50.0) }, { assertThat(getMeasureAsDouble(PROJECT_KEY, "branch_coverage")).isNull() }, ) } @Test fun file_level() { assertAll( // Size { assertThat(getMeasureAsInteger(FILE_NAME, "ncloc")).isEqualTo(7) }, { assertThat(getMeasureAsInteger(FILE_NAME, "lines")).isEqualTo(7) }, { assertThat(getMeasureAsInteger(FILE_NAME, "statements")).isEqualTo(2) }, // Documentation { assertThat(getMeasureAsInteger(FILE_NAME, "comment_lines")).isZero }, { assertThat(getMeasureAsDouble(FILE_NAME, "comment_lines_density")).isZero }, // Duplication { assertThat(getMeasureAsInteger(FILE_NAME, "duplicated_lines")).isZero }, { assertThat(getMeasureAsInteger(FILE_NAME, "duplicated_blocks")).isZero }, { assertThat(getMeasureAsInteger(FILE_NAME, "duplicated_files")).isZero }, { assertThat(getMeasureAsDouble(FILE_NAME, "duplicated_lines_density")).isZero }, // Rules { assertThat(getMeasureAsInteger(FILE_NAME, "violations")).isZero }, ) } @Test fun covered_file() { assertAll( // Size { assertThat(getMeasureAsInteger(COVERED_FILE_NAME, "ncloc")).isEqualTo(10) }, { assertThat(getMeasureAsInteger(COVERED_FILE_NAME, "lines")).isEqualTo(10) }, { assertThat(getMeasureAsInteger(COVERED_FILE_NAME, "statements")).isEqualTo(3) }, // Documentation { assertThat(getMeasureAsInteger(COVERED_FILE_NAME, "comment_lines")).isZero }, { assertThat(getMeasureAsDouble(COVERED_FILE_NAME, "comment_lines_density")).isZero }, // Duplication { assertThat(getMeasureAsInteger(COVERED_FILE_NAME, "duplicated_lines")).isZero }, { assertThat(getMeasureAsInteger(COVERED_FILE_NAME, "duplicated_blocks")).isZero }, { assertThat(getMeasureAsInteger(COVERED_FILE_NAME, "duplicated_files")).isZero }, { assertThat(getMeasureAsDouble(COVERED_FILE_NAME, "duplicated_lines_density")).isZero }, // Rules { assertThat(getMeasureAsInteger(COVERED_FILE_NAME, "violations")).isZero }, // Coverage { assertThat(getMeasureAsDouble(COVERED_FILE_NAME, "coverage")).isEqualTo(100.0) }, { assertThat(getMeasureAsDouble(COVERED_FILE_NAME, "line_coverage")).isEqualTo(100.0) }, { assertThat(getMeasureAsDouble(COVERED_FILE_NAME, "branch_coverage")).isNull() }, ) } @Test fun test_file() { assertAll( // Size { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "ncloc")).isNull() }, { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "lines")).isNull() }, { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "statements")).isNull() }, // Documentation { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "comment_lines")).isNull() }, { assertThat(getMeasureAsDouble(TEST_FILE_NAME, "comment_lines_density")).isNull() }, // Duplication { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "duplicated_lines")).isZero }, { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "duplicated_blocks")).isZero }, { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "duplicated_files")).isZero }, { assertThat(getMeasureAsDouble(TEST_FILE_NAME, "duplicated_lines_density")).isZero }, // Rules { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "violations")).isZero }, // Tests { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "tests")).isEqualTo(6) }, { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "skipped_tests")).isEqualTo(1) }, { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "test_failures")).isEqualTo(1) }, { assertThat(getMeasureAsInteger(TEST_FILE_NAME, "test_errors")).isEqualTo(1) }, { assertThat(getMeasureAsDouble(TEST_FILE_NAME, "test_success_density")).isEqualTo(66.7) }, { assertThat(getMeasureAsDouble(TEST_FILE_NAME, "test_execution_time")).isEqualTo(15.0) }, ) } /* Helper methods */ private fun getMeasure(componentKey: String, metricKey: String): Measures.Measure? { val response = Tests.newWsClient(orchestrator).measures() .component( ComponentRequest() .setComponent(componentKey) .setMetricKeys(listOf(metricKey)) ) val measures = response.component.measuresList return if (measures.size == 1) measures[0] else null } private fun getMeasureAsString(componentKey: String, metricKey: String): String? { val measure = getMeasure(componentKey, metricKey) return measure?.value } private fun getMeasureAsInteger(componentKey: String, metricKey: String): Int? { val measure = getMeasure(componentKey, metricKey) return if (measure == null) null else Integer.parseInt(measure.value) } private fun getMeasureAsDouble(componentKey: String, metricKey: String): Double? { val measure = getMeasure(componentKey, metricKey) return if (measure == null) null else java.lang.Double.parseDouble(measure.value) } companion object { @JvmField @RegisterExtension var orchestrator = Tests.ORCHESTRATOR private const val PROJECT_KEY = "metrics" private const val FILE_NAME = "$PROJECT_KEY:src/source1.sql" private const val COVERED_FILE_NAME = "$PROJECT_KEY:src/betwnstr.sql" private const val TEST_FILE_NAME = "$PROJECT_KEY:test/test_betwnstr.sql" @JvmStatic @BeforeAll fun init() { orchestrator.server.provisionProject(PROJECT_KEY, PROJECT_KEY) orchestrator.server.associateProjectToQualityProfile(PROJECT_KEY, "plsqlopen", "empty-profile") val build = Tests.createSonarScanner() .setProjectDir(File("src/integrationTest/resources/projects/metrics/")) .setProjectKey(PROJECT_KEY) .setProjectName(PROJECT_KEY) .setProjectVersion("1.0") .setSourceDirs("src") .setTestDirs("test") .setProperty("sonar.sourceEncoding", "UTF-8") .setProperty("sonar.zpa.tests.reportPaths", "test_results.xml") .setProperty("sonar.zpa.coverage.reportPaths", "coverage.xml") .setDebugLogs(true) orchestrator.executeBuild(build) } } } ================================================ FILE: sonar-zpa-plugin/src/integrationTest/kotlin/com/felipebz/zpa/it/Tests.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.it import com.sonar.orchestrator.Orchestrator import com.sonar.orchestrator.build.SonarScanner import com.sonar.orchestrator.junit5.OrchestratorExtension import com.sonar.orchestrator.locator.FileLocation import org.junit.jupiter.api.extension.RegisterExtension import org.sonarqube.ws.client.HttpConnector import org.sonarqube.ws.client.WsClient import org.sonarqube.ws.client.WsClientFactories import java.io.File object Tests { @JvmField @RegisterExtension val ORCHESTRATOR: OrchestratorExtension = OrchestratorExtension.builderEnv() .useDefaultAdminCredentialsForBuilds(true) .apply { val zipFile = System.getProperty("sonar.zipFile") if (zipFile != null) { setZipFile(File(zipFile)) } else { setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE[25.8]")) } } .setOrchestratorProperty("orchestrator.artifactory.url", "https://repo1.maven.org/maven2") .addPlugin(FileLocation.byWildcardMavenFilename( File("build/libs"), "sonar-zpa-plugin-*.jar")) .addPlugin(FileLocation.byWildcardMavenFilename( File("../plsql-custom-rules/build/libs"), "plsql-custom-rules-*.jar")) .restoreProfileAtStartup(FileLocation.ofClasspath("/com/felipebz/zpa/it/it-profile.xml")) .restoreProfileAtStartup(FileLocation.ofClasspath("/com/felipebz/zpa/it/empty-profile.xml")) .build() fun createSonarScanner(): SonarScanner = SonarScanner.create() .setScannerVersion("7.0.2.4839") fun newWsClient(orchestrator: Orchestrator): WsClient = WsClientFactories.getDefault() .newClient(HttpConnector.newBuilder() .url(orchestrator.server.url).build()) } ================================================ FILE: sonar-zpa-plugin/src/integrationTest/resources/com/felipebz/zpa/it/empty-profile.xml ================================================ empty-profile plsqlopen ================================================ FILE: sonar-zpa-plugin/src/integrationTest/resources/com/felipebz/zpa/it/it-profile.xml ================================================ it-profile plsqlopen plsql EmptyBlock MAJOR my-rules ForbiddenDmlCheck MAJOR ================================================ FILE: sonar-zpa-plugin/src/integrationTest/resources/projects/metrics/coverage.xml ================================================ ================================================ FILE: sonar-zpa-plugin/src/integrationTest/resources/projects/metrics/src/betwnstr.sql ================================================ CREATE OR REPLACE FUNCTION BETWNSTR(A_STRING VARCHAR2, A_START_POS INTEGER, A_END_POS INTEGER) RETURN VARCHAR2 IS L_START_POS PLS_INTEGER := A_START_POS; BEGIN IF L_START_POS = 0 THEN L_START_POS := 1; END IF; RETURN SUBSTR(A_STRING, L_START_POS, A_END_POS - L_START_POS + 1); END; / ================================================ FILE: sonar-zpa-plugin/src/integrationTest/resources/projects/metrics/src/custom_rule.sql ================================================ declare x number; begin select x into x from user; end; ================================================ FILE: sonar-zpa-plugin/src/integrationTest/resources/projects/metrics/src/source1.sql ================================================ begin null; end; begin null; -- NOSONAR end; ================================================ FILE: sonar-zpa-plugin/src/integrationTest/resources/projects/metrics/src/source2.sql ================================================ declare i number; begin -- a comment select count(*) into i from dual; end; ================================================ FILE: sonar-zpa-plugin/src/integrationTest/resources/projects/metrics/test/test_betwnstr.sql ================================================ create or replace package test_betwnstr as -- %suite(Between string function) -- %test(Returns substring from start position to end position) procedure normal_case; -- %test(Returns substring when start position is zero) procedure zero_start_position; -- %test(Returns string until end if end position is greater than string length) procedure big_end_position; -- %test(Returns null for null input string value) procedure null_string; -- %test(A demo of test raising runtime exception) procedure bad_params; -- %test(A demo of failing test) procedure bad_test; -- %test(Demo of a disabled test) -- %disabled procedure disabled_test; end; / create or replace package body test_betwnstr as procedure normal_case is begin ut.expect(betwnstr('1234567', 2, 5)).to_equal('2345'); end; procedure zero_start_position is begin ut.expect(betwnstr('1234567', 0, 5)).to_(equal('12345')); end; procedure big_end_position is begin ut.expect(betwnstr('1234567', 0, 500)).to_(equal('1234567')); end; procedure null_string is begin ut.expect(betwnstr(null, 2, 5)).to_(be_null()); end; procedure bad_params is begin ut.expect(betwnstr('1234567', 'a', 'b')).to_(be_null()); end; procedure bad_test is begin ut.expect(betwnstr('1234567', 0, 500)).to_(equal('1')); end; procedure disabled_test is begin ut.expect(betwnstr(null, null, null)).not_to(be_null); end; end; / ================================================ FILE: sonar-zpa-plugin/src/integrationTest/resources/projects/metrics/test_results.xml ================================================ ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/PlSql.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.sonar.api.config.Configuration import org.sonar.api.resources.AbstractLanguage class PlSql internal constructor(private val settings: Configuration) : AbstractLanguage(KEY, "PL/SQL (ZPA)") { private val defaultFileSuffixes = arrayOf("sql", "pkg", "pks", "pkb") override fun getFileSuffixes(): Array { val suffixes = filterEmptyStrings(settings.getStringArray(PlSqlPlugin.Companion.FILE_SUFFIXES_KEY)) return if (suffixes.isEmpty()) defaultFileSuffixes else suffixes } private fun filterEmptyStrings(stringArray: Array): Array { val nonEmptyStrings = stringArray .filterNot { it.isBlank() } .map { it.trim() } return nonEmptyStrings.toTypedArray() } companion object { const val KEY = "plsqlopen" } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/PlSqlPlugin.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.sonar.api.Plugin import org.sonar.api.PropertyType import org.sonar.api.config.PropertyDefinition import com.felipebz.zpa.symbols.ObjectLocator import com.felipebz.zpa.log.SonarQubeLoggers import com.felipebz.zpa.utils.log.Loggers import com.felipebz.zpa.utplsql.UtPlSqlSensor class PlSqlPlugin : Plugin { override fun define(context: Plugin.Context) { Loggers.factory = SonarQubeLoggers() context.addExtensions( PropertyDefinition.builder(FILE_SUFFIXES_KEY) .deprecatedKey(OLD_FILE_SUFFIXES_KEY) .name("File Suffixes") .description("Comma-separated list of suffixes of PL/SQL files to analyze.") .category(DEFAULT_CATEGORY) .subCategory(GENERAL) .onConfigScopes(PropertyDefinition.ConfigScope.PROJECT) .defaultValue("sql,pkg,pks,pkb") .multiValues(true) .build(), PropertyDefinition.builder(FORMS_METADATA_KEY) .name("Oracle Forms metadata file") .description("Path to the JSON file with the Oracle Forms metadata.") .category(DEFAULT_CATEGORY) .subCategory(GENERAL) .onConfigScopes(PropertyDefinition.ConfigScope.PROJECT) .build(), PropertyDefinition.builder(ERROR_RECOVERY_KEY) .name("Parse error recovery") .description("Defines mode for error handling of parsing errors. 'False' (strict) breaks after an error or 'True' (tolerant, default) continues.") .category(DEFAULT_CATEGORY) .subCategory(GENERAL) .onConfigScopes(PropertyDefinition.ConfigScope.PROJECT) .type(PropertyType.BOOLEAN) .defaultValue("true") .build(), PropertyDefinition.builder(CONCURRENT_EXECUTION_KEY) .name("Enable concurrent execution") .description("Enable concurrent analysis of files.") .category(DEFAULT_CATEGORY) .subCategory(GENERAL) .onConfigScopes(PropertyDefinition.ConfigScope.PROJECT) .type(PropertyType.BOOLEAN) .defaultValue("true") .build(), PlSql::class.java, PlSqlProfile::class.java, PlSqlSquidSensor::class.java, PlSqlRuleRepository::class.java, ObjectLocator::class.java, ) addUtPlSqlExtensions(context) } private fun addUtPlSqlExtensions(context: Plugin.Context) { context.addExtensions( PropertyDefinition.builder(UtPlSqlSensor.TEST_REPORT_PATH_KEY) .name("Path to the utPLSQL test report(s)") .description("Paths (absolute or relative) to report files with utPLSQL test execution data.") .category(DEFAULT_CATEGORY) .subCategory(TEST_AND_COVERAGE) .onConfigScopes(PropertyDefinition.ConfigScope.PROJECT) .defaultValue(UtPlSqlSensor.DEFAULT_TEST_REPORT_PATH) .multiValues(true) .build(), PropertyDefinition.builder(UtPlSqlSensor.COVERAGE_REPORT_PATH_KEY) .name("Path to the utPLSQL coverage report(s)") .description("Paths (absolute or relative) to report files with utPLSQL coverage data.") .category(DEFAULT_CATEGORY) .subCategory(TEST_AND_COVERAGE) .onConfigScopes(PropertyDefinition.ConfigScope.PROJECT) .defaultValue(UtPlSqlSensor.DEFAULT_COVERAGE_REPORT_PATH) .multiValues(true) .build(), UtPlSqlSensor::class.java, ) } companion object { private const val DEFAULT_CATEGORY = "ZPA" private const val GENERAL = "General" private const val TEST_AND_COVERAGE = "Tests and Coverage" internal const val FILE_SUFFIXES_KEY = "sonar.plsqlopen.file.suffixes" internal const val OLD_FILE_SUFFIXES_KEY = "sonar.zpa.file.suffixes" internal const val FORMS_METADATA_KEY = "sonar.zpa.forms.metadata" internal const val ERROR_RECOVERY_KEY = "sonar.zpa.errorRecoveryEnabled" internal const val CONCURRENT_EXECUTION_KEY = "sonar.zpa.concurrentExecution" } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/PlSqlProfile.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition import org.sonar.api.utils.AnnotationUtils import com.felipebz.zpa.checks.CheckList import com.felipebz.zpa.rules.SonarQubeRuleMetadataLoader import com.felipebz.zpa.api.annotations.ActivatedByDefault class PlSqlProfile : BuiltInQualityProfilesDefinition { private val ruleMetadataLoader = SonarQubeRuleMetadataLoader() override fun define(context: BuiltInQualityProfilesDefinition.Context) { val profile = context.createBuiltInQualityProfile(CheckList.SONAR_WAY_PROFILE, PlSql.KEY) profile.isDefault = true for (ruleClass in CheckList.checks) { addRule(ruleClass, profile) } profile.done() } private fun addRule(ruleClass: Class<*>, profile: BuiltInQualityProfilesDefinition.NewBuiltInQualityProfile) { if (AnnotationUtils.getAnnotation(ruleClass, ActivatedByDefault::class.java) != null) { val ruleKey = CustomAnnotationBasedRulesDefinition.getRuleKey(ruleMetadataLoader, ruleClass) profile.activateRule(PlSqlRuleRepository.KEY, ruleKey) } } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/PlSqlRuleRepository.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import com.felipebz.zpa.checks.CheckList import com.felipebz.zpa.rules.SonarQubeRepositoryAdapter import com.felipebz.zpa.rules.SonarQubeRuleMetadataLoader import org.sonar.api.server.rule.RulesDefinition class PlSqlRuleRepository : RulesDefinition { override fun define(context: RulesDefinition.Context) { val repository = context .createRepository(KEY, PlSql.Companion.KEY) .setName("ZPA") CustomAnnotationBasedRulesDefinition.load(SonarQubeRepositoryAdapter(repository), PlSql.Companion.KEY, CheckList.checks, SonarQubeRuleMetadataLoader()) repository.done() } companion object { internal val KEY: String init { // TODO: remove this code and always use the key "zpa" var repositoryKey = "plsql" if (SonarQubeUtils.isCommercialEdition) { repositoryKey = "zpa" } KEY = repositoryKey } } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/PlSqlSquidSensor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.sonar.api.batch.rule.ActiveRules import org.sonar.api.batch.sensor.Sensor import org.sonar.api.batch.sensor.SensorContext import org.sonar.api.batch.sensor.SensorDescriptor import org.sonar.api.config.Configuration import org.sonar.api.issue.NoSonarFilter import org.sonar.api.measures.FileLinesContextFactory import com.felipebz.zpa.checks.CheckList import com.felipebz.zpa.metadata.FormsMetadata import com.felipebz.zpa.rules.SonarQubeActiveRulesAdapter import com.felipebz.zpa.rules.SonarQubeRuleMetadataLoader import com.felipebz.zpa.squid.PlSqlAstScanner import com.felipebz.zpa.squid.ProgressReport import com.felipebz.zpa.symbols.ObjectLocator import com.felipebz.zpa.utils.log.Logger import com.felipebz.zpa.utils.log.Loggers import com.felipebz.zpa.api.ZpaRulesDefinition import java.util.concurrent.TimeUnit class PlSqlSquidSensor @JvmOverloads constructor(activeRules: ActiveRules, settings: Configuration, private val noSonarFilter: NoSonarFilter, private val fileLinesContextFactory: FileLinesContextFactory, customRulesDefinition: Array? = null, private val objectLocator: ObjectLocator) : Sensor { private val logger: Logger = Loggers.getLogger(PlSqlSquidSensor::class.java) private val checks = PlSqlChecks.createPlSqlCheck(SonarQubeActiveRulesAdapter(activeRules), SonarQubeRuleMetadataLoader()) .addChecks(PlSqlRuleRepository.Companion.KEY, CheckList.checks) .addCustomChecks(customRulesDefinition) private val isErrorRecoveryEnabled = settings.getBoolean(PlSqlPlugin.Companion.ERROR_RECOVERY_KEY).orElse(false) private val isConcurrentModeEnabled = settings.getBoolean(PlSqlPlugin.Companion.CONCURRENT_EXECUTION_KEY).orElse(true) private val formsMetadata = FormsMetadata.loadFromFile(settings.get(PlSqlPlugin.Companion.FORMS_METADATA_KEY) .orElse(null)) override fun describe(descriptor: SensorDescriptor) { descriptor.name("ZPA").onlyOnLanguage(PlSql.Companion.KEY) } override fun execute(context: SensorContext) { val fs = context.fileSystem() val inputFiles = fs.inputFiles(fs.predicates().hasLanguage(PlSql.Companion.KEY)).toList() val progressReport = ProgressReport("Report about progress of code analyzer", TimeUnit.SECONDS.toMillis(10)) val scanner = PlSqlAstScanner(context, checks, noSonarFilter, formsMetadata, isErrorRecoveryEnabled, fileLinesContextFactory, objectLocator) progressReport.start(inputFiles.map { it.toString() }) val files = if (isConcurrentModeEnabled) { logger.info("Concurrent mode enabled") inputFiles.parallelStream() } else { inputFiles.stream() } files.forEach { try { scanner.scanFile(it) progressReport.nextFile() } catch (e: Exception) { logger.error("Error during analysis of file $it", e) } } progressReport.stop() } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/SonarQubeUtils.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa object SonarQubeUtils { val isCommercialEdition by lazy { var value = false try { // is it running a commercial edition of SQ? Class.forName("com.sonarsource.plugins.license.api.LicensedPluginRegistration") value = true } catch (e: ClassNotFoundException) { // ignore } value } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/api/CustomPlSqlRulesDefinition.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.zpa.CustomAnnotationBasedRulesDefinition import com.felipebz.zpa.PlSql import com.felipebz.zpa.rules.SonarQubeRepositoryAdapter import com.felipebz.zpa.rules.SonarQubeRuleMetadataLoader import org.sonar.api.ExtensionPoint import org.sonar.api.scanner.ScannerSide import org.sonar.api.server.rule.RulesDefinition @ExtensionPoint @ScannerSide abstract class CustomPlSqlRulesDefinition : RulesDefinition, ZpaRulesDefinition { override fun define(context: RulesDefinition.Context) { val repo = context.createRepository(repositoryKey(), PlSql.KEY) .setName(repositoryName()) // Load metadata from check classes' annotations CustomAnnotationBasedRulesDefinition(SonarQubeRepositoryAdapter(repo), PlSql.KEY, SonarQubeRuleMetadataLoader()) .addRuleClasses(checkClasses().toList()) repo.done() } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/highlight/PlSqlHighlighterVisitor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.highlight import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.Token import com.felipebz.flr.api.Trivia import org.sonar.api.batch.fs.InputFile import org.sonar.api.batch.sensor.SensorContext import org.sonar.api.batch.sensor.highlighting.NewHighlighting import org.sonar.api.batch.sensor.highlighting.TypeOfText import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.PlSqlTokenType import com.felipebz.zpa.api.checks.PlSqlCheck class PlSqlHighlighterVisitor(context: SensorContext, inputFile: InputFile) : PlSqlCheck() { private val highlighting: NewHighlighting = context.newHighlighting().onFile(inputFile) override fun visitToken(token: Token) { if (token.type is PlSqlTokenType) { highlight(token, TypeOfText.STRING) } if (token.type is PlSqlKeyword) { highlight(token, TypeOfText.KEYWORD) } } override fun visitComment(trivia: Trivia, content: String) { val token = trivia.token if (token.value.startsWith("/**")) { highlight(token, TypeOfText.STRUCTURED_COMMENT) } else { highlight(token, TypeOfText.COMMENT) } } override fun leaveFile(node: AstNode) { highlighting.save() } private fun highlight(token: Token, code: TypeOfText) { highlighting.highlight(token.line, token.column, token.endLine, token.endColumn, code) } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/log/SonarQubeLogger.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.log import org.slf4j.Logger class SonarQubeLogger internal constructor(private val logger: Logger) : com.felipebz.zpa.utils.log.Logger { override fun trace(msg: String) { logger.trace(msg) } override fun trace(msg: String, vararg args: Any?) { logger.trace(msg, *args) } override fun debug(msg: String) { logger.debug(msg) } override fun debug(msg: String, vararg args: Any?) { logger.debug(msg, *args) } override fun info(msg: String) { logger.info(msg) } override fun info(msg: String, vararg args: Any?) { logger.info(msg, *args) } override fun warn(msg: String) { logger.warn(msg) } override fun warn(msg: String, vararg args: Any?) { logger.warn(msg, *args) } override fun error(msg: String) { logger.error(msg) } override fun error(msg: String, vararg args: Any?) { logger.error(msg, *args) } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/log/SonarQubeLoggers.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.log import org.slf4j.LoggerFactory import com.felipebz.zpa.utils.log.Logger import com.felipebz.zpa.utils.log.Loggers class SonarQubeLoggers : Loggers() { override fun getLogger(name: String): Logger { return SonarQubeLogger(LoggerFactory.getLogger(name)) } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/metrics/CpdVisitor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.metrics import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.Token import org.sonar.api.batch.fs.InputFile import org.sonar.api.batch.sensor.SensorContext import org.sonar.api.batch.sensor.cpd.NewCpdTokens import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.checks.PlSqlCheck class CpdVisitor(context: SensorContext, inputFile: InputFile) : PlSqlCheck() { private val newCpdTokens: NewCpdTokens = context.newCpdTokens().onFile(inputFile) override fun init() { subscribeTo(PlSqlGrammar.ANONYMOUS_BLOCK, PlSqlGrammar.CREATE_PROCEDURE, PlSqlGrammar.CREATE_FUNCTION, PlSqlGrammar.CREATE_PACKAGE_BODY, PlSqlGrammar.CREATE_TYPE_BODY) } override fun visitNode(node: AstNode) { for (token in node.tokens) { saveCpdTokens(token) } } private fun saveCpdTokens(token: Token) { newCpdTokens.addToken(token.line, token.column, token.endLine, token.endColumn, token.value) } override fun leaveFile(node: AstNode) { newCpdTokens.save() } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/rules/SonarQubeActiveRuleAdapter.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import org.sonar.api.batch.rule.ActiveRule class SonarQubeActiveRuleAdapter(private val activeRule: ActiveRule) : ZpaActiveRule { override val ruleKey: ZpaRuleKey get() = SonarQubeRuleKeyAdapter(activeRule.ruleKey()) override val severity: String get() = activeRule.severity() override val language: String get() = activeRule.language() override fun param(key: String): String? = activeRule.param(key) override val params: Map get() = activeRule.params() override val internalKey: String? get() = activeRule.internalKey() override val templateRuleKey: String? get() = activeRule.templateRuleKey() override val tags: Array get() = throw NotImplementedError() override val remediationConstant: String get() = throw NotImplementedError() override val name: String get() = throw NotImplementedError() override fun toString(): String = activeRule.toString() override fun equals(other: Any?): Boolean = activeRule == other override fun hashCode(): Int = activeRule.hashCode() } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/rules/SonarQubeActiveRulesAdapter.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import org.sonar.api.batch.rule.ActiveRules class SonarQubeActiveRulesAdapter(private val activeRules: ActiveRules) : ZpaActiveRules { override fun findByRepository(repository: String): Collection = activeRules.findByRepository(repository).map { SonarQubeActiveRuleAdapter(it) } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/rules/SonarQubeRepositoryAdapter.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import org.sonar.api.server.rule.RulesDefinition class SonarQubeRepositoryAdapter(private val repository: RulesDefinition.NewRepository) : ZpaRepository { override val key: String = repository.key() override fun createRule(ruleKey: String): ZpaRule = SonarQubeRuleAdapter(repository.createRule(ruleKey)) override fun rule(ruleKey: String): ZpaRule? { val rule = repository.rule(ruleKey) return if (rule != null) SonarQubeRuleAdapter(rule) else null } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/rules/SonarQubeRuleAdapter.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import org.sonar.api.rule.RuleScope import org.sonar.api.server.rule.RulesDefinition import com.felipebz.zpa.api.annotations.RuleInfo import org.sonar.api.rule.RuleStatus as SonarQubeRuleStatus class SonarQubeRuleAdapter(private val newRule: RulesDefinition.NewRule) : ZpaRule { override val key: String get() = newRule.key() override val params: List get() = newRule.params().map { SonarQubeRuleParamAdapter(it) } override var name: String get() = throw IllegalAccessException("Getter is not available") set(value) { newRule.setName(value) } override var remediationConstant: String get() = throw IllegalAccessException("Getter is not available") set(value) { newRule.setDebtRemediationFunction(newRule.debtRemediationFunctions().constantPerIssue(value)) } override var scope: RuleInfo.Scope get() = throw IllegalAccessException("Getter is not available") set(value) { newRule.setScope(RuleScope.valueOf(value.name)) } override var template: Boolean get() = throw IllegalAccessException("Getter is not available") set(value) { newRule.setTemplate(value) } override var tags: Array get() = throw IllegalAccessException("Getter is not available") set(value) { newRule.setTags(*value) } override var status: RuleStatus get() = throw IllegalAccessException("Getter is not available") set(value) { newRule.setStatus(SonarQubeRuleStatus.valueOf(value.name)) } override var severity: String get() = throw IllegalAccessException("Getter is not available") set(value) { newRule.setSeverity(value) } override var htmlDescription: String get() = throw IllegalAccessException("Getter is not available") set(value) { newRule.setHtmlDescription(value) } override var isActivatedByDefault: Boolean get() = throw IllegalAccessException("Getter is not available") set(value) { newRule.setActivatedByDefault(value) } override fun createParam(fieldKey: String): ZpaRuleParam = SonarQubeRuleParamAdapter(newRule.createParam(fieldKey)) } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/rules/SonarQubeRuleKeyAdapter.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import org.sonar.api.rule.RuleKey class SonarQubeRuleKeyAdapter(val ruleKey: RuleKey) : ZpaRuleKey { override val rule: String get() = ruleKey.rule() override val repository: String get() = ruleKey.repository() override fun toString(): String = ruleKey.toString() override fun equals(other: Any?): Boolean = ruleKey == (other as SonarQubeRuleKeyAdapter).ruleKey override fun hashCode(): Int = ruleKey.hashCode() companion object { fun of(repository: String, rule: String): ZpaRuleKey = SonarQubeRuleKeyAdapter(RuleKey.of(repository, rule)) } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/rules/SonarQubeRuleMetadataLoader.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import com.felipebz.zpa.utils.getAnnotation import com.felipebz.zpa.api.annotations.Priority import java.lang.reflect.Field import org.sonar.check.Priority as SonarPriority import org.sonar.check.Rule as SonarRule import org.sonar.check.RuleProperty as SonarRuleProperty class SonarQubeRuleMetadataLoader : RuleMetadataLoader() { override fun getRuleAnnotation(annotatedClassOrObject: Any): RuleData? { val ruleAnnotation = super.getRuleAnnotation(annotatedClassOrObject) if (ruleAnnotation != null) { return ruleAnnotation } val sonarRule = getAnnotation(annotatedClassOrObject, SonarRule::class.java) if (sonarRule != null) { val priority = when(sonarRule.priority) { SonarPriority.BLOCKER -> Priority.BLOCKER SonarPriority.CRITICAL -> Priority.CRITICAL SonarPriority.MAJOR -> Priority.MAJOR SonarPriority.MINOR -> Priority.MINOR SonarPriority.INFO -> Priority.INFO } return RuleData( sonarRule.key, sonarRule.name, sonarRule.description, priority, sonarRule.tags, sonarRule.status) } return null } override fun getRulePropertyAnnotation(field: Field): RulePropertyData? { val rulePropertyAnnotation = super.getRulePropertyAnnotation(field) if (rulePropertyAnnotation != null) { return rulePropertyAnnotation } val sonarRuleProperty = field.getAnnotation(SonarRuleProperty::class.java) if (sonarRuleProperty != null) { return RulePropertyData( sonarRuleProperty.key, sonarRuleProperty.description, sonarRuleProperty.defaultValue, sonarRuleProperty.type) } return null } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/rules/SonarQubeRuleParamAdapter.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import org.sonar.api.server.rule.RulesDefinition class SonarQubeRuleParamAdapter(private val param: RulesDefinition.NewParam) : ZpaRuleParam { override val key: String get() = param.key() override var description: String get() = throw IllegalAccessException("Getter is not available") set(value) { param.setDescription(value) } override var defaultValue: String get() = throw IllegalAccessException("Getter is not available") set(value) { param.setDefaultValue(value) } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/squid/PlSqlAstScanner.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.squid import org.sonar.api.batch.fs.InputFile import org.sonar.api.batch.fs.TextRange import org.sonar.api.batch.measure.Metric import org.sonar.api.batch.sensor.SensorContext import org.sonar.api.batch.sensor.issue.NewIssue import org.sonar.api.batch.sensor.issue.NewIssueLocation import org.sonar.api.issue.NoSonarFilter import org.sonar.api.measures.CoreMetrics import org.sonar.api.measures.FileLinesContextFactory import com.felipebz.zpa.PlSqlChecks import com.felipebz.zpa.checks.IssueLocation import com.felipebz.zpa.highlight.PlSqlHighlighterVisitor import com.felipebz.zpa.metadata.FormsMetadata import com.felipebz.zpa.metrics.CpdVisitor import com.felipebz.zpa.rules.SonarQubeRuleKeyAdapter import com.felipebz.zpa.symbols.ObjectLocator import com.felipebz.zpa.symbols.SonarQubeSymbolTable import com.felipebz.zpa.api.PlSqlFile import com.felipebz.zpa.api.checks.PlSqlVisitor import java.io.Serializable import java.util.concurrent.locks.ReentrantLock import kotlin.concurrent.withLock class PlSqlAstScanner(private val context: SensorContext, checks: Collection, private val noSonarFilter: NoSonarFilter, formsMetadata: FormsMetadata?, isErrorRecoveryEnabled: Boolean, private val fileLinesContextFactory: FileLinesContextFactory?) { private val astScanner: AstScanner = AstScanner(checks, formsMetadata, isErrorRecoveryEnabled, context.fileSystem().encoding()) private lateinit var plsqlChecks: PlSqlChecks constructor(context: SensorContext, checks: PlSqlChecks, noSonarFilter: NoSonarFilter, formsMetadata: FormsMetadata?, isErrorRecoveryEnabled: Boolean, fileLinesContextFactory: FileLinesContextFactory, objectLocator: ObjectLocator) : this(context, checks.all(), noSonarFilter, formsMetadata, isErrorRecoveryEnabled, fileLinesContextFactory) { this.plsqlChecks = checks objectLocator.setScope(astScanner.globalScope) } fun scanFile(inputFile: InputFile) { val plSqlFile = SonarQubePlSqlFile(inputFile) if (plSqlFile.type() == PlSqlFile.Type.MAIN) { scanMainFile(plSqlFile) } else { scanTestFile(plSqlFile) } } private fun scanMainFile(plSqlFile: SonarQubePlSqlFile) { val inputFile = plSqlFile.inputFile val result = try { astScanner.scanFile( plSqlFile, listOf(PlSqlHighlighterVisitor(context, inputFile), CpdVisitor(context, inputFile)) ) } catch (e: Exception) { e.printStackTrace() throw e } noSonarFilter.noSonarInFile(inputFile, result.linesWithNoSonar) lock.withLock { // needed because SonarQube 7.6 save this data in a non thread-safe way saveIssues(inputFile, result.issues) val symbolSaver = SonarQubeSymbolTable(context, inputFile) symbolSaver.save(result.symbols) saveMetricOnFile(inputFile, CoreMetrics.STATEMENTS, result.numberOfStatements) saveMetricOnFile(inputFile, CoreMetrics.NCLOC, result.linesOfCode) saveMetricOnFile(inputFile, CoreMetrics.COMMENT_LINES, result.linesOfComments) saveMetricOnFile(inputFile, CoreMetrics.COMPLEXITY, result.complexity) saveMetricOnFile(inputFile, CoreMetrics.FUNCTIONS, result.numberOfFunctions) if (fileLinesContextFactory != null) { val fileLinesContext = fileLinesContextFactory.createFor(inputFile) for (line in result.executableLines) { fileLinesContext.setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, line, 1) } fileLinesContext.save() } } } private fun scanTestFile(plSqlFile: SonarQubePlSqlFile) { val inputFile = plSqlFile.inputFile val result = astScanner.scanFile(plSqlFile, listOf(PlSqlHighlighterVisitor(context, inputFile))) noSonarFilter.noSonarInFile(inputFile, result.linesWithNoSonar) lock.withLock { // needed because SonarQube 7.6 save this data in a non thread-safe way saveIssues(inputFile, result.issues) val symbolTable = SonarQubeSymbolTable(context, inputFile) symbolTable.save(result.symbols) } } private fun saveIssues(inputFile: InputFile, issues: List) { for (issue in issues) { val rule = plsqlChecks.ruleKey(issue.check) as SonarQubeRuleKeyAdapter val newIssue = context.newIssue().forRule(rule.ruleKey) val cost = issue.cost if (cost != null) { newIssue.gap(cost.toDouble()) } newIssue.at(newLocation(inputFile, newIssue, issue.primaryLocation)) for (secondaryLocation in issue.secondaryLocations) { newIssue.addLocation(newLocation(inputFile, newIssue, secondaryLocation)) } newIssue.save() } } private fun saveMetricOnFile(inputFile: InputFile, metric: Metric, value: T) { context.newMeasure() .on(inputFile) .forMetric(metric) .withValue(value) .save() } private fun newLocation(inputFile: InputFile, issue: NewIssue, location: IssueLocation): NewIssueLocation { val newLocation = issue.newLocation().on(inputFile) if (location.startLine() != IssueLocation.UNDEFINED_LINE) { val range: TextRange = if (location.startLineOffset() == IssueLocation.UNDEFINED_OFFSET) { inputFile.selectLine(location.startLine()) } else { inputFile.newRange(location.startLine(), location.startLineOffset(), location.endLine(), location.endLineOffset()) } newLocation.at(range) } newLocation.message(location.message()) return newLocation } companion object { private val lock = ReentrantLock() } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/squid/SonarQubePlSqlFile.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.squid import org.sonar.api.batch.fs.InputFile import com.felipebz.zpa.api.PlSqlFile import java.io.IOException import java.nio.file.Path import kotlin.io.path.toPath class SonarQubePlSqlFile(val inputFile: InputFile) : PlSqlFile { override fun contents(): String = try { inputFile.contents() } catch (e: IOException) { throw IllegalStateException("Could not read contents of input file $inputFile", e) } override fun fileName(): String = inputFile.filename() override fun path(): Path = inputFile.uri().toPath() override fun type(): PlSqlFile.Type = when (inputFile.type()) { InputFile.Type.MAIN -> PlSqlFile.Type.MAIN InputFile.Type.TEST -> PlSqlFile.Type.TEST else -> PlSqlFile.Type.MAIN } override fun toString(): String = inputFile.toString() } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/symbols/MappedObject.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.symbols import com.felipebz.flr.api.AstNodeType import org.sonar.api.batch.fs.InputFile import com.felipebz.zpa.api.PlSqlFile import java.nio.file.Path data class MappedObject( val identifier: String, val objectType: AstNodeType, val fileType: PlSqlFile.Type, val path: Path, val inputFile: InputFile, val firstLine: Int = -1, val lastLine: Int = -1 ) { val isMain: Boolean get() = fileType === PlSqlFile.Type.MAIN val isTest: Boolean get() = fileType === PlSqlFile.Type.TEST } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/symbols/ObjectLocator.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.symbols import com.felipebz.flr.api.AstNodeType import org.sonar.api.scanner.ScannerSide import com.felipebz.zpa.squid.SonarQubePlSqlFile import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.symbols.Scope @ScannerSide class ObjectLocator { private var scope: Scope = ScopeImpl() private val mappedObjects get() = scope.innerScopes .union(scope.innerScopes .flatMap { it.innerScopes } .filter { it.type == PlSqlGrammar.CREATE_PACKAGE_BODY || it.type == PlSqlGrammar.CREATE_TYPE_BODY }) .map { val plSqlFile = it.plSqlFile as SonarQubePlSqlFile? ?: return@map null val identifier = it.identifier ?: return@map null val type = it.type ?: return@map null val firstLine = it.firstToken?.line ?: return@map null val lastLine = it.lastToken?.line ?: return@map null MappedObject( identifier, type, plSqlFile.type(), plSqlFile.path(), plSqlFile.inputFile, firstLine, lastLine ) }.filterNotNull() fun setScope(scope: Scope) { this.scope = scope } fun findMainObject(identifier: String, vararg types: AstNodeType): MappedObject? { return mappedObjects.find { it.isMain && it.identifier.equals(identifier, ignoreCase = true) && it.objectType in types } } fun findTestObject(identifier: String, vararg types: AstNodeType): MappedObject? { return mappedObjects.find { it.isTest && it.identifier.equals(identifier, ignoreCase = true) && it.objectType in types } } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/symbols/SonarQubeSymbolTable.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.symbols import org.sonar.api.batch.fs.InputFile import org.sonar.api.batch.sensor.SensorContext import org.sonar.api.batch.sensor.symbol.NewSymbolTable import com.felipebz.zpa.api.symbols.Symbol class SonarQubeSymbolTable(context: SensorContext, inputFile: InputFile) { private val symbolizable: NewSymbolTable = context.newSymbolTable().onFile(inputFile) fun save(symbols: List) { for (symbol in symbols) { val symbolNode = symbol.declaration val symbolToken = symbolNode.token val newSymbol = symbolizable.newSymbol(symbolToken.line, symbolToken.column, symbolToken.endLine, symbolToken.endColumn) for (usage in symbol.usages) { val usageToken = usage.token newSymbol.newReference(usageToken.line, usageToken.column, usageToken.endLine, usageToken.endColumn) } } symbolizable.save() } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/utplsql/AbstractReportImporter.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utplsql import org.sonar.api.batch.sensor.SensorContext import org.sonar.api.notifications.AnalysisWarnings import org.sonar.api.utils.WildcardPattern import com.felipebz.zpa.utils.log.Logger import com.felipebz.zpa.utils.log.Loggers import java.io.File abstract class AbstractReportImporter(private val analysisWarnings: AnalysisWarnings) { private val logger: Logger = Loggers.getLogger(AbstractReportImporter::class.java) abstract val reportType: String abstract val reportKey: String abstract fun processReport(context: SensorContext, report: File) fun execute(context: SensorContext) { val reports = files(context) for (report in reports) { logger.info("Processing $reportType report {}", report) processReport(context, report) } } protected fun files(context: SensorContext) = context.config().getStringArray(reportKey).flatMap { getReports(context, it) } private fun getReports(context: SensorContext, reportPath: String): List { val pattern = WildcardPattern.create(reportPath) val baseDir = context.fileSystem().baseDir() val matchingFiles = baseDir .walkTopDown() .filter { it.isFile && pattern.match(it.relativeTo(baseDir).invariantSeparatorsPath) } .toMutableList() if (matchingFiles.isEmpty()) { if (context.config().hasKey(reportKey)) { val file = File(reportPath) if (!file.exists()) { val formattedMessage = "No utPLSQL $reportType report was found for ${reportKey} using pattern $reportPath" logger.warn(formattedMessage) analysisWarnings.addUnique(formattedMessage) } else { matchingFiles.add(file) } } else { logger.info("No utPLSQL $reportType report was found for {} using default pattern {}", reportKey, reportPath) } } return matchingFiles } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/utplsql/CoverageReport.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utplsql import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement @JacksonXmlRootElement(localName = "coverage") data class Coverage @JvmOverloads constructor( @field:JacksonXmlProperty(isAttribute = true, localName = "version") var version: Int = 0, @field:JacksonXmlElementWrapper(useWrapping = false) @field:JacksonXmlProperty(localName = "file") var files: List? = null ) @JacksonXmlRootElement(localName = "file") data class CoveredFile @JvmOverloads constructor( @field:JacksonXmlProperty(isAttribute = true, localName = "path") var path: String = "", @field:JacksonXmlElementWrapper(useWrapping = false) @field:JacksonXmlProperty(localName = "lineToCover") var linesToCover: List? = null ) @JacksonXmlRootElement(localName = "lineToCover") data class LineToCover @JvmOverloads constructor( @field:JacksonXmlProperty(isAttribute = true, localName = "lineNumber") var lineNumber: Int = 0, @field:JacksonXmlProperty(isAttribute = true, localName = "covered") var covered: Boolean = false, @field:JacksonXmlProperty(isAttribute = true, localName = "branchesToCover") var branchesToCover: Int? = null, @field:JacksonXmlProperty(isAttribute = true, localName = "coveredBranches") var coveredBranches: Int? = null ) ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/utplsql/CoverageResultImporter.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utplsql import com.fasterxml.jackson.dataformat.xml.XmlMapper import org.sonar.api.batch.fs.InputFile import org.sonar.api.batch.sensor.SensorContext import org.sonar.api.notifications.AnalysisWarnings import com.felipebz.zpa.symbols.ObjectLocator import com.felipebz.zpa.utils.log.Loggers import com.felipebz.zpa.api.PlSqlGrammar import java.io.File class CoverageResultImporter(private val objectLocator: ObjectLocator, analysisWarnings: AnalysisWarnings) : AbstractReportImporter(analysisWarnings) { private val logger = Loggers.getLogger(CoverageResultImporter::class.java) override val reportType = "coverage" override val reportKey = UtPlSqlSensor.COVERAGE_REPORT_PATH_KEY override fun processReport(context: SensorContext, report: File) { val serializer = XmlMapper() val coverage = serializer.readValue(report, Coverage::class.java) coverage.files?.forEach { file -> val filePath = file.path var inputFile = context.fileSystem() .inputFile(context.fileSystem().predicates().hasPath(filePath)) var lineOffset = 0 if (inputFile == null) { val objectType = when (filePath.substringBeforeLast(' ')) { "package body" -> PlSqlGrammar.CREATE_PACKAGE_BODY "procedure" -> PlSqlGrammar.CREATE_PROCEDURE "function" -> PlSqlGrammar.CREATE_FUNCTION "trigger" -> PlSqlGrammar.CREATE_TRIGGER "type body" -> PlSqlGrammar.CREATE_TYPE_BODY else -> error("Unknown object type for file \"$filePath\"") } val objectName = filePath.substringAfterLast('.') val mappedObject = objectLocator.findMainObject(objectName, objectType) if (mappedObject != null) { inputFile = mappedObject.inputFile lineOffset = mappedObject.firstLine - 1 } } if (inputFile != null) { logger.debug("The path ${file.path} was mapped to ${inputFile}") saveCoverage(context, inputFile, file, lineOffset, filePath) } else { logger.warn("The path ${file.path} was not found in the project") } } } private fun saveCoverage( context: SensorContext, inputFile: InputFile, file: CoveredFile, lineOffset: Int, filePath: String ) { val linesToCover = file.linesToCover if (linesToCover != null) { if (linesToCover.all { !it.covered }) { // No need to save coverage for files with no covered lines return } val newCoverage = context.newCoverage().onFile(inputFile) file.linesToCover?.forEach { line -> val lineNumber = line.lineNumber + lineOffset newCoverage.lineHits(lineNumber, if (line.covered) 1 else 0) val branchesToCover = line.branchesToCover val coveredBranches = line.coveredBranches ?: 0 if (branchesToCover != null) { check(coveredBranches <= branchesToCover) { "\"coveredBranches\" should not be greater than \"branchesToCover\" on line " + "${line.lineNumber} for file \"$filePath\"" } newCoverage.conditions(lineNumber, branchesToCover, coveredBranches) } } newCoverage.save() } } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/utplsql/TestExecutionReport.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utplsql import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement @JacksonXmlRootElement(localName = "testExecutions") data class TestExecutions @JvmOverloads constructor( @field:JacksonXmlProperty(isAttribute = true, localName = "version") var version: Int = 0, @field:JacksonXmlElementWrapper(useWrapping = false) @field:JacksonXmlProperty(localName = "file") var files: List? = null ) @JacksonXmlRootElement(localName = "file") data class TestFile @JvmOverloads constructor( @field:JacksonXmlProperty(isAttribute = true, localName = "path") var path: String = "", @field:JacksonXmlElementWrapper(useWrapping = false) @field:JacksonXmlProperty(localName = "testCase") var testCases: List? = null ) @JacksonXmlRootElement(localName = "testCase") data class TestCase @JvmOverloads constructor( @field:JacksonXmlProperty(isAttribute = true, localName = "name") var name: String = "", @field:JacksonXmlProperty(isAttribute = true, localName = "duration") var duration: Long = 0, @field:JacksonXmlProperty(localName = "skipped") var skipped: Skipped? = null, @field:JacksonXmlProperty(localName = "failure") var failure: Failure? = null, @field:JacksonXmlProperty(localName = "error") var error: Error? = null ) { val status: TestCaseStatus get() { return when { skipped != null -> TestCaseStatus.SKIPPED failure != null -> TestCaseStatus.FAILED error != null -> TestCaseStatus.ERROR else -> TestCaseStatus.PASSED } } } @JacksonXmlRootElement(localName = "skipped") @JsonIgnoreProperties(ignoreUnknown = true) class Skipped @JacksonXmlRootElement(localName = "failure") @JsonIgnoreProperties(ignoreUnknown = true) class Failure @JacksonXmlRootElement(localName = "error") @JsonIgnoreProperties(ignoreUnknown = true) class Error enum class TestCaseStatus { PASSED, FAILED, SKIPPED, ERROR } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/utplsql/TestResultImporter.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utplsql import com.fasterxml.jackson.dataformat.xml.XmlMapper import org.sonar.api.batch.fs.InputFile import org.sonar.api.batch.measure.Metric import org.sonar.api.batch.sensor.SensorContext import org.sonar.api.measures.CoreMetrics import org.sonar.api.notifications.AnalysisWarnings import com.felipebz.zpa.symbols.ObjectLocator import com.felipebz.zpa.utils.log.Loggers import com.felipebz.zpa.api.PlSqlGrammar import java.io.File import java.io.Serializable class TestResultImporter(private val objectLocator: ObjectLocator, analysisWarnings: AnalysisWarnings) : AbstractReportImporter(analysisWarnings) { private val logger = Loggers.getLogger(TestResultImporter::class.java) override val reportType = "test" override val reportKey = UtPlSqlSensor.TEST_REPORT_PATH_KEY override fun processReport(context: SensorContext, report: File) { val serializer = XmlMapper() val testExecutions = serializer.readValue(report, TestExecutions::class.java) testExecutions.files?.forEach { file -> val packageName = file.path.substringAfterLast('.') val mappedTest = objectLocator.findTestObject(packageName, PlSqlGrammar.CREATE_PACKAGE) val inputFile = mappedTest?.inputFile ?: context.fileSystem() .inputFile(context.fileSystem().predicates().hasPath(file.path)) if (inputFile != null) { logger.debug("The path ${file.path} was mapped to ${inputFile}") file.testCases?.let { testCase -> val testCount = testCase.count { it.status != TestCaseStatus.SKIPPED } val failureCount = testCase.count { it.status == TestCaseStatus.FAILED } val errorCount = testCase.count { it.status == TestCaseStatus.ERROR } val skippedCount = testCase.count { it.status == TestCaseStatus.SKIPPED } val duration = testCase.sumOf { it.duration } saveMetricOnFile(context, inputFile, CoreMetrics.TESTS, testCount) saveMetricOnFile(context, inputFile, CoreMetrics.TEST_FAILURES, failureCount) saveMetricOnFile(context, inputFile, CoreMetrics.TEST_ERRORS, errorCount) saveMetricOnFile(context, inputFile, CoreMetrics.SKIPPED_TESTS, skippedCount) saveMetricOnFile(context, inputFile, CoreMetrics.TEST_EXECUTION_TIME, duration) } } else { logger.warn("The path ${file.path} was not found in the project") } } } private fun saveMetricOnFile( context: SensorContext, inputFile: InputFile, metric: Metric, value: T ) { context.newMeasure() .on(inputFile) .forMetric(metric) .withValue(value) .save() } } ================================================ FILE: sonar-zpa-plugin/src/main/kotlin/com/felipebz/zpa/utplsql/UtPlSqlSensor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utplsql import org.sonar.api.batch.sensor.Sensor import org.sonar.api.batch.sensor.SensorContext import org.sonar.api.batch.sensor.SensorDescriptor import org.sonar.api.notifications.AnalysisWarnings import com.felipebz.zpa.PlSql import com.felipebz.zpa.symbols.ObjectLocator class UtPlSqlSensor(objectLocator: ObjectLocator, analysisWarnings: AnalysisWarnings) : Sensor { private val testResultImporter = TestResultImporter(objectLocator, analysisWarnings) private val coverageResultImporter = CoverageResultImporter(objectLocator, analysisWarnings) override fun describe(descriptor: SensorDescriptor) { descriptor.name("ZPA - utPLSQL Report Importer").onlyOnLanguage(PlSql.KEY) } override fun execute(context: SensorContext) { testResultImporter.execute(context) coverageResultImporter.execute(context) } companion object { const val TEST_REPORT_PATH_KEY = "sonar.zpa.tests.reportPaths" const val DEFAULT_TEST_REPORT_PATH = "utplsql-test.xml" const val COVERAGE_REPORT_PATH_KEY = "sonar.zpa.coverage.reportPaths" const val DEFAULT_COVERAGE_REPORT_PATH = "utplsql-coverage.xml" } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/CustomAnnotationBasedRulesDefinitionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.assertj.core.api.Assertions.* import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.sonar.api.server.debt.DebtRemediationFunction.Type import org.sonar.api.server.rule.RulesDefinition import org.sonar.api.server.rule.RulesDefinition.* import org.sonar.check.Rule import org.sonar.check.RuleProperty import com.felipebz.zpa.rules.SonarQubeRepositoryAdapter import com.felipebz.zpa.rules.SonarQubeRuleMetadataLoader import com.felipebz.zpa.api.annotations.ConstantRemediation import java.util.* class CustomAnnotationBasedRulesDefinitionTest { private val context = Context() @BeforeEach fun setup() { Locale.setDefault(Locale.ROOT) } @Test fun noClassToAdd() { assertThat(buildRepository().rules()).isEmpty() } @Test fun classWithoutRuleAnnotation() { class NotRuleClass assertThatIllegalArgumentException().isThrownBy { buildSingleRuleRepository(NotRuleClass::class.java) } } @Test fun ruleAnnotationData() { @Rule(key = "key1", name = "name1", description = "description1", tags = ["mytag"]) class RuleClass { @RuleProperty(key = "param1Key", description = "param1 description") var param1 = "x" } val rule = buildSingleRuleRepository(RuleClass::class.java) assertThat(rule.key()).isEqualTo("key1") assertThat(rule.name()).isEqualTo("name1") assertThat(rule.htmlDescription()).isEqualTo("description1") assertThat(rule.tags()).containsOnly("mytag") assertThat(rule.template()).isFalse assertThat(rule.params()).hasSize(1) assertParam(rule.params()[0], "param1Key", "param1 description") } @Rule(name = "name1", description = "description1") internal class RuleClassWithoutAnnotationDefinedKey @Test fun ruleWithoutExplicitKeyCanBeAcceptable() { val repository = buildRepository(LANGUAGE_KEY_WITH_RESOURCE_BUNDLE, RuleClassWithoutAnnotationDefinedKey::class.java) val rule = repository.rules()[0] assertThat(rule.key()).isEqualTo(RuleClassWithoutAnnotationDefinedKey::class.java.simpleName) assertThat(rule.name()).isEqualTo("name1") } @Test fun externalNamesAndDescriptions() { @Rule(key = "ruleWithExternalInfo") class RuleClass { @RuleProperty(key = "param1Key") var param1 = "x" @RuleProperty var param2 = "x" } val rule = buildSingleRuleRepository(RuleClass::class.java) assertThat(rule.key()).isEqualTo("ruleWithExternalInfo") assertThat(rule.name()).isEqualTo("external name for ruleWithExternalInfo") assertThat(rule.htmlDescription()).isEqualTo("description for ruleWithExternalInfo") assertThat(rule.params()).hasSize(2) assertParam(rule.params()[0], "param1Key", "description for param1") assertParam(rule.params()[1], "param2", null) } @Test fun classWithSqaleConstantRemediation() { @Rule(key = "key1", name = "name1", description = "description1") @ConstantRemediation("10min") class RuleClass val rule = buildSingleRuleRepository(RuleClass::class.java) assertRemediation(rule, Type.CONSTANT_ISSUE, null, "10min", null) } @Test fun invalidSqaleAnnotation() { @Rule(key = "key1", name = "name1", description = "description1") @ConstantRemediation("xxx") class MyInvalidRuleClass assertThatIllegalArgumentException().isThrownBy { buildSingleRuleRepository(MyInvalidRuleClass::class.java) } } @Test fun loadMethodWithClassWithSqaleAnnotations() { @Rule(key = "key1", name = "name1", description = "description1") @ConstantRemediation("10min") class RuleClass val repository = load(RuleClass::class.java) assertThat(repository.rules()).hasSize(1) } private fun assertRemediation(rule: RulesDefinition.Rule, type: Type, gapMultiplier: String?, baseEffort: String, gapDescription: String?) { val remediationFunction = rule.debtRemediationFunction() assertThat(remediationFunction?.type()).isEqualTo(type) assertThat(remediationFunction?.gapMultiplier()).isEqualTo(gapMultiplier) assertThat(remediationFunction?.baseEffort()).isEqualTo(baseEffort) assertThat(rule.gapDescription()).isEqualTo(gapDescription) } private fun assertParam(param: Param, expectedKey: String, expectedDescription: String?) { assertThat(param.key()).isEqualTo(expectedKey) assertThat(param.name()).isEqualTo(expectedKey) assertThat(param.description()).isEqualTo(expectedDescription) } private fun buildSingleRuleRepository(ruleClass: Class<*>): RulesDefinition.Rule { val repository = buildRepository(ruleClass) assertThat(repository.rules()).hasSize(1) return repository.rules()[0] } private fun buildRepository(vararg classes: Class<*>): Repository { return buildRepository(LANGUAGE_KEY_WITH_RESOURCE_BUNDLE, *classes) } private fun buildRepository(languageKey: String, vararg classes: Class<*>): Repository { val newRepository = createRepository(languageKey) CustomAnnotationBasedRulesDefinition( SonarQubeRepositoryAdapter(newRepository), languageKey, SonarQubeRuleMetadataLoader() ) .addRuleClasses(classes.toList()) newRepository.done() return context.repository(REPO_KEY) ?: fail("Should build a repository") } private fun load(vararg classes: Class<*>): Repository { val languageKey = LANGUAGE_KEY_WITH_RESOURCE_BUNDLE val newRepository = createRepository(languageKey) CustomAnnotationBasedRulesDefinition.load(SonarQubeRepositoryAdapter(newRepository), languageKey, classes.toList(), SonarQubeRuleMetadataLoader()) newRepository.done() return context.repository(REPO_KEY) ?: fail("Should build a repository") } private fun createRepository(languageKey: String): NewRepository { return context.createRepository(REPO_KEY, languageKey) } companion object { private const val REPO_KEY = "plsql" private const val LANGUAGE_KEY_WITH_RESOURCE_BUNDLE = "languageKey" } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/PlSqlChecksTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.fail import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.sonar.api.batch.rule.internal.ActiveRulesBuilder import org.sonar.api.batch.rule.internal.NewActiveRule import org.sonar.api.rule.RuleKey import org.sonar.api.server.rule.RulesDefinition import org.sonar.check.Rule import com.felipebz.zpa.rules.SonarQubeActiveRulesAdapter import com.felipebz.zpa.rules.SonarQubeRuleKeyAdapter import com.felipebz.zpa.rules.SonarQubeRuleMetadataLoader import com.felipebz.zpa.api.CustomPlSqlRulesDefinition import com.felipebz.zpa.api.checks.PlSqlCheck import com.felipebz.zpa.api.checks.PlSqlVisitor class PlSqlChecksTest { private lateinit var activeRules: SonarQubeActiveRulesAdapter private lateinit var customRulesDefinition: MyCustomPlSqlRulesDefinition private val ruleMetadataLoader = SonarQubeRuleMetadataLoader() @BeforeEach fun setUp() { activeRules = SonarQubeActiveRulesAdapter(ActiveRulesBuilder() .addRule(NewActiveRule.Builder().setRuleKey(RuleKey.of(DEFAULT_REPOSITORY_KEY, DEFAULT_RULE_KEY)).build()) .addRule(NewActiveRule.Builder().setRuleKey(RuleKey.of(CUSTOM_REPOSITORY_KEY, CUSTOM_RULE_KEY)).build()) .build()) customRulesDefinition = MyCustomPlSqlRulesDefinition() val context = RulesDefinition.Context() customRulesDefinition.define(context) } @Test fun shouldReturnDefaultChecks() { val checks = PlSqlChecks.createPlSqlCheck(activeRules, ruleMetadataLoader) checks.addChecks(DEFAULT_REPOSITORY_KEY, listOf(MyRule::class.java)) val defaultVisitor = visitor(checks, DEFAULT_REPOSITORY_KEY, DEFAULT_RULE_KEY) assertThat(checks.all()).hasSize(1) assertThat(checks.ruleKey(defaultVisitor)).isNotNull assertThat(checks.ruleKey(defaultVisitor)?.rule).isEqualTo(DEFAULT_RULE_KEY) assertThat(checks.ruleKey(defaultVisitor)?.repository).isEqualTo(DEFAULT_REPOSITORY_KEY) } @Test fun shouldReturnCustomChecks() { val checks = PlSqlChecks.createPlSqlCheck(activeRules, ruleMetadataLoader) checks.addCustomChecks(arrayOf(customRulesDefinition)) val customVisitor = visitor(checks, CUSTOM_REPOSITORY_KEY, CUSTOM_RULE_KEY) assertThat(checks.all()).hasSize(1) assertThat(checks.ruleKey(customVisitor)).isNotNull assertThat(checks.ruleKey(customVisitor)?.rule).isEqualTo(CUSTOM_RULE_KEY) assertThat(checks.ruleKey(customVisitor)?.repository).isEqualTo(CUSTOM_REPOSITORY_KEY) } @Test fun shouldWorkWithoutCustomChecks() { val checks = PlSqlChecks.createPlSqlCheck(activeRules, ruleMetadataLoader) checks.addCustomChecks(null) assertThat(checks.all()).hasSize(0) } @Test fun shouldNotReturnRuleKeyIfCheckDoesNotExists() { val checks = PlSqlChecks.createPlSqlCheck(activeRules, ruleMetadataLoader) checks.addChecks(DEFAULT_REPOSITORY_KEY, listOf(MyRule::class.java)) assertThat(checks.ruleKey(MyCustomRule())).isNull() } private fun visitor(plSqlChecks: PlSqlChecks, repository: String, rule: String): PlSqlVisitor { val key = SonarQubeRuleKeyAdapter.of(repository, rule) var visitor: PlSqlVisitor? = null for (checks in plSqlChecks.checks) { visitor = checks.of(key) if (visitor != null) { return visitor } } return visitor ?: fail("Should return a visitor.") } @Rule(key = DEFAULT_RULE_KEY, name = "This is the default rules", description = "desc") class MyRule : PlSqlCheck() @Rule(key = CUSTOM_RULE_KEY, name = "This is a custom rules", description = "desc") class MyCustomRule : PlSqlCheck() class MyCustomPlSqlRulesDefinition : CustomPlSqlRulesDefinition() { override fun repositoryName(): String { return "Custom Rule Repository" } override fun repositoryKey(): String { return CUSTOM_REPOSITORY_KEY } override fun checkClasses(): Array> { return arrayOf(MyCustomRule::class.java) } } companion object { private const val DEFAULT_REPOSITORY_KEY = "DefaultRuleRepository" private const val DEFAULT_RULE_KEY = "MyRule" private const val CUSTOM_REPOSITORY_KEY = "CustomRuleRepository" private const val CUSTOM_RULE_KEY = "MyCustomRule" } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/PlSqlPluginTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.sonar.api.Plugin import org.sonar.api.SonarEdition import org.sonar.api.SonarQubeSide import org.sonar.api.internal.SonarRuntimeImpl import org.sonar.api.utils.Version class PlSqlPluginTest { @Test fun testGetExtensions() { val context = Plugin.Context(SonarRuntimeImpl.forSonarQube(Version.create(6, 0), SonarQubeSide.SERVER, SonarEdition.COMMUNITY)) val plugin = PlSqlPlugin() plugin.define(context) assertThat(context.extensions).hasSize(12) } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/PlSqlProfileTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.Context import com.felipebz.zpa.checks.CheckList class PlSqlProfileTest { @Test fun should_create_sonar_way_profile() { val context = Context() val definition = PlSqlProfile() definition.define(context) val profile = context.profile(PlSql.KEY, CheckList.SONAR_WAY_PROFILE) assertThat(profile).isNotNull val activeRules = profile.rules() assertThat(activeRules.size).isGreaterThan(40) } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/PlSqlSquidSensorTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mockito.* import org.sonar.api.batch.fs.InputFile import org.sonar.api.batch.fs.internal.TestInputFileBuilder import org.sonar.api.batch.rule.internal.ActiveRulesBuilder import org.sonar.api.batch.rule.internal.NewActiveRule import org.sonar.api.batch.sensor.highlighting.TypeOfText import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor import org.sonar.api.batch.sensor.internal.SensorContextTester import org.sonar.api.config.internal.MapSettings import org.sonar.api.issue.NoSonarFilter import org.sonar.api.measures.CoreMetrics import org.sonar.api.measures.FileLinesContext import org.sonar.api.measures.FileLinesContextFactory import org.sonar.api.rule.RuleKey import com.felipebz.zpa.symbols.ObjectLocator import java.io.File import java.nio.charset.StandardCharsets import java.nio.file.Paths class PlSqlSquidSensorTest { private lateinit var sensor: PlSqlSquidSensor private lateinit var context: SensorContextTester private lateinit var fileLinesContext: FileLinesContext @BeforeEach fun setUp() { val activeRules = ActiveRulesBuilder() .addRule(NewActiveRule.Builder() .setRuleKey(RuleKey.of(PlSqlRuleRepository.KEY, "EmptyBlock")) .setName("Print Statement Usage").build()) .build() context = SensorContextTester.create(File(".")) val fileLinesContextFactory = mock(FileLinesContextFactory::class.java) fileLinesContext = mock(FileLinesContext::class.java) `when`(fileLinesContextFactory.createFor(any(InputFile::class.java))).thenReturn(fileLinesContext) sensor = PlSqlSquidSensor( activeRules, MapSettings().asConfig(), mock(NoSonarFilter::class.java), fileLinesContextFactory, null, ObjectLocator() ) } @Test fun testDescriptor() { val descriptor = DefaultSensorDescriptor() sensor.describe(descriptor) assertThat(descriptor.name()).isEqualTo("ZPA") assertThat(descriptor.languages()).containsOnly(PlSql.KEY) } @Test fun shouldAnalyse() { val relativePath = "src/test/resources/com/felipebz/zpa/code.sql" val inputFile = TestInputFileBuilder("key", relativePath) .setLanguage(PlSql.KEY) .setCharset(StandardCharsets.UTF_8) .initMetadata(File(relativePath).readText()) .setModuleBaseDir(Paths.get("")) .build() context.fileSystem().add(inputFile) sensor.execute(context) val key = inputFile.key() //assertThat(context.measure(key, CoreMetrics.FILES).value()).isEqualTo(1); assertThat(context.measure(key, CoreMetrics.NCLOC).value()).isEqualTo(18) assertThat(context.measure(key, CoreMetrics.COMMENT_LINES).value()).isEqualTo(4) assertThat(context.measure(key, CoreMetrics.COMPLEXITY).value()).isEqualTo(6) assertThat(context.measure(key, CoreMetrics.FUNCTIONS).value()).isEqualTo(2) assertThat(context.measure(key, CoreMetrics.STATEMENTS).value()).isEqualTo(7) verify(fileLinesContext, times(7)) .setIntValue(eq(CoreMetrics.EXECUTABLE_LINES_DATA_KEY), anyInt(), eq(1)) verify(fileLinesContext).save() } @Test fun shouldAnalyseTestFile() { val relativePath = "src/test/resources/com/felipebz/zpa/test.sql" val inputFile = TestInputFileBuilder("key", relativePath) .setLanguage(PlSql.KEY) .setType(InputFile.Type.TEST) .setCharset(StandardCharsets.UTF_8) .initMetadata(File(relativePath).readText()) .setModuleBaseDir(Paths.get("")) .build() context.fileSystem().add(inputFile) sensor.execute(context) val key = inputFile.key() // shouldn't save metrics for test files assertThat(context.measure(key, CoreMetrics.NCLOC)).isNull() assertThat(context.measure(key, CoreMetrics.COMMENT_LINES)).isNull() assertThat(context.measure(key, CoreMetrics.COMPLEXITY)).isNull() assertThat(context.measure(key, CoreMetrics.FUNCTIONS)).isNull() assertThat(context.measure(key, CoreMetrics.STATEMENTS)).isNull() verifyNoInteractions(fileLinesContext) // but should save highlighting data assertThat(context.highlightingTypeAt(key, 1, lineOffset(1))).containsExactly(TypeOfText.KEYWORD) assertThat(context.highlightingTypeAt(key, 2, lineOffset(3))).containsExactly(TypeOfText.COMMENT) assertThat(context.highlightingTypeAt(key, 3, lineOffset(3))).containsExactly(TypeOfText.STRUCTURED_COMMENT) assertThat(context.highlightingTypeAt(key, 6, lineOffset(8))).containsExactly(TypeOfText.STRING) assertThat(context.highlightingTypeAt(key, 7, lineOffset(1))).containsExactly(TypeOfText.KEYWORD) } private fun lineOffset(offset: Int): Int { return offset - 1 } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/PlSqlTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.sonar.api.config.internal.MapSettings class PlSqlTest { @Test fun test() { val language = PlSql(MapSettings().asConfig()) assertThat(language.key).isEqualTo("plsqlopen") assertThat(language.name).isEqualTo("PL/SQL (ZPA)") assertThat(language.fileSuffixes) .hasSize(4) .contains("sql") .contains("pkg") .contains("pks") .contains("pkb") } @Test fun custom_file_suffixes() { val settings = MapSettings() settings.setProperty(PlSqlPlugin.FILE_SUFFIXES_KEY, "sql, custom") val language = PlSql(settings.asConfig()) assertThat(language.fileSuffixes).hasSize(2).contains("custom") } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/api/CustomPlSqlRulesDefinitionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.sonar.api.server.rule.RulesDefinition import org.sonar.check.Rule import org.sonar.check.RuleProperty import com.felipebz.zpa.api.checks.PlSqlCheck class CustomPlSqlRulesDefinitionTest { @Test fun test() { val rulesDefinition = MyCustomPlSqlRulesDefinition() val context = RulesDefinition.Context() rulesDefinition.define(context) val repository = context.repository(REPOSITORY_KEY) checkNotNull(repository) assertThat(repository.name()).isEqualTo(REPOSITORY_NAME) assertThat(repository.language()).isEqualTo("plsqlopen") assertThat(repository.rules()).hasSize(1) val alertUseRule = repository.rule(RULE_KEY) assertThat(alertUseRule).isNotNull assertThat(alertUseRule?.name()).isEqualTo(RULE_NAME) for (rule in repository.rules()) { for (param in rule.params()) { assertThat(param.description()).`as`("description for " + param.key()).isNotEmpty } } } @Rule(key = RULE_KEY, name = RULE_NAME, description = "desc", tags = ["bug"]) inner class MyCustomRule : PlSqlCheck() { @RuleProperty(key = "customParam", description = "Custom parameter", defaultValue = "value") var customParam = "value" } class MyCustomPlSqlRulesDefinition : CustomPlSqlRulesDefinition() { override fun repositoryName(): String { return REPOSITORY_NAME } override fun repositoryKey(): String { return REPOSITORY_KEY } override fun checkClasses(): Array> { return arrayOf(MyCustomRule::class.java) } } companion object { private const val REPOSITORY_NAME = "Custom Rule Repository" private const val REPOSITORY_KEY = "CustomRuleRepository" private const val RULE_NAME = "This is my custom rule" private const val RULE_KEY = "MyCustomRule" } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/highlight/PlSqlHighlighterVisitorTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.highlight import com.felipebz.zpa.TestPlSqlVisitorRunner import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.io.TempDir import org.sonar.api.batch.fs.internal.TestInputFileBuilder import org.sonar.api.batch.sensor.highlighting.TypeOfText import org.sonar.api.batch.sensor.internal.SensorContextTester import java.io.File import java.nio.charset.StandardCharsets class PlSqlHighlighterVisitorTest { @Test fun shouldAnalyse_lf(@TempDir dir: File) { verifyHighlighting(dir, "\n") } @Test fun shouldAnalyse_crlf(@TempDir dir: File) { verifyHighlighting(dir, "\r\n") } @Test fun shouldAnalyse_cr(@TempDir dir: File) { verifyHighlighting(dir, "\r") } private fun verifyHighlighting(baseDir: File, eol: String) { val file = File(baseDir, "test.sql") val content = File("src/test/resources/highlight/highlight.sql") .readText() .replace("\r\n", "\n") .replace("\n", eol) file.writeText(content) val inputFile = TestInputFileBuilder("key", "test.sql") .setLanguage("plsqlopen") .setCharset(StandardCharsets.UTF_8) .initMetadata(content) .setModuleBaseDir(baseDir.toPath()) .build() val context = SensorContextTester.create(baseDir) context.fileSystem().add(inputFile) val visitor = PlSqlHighlighterVisitor(context, inputFile) TestPlSqlVisitorRunner.scanFile(file, null, visitor) val key = inputFile.key() assertThat(context.highlightingTypeAt(key, 1, lineOffset(1))).containsExactly(TypeOfText.KEYWORD) assertThat(context.highlightingTypeAt(key, 2, lineOffset(3))).containsExactly(TypeOfText.COMMENT) assertThat(context.highlightingTypeAt(key, 3, lineOffset(3))).containsExactly(TypeOfText.STRUCTURED_COMMENT) assertThat(context.highlightingTypeAt(key, 6, lineOffset(8))).containsExactly(TypeOfText.STRING) assertThat(context.highlightingTypeAt(key, 7, lineOffset(1))).containsExactly(TypeOfText.KEYWORD) } private fun lineOffset(offset: Int): Int { return offset - 1 } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/metrics/CpdVisitorTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.metrics import com.felipebz.zpa.TestPlSqlVisitorRunner import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.sonar.api.batch.fs.internal.DefaultInputFile import org.sonar.api.batch.fs.internal.TestInputFileBuilder import org.sonar.api.batch.sensor.internal.SensorContextTester import java.io.File import java.nio.charset.StandardCharsets import java.nio.file.Paths class CpdVisitorTest { private val context = SensorContextTester.create(File(BASE_DIR)) @Test fun scanFile() { val inputFile = inputFile() context.fileSystem().add(inputFile) val visitor = CpdVisitor(context, inputFile) TestPlSqlVisitorRunner.scanFile(File(Paths.get(BASE_DIR, FILE).toString()), null, visitor) val cpdTokenLines = context.cpdTokens(inputFile.key()) assertThat(cpdTokenLines).hasSize(17) } private fun inputFile(): DefaultInputFile { val inputFile = TestInputFileBuilder("key", "cpd.sql") .setLanguage("plsqlopen") .setCharset(StandardCharsets.UTF_8) .initMetadata(File(BASE_DIR, FILE).readText()) .setModuleBaseDir(Paths.get(BASE_DIR)) .build() context.fileSystem().add(inputFile) return inputFile } companion object { private const val BASE_DIR = "src/test/resources/metrics" private const val FILE = "cpd.sql" } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/symbols/SonarQubeSymbolTableTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.symbols import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.GenericTokenType import com.felipebz.flr.api.Token import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.Symbol import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.tuple import org.junit.jupiter.api.Test import org.mockito.Mockito.mock import org.sonar.api.batch.fs.internal.TestInputFileBuilder import org.sonar.api.batch.sensor.internal.SensorContextTester import java.io.File import java.nio.charset.StandardCharsets class SonarQubeSymbolTableTest { @Test fun test() { val inputFile = TestInputFileBuilder("key", File("test.sql").path) .setContents("abcde") .setLanguage("plsqlopen") .setCharset(StandardCharsets.UTF_8) .build() val key = inputFile.key() val context = SensorContextTester.create(File("")) context.fileSystem().add(inputFile) val symbol = createSymbol(createNode(1)) symbol.addUsage(createNode(2)) symbol.addUsage(createNode(3)) val symbolTable = SonarQubeSymbolTable(context, inputFile) symbolTable.save(listOf(symbol)) assertThat(context.referencesForSymbolAt(key, 1, 1)) .extracting("start.line", "start.lineOffset") .containsExactly(tuple(1, 2), tuple(1, 3)) } private fun createNode(character: Int): AstNode { val token = Token.builder() .setLine(1) .setColumn(character) .setValueAndOriginalValue(" ") .setType(GenericTokenType.IDENTIFIER) .build() val lastToken = Token.builder() .setLine(1) .setColumn(character + 2) .setValueAndOriginalValue(" ") .setType(GenericTokenType.IDENTIFIER) .build() val node = AstNode(token) node.addChild(AstNode(token)) node.addChild(AstNode(lastToken)) return node } private fun createSymbol(node: AstNode): Symbol { return Symbol(node, Symbol.Kind.VARIABLE, mock(Scope::class.java), null) } } ================================================ FILE: sonar-zpa-plugin/src/test/kotlin/com/felipebz/zpa/utplsql/UtPlSqlSensorTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utplsql import com.felipebz.zpa.PlSql import com.felipebz.zpa.api.PlSqlFile import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.symbols.MappedObject import com.felipebz.zpa.symbols.ObjectLocator import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.kotlin.* import org.sonar.api.batch.fs.InputFile import org.sonar.api.batch.fs.internal.TestInputFileBuilder import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor import org.sonar.api.batch.sensor.internal.SensorContextTester import org.sonar.api.measures.CoreMetrics import org.sonar.api.notifications.AnalysisWarnings import java.io.File import java.nio.charset.StandardCharsets class UtPlSqlSensorTest { private lateinit var sensor: UtPlSqlSensor private lateinit var context: SensorContextTester private lateinit var objectLocator: ObjectLocator private lateinit var analysisWarnings: AnalysisWarnings @BeforeEach fun setUp() { context = SensorContextTester.create(File("src/test/resources/com/felipebz/zpa/utplsql/")) objectLocator = mock() analysisWarnings = spy() sensor = UtPlSqlSensor(objectLocator, analysisWarnings) } @Test fun testDescriptor() { val descriptor = DefaultSensorDescriptor() sensor.describe(descriptor) assertThat(descriptor.name()).isEqualTo("ZPA - utPLSQL Report Importer") assertThat(descriptor.languages()).containsOnly(PlSql.KEY) } @Test fun shouldImportTestReportWithPaths() { val testFile = TestInputFileBuilder("moduleKey", "path/to/file.sql") .setType(InputFile.Type.TEST) .build() context.fileSystem().add(testFile) whenever(objectLocator.findTestObject(any(), any())).thenReturn(null) context.settings().setProperty(UtPlSqlSensor.TEST_REPORT_PATH_KEY, "test-report-with-paths.xml") sensor.execute(context) val key = testFile.key() assertThat(context.measure(key, CoreMetrics.TESTS).value()).isEqualTo(4) assertThat(context.measure(key, CoreMetrics.TEST_FAILURES).value()).isEqualTo(1) assertThat(context.measure(key, CoreMetrics.TEST_ERRORS).value()).isEqualTo(1) assertThat(context.measure(key, CoreMetrics.SKIPPED_TESTS).value()).isEqualTo(1) assertThat(context.measure(key, CoreMetrics.TEST_EXECUTION_TIME).value()).isEqualTo(5L) } @Test fun shouldImportTestReportWithoutPaths() { val testFile = TestInputFileBuilder("moduleKey", "path/to/file.sql") .setType(InputFile.Type.TEST) .build() context.fileSystem().add(testFile) whenever(objectLocator.findTestObject(eq("test_package"), any())).thenReturn( MappedObject("", PlSqlGrammar.CREATE_PACKAGE_BODY, PlSqlFile.Type.TEST, testFile.path(), testFile) ) context.settings().setProperty(UtPlSqlSensor.TEST_REPORT_PATH_KEY, "test-report-with-paths.xml") sensor.execute(context) val key = testFile.key() assertThat(context.measure(key, CoreMetrics.TESTS).value()).isEqualTo(4) assertThat(context.measure(key, CoreMetrics.TEST_FAILURES).value()).isEqualTo(1) assertThat(context.measure(key, CoreMetrics.TEST_ERRORS).value()).isEqualTo(1) assertThat(context.measure(key, CoreMetrics.SKIPPED_TESTS).value()).isEqualTo(1) assertThat(context.measure(key, CoreMetrics.TEST_EXECUTION_TIME).value()).isEqualTo(5L) } @Test fun invalidTestReport() { context.settings().setProperty(UtPlSqlSensor.TEST_REPORT_PATH_KEY, "doesnotexists.xml") sensor.execute(context) verify(analysisWarnings).addUnique("No utPLSQL test report was found for sonar.zpa.tests.reportPaths using pattern doesnotexists.xml") } @Test fun shouldImportCoverageReportWithPaths() { val relativePath = "award_bonus.sql" val mainFile = TestInputFileBuilder("moduleKey", relativePath) .setType(InputFile.Type.MAIN) .setCharset(StandardCharsets.UTF_8) .initMetadata(File(context.fileSystem().baseDir(), relativePath).readText()) .build() context.fileSystem().add(mainFile) whenever(objectLocator.findMainObject(any(), any())).thenReturn(null) context.settings().setProperty(UtPlSqlSensor.COVERAGE_REPORT_PATH_KEY, "coverage-report-with-paths.xml") sensor.execute(context) val key = mainFile.key() assertThat(context.lineHits(key, 5)).isOne() assertThat(context.lineHits(key, 10)).isOne() assertThat(context.lineHits(key, 11)).isOne() assertThat(context.lineHits(key, 13)).isOne() assertThat(context.conditions(key, 10)).isEqualTo(2) assertThat(context.coveredConditions(key, 10)).isEqualTo(2) } @Test fun shouldImportCoverageReportWithoutPaths() { val relativePath = "betwnstr.sql" val mainFile = TestInputFileBuilder("moduleKey", relativePath) .setType(InputFile.Type.MAIN) .setCharset(StandardCharsets.UTF_8) .initMetadata(File(context.fileSystem().baseDir(), relativePath).readText()) .build() context.fileSystem().add(mainFile) whenever(objectLocator.findMainObject(any(), any())).thenReturn( MappedObject( identifier = "", objectType = PlSqlGrammar.CREATE_FUNCTION, fileType = PlSqlFile.Type.MAIN, path = mainFile.path(), inputFile = mainFile, firstLine = 3, lastLine = 10 ) ) context.settings().setProperty(UtPlSqlSensor.COVERAGE_REPORT_PATH_KEY, "coverage-report-without-paths.xml") sensor.execute(context) val key = mainFile.key() assertThat(context.lineHits(key, 4)).isOne() assertThat(context.lineHits(key, 6)).isOne() assertThat(context.lineHits(key, 7)).isOne() assertThat(context.lineHits(key, 9)).isOne() } @Test fun invalidCoverageReport() { context.settings().setProperty(UtPlSqlSensor.COVERAGE_REPORT_PATH_KEY, "doesnotexists.xml") sensor.execute(context) verify(analysisWarnings).addUnique("No utPLSQL coverage report was found for sonar.zpa.coverage.reportPaths using pattern doesnotexists.xml") } @Test fun shouldNotImportCoverageIfFileDoesNotContainCoveredLined() { val relativePath = "betwnstr.sql" val mainFile = TestInputFileBuilder("moduleKey", relativePath) .setType(InputFile.Type.MAIN) .setCharset(StandardCharsets.UTF_8) .build() context.fileSystem().add(mainFile) whenever(objectLocator.findMainObject(any(), any())).thenReturn( MappedObject( identifier = "", objectType = PlSqlGrammar.CREATE_FUNCTION, fileType = PlSqlFile.Type.MAIN, path = mainFile.path(), inputFile = mainFile, firstLine = 3, lastLine = 10 ) ) context.settings().setProperty(UtPlSqlSensor.COVERAGE_REPORT_PATH_KEY, "coverage-report-all-uncovered.xml") sensor.execute(context) val key = mainFile.key() assertThat(context.lineHits(key, 1)).isNull() assertThat(context.lineHits(key, 2)).isNull() assertThat(context.lineHits(key, 3)).isNull() assertThat(context.lineHits(key, 4)).isNull() } } ================================================ FILE: sonar-zpa-plugin/src/test/resources/com/felipebz/zpa/code.sql ================================================ begin -- this is a comment /* * another comment */ for i in 1..2 loop dbms_output.put_line(i); end loop; begin null; end; exception when no_data_found then null; when too_many_rows then null; end; / create procedure test is begin null; end; / create function foo return number is begin null; end; / ================================================ FILE: sonar-zpa-plugin/src/test/resources/com/felipebz/zpa/test.sql ================================================ begin -- this is a comment /** * another comment */ x := 1; end; ================================================ FILE: sonar-zpa-plugin/src/test/resources/com/felipebz/zpa/utplsql/award_bonus.sql ================================================ create or replace procedure award_bonus(emp_id number, sales_amt number) as commission real; comm_missing exception; begin select commission_pct into commission from employees_test where employee_id = emp_id; if commission is null then raise comm_missing; else update employees_test set salary = nvl(salary, 0) + sales_amt * commission where employee_id = emp_id; end if; end; / ================================================ FILE: sonar-zpa-plugin/src/test/resources/com/felipebz/zpa/utplsql/betwnstr.sql ================================================ /* comment before the code so the lines in the coverage report don't match the file */ create or replace function betwnstr(a_string varchar2, a_start_pos integer, a_end_pos integer) return varchar2 is l_start_pos pls_integer := a_start_pos; begin if l_start_pos = 0 then l_start_pos := 1; end if; return substr(a_string, l_start_pos, a_end_pos - l_start_pos + 1); end; / ================================================ FILE: sonar-zpa-plugin/src/test/resources/com/felipebz/zpa/utplsql/coverage-report-all-uncovered.xml ================================================ ================================================ FILE: sonar-zpa-plugin/src/test/resources/com/felipebz/zpa/utplsql/coverage-report-with-paths.xml ================================================ ================================================ FILE: sonar-zpa-plugin/src/test/resources/com/felipebz/zpa/utplsql/coverage-report-without-paths.xml ================================================ ================================================ FILE: sonar-zpa-plugin/src/test/resources/com/felipebz/zpa/utplsql/test-report-with-paths.xml ================================================ ================================================ FILE: sonar-zpa-plugin/src/test/resources/com/felipebz/zpa/utplsql/test-report-without-paths.xml ================================================ ================================================ FILE: sonar-zpa-plugin/src/test/resources/highlight/highlight.sql ================================================ begin -- this is a comment /** * another comment */ x := 1; end; ================================================ FILE: sonar-zpa-plugin/src/test/resources/metrics/cpd.sql ================================================ begin null; end; create package body pkg is procedure foo is begin null; end; end; create procedure foo is begin null; end; create function foo return number is begin null; end; -- package specification should not be considered for duplication detection create package pkg is procedure foo; end; create view foo as select * from dual; create trigger foo before insert on tab begin null; end; ================================================ FILE: sonar-zpa-plugin/src/test/resources/org/sonar/l10n/languageKey/rules/plsql/ruleWithExternalInfo.html ================================================ description for ruleWithExternalInfo ================================================ FILE: sonar-zpa-plugin/src/test/resources/org/sonar/l10n/languageKey/rules/repoKey/ruleWithExternalInfo.html ================================================ description for ruleWithExternalInfo ================================================ FILE: sonar-zpa-plugin/src/test/resources/org/sonar/l10n/languageKey.properties ================================================ ruleWithExternalInfo.name=external name for ruleWithExternalInfo ruleWithExternalInfo.param.param1Key=description for param1 ================================================ FILE: sonar-zpa-plugin/src/test/resources/org/sonar/l10n/languageWithoutBundle/empty.txt ================================================ ================================================ FILE: template/changelog.tpl ================================================ ## SonarQube compatibility This release is compatible with SonarQube Community Build 26.2 and newer and it has been tested on versions 26.2 to 26.5. SonarQube commercial builds are not supported. For that, consider using [zpa-cli](https://github.com/felipebz/zpa-cli) instead. ## Install/update instructions * Download the {{#f_release_download_url}}sonar-zpa-plugin-{{projectVersion}}.jar{{/f_release_download_url}} and copy it to the SONARQUBE_HOME/extensions/plugins. * Remove the older plugin from that directory. * Restart the SonarQube instance. ## For custom plugin developers Binary compatibility is not guaranteed either in between any version number change. Custom plugins should be recompiled against the same version of `sonar-zpa-plugin`. Download the {{#f_release_download_url}}zpa-toolkit-{{projectVersion}}.jar{{/f_release_download_url}} (requires Java 17+) to test the parser and view the AST. ## Full changelog {{changelogChanges}} ================================================ FILE: zpa-checks/build.gradle.kts ================================================ import de.undercouch.gradle.tasks.download.Download plugins { id("com.felipebz.zpa.build-conventions") alias(libs.plugins.download) } dependencies { implementation(libs.flr.core) implementation(libs.flr.xpath) implementation(project(":zpa-core")) testImplementation(project(":zpa-checks-testkit")) } testing { suites { register("integrationTest") { val downloadZipFile by tasks.registering(Download::class, fun Download.() { val sqlclVersion = "25.3.0.274.1210" src("https://download.oracle.com/otn_software/java/sqldeveloper/sqlcl-$sqlclVersion.zip") overwrite(false) dest(layout.projectDirectory.dir("tools").file("sqlcl-$sqlclVersion.zip")) }) val downloadAndUnzipFile = tasks.register("downloadAndUnzipFile") { dependsOn(downloadZipFile) from(zipTree(downloadZipFile.get().dest)) into(layout.projectDirectory.dir("tools")) } tasks.named("compileIntegrationTestKotlin") { dependsOn(downloadAndUnzipFile) } tasks.named("integrationTest") { dependsOn(downloadAndUnzipFile) } dependencies { implementation(layout.projectDirectory.dir("tools/sqlcl/lib").asFileTree) implementation(project()) implementation(libs.jackson) implementation(project(":zpa-core")) implementation(libs.jsoup) } } } } description = "ZPA Checks" ================================================ FILE: zpa-checks/src/integrationTest/kotlin/com/felipebz/zpa/it/InputFile.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.it import com.felipebz.zpa.api.PlSqlFile import java.io.File import java.nio.charset.Charset import java.nio.file.Path import kotlin.io.path.invariantSeparatorsPathString class InputFile(private val type: PlSqlFile.Type, baseDirPath: Path, private val file: File, private val charset: Charset ) : PlSqlFile { override fun contents(): String = file.inputStream().use { return it.bufferedReader(charset).use { r -> r.readText() } } override fun fileName(): String = file.name override fun path(): Path = file.toPath() override fun type(): PlSqlFile.Type = type val pathRelativeToBase: String = baseDirPath.relativize(path()).invariantSeparatorsPathString override fun hashCode(): Int { return file.hashCode() } override fun equals(other: Any?): Boolean { if (other == null || other !is InputFile) return false return file == other.file } override fun toString(): String { return pathRelativeToBase } } ================================================ FILE: zpa-checks/src/integrationTest/kotlin/com/felipebz/zpa/it/OracleDocsExtractor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.it import oracle.dbtools.parser.Lexer import oracle.dbtools.parser.plsql.SyntaxError import oracle.dbtools.raptor.newscriptrunner.ScriptParser import org.jsoup.Jsoup import java.io.File import java.nio.file.Paths import java.util.zip.ZipFile fun main() { OracleDocsExtractor().extract() } class OracleDocsExtractor { fun extract() { // you need to get the file from https://docs.oracle.com/en/database/oracle/oracle-database/23/zip/oracle-database_23.zip val zipFile = ZipFile(System.getProperty("oracleDocs")) val outputDir = File("zpa-checks/src/integrationTest/resources/sources/oracle-database_23") if (outputDir.exists()) { outputDir.deleteRecursively() } outputDir.mkdirs() val entries = zipFile.entries() val booksToExtract = listOf( "adjsn", // JSON Developer's Guide "lnpls", // PL/SQL Language Reference "sqlrf", // SQL Language Reference ) entries.asSequence() .filter { !it.isDirectory } .map { Pair(it, File(it.name).parentFile.name) } .forEach { (entry, parent) -> if (parent in booksToExtract) { zipFile.getInputStream(entry).use { stream -> Jsoup.parse(stream, Charsets.UTF_8.name(), "").run { select("pre.oac_no_warn, pre.codeblock code").forEachIndexed { index, element -> var text = element.text() .replace('’', '\'') val name = "${File(entry.name).nameWithoutExtension}-$index.sql" val fileContent = extractValidStatementsFrom(text) if (fileContent.isNotEmpty()) { val path = entry.name.substring(entry.name.indexOf(parent)) text = "-- https://docs.oracle.com/en/database/oracle/oracle-database/23/$path\n$fileContent" val pathOutput = Paths.get(outputDir.absolutePath, parent, name).toFile() pathOutput.parentFile.mkdirs() pathOutput.writeText(text, Charsets.UTF_8) } } } } } } } private fun extractValidStatementsFrom(text: String): String { val alteredText = if (text.startsWith("PACKAGE")) { "CREATE $text" } else { text } val parser = ScriptParser(alteredText) var validText = "" while (true) { val cmd = try { parser.next() ?: break } catch (_: NullPointerException) { // the dbtools-common from SQLcl 25.x throws a NullPointerException when parsing invalid code break } val sql = cmd.sqlOrigWithTerminator val syntaxError = SyntaxError.checkSyntax( sql, arrayOf("select", "sql_statement", "sql_statements") ) if (syntaxError == null) { val tokens = Lexer.parse(sql) // ignore the command if it doesn't have any token (e.g. comment line) if (tokens.isNotEmpty()) { if (validText.isNotEmpty()) { validText += "\n" } validText += sql } } } return validText } } ================================================ FILE: zpa-checks/src/integrationTest/kotlin/com/felipebz/zpa/it/PlSqlRulingTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.it import com.fasterxml.jackson.core.util.DefaultIndenter import com.fasterxml.jackson.core.util.DefaultPrettyPrinter import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper import org.junit.jupiter.api.AfterAll import org.junit.jupiter.api.Test import org.junit.jupiter.api.fail import com.felipebz.zpa.checks.CheckList import com.felipebz.zpa.checks.ParsingErrorCheck import com.felipebz.zpa.metadata.FormsMetadata import com.felipebz.zpa.squid.AstScanner import com.felipebz.zpa.api.PlSqlFile import com.felipebz.zpa.api.checks.PlSqlVisitor import java.io.File import java.nio.charset.StandardCharsets import java.nio.file.Paths import java.util.* import kotlin.io.path.exists class PlSqlRulingTest { private val mapper = ObjectMapper() private val prettyPrinter = DefaultPrettyPrinter().apply { indentArraysWith(DefaultIndenter.SYSTEM_LINEFEED_INSTANCE) } @Test fun alexandria_plsql_utils() { analyze("alexandria-plsql-utils") } @Test fun pljson() { analyze("pljson") } @Test fun antlr() { analyze("antlr-grammars-v4") } @Test fun utPLSQL2() { analyze("utPLSQL2") } @Test fun utPLSQL3() { analyze("utPLSQL3") } @Test fun demo0001() { analyze("demo0001", "Doag-Forms-extracted/demo0001/WEBUTIL_DEMO") } @Test fun demo0002() { analyze("demo0002", "Doag-Forms-extracted/demo0002/DEMO0002") } @Test fun demo0002_2() { analyze("demo0002_2", "Doag-Forms-extracted/demo0002/FRW_REF") } @Test fun demo0003() { analyze("demo0003", "Doag-Forms-extracted/demo0003/DEMO0003") } @Test fun demo0004() { analyze("demo0004", "Doag-Forms-extracted/demo0004/RELEASE_LOCKS") } @Test fun demo0005() { analyze("demo0005", "Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST") } @Test fun demo0006() { analyze("demo0006", "Doag-Forms-extracted/demo0006/TIMEOUT_SYS_CLIENT_IDL") } @Test fun demo0007() { analyze("demo0007", "Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL") } @Test fun demo0008() { analyze("demo0008", "Doag-Forms-extracted/demo0008/LATENCY_TEST") } @Test fun demo0009() { analyze("demo0009", "Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905") } @Test fun demo0010() { analyze("demo0010", "Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5") } @Test fun demo0011() { analyze("demo0011", "Doag-Forms-extracted/demo0011/WEBUTIL_DEMO") } @Test fun demo0012() { analyze("demo0012", "Doag-Forms-extracted/demo0012/PDFVIEWER") } @Test fun demo0013() { analyze("demo0013", "Doag-Forms-extracted/demo0013/COLOR_SLIDER") } @Test fun demo0014() { analyze("demo0014", "Doag-Forms-extracted/demo0014/ACCORDION") } @Test fun demo0014_2() { analyze("demo0014_2", "Doag-Forms-extracted/demo0014/ACCORDION2") } @Test fun demo0015() { analyze("demo0015", "Doag-Forms-extracted/demo0015/MODERNIZE") } @Test fun demo0016() { analyze("demo0016", "Doag-Forms-extracted/demo0016/CHK_CBOX3") } @Test fun demo0017() { analyze("demo0017", "Doag-Forms-extracted/demo0017/POC_ACCOUNT") } @Test fun demo0018() { analyze("demo0018", "Doag-Forms-extracted/demo0018/TEST") } @Test fun oracleDatabase23() { val project = "oracle-database_23" if (!File("src/integrationTest/resources/sources/$project").exists()) { OracleDocsExtractor().extract() } analyze(project) } private fun analyze(project: String, sources: String = project) { val extensions = "sql,typ,pkg,pkb,pks,tab,tps,tpb,pcd,fun,tgg" val baseDir = File("src/integrationTest/resources/sources/$sources").absoluteFile val baseDirPath = baseDir.toPath() val metadataFilePath = Paths.get(baseDir.absolutePath, "metadata.json") val metadata = if (metadataFilePath.exists()) FormsMetadata.loadFromFile(metadataFilePath.toString()) else null val checks = CheckList.checks.map { it.getDeclaredConstructor().newInstance() as PlSqlVisitor } val scanner = AstScanner(checks, metadata, false, StandardCharsets.UTF_8) val files = baseDir .walkTopDown() .filter { it.isFile && it.extension.isNotEmpty() && extensions.contains(it.extension.lowercase(Locale.getDefault())) } .toList() val issues = files .map { scanner.scanFile(InputFile(PlSqlFile.Type.MAIN, baseDirPath, it, StandardCharsets.UTF_8)) } .flatMap { it.issues } val writer = mapper.writer(prettyPrinter) var differences = "" for (check in checks) { val export = issues.filter { it.check == check } .sortedBy { it.primaryLocation.startLine() } .groupBy({ (it.file as InputFile).pathRelativeToBase }, { it.primaryLocation.startLine() }) .toSortedMap() val actualContent = if (export.size > 0) mapper.valueToTree(export) else null val expectedFile = File("src/integrationTest/resources/expected/$project/${check::class.simpleName}.json") val expectedContent = if (expectedFile.exists()) mapper.readTree(expectedFile) else null if (actualContent == null && expectedFile.exists()) { differences += "\nExpected issues on $expectedFile were not found" } else if (actualContent != null && actualContent != expectedContent) { val actualFile = File("build/integrationTest/$project/${check::class.simpleName}.json") actualFile.parentFile.mkdirs() actualFile.writeText(writer.writeValueAsString(actualContent)) differences += "\nIssues differences on the expected file $expectedFile (actual: $actualFile)" } } if (differences.isNotEmpty()) { fail(differences) } if (issues.none { it.check is ParsingErrorCheck }) { // if there are no parsing errors, rerun the scanner with the error recovery enabled to check if it is working val newScanner = AstScanner(listOf(ParsingErrorCheck()), metadata, true, StandardCharsets.UTF_8) val parsingIssues = files .map { newScanner.scanFile(InputFile(PlSqlFile.Type.MAIN, baseDirPath, it, StandardCharsets.UTF_8)) } .flatMap { it.issues } if (parsingIssues.isNotEmpty()) { val export = issues .groupBy({ (it.file as InputFile).pathRelativeToBase }, { it.primaryLocation.startLine() }) .toSortedMap() val actualContent = if (export.size > 0) mapper.valueToTree(export) else null fail("The project was parsed correctly with error recovery disabled, but there are parsing " + "issues with error recovery enabled:\n" + writer.writeValueAsString(actualContent) ) } } summary.add(SummaryItem(project, files.size, issues.filter { it.check is ParsingErrorCheck }.size)) } companion object { private val summary = mutableListOf() @AfterAll @JvmStatic fun writeSummary() { val output = File("build/integrationTest/progress-summary.md") output.parentFile.mkdirs() output.writeText("| Project | Files | Parsing Errors | % Success | Status |\n| --- | --- | --- | --- | --- |\n") for (item in summary.sortedWith(compareByDescending { it.parsingErrors }.thenBy { it.name })) { val successPercentage = ((item.files - item.parsingErrors).toDouble() / item.files) * 100 val status = if (item.parsingErrors > 0) "❌" else "✅" output.appendText( "| ${item.name} | ${item.files} | ${item.parsingErrors} | ${ String.format( "%.2f", successPercentage ) }% | $status |\n" ) } } } data class SummaryItem( val name: String, val files: Int, val parsingErrors: Int, ) } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/CharacterDatatypeUsageCheck.json ================================================ { "extras/hash_util_pkg.pkb" : [ 284 ], "ora/ftp_util_pkg.pkb" : [ 92 ], "ora/xlsx_builder_pkg.pkb" : [ 834, 865, 892 ], "ora/xlsx_builder_pkg.pks" : [ 214, 227 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/CollapsibleIfStatementsCheck.json ================================================ { "extras/as_pdf3.pkb" : [ 2441, 2995 ], "extras/pdfgen_pkg.pkb" : [ 3206 ], "ora/amazon_aws_s3_pkg.pkb" : [ 129 ], "ora/image_util_pkg.pkb" : [ 372 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/CommitRollbackCheck.json ================================================ { "ora/soap_server_pkg.pkb" : [ 772 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/ComparisonWithBooleanCheck.json ================================================ { "ora/debug_pkg.pkb" : [ 184 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/ComparisonWithNullCheck.json ================================================ { "ora/pdf_builder_pkg.pkb" : [ 995 ], "ora/string_util_pkg.pkb" : [ 584 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/ConcatenationWithNullCheck.json ================================================ { "extras/pdfgen_pkg.pkb" : [ 3166 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/DbmsOutputPutCheck.json ================================================ { "demos/csv_util_pkg_demo.sql" : [ 45, 69, 74, 79 ], "demos/zip_util_pkg_demo.sql" : [ 32, 49, 51 ], "extras/as_pdf3.pkb" : [ 800, 2277, 2546 ], "extras/as_pdf3_demo.sql" : [ 239 ], "extras/hash_util_pkg.pkb" : [ 1285, 1287, 1290, 1292, 1295, 1297, 1301, 1303, 1306, 1308, 1311, 1313, 1317, 1319, 1322, 1324, 1327, 1329, 1333, 1335, 1338, 1340, 1343, 1345, 1349, 1351, 1354, 1356, 1359, 1361, 1365, 1367, 1370, 1372, 1376, 1378, 1381, 1383 ], "ora/debug_pkg.pkb" : [ 89 ], "ora/ftp_util_pkg.pkb" : [ 792 ], "ora/t_soap_envelope.pkb" : [ 116, 121 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/DeadCodeCheck.json ================================================ { "extras/pdfgen_pkg.pkb" : [ 680 ], "ora/sylk_util_pkg.pkb" : [ 96 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/EmptyBlockCheck.json ================================================ { "demos/employee_service.pkb" : [ 70 ], "extras/as_pdf3.pkb" : [ 352 ], "extras/pdfgen_pkg.pkb" : [ 866, 3554 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/EmptyStringAssignmentCheck.json ================================================ { "extras/as_pdf3.pkb" : [ 749, 2429 ], "extras/pdfgen_pkg.pkb" : [ 1159, 1197, 1227, 1451, 1578, 1582, 2612, 2812, 2961, 3099 ], "ora/date_util_pkg.pkb" : [ 446 ], "ora/t_soap_envelope.pkb" : [ 42 ], "ora/xml_builder_pkg.pkb" : [ 71 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/ExplicitInParameterCheck.json ================================================ { "demos/pdf_builder_pkg_demo.sql" : [ 188 ], "extras/as_pdf3.pkb" : [ 93, 100, 107, 107, 107, 114, 114, 127, 127, 127, 134, 134, 167, 186, 187, 188, 189, 190, 309, 310, 318, 324, 330, 348, 387, 405, 406, 407, 408, 436, 437, 438, 453, 625, 837, 948, 949, 950, 1128, 1128, 1153, 1154, 1155, 1163, 1196, 1215, 1216, 1217, 1218, 1219, 1262, 1263, 1264, 1265, 1306, 1307, 1308, 1332, 1344, 1350, 1362, 1363, 1364, 1378, 1379, 1380, 1418, 1419, 1420, 1429, 1430, 1431, 1432, 1476, 1477, 1478, 1479, 1542, 1597, 1597, 1597, 1597, 1624, 1624, 1624, 1624, 1866, 1867, 1868, 1869, 1870, 2484, 2485, 2486, 2487, 2488, 2497, 2498, 2499, 2500, 2501, 2510, 2511, 2512, 2513, 2514, 2522, 2523, 2524, 2525, 2551, 2552, 2553, 2554, 2555, 2562, 2583, 2583, 2589, 2596, 2597, 2598, 2615, 2622, 2623, 2624, 2642, 2643, 2644, 2645, 2646, 2671, 2672, 2673, 2674, 2675, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2736, 2754, 2805, 2859, 2860, 2962, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3232, 3239, 3240, 3241, 3397, 3398, 3399, 3414, 3415, 3416 ], "extras/as_pdf3.pks" : [ 54, 54, 57, 57, 61, 62, 63, 66, 68, 71, 72, 73, 74, 75, 79, 80, 81, 82, 91, 92, 93, 96, 98, 98, 98, 98, 100, 114, 115, 116, 120, 121, 122, 127, 128, 129, 133, 134, 135, 136, 141, 142, 143, 144, 150, 151, 152, 153, 154, 159, 160, 161, 162, 163, 167, 168, 169, 170, 171, 176, 177, 178, 179, 180, 184, 185, 186, 187, 191, 192, 193, 194, 195, 198, 201, 202, 203, 206, 209, 210, 211, 244, 245, 246, 247, 248, 249, 250, 254, 255, 256, 257, 258, 259, 260, 261, 265, 266, 267, 268, 269, 270, 271, 274, 280, 281, 282, 287, 288, 289 ], "extras/pdfgen_pkg.pkb" : [ 212, 225, 495, 545, 592, 608, 627, 646, 686, 729, 739, 744, 752, 757, 757, 757, 762, 767, 795, 795, 814, 819, 830, 846, 846, 877, 877, 895, 895, 926, 934, 941, 952, 1260, 1269, 1269, 1574, 1615, 1615, 1615, 1841, 2018, 2018, 2033, 2071, 2090, 2108, 2120, 2120, 2130, 2139, 2146, 2146, 2146, 2159, 2169, 2176, 2183, 2183, 2192, 2192, 2208, 2219, 2226, 2233, 2240, 2247, 2254, 2265, 2265, 2332, 2332, 2332, 2346, 2346, 2346, 2365, 2365, 2365, 2381, 2391, 2391, 2391, 2391, 2401, 2401, 2401, 2401, 2401, 2430, 2430, 2430, 2446, 2446, 2446, 2446, 2446, 2467, 2467, 2467, 2517, 2593, 2594, 2595, 2720, 2720, 2720, 2793, 2793, 2793, 2884, 2909, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3272, 3272, 3272, 3380, 3380, 3551 ], "extras/pdfgen_pkg.pks" : [ 50, 50, 52, 55, 57, 59, 60, 60, 61, 62, 63, 63, 63, 64, 65, 66, 67, 67, 68, 68, 69, 70, 71, 72, 73, 74, 75, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 83, 83, 83, 83, 84, 84, 84, 84, 84, 86, 86, 86, 87, 87, 87, 87, 87, 88, 88, 88, 90, 90, 90, 91, 91, 91, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 111, 111, 112, 113, 114, 115, 116, 117, 118, 120, 120, 124, 125, 125, 125, 126, 130, 132, 133, 133 ], "ora/image_util_pkg.pkb" : [ 19, 20, 21, 28, 35, 36, 37, 78, 143, 210, 211, 327 ], "ora/sylk_util_pkg.pkb" : [ 79, 80, 81, 92, 218 ], "ora/xlsx_builder_pkg.pkb" : [ 132, 133, 134, 156, 156, 156, 163, 163, 170, 170, 170, 179, 180, 310, 321, 363, 389, 390, 391, 419, 436, 467, 468, 469, 470, 471, 472, 473, 474, 513, 514, 539, 540, 541, 542, 571, 572, 573, 586, 587, 588, 589, 590, 591, 592, 593, 654, 655, 656, 657, 658, 659, 660, 661, 662, 678, 709, 710, 711, 712, 713, 714, 715, 716, 717, 738, 739, 740, 741, 742, 743, 744, 745, 746, 767, 768, 769, 770, 771, 791, 792, 793, 794, 795, 796, 797, 813, 814, 815, 816, 817, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 914, 915, 916, 917, 918, 919, 920, 933, 934, 935, 943, 944, 945, 946, 947, 948, 949, 962, 963, 964, 965, 966, 967, 968, 981, 982, 992, 993, 1003, 1004, 1005, 1015, 1016, 1017, 1018, 1019, 1063, 1064, 1863, 1864, 1872, 1873, 1874, 1875, 1876 ], "ora/xlsx_builder_pkg.pks" : [ 69, 71, 74, 78, 79, 80, 81, 82, 83, 84, 85, 90, 91, 96, 97, 98, 99, 120, 121, 122, 144, 145, 146, 147, 148, 149, 150, 151, 152, 156, 157, 158, 159, 160, 161, 162, 163, 164, 168, 169, 170, 171, 172, 173, 174, 175, 176, 180, 181, 182, 183, 184, 188, 189, 190, 191, 192, 193, 194, 198, 199, 200, 201, 202, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 235, 236, 237, 238, 239, 240, 241, 245, 246, 247, 251, 252, 253, 254, 255, 256, 257, 261, 262, 263, 264, 265, 266, 267, 271, 272, 276, 277, 281, 282, 283, 287, 288, 289, 290, 291, 298, 299, 303, 304, 305, 306, 307 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/FunctionWithOutParameterCheck.json ================================================ { "extras/pdfgen_pkg.pkb" : [ 836, 841, 1870, 1870, 1870, 1879, 1879, 1879 ], "ora/ftp_util_pkg.pkb" : [ 87, 223, 266 ], "ora/ftp_util_pkg.pks" : [ 31, 48, 51 ], "ora/ntlm_http_pkg.pkb" : [ 28, 370 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/IfWithExitCheck.json ================================================ { "ora/date_util_pkg.pkb" : [ 618 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/InequalityUsageCheck.json ================================================ { "demos/pdf_builder_pkg_demo.sql" : [ 240 ], "extras/as_pdf3.pkb" : [ 1389, 1891, 1938, 2344, 2368, 2449, 2456, 2539, 2654, 2683, 2711, 2715, 2761, 2762, 2784, 2814, 2970, 3391 ], "extras/pdfgen_pkg.pkb" : [ 632, 670, 1115, 1115, 1589, 1593, 1908, 1928, 1949, 1952, 1955, 2021, 2021, 2274, 2354, 2373, 2557, 2561, 2569, 2579, 2583, 3346 ], "ora/flex_ws_api.pkb" : [ 518, 537 ], "ora/image_util_pkg.pkb" : [ 97, 98, 120, 164, 347 ], "ora/pdf_builder_pkg.pkb" : [ 649, 694, 695, 717, 1222, 1263, 1267 ], "ora/string_util_pkg.pkb" : [ 709 ], "ora/sylk_util_pkg.pkb" : [ 71 ], "ora/xlsx_builder_pkg.pkb" : [ 1968 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/InsertWithoutColumnsCheck.json ================================================ { "demos/01_create_demo_tables.sql" : [ 38, 41, 44, 47, 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, 86, 87, 88, 89, 102, 103, 104, 105, 106, 111 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/NvlWithNullParameterCheck.json ================================================ { "extras/pdfgen_pkg.pkb" : [ 2835 ], "ora/json_util_pkg.pkb" : [ 317 ], "ora/xlsx_builder_pkg.pkb" : [ 689 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/ParsingErrorCheck.json ================================================ { "demos/string_util_pkg_demo.sql" : [ 39 ], "setup/grants.sql" : [ 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/QueryWithoutExceptionHandlingCheck.json ================================================ { "demos/employee_service.pkb" : [ 109 ], "demos/owa_util_pkg_demo.sql" : [ 29 ], "ora/flex_ws_api.pkb" : [ 98, 267, 443 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/SameBranchCheck.json ================================================ { "ora/rss_util_pkg.pkb" : [ 84 ], "ora/string_util_pkg.pkb" : [ 585 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/SelectAllColumnsCheck.json ================================================ { "demos/amazon_aws_s3_pkg_demo.sql" : [ 40, 61, 67 ], "demos/csv_util_pkg_demo.sql" : [ 3, 15, 33 ], "demos/datapump_util_pkg_demo.sql" : [ 4, 7 ], "demos/date_util_pkg_demo.sql" : [ 3 ], "demos/file_util_pkg_demo.sql" : [ 8 ], "demos/ms_ews_util_pkg_demo.sql" : [ 25, 71, 83, 88, 93, 183 ], "demos/random_util_pkg_demo.sql" : [ 25 ], "demos/rss_util_pkg_demo.sql" : [ 17, 20, 25, 28, 33 ], "demos/sql_util_pkg_demo.sql" : [ 5, 10 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/UnnecessaryAliasInQueryCheck.json ================================================ { "demos/csv_util_pkg_demo.sql" : [ 34 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/UnnecessaryElseCheck.json ================================================ { "ora/csv_util_pkg.pkb" : [ 210 ], "ora/regexp_util_pkg.pkb" : [ 42 ], "ora/string_util_pkg.pkb" : [ 270 ], "ora/sylk_util_pkg.pkb" : [ 86 ], "ora/xml_util_pkg.pkb" : [ 273 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/UnnecessaryNullStatementCheck.json ================================================ { "extras/pdfgen_pkg.pkb" : [ 1037, 1052, 2942 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/UnusedParameterCheck.json ================================================ { "demos/datapump_cloud_pkg.pkb" : [ 85, 149, 150 ], "demos/employee_service.pkb" : [ 66, 74 ], "extras/as_pdf3.pkb" : [ 2488 ], "extras/pdfgen_pkg.pkb" : [ 686, 830, 3230, 3551 ], "extras/utl_file_nonstandard.pkb" : [ 20 ], "ora/soap_server_pkg.pkb" : [ 88 ], "ora/xlsx_builder_pkg.pkb" : [ 832 ], "ora/xml_builder_pkg.pkb" : [ 126 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/UnusedVariableCheck.json ================================================ { "extras/as_pdf3.pkb" : [ 350, 461, 469, 634, 718, 2533, 2534, 2535, 2536, 2809, 3012, 3255 ], "extras/hash_util_pkg.pkb" : [ 23, 28, 191, 471, 859 ], "extras/pdfgen_pkg.pkb" : [ 1420, 1845, 1863, 1865, 1866, 1867, 1868, 1872, 2449 ], "ora/amazon_aws_s3_pkg.pkb" : [ 158, 394, 757, 833, 1155 ], "ora/flex_ws_api.pkb" : [ 90, 258 ], "ora/google_maps_js_pkg.pkb" : [ 133 ], "ora/icalendar_util_pkg.pkb" : [ 188 ], "ora/image_util_pkg.pkb" : [ 146, 389 ], "ora/math_util_pkg.pkb" : [ 49 ], "ora/ntlm_http_pkg.pkb" : [ 119, 122, 135, 360, 363 ], "ora/ntlm_util_pkg.pkb" : [ 20, 21, 22, 23, 24, 25, 27, 28, 31, 33, 34, 35, 37, 38, 39, 41, 43, 44, 45, 47, 346, 357, 368, 604, 721, 766 ], "ora/ooxml_util_pkg.pkb" : [ 226 ], "ora/pdf_builder_pkg.pkb" : [ 644 ], "ora/regexp_util_pkg.pkb" : [ 20 ], "ora/validation_util_pkg.pkb" : [ 19 ], "ora/xlsx_builder_pkg.pkb" : [ 1106 ], "ora/xml_dataset_pkg.pkb" : [ 279 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/UselessParenthesisCheck.json ================================================ { "ora/date_util_pkg.pkb" : [ 440, 441 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/VariableHidingCheck.json ================================================ { "extras/pdfgen_pkg.pkb" : [ 1023, 1421, 1618, 1863, 2886 ], "ora/ms_ews_util_pkg.pkb" : [ 328, 472, 554, 612, 773, 1128, 1148, 1229, 1300, 1320, 1467, 1588, 1657, 1784, 1890 ], "ora/ntlm_http_pkg.pkb" : [ 133, 134, 373, 405, 406 ], "ora/string_util_pkg.pkb" : [ 838 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/VariableInitializationWithFunctionCallCheck.json ================================================ { "demos/datapump_cloud_pkg.pkb" : [ 21, 22 ], "demos/plsql_status_web_pkg.pkb" : [ 17 ], "extras/as_pdf3.pkb" : [ 350, 2284 ], "extras/hash_util_pkg.pkb" : [ 19, 20, 192, 193, 194, 195, 196, 472, 473, 474, 475, 476, 477, 478, 479, 860, 861, 862, 863, 864, 865, 866, 867 ], "extras/pdfgen_pkg.pkb" : [ 796, 965, 1635 ], "extras/utl_file_nonstandard.pkb" : [ 23 ], "ora/amazon_aws_s3_pkg.pkb" : [ 717, 754, 830, 1153 ], "ora/csv_util_pkg.pkb" : [ 22 ], "ora/datapump_util_pkg.pkb" : [ 25, 86, 87, 89 ], "ora/date_util_pkg.pkb" : [ 635, 636 ], "ora/encode_util_pkg.pkb" : [ 45, 84, 145, 185 ], "ora/flex_ws_api.pkb" : [ 23, 49, 425 ], "ora/ntlm_util_pkg.pkb" : [ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 494 ], "ora/pdf_builder_pkg.pkb" : [ 1077, 1078, 1079, 1080, 1081 ], "ora/random_util_pkg.pkb" : [ 24, 25, 85, 86, 393, 800 ], "ora/rss_util_pkg.pkb" : [ 103 ], "ora/string_util_pkg.pkb" : [ 433 ], "ora/string_util_pkg.pks" : [ 30, 31, 32, 34, 35 ], "ora/xlsx_builder_pkg.pkb" : [ 4, 5, 187, 258, 422, 665, 720, 750, 775, 801, 821, 842, 924, 952, 971, 985, 996, 1008, 1023 ], "ora/zip_util_pkg.pkb" : [ 425 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/alexandria-plsql-utils/VariableInitializationWithNullCheck.json ================================================ { "extras/pdfgen_pkg.pkb" : [ 878, 897 ], "extras/utl_file_nonstandard.pkb" : [ 26, 27 ], "ora/amazon_aws_auth_pkg.pkb" : [ 20 ], "ora/amazon_aws_s3_pkg.pks" : [ 54 ], "ora/ftp_util_pkg.pkb" : [ 146, 642, 684 ], "ora/google_translate_pkg.pkb" : [ 17, 145 ], "ora/google_translate_pkg.pks" : [ 108 ], "ora/paypal_util_pkg.pkb" : [ 207 ], "ora/sylk_util_pkg.pkb" : [ 53, 148 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/AddParenthesesInNestedExpressionCheck.json ================================================ { "examples/condition03.sql" : [ 3, 8 ], "examples/condition05.sql" : [ 4 ], "examples/query_factoring05.sql" : [ 21 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/ColumnsShouldHaveTableNameCheck.json ================================================ { "examples/bindvar05.sql" : [ 1, 1, 4 ], "examples/condition11.sql" : [ 1 ], "examples/dblink01.sql" : [ 1, 1 ], "examples/groupby06.sql" : [ 2, 2, 2, 2 ], "examples/query_factoring01.sql" : [ 12, 12, 12, 12 ], "examples/query_factoring06.sql" : [ 3 ], "examples/query_factoring09.sql" : [ 5 ], "examples/xmltable01.sql" : [ 3 ], "examples/xmltable03.sql" : [ 3, 4, 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/CommitRollbackCheck.json ================================================ { "examples-sql-script/procedure_with_cursor_and_limit.sql" : [ 34, 41 ], "examples-sql-script/with_clause_in_exists_block_in_procedure.sql" : [ 17 ], "examples/forall_statement_and_exception_handling.sql" : [ 33, 53 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/CursorBodyInPackageSpecCheck.json ================================================ { "examples-sql-script/package_with_cursor.sql" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/DbmsOutputPutCheck.json ================================================ { "examples-sql-script/anonymous_block.sql" : [ 4, 7 ], "examples-sql-script/green_tools.pkb" : [ 7, 23, 25 ], "examples-sql-script/package_with_cursor.sql" : [ 19, 23 ], "examples/block01.sql" : [ 21, 26, 30 ], "examples/block02.sql" : [ 5 ], "examples/collection_method_invocation.sql" : [ 7, 8, 9, 13 ], "examples/concatenation-double_asterisk.sql" : [ 21 ], "examples/concatenation-mod.sql" : [ 21 ], "examples/create_package04.sql" : [ 10, 13 ], "examples/create_procedure03.sql" : [ 4, 13 ], "examples/fetch_statement.sql" : [ 40, 50 ], "examples/forall_bulk_rowcount.sql" : [ 9, 12 ], "examples/forall_statement_and_exception_handling.sql" : [ 46, 49, 56 ], "examples/general_element_part.sql" : [ 33 ], "examples/varray_type_def.sql" : [ 30 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/DeclareSectionWithoutDeclarationsCheck.json ================================================ { "examples/block01.sql" : [ 24 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/EmptyBlockCheck.json ================================================ { "examples-sql-script/declare_procedure_no_args.sql" : [ 5 ], "examples-sql-script/package_body_null.pkb" : [ 3 ], "examples-sql-script/package_with_schema.pkb" : [ 6 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/ExplicitInParameterCheck.json ================================================ { "examples-sql-script/delete_as_regular_id.pkb" : [ 3 ], "examples-sql-script/in_out_parameters.pks" : [ 4 ], "examples-sql-script/pipe_row.pkb" : [ 16 ], "examples-sql-script/proc_over_dblink_as_nvl_param.pkb" : [ 3 ], "examples-sql-script/procedure_with_cursor_and_limit.sql" : [ 1, 1 ], "examples-sql-script/with_clause_in_exists_block_in_procedure.sql" : [ 1 ], "examples/create_function04.sql" : [ 3 ], "examples/create_function06.sql" : [ 5 ], "examples/create_package01.sql" : [ 4 ], "examples/create_procedure01.sql" : [ 1 ], "examples/package_body.sql" : [ 4 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/IdenticalExpressionCheck.json ================================================ { "examples/condition02.sql" : [ 4 ], "examples/condition03.sql" : [ 4 ], "examples/condition09.sql" : [ 9 ], "examples/condition10.sql" : [ 4 ], "examples/quntitative_expression.sql" : [ 2, 3 ], "examples/union07.sql" : [ 23, 37 ], "examples/union09.sql" : [ 13, 19 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/IfWithExitCheck.json ================================================ { "examples-sql-script/cursor-attributes-with-spaces.sql" : [ 22 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/InequalityUsageCheck.json ================================================ { "examples/bindvar03.sql" : [ 15 ], "examples/connect_by03.sql" : [ 4 ], "examples/groupby01.sql" : [ 7 ], "examples/groupby02.sql" : [ 7 ], "examples/lexer01.sql" : [ 1, 1 ], "hw-examples/lexer01.sql" : [ 1, 1 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/InsertWithoutColumnsCheck.json ================================================ { "examples/values_clause.sql" : [ 27 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/ParsingErrorCheck.json ================================================ { "examples-sql-script/e_in_out_parameters.pks" : [ 4 ], "examples-sql-script/grants.sql" : [ 5 ], "examples-sql-script/logical_expressions.sql" : [ 13 ], "examples-sql-script/user.sql" : [ 1 ], "examples/administer_key_management.sql" : [ 1 ], "examples/aggregate_functions.sql" : [ 1 ], "examples/alter_analytic_view.sql" : [ 1 ], "examples/alter_attribute_dimension.sql" : [ 1 ], "examples/alter_audit_policy.sql" : [ 1 ], "examples/alter_database.sql" : [ 1 ], "examples/alter_dimension.sql" : [ 1 ], "examples/alter_diskgroup.sql" : [ 1 ], "examples/alter_flashback_archive.sql" : [ 1 ], "examples/alter_hierarchy.sql" : [ 1 ], "examples/alter_inmemory_join_group.sql" : [ 1 ], "examples/alter_java.sql" : [ 1 ], "examples/alter_library.sql" : [ 1 ], "examples/alter_lockdown_profile.sql" : [ 1 ], "examples/alter_materialized_zonemap.sql" : [ 1 ], "examples/alter_mv.sql" : [ 1 ], "examples/alter_mv_log.sql" : [ 1 ], "examples/alter_operator.sql" : [ 1 ], "examples/alter_outline.sql" : [ 1 ], "examples/alter_pmem_filestore.sql" : [ 1 ], "examples/alter_resource_cost.sql" : [ 1 ], "examples/alter_role.sql" : [ 1 ], "examples/alter_rollback_segment.sql" : [ 1 ], "examples/alter_synonym01.sql" : [ 1 ], "examples/alter_table.sql" : [ 35 ], "examples/alter_table_inmemory.sql" : [ 2 ], "examples/alter_table_modify_partition_by_range.sql" : [ 2 ], "examples/alter_table_modify_partition_shrink.sql" : [ 1 ], "examples/alter_tablespace_set.sql" : [ 1 ], "examples/alter_tablespaces.sql" : [ 1 ], "examples/alter_view.sql" : [ 1 ], "examples/analytic_query.sql" : [ 2 ], "examples/analyze.sql" : [ 1 ], "examples/associate_statistics.sql" : [ 1 ], "examples/audit.sql" : [ 1 ], "examples/bindvar04.sql" : [ 6 ], "examples/call.sql" : [ 1 ], "examples/cluster.sql" : [ 1 ], "examples/columns01.sql" : [ 6 ], "examples/commit.sql" : [ 4 ], "examples/context.sql" : [ 1 ], "examples/create_analytic_view.sql" : [ 1 ], "examples/create_attribute_dimension.sql" : [ 1 ], "examples/create_audit_policy.sql" : [ 1 ], "examples/create_controlfile.sql" : [ 1 ], "examples/create_database.sql" : [ 1 ], "examples/create_dimension.sql" : [ 1 ], "examples/create_diskgroup.sql" : [ 1 ], "examples/create_edition.sql" : [ 1 ], "examples/create_flashback_archive.sql" : [ 1 ], "examples/create_function03.sql" : [ 1 ], "examples/create_hierarchy.sql" : [ 1 ], "examples/create_index.sql" : [ 1 ], "examples/create_inmemory_join_group.sql" : [ 1 ], "examples/create_java.sql" : [ 1 ], "examples/create_library.sql" : [ 1 ], "examples/create_lockdown_profile.sql" : [ 1 ], "examples/create_materialized_zonemap.sql" : [ 1 ], "examples/create_operator.sql" : [ 1 ], "examples/create_outline.sql" : [ 1 ], "examples/create_package02.sql" : [ 12 ], "examples/create_package03.sql" : [ 8 ], "examples/create_package05.sql" : [ 19 ], "examples/create_pmem_filestore.sql" : [ 1 ], "examples/create_procedure02.sql" : [ 2 ], "examples/create_profile.sql" : [ 1 ], "examples/create_restore_point.sql" : [ 1 ], "examples/create_role.sql" : [ 1 ], "examples/create_rollback_segment.sql" : [ 1 ], "examples/create_spfile.sql" : [ 1 ], "examples/create_table.sql" : [ 14 ], "examples/create_tablespace.sql" : [ 1 ], "examples/create_tablespace_set.sql" : [ 1 ], "examples/create_trigger01.sql" : [ 7 ], "examples/create_trigger02.sql" : [ 2 ], "examples/create_view.sql" : [ 16 ], "examples/ctas.sql" : [ 1 ], "examples/dblink.sql" : [ 1 ], "examples/disassociate_statistics.sql" : [ 1 ], "examples/explain01.sql" : [ 1 ], "examples/fetch_clause01.sql" : [ 3 ], "examples/fetch_clause02.sql" : [ 3 ], "examples/fetch_clause04.sql" : [ 2 ], "examples/flashback01.sql" : [ 1 ], "examples/flashback_table.sql" : [ 1 ], "examples/forall_indices_of.sql" : [ 12 ], "examples/function03.sql" : [ 1 ], "examples/function06.sql" : [ 1 ], "examples/function07.sql" : [ 1 ], "examples/index.sql" : [ 1 ], "examples/interval01.sql" : [ 1 ], "examples/interval03.sql" : [ 16 ], "examples/join17.sql" : [ 4 ], "examples/join23.sql" : [ 3 ], "examples/json_sql.sql" : [ 4 ], "examples/materialized_views.sql" : [ 1 ], "examples/max_001.sql" : [ 4 ], "examples/model_clause01.sql" : [ 5 ], "examples/model_clause02.sql" : [ 7 ], "examples/model_clause03.sql" : [ 5 ], "examples/model_clause04.sql" : [ 7 ], "examples/model_clause05.sql" : [ 7 ], "examples/noaudit_statement.sql" : [ 1 ], "examples/offset_clause.sql" : [ 3 ], "examples/order_by04.sql" : [ 1 ], "examples/partitioned_tables.sql" : [ 32 ], "examples/purge_statement.sql" : [ 1 ], "examples/rename_objects.sql" : [ 2 ], "examples/revoke_statement.sql" : [ 1 ], "examples/sample01.sql" : [ 3 ], "examples/select_analytic_view.sql" : [ 2 ], "examples/select_cte.sql" : [ 6 ], "examples/select_dense_rank.sql" : [ 2 ], "examples/select_flashback_query.sql" : [ 2 ], "examples/select_time.sql" : [ 1 ], "examples/simple13.sql" : [ 1 ], "examples/single_statement.sql" : [ 1 ], "examples/truncate_cluster.sql" : [ 1 ], "examples/unified.sql" : [ 1 ], "examples/validate_conversion.sql" : [ 3 ], "examples/views.sql" : [ 6 ], "hw-examples/alter_operator.sql" : [ 1 ], "hw-examples/alter_outline.sql" : [ 1 ], "long-running/order_by07.sql" : [ 2 ], "long-running/query_factoring07.sql" : [ 61 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/QueryWithoutExceptionHandlingCheck.json ================================================ { "examples-sql-script/select_into.sql" : [ 9, 13, 17 ], "examples/insert_statement.sql" : [ 4 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/SelectAllColumnsCheck.json ================================================ { "examples-sql-script/green_table.sql" : [ 26 ], "examples-sql-script/package_with_cursor.sql" : [ 4 ], "examples-sql-script/with_clause_in_exists_block_in_procedure.sql" : [ 6 ], "examples/bindvar02.sql" : [ 1 ], "examples/cast_multiset01.sql" : [ 1 ], "examples/cast_multiset05.sql" : [ 1 ], "examples/cast_multiset08.sql" : [ 1 ], "examples/comments.sql" : [ 2 ], "examples/condition02.sql" : [ 1 ], "examples/condition03.sql" : [ 1 ], "examples/condition04.sql" : [ 1 ], "examples/condition05.sql" : [ 1 ], "examples/condition06.sql" : [ 1 ], "examples/condition07.sql" : [ 1 ], "examples/condition08.sql" : [ 1 ], "examples/condition12.sql" : [ 1 ], "examples/condition14.sql" : [ 1 ], "examples/condition16.sql" : [ 1 ], "examples/dblink01.sql" : [ 5, 7 ], "examples/for_update01.sql" : [ 1 ], "examples/groupby03.sql" : [ 1 ], "examples/groupby04.sql" : [ 1 ], "examples/groupby05.sql" : [ 1 ], "examples/join06.sql" : [ 1 ], "examples/join07.sql" : [ 1 ], "examples/join08.sql" : [ 1, 2, 3, 4, 5, 6, 7 ], "examples/join09.sql" : [ 1, 2, 3, 4, 5, 6, 7 ], "examples/join10.sql" : [ 1, 3 ], "examples/join11.sql" : [ 1 ], "examples/join12.sql" : [ 1 ], "examples/join13.sql" : [ 1 ], "examples/join14.sql" : [ 1 ], "examples/join15.sql" : [ 1 ], "examples/join16.sql" : [ 1 ], "examples/join19.sql" : [ 1, 1 ], "examples/join20.sql" : [ 1, 1 ], "examples/join21.sql" : [ 1 ], "examples/join22.sql" : [ 1, 3 ], "examples/keywordasidentifier06.sql" : [ 1 ], "examples/lexer01.sql" : [ 1 ], "examples/merge01.sql" : [ 2 ], "examples/merge02.sql" : [ 2 ], "examples/order_by01.sql" : [ 1 ], "examples/order_by02.sql" : [ 1 ], "examples/order_by03.sql" : [ 1 ], "examples/order_by05.sql" : [ 1 ], "examples/order_by06.sql" : [ 1, 1 ], "examples/pivot01.sql" : [ 1 ], "examples/pivot02.sql" : [ 1 ], "examples/pivot03.sql" : [ 1 ], "examples/pivot05.sql" : [ 1 ], "examples/pivot06.sql" : [ 1 ], "examples/pivot07.sql" : [ 1 ], "examples/pivot08.sql" : [ 1 ], "examples/pivot09.sql" : [ 1 ], "examples/pivot10.sql" : [ 1 ], "examples/pivot11.sql" : [ 1 ], "examples/pivot13.sql" : [ 8 ], "examples/query_factoring05.sql" : [ 15 ], "examples/query_factoring06.sql" : [ 10 ], "examples/query_factoring08.sql" : [ 2, 3, 5 ], "examples/select_all_some_any.sql" : [ 2, 3, 4 ], "examples/simple04.sql" : [ 1, 4 ], "examples/simple05.sql" : [ 1, 3 ], "examples/simple06.sql" : [ 1, 1 ], "examples/simple07.sql" : [ 1 ], "examples/simple11.sql" : [ 1 ], "examples/simple12.sql" : [ 4 ], "examples/union05.sql" : [ 1, 4, 8, 12, 16, 20, 24, 28 ], "examples/union07.sql" : [ 5, 6, 8, 11 ], "examples/union08.sql" : [ 1 ], "examples/union09.sql" : [ 1, 2, 4, 7 ], "hw-examples/lexer01.sql" : [ 1 ], "hw-examples/simple11.sql" : [ 1 ], "long-running/aggregate01.sql" : [ 11 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/ToDateWithoutFormatCheck.json ================================================ { "examples/to_date.sql" : [ 1, 7, 10, 13, 16, 19 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/UnnecessaryAliasInQueryCheck.json ================================================ { "examples-sql-script/procedure_with_cursor_and_limit.sql" : [ 16, 17 ], "examples/bindvar03.sql" : [ 5, 13 ], "examples/bindvar05.sql" : [ 5, 5 ], "examples/case_when07.sql" : [ 6 ], "examples/case_when08.sql" : [ 3 ], "examples/cast_multiset01.sql" : [ 2, 4 ], "examples/condition02.sql" : [ 2 ], "examples/condition03.sql" : [ 2 ], "examples/condition09.sql" : [ 4, 5, 6 ], "examples/condition10.sql" : [ 2 ], "examples/condition16.sql" : [ 1 ], "examples/for_update08.sql" : [ 2 ], "examples/join01.sql" : [ 2, 2 ], "examples/join02.sql" : [ 2, 2 ], "examples/join03.sql" : [ 2, 2 ], "examples/join04.sql" : [ 2, 2 ], "examples/join22.sql" : [ 2, 3 ], "examples/keywordasidentifier03.sql" : [ 14, 14, 22 ], "examples/keywordasidentifier04.sql" : [ 2, 5 ], "examples/multiset_operators.sql" : [ 3 ], "examples/object_access_expressions.sql" : [ 9 ], "examples/pivot02.sql" : [ 3 ], "examples/pivot03.sql" : [ 3 ], "examples/query_factoring01.sql" : [ 9, 9, 13, 13 ], "examples/query_factoring02.sql" : [ 12, 12 ], "examples/query_factoring03.sql" : [ 9, 9 ], "examples/query_factoring04.sql" : [ 10, 10 ], "examples/query_factoring06.sql" : [ 4, 4 ], "examples/select_all_some_any.sql" : [ 6 ], "examples/to_date.sql" : [ 9 ], "examples/union07.sql" : [ 21, 36 ], "examples/xmltable03.sql" : [ 6 ], "long-running/aggregate01.sql" : [ 34 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/UnnecessaryLikeCheck.json ================================================ { "examples/condition06.sql" : [ 13, 13 ], "examples/query_factoring05.sql" : [ 22 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/UnusedParameterCheck.json ================================================ { "examples-sql-script/substr_as_regular_id.pkb" : [ 3 ], "examples-sql-script/with_clause_in_exists_block_in_procedure.sql" : [ 1 ], "examples/create_function04.sql" : [ 3 ], "examples/create_function05.sql" : [ 2, 3, 4 ], "examples/create_procedure01.sql" : [ 1 ], "examples/package_body.sql" : [ 4 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/UnusedVariableCheck.json ================================================ { "examples-sql-script/anonymous_block.sql" : [ 2 ], "examples-sql-script/cursor-attributes-with-spaces.sql" : [ 15 ], "examples-sql-script/declare_procedure_no_args.sql" : [ 3 ], "examples-sql-script/proc_over_dblink_as_nvl_param.pkb" : [ 6 ], "examples/bulk_collect_fetch_clause01.sql" : [ 4 ], "examples/create_procedure01.sql" : [ 4 ], "examples/package_body.sql" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/antlr-grammars-v4/UselessParenthesisCheck.json ================================================ { "examples/condition06.sql" : [ 13 ], "examples/condition08.sql" : [ 5 ], "examples/condition15.sql" : [ 10 ], "long-running/cast_multiset07.sql" : [ 10 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/CommitRollbackCheck.json ================================================ { "UPLOAD_DB.pcd" : [ 22 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/DeclareSectionWithoutDeclarationsCheck.json ================================================ { "WEBUTIL_DEMO/PRE-FORM.tgg" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/EmptyStringAssignmentCheck.json ================================================ { "FILES_WBP.pcd" : [ 65 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/ExplicitInParameterCheck.json ================================================ { "SET_BROWSER_MESSAGE.pcd" : [ 1 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/InvalidReferenceToObjectCheck.json ================================================ { "BUILTINS/BUILTINS__READ_IMAGE__WHEN-BUTTON-PRESSED.tgg" : [ 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/QueryWithoutExceptionHandlingCheck.json ================================================ { "F_GET_TIMER_VALUE.fun" : [ 6 ], "WEBUTIL_DEMO/WHEN-NEW-FORM-INSTANCE.tgg" : [ 20 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/UnnecessaryElseCheck.json ================================================ { "WEBUTIL_DEMO/PRE-FORM.tgg" : [ 26 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/UnusedVariableCheck.json ================================================ { "DOWNLOAD_AS.pcd" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/VariableInitializationWithFunctionCallCheck.json ================================================ { "C_API/C_API__CALL_C_API__WHEN-BUTTON-PRESSED.tgg" : [ 9 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0001/VariableInitializationWithNullCheck.json ================================================ { "HOST/HOST__RUN_HOST__WHEN-BUTTON-PRESSED.tgg" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0002/EmptyBlockCheck.json ================================================ { "BL_EMPLOYEES.pkb" : [ 13, 18, 23, 28, 33, 38, 43, 48 ], "BL_MAINBLOCK.pkb" : [ 5, 10, 15, 20, 25, 30, 35, 40, 45 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0002/VariableInitializationWithFunctionCallCheck.json ================================================ { "CONST_LOCAL.pks" : [ 12, 13, 14, 17 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0002_2/EmptyBlockCheck.json ================================================ { "WNB.pcd" : [ 3 ], "WNF.pcd" : [ 3 ], "WNI.pcd" : [ 3 ], "WNR.pcd" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0003/EmptyBlockCheck.json ================================================ { "BL_MAINBLOCK.pkb" : [ 5, 10, 15, 20, 25, 30, 35, 40, 45 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0003/InequalityUsageCheck.json ================================================ { "EMPLOYEES_LI/EMPLOYEES_LI__PRE-QUERY.tgg" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0003/VariableInitializationWithFunctionCallCheck.json ================================================ { "CONST_LOCAL.pks" : [ 12, 13, 14, 15, 18 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0004/ExplicitInParameterCheck.json ================================================ { "ERRORMESSAGE.pcd" : [ 1 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0004/InequalityUsageCheck.json ================================================ { "RELEASE_LOCKS/POST-FORM.tgg" : [ 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0004/RaiseStandardExceptionCheck.json ================================================ { "V$LOCK/V$LOCK__POST-QUERY.tgg" : [ 51 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0004/ReturnOfBooleanExpressionCheck.json ================================================ { "IS_DBA.fun" : [ 11 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0004/UnnecessaryElseCheck.json ================================================ { "IS_DBA.fun" : [ 13 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0004/UnusedVariableCheck.json ================================================ { "V$SESSION/V$SESSION__PB_KILL_SESSION__WHEN-BUTTON-PRESSED.tgg" : [ 3, 4 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0004/VariableInitializationWithFunctionCallCheck.json ================================================ { "RELEASE_LOCKS/POST-FORM.tgg" : [ 3 ], "STEUERBLOCK/STEUERBLOCK__PB_CONNECT__WHEN-BUTTON-PRESSED.tgg" : [ 3, 4, 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0005/EmptyBlockCheck.json ================================================ { "TIMEOUTPJC_TEST/ON-LOGON.tgg" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0005/EmptyStringAssignmentCheck.json ================================================ { "TEST/TEST__PRESET1__WHEN-BUTTON-PRESSED.tgg" : [ 7 ], "TEST/TEST__PRESET2__WHEN-BUTTON-PRESSED.tgg" : [ 7 ], "TEST/TEST__PRESET3__WHEN-BUTTON-PRESSED.tgg" : [ 8 ], "TEST/TEST__PRESET4__WHEN-BUTTON-PRESSED.tgg" : [ 8 ], "TEST/TEST__PRESET5__WHEN-BUTTON-PRESSED.tgg" : [ 8 ], "TEST/TEST__PRESET6__WHEN-BUTTON-PRESSED.tgg" : [ 8 ], "TEST/TEST__PRESET7__WHEN-BUTTON-PRESSED.tgg" : [ 8 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0005/InvalidReferenceToObjectCheck.json ================================================ { "TIMEOUTPJC_TEST/WHEN-NEW-FORM-INSTANCE.tgg" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0006/QueryWithoutExceptionHandlingCheck.json ================================================ { "F_GET_TIMER_VALUE.fun" : [ 6 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0007/InequalityUsageCheck.json ================================================ { "ALL_OBJECTS/ALL_OBJECTS__CALL_EXCEL__WHEN-BUTTON-PRESSED.tgg" : [ 10 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0008/EmptyBlockCheck.json ================================================ { "LATENCY_TEST/ON-LOGON.tgg" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0008/InvalidReferenceToObjectCheck.json ================================================ { "P_WHEN_NEW_FORM_INSTANCE.pcd" : [ 13, 14, 15, 30, 50, 70, 90 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0008/UnusedVariableCheck.json ================================================ { "LATENCY_TEST/WHEN-TIMER-EXPIRED.tgg" : [ 18 ], "P_DOWNLOAD_DOKUMENT_AS.pcd" : [ 3, 7, 9 ], "WEBUTIL_PREPARE_TESTFILE.pcd" : [ 21, 22 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/CharacterDatatypeUsageCheck.json ================================================ { "G.pkb" : [ 47, 62 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/CollapsibleIfStatementsCheck.json ================================================ { "BLK_HANDLG/BLK_HANDLG__BT_COMPILE_SINGLE__WHEN-BUTTON-PRESSED.tgg" : [ 22, 28, 34, 40, 46, 52, 58 ], "PKG_BLK_DATA.pkb" : [ 221 ], "PRC_CHECK_FAM.pcd" : [ 98 ], "PRC_COMPILATION.pcd" : [ 6, 11, 16, 21, 26, 31, 36 ], "PRC_MIGRATION.pcd" : [ 8, 13, 19, 24, 29 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/DeadCodeCheck.json ================================================ { "PKG_CONFIG.pkb" : [ 500 ], "PRC_CHECK_FAM.pcd" : [ 91, 131 ], "PRC_GET_CHK_REF_INFO.pcd" : [ 32, 59 ], "PRC_SET_MIGRATE_RESULT.pcd" : [ 29, 57 ], "PRC_SET_STATISTIK.pcd" : [ 52, 95, 134, 161 ], "PRC_SET_STATISTIK_SINGLE.pcd" : [ 51, 94, 132, 158 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/DeclareSectionWithoutDeclarationsCheck.json ================================================ { "FORMSAPI_WIZARD_2905/ON-LOGON.tgg" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/EmptyBlockCheck.json ================================================ { "BLK_HANDLG/BLK_HANDLG__CBOX_FAM_ACTION__WHEN-LIST-CHANGED.tgg" : [ 37 ], "BLK_HANDLG/BLK_HANDLG__CB__WHEN-CHECKBOX-CHANGED.tgg" : [ 18 ], "FORMSAPI_WIZARD_2905/MODULE_FEATURES.tgg" : [ 8 ], "FORMSAPI_WIZARD_2905/ON-LOGON.tgg" : [ 9 ], "PKG_BLK_DATA.pkb" : [ 58 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/EmptyStringAssignmentCheck.json ================================================ { "PKG_CONFIG.pkb" : [ 457 ], "PRC_CHECK_FAM.pcd" : [ 71, 111 ], "PRC_GET_CHK_REF_INFO.pcd" : [ 7 ], "PRC_SET_MIGRATE_RESULT.pcd" : [ 9, 37 ], "PRC_SET_STATISTIK.pcd" : [ 13, 109 ], "PRC_SET_STATISTIK_SINGLE.pcd" : [ 13, 108 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/ExplicitInParameterCheck.json ================================================ { "FNC_FILE_EXISTS_HOST.fun" : [ 1 ], "G.pkb" : [ 22 ], "G.pks" : [ 24 ], "PKG_BLK_DATA.pkb" : [ 10, 11, 12, 13, 14, 15, 16, 17, 26, 26, 63, 97, 97, 97, 97, 97, 97, 97, 98, 128, 128, 158, 158, 158, 239 ], "PKG_BLK_DATA.pks" : [ 48, 48, 48, 50 ], "PKG_CONFIG.pkb" : [ 85, 86, 87, 88, 89, 90, 91, 92, 130, 130, 183, 294, 294, 309, 309, 326, 326, 341, 341, 360 ], "PKG_CONFIG.pks" : [ 11, 13, 15, 15, 17, 17, 19, 19, 21, 21 ], "PKG_FAM_RUN_SCRIPT.pkb" : [ 76, 77, 78, 79, 80, 81, 82, 83, 91, 91, 120, 154, 154, 154, 201, 201, 201, 250, 295, 347, 386 ], "PKG_FAM_RUN_SCRIPT.pks" : [ 6, 8, 8, 8, 10, 10, 10, 12, 14, 16, 18, 20, 20 ], "PRC_CMD_HOST_CLIENT.pcd" : [ 4, 4 ], "PRC_COPY_FILE.pcd" : [ 1, 1 ], "PRC_COPY_FILE_HOST.pcd" : [ 1, 1 ], "PRC_ERROR.pcd" : [ 1 ], "PRC_EXCEPTION.pcd" : [ 1, 1 ], "PRC_FILE_MERGE.pcd" : [ 1, 1, 1, 1 ], "PRC_FILE_MERGE_HOST.pcd" : [ 1, 1, 1, 1 ], "PRC_FLOG.pcd" : [ 1, 2, 3, 4, 5, 6, 7, 8 ], "PRC_GET_CHK_REF_INFO.pcd" : [ 1 ], "PRC_INFO.pcd" : [ 1 ], "PRC_MSG.pcd" : [ 7, 8, 9, 10, 11, 12, 13, 14, 15, 32 ], "PRC_SET_COMPILE_RESULT.pcd" : [ 1 ], "PRC_SET_MIGRATE_RESULT.pcd" : [ 1 ], "PRC_SET_STATISTIK.pcd" : [ 5, 5, 103 ], "PRC_SET_STATISTIK_SINGLE.pcd" : [ 5, 5, 102 ], "PRC_SHOW_DURATION.pcd" : [ 3, 3 ], "PRC_SHOW_INIT.pcd" : [ 1, 1, 1 ], "PRC_VIEW_FILE.pcd" : [ 1, 10 ], "PRC_WRITE_SCRIPT.pcd" : [ 2, 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/IfWithExitCheck.json ================================================ { "BLK_HANDLG/BLK_HANDLG__BT_SELECT__WHEN-BUTTON-PRESSED.tgg" : [ 27 ], "CTL_BASIC/CTL_BASIC__BT_ALL__WHEN-BUTTON-PRESSED.tgg" : [ 63, 98 ], "CTL_BASIC/CTL_BASIC__BT_COMPILE__WHEN-BUTTON-PRESSED.tgg" : [ 23 ], "CTL_BASIC/CTL_BASIC__BT_MIGRATE__WHEN-BUTTON-PRESSED.tgg" : [ 19 ], "PRC_SET_STATISTIK.pcd" : [ 236 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/SameBranchCheck.json ================================================ { "PRC_SET_COMPILE_RESULT.pcd" : [ 14, 16, 18, 29, 31, 33 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/UnnecessaryElseCheck.json ================================================ { "FNC_GET_FILE_SEPARATOR.fun" : [ 5 ], "PKG_CONFIG.pkb" : [ 428, 448 ], "PRC_GET_CHK_REF_INFO.pcd" : [ 20, 47 ], "PRC_VIEW_FILE.pcd" : [ 74 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/UnusedParameterCheck.json ================================================ { "PKG_BLK_DATA.pkb" : [ 97, 97, 97, 98, 158, 158 ], "PRC_MSG.pcd" : [ 13 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/UnusedVariableCheck.json ================================================ { "BLK_HANDLG/BLK_HANDLG__BT_COMPILE_SINGLE__WHEN-BUTTON-PRESSED.tgg" : [ 5, 6 ], "BLK_HANDLG/BLK_HANDLG__BT_VIEW_COMPILE__WHEN-BUTTON-PRESSED.tgg" : [ 7 ], "BLK_HANDLG/BLK_HANDLG__CBOX_FAM_ACTION__WHEN-LIST-CHANGED.tgg" : [ 5, 6, 7, 8, 9, 10, 11, 12 ], "CTL_BASIC/CTL_BASIC__BT_ALL__WHEN-BUTTON-PRESSED.tgg" : [ 9, 86 ], "CTL_BASIC/CTL_BASIC__BT_COMPILE__WHEN-BUTTON-PRESSED.tgg" : [ 7 ], "G.pkb" : [ 20 ], "PKG_BLK_DATA.pkb" : [ 129, 161, 162, 166, 168 ], "PKG_CONFIG.pkb" : [ 369, 371, 377 ], "PRC_COMPILATION.pcd" : [ 43 ], "PRC_COPY_FILE_HOST.pcd" : [ 2 ], "PRC_MIGRATION.pcd" : [ 36 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/VariableHidingCheck.json ================================================ { "CTL_BASIC/CTL_BASIC__BT_ALL__WHEN-BUTTON-PRESSED.tgg" : [ 86 ], "PKG_CONFIG.pkb" : [ 410 ], "PRC_MSG.pcd" : [ 33 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0009/VariableInitializationWithNullCheck.json ================================================ { "G.pks" : [ 7, 15 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0010/EmptyBlockCheck.json ================================================ { "CHK_MYFFI_SAMPLE5/ON-LOGON.tgg" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0010/ExplicitInParameterCheck.json ================================================ { "FNC_BOOL.fun" : [ 1 ], "PRC_SHOW.pcd" : [ 1 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0010/UnnecessaryElseCheck.json ================================================ { "FNC_BOOL.fun" : [ 4 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0010/UnusedVariableCheck.json ================================================ { "BLK/BLK__PB_WEB_FFI__WHEN-BUTTON-PRESSED.tgg" : [ 12 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0010/VariableInitializationWithFunctionCallCheck.json ================================================ { "BLK/BLK__PB_WEB_FFI__WHEN-BUTTON-PRESSED.tgg" : [ 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0011/CommitRollbackCheck.json ================================================ { "UPLOAD_DB.pcd" : [ 22 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0011/EmptyStringAssignmentCheck.json ================================================ { "FILES_WBP.pcd" : [ 65 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0011/ExplicitInParameterCheck.json ================================================ { "SET_BROWSER_MESSAGE.pcd" : [ 1 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0011/InvalidReferenceToObjectCheck.json ================================================ { "BUILTINS/BUILTINS__READ_IMAGE__WHEN-BUTTON-PRESSED.tgg" : [ 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0011/QueryWithoutExceptionHandlingCheck.json ================================================ { "WEBUTIL_DEMO/WHEN-NEW-FORM-INSTANCE.tgg" : [ 20 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0011/SameBranchCheck.json ================================================ { "WEBUTIL_DEMO/KEY-EXIT.tgg" : [ 21 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0011/UnnecessaryElseCheck.json ================================================ { "OLE/OLE__WRITE__WHEN-BUTTON-PRESSED.tgg" : [ 10 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0011/VariableInitializationWithFunctionCallCheck.json ================================================ { "C_API/C_API__CALL_C_API__WHEN-BUTTON-PRESSED.tgg" : [ 9 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0011/VariableInitializationWithNullCheck.json ================================================ { "HOST/HOST__RUN_HOST__WHEN-BUTTON-PRESSED.tgg" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0012/EmptyBlockCheck.json ================================================ { "PDFVIEWER/ON-LOGON.tgg" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0012/VariableInitializationWithFunctionCallCheck.json ================================================ { "PDFVIEWER/WHEN-NEW-FORM-INSTANCE.tgg" : [ 3 ], "PDFVIEWER/WHEN-TIMER-EXPIRED.tgg" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0013/EmptyBlockCheck.json ================================================ { "COLOR_SLIDER/ON-LOGON.tgg" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0013/VariableInitializationWithFunctionCallCheck.json ================================================ { "PKG_SLIDER.pkb" : [ 11, 12, 13, 14 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0013/VariableInitializationWithNullCheck.json ================================================ { "PKG_SLIDER.pks" : [ 14 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0013/VariableNameCheck.json ================================================ { "PKG_SLIDER.pkb" : [ 11, 12, 13, 14, 15 ], "PKG_SLIDER.pks" : [ 4, 5, 6, 7, 8, 9, 10, 11, 14 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0014/SameBranchCheck.json ================================================ { "PK_TREE.pkb" : [ 75 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0014/VariableInitializationWithFunctionCallCheck.json ================================================ { "PK_TREE.pkb" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0016/DeclareSectionWithoutDeclarationsCheck.json ================================================ { "C/C__CBOX__KEY-NEXT-ITEM.tgg" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0016/EmptyBlockCheck.json ================================================ { "CBX/CBX__ON-ERROR.tgg" : [ 5 ], "PKG_CBOX.pkb" : [ 138 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0016/ExplicitInParameterCheck.json ================================================ { "PKG_CBOX.pkb" : [ 14, 23, 23, 48 ], "PKG_CBOX.pks" : [ 3, 4, 4, 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0016/InvalidReferenceToObjectCheck.json ================================================ { "C/C__CBOX__KEY-NEXT-ITEM.tgg" : [ 12 ], "CHK_CBOX3/WHEN-TIMER-EXPIRED.tgg" : [ 2 ], "PKG_CBOX.pkb" : [ 65 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0016/UnusedVariableCheck.json ================================================ { "PKG_CBOX.pkb" : [ 27, 28, 53, 54 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0016/VariableInitializationWithFunctionCallCheck.json ================================================ { "PKG_CBOX.pkb" : [ 26 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0017/CharacterDatatypeUsageCheck.json ================================================ { "V#R#FY_PW$001.fun" : [ 33, 35 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0017/CollapsibleIfStatementsCheck.json ================================================ { "V#R#FY_PW$001.fun" : [ 67 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0017/DuplicatedValueInInCheck.json ================================================ { "V#R#FY_PW$001.fun" : [ 61, 61, 61 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0017/ExplicitInParameterCheck.json ================================================ { "FNC_MSG_QUERY.fun" : [ 1 ], "FNC_VALIDATE.fun" : [ 1 ], "PKG_ITEM.pkb" : [ 8, 16, 28, 28, 37, 171, 171, 171, 171, 217, 217, 217, 217, 217, 218, 218, 218 ], "PKG_ITEM.pks" : [ 36, 36, 36, 36, 38, 38, 38, 38, 38, 39, 39, 39 ], "PRC_INFO.pcd" : [ 1 ], "V#R#FY_PW$001.fun" : [ 2, 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0017/InvalidReferenceToObjectCheck.json ================================================ { "POC_ACCOUNT/WHEN-NEW-FORM-INSTANCE.tgg" : [ 40 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0017/UnnecessaryElseCheck.json ================================================ { "FNC_VALIDATE.fun" : [ 12, 23, 31 ], "PKG_ITEM.pkb" : [ 32 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0017/UnusedParameterCheck.json ================================================ { "PKG_ITEM.pkb" : [ 16 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0017/UnusedVariableCheck.json ================================================ { "PKG_ITEM.pkb" : [ 17 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/demo0018/InvalidReferenceToObjectCheck.json ================================================ { "TEST/TEST__BUTTON1__WHEN-BUTTON-PRESSED.tgg" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/AddParenthesesInNestedExpressionCheck.json ================================================ { "lnpls/dml-triggers-36.sql" : [ 10 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/CharacterDatatypeUsageCheck.json ================================================ { "adjsn/sql-json-function-json_object-19.sql" : [ 5 ], "adjsn/sql-json-function-json_table-3.sql" : [ 12 ], "lnpls/CREATE-TYPE-statement-15.sql" : [ 4, 8 ], "lnpls/CREATE-TYPE-statement-9.sql" : [ 7 ], "lnpls/conditional-selection-statements-16.sql" : [ 3 ], "lnpls/conditional-selection-statements-19.sql" : [ 3 ], "lnpls/conditional-selection-statements-24.sql" : [ 3 ], "lnpls/conditional-selection-statements-26.sql" : [ 3 ], "lnpls/declarations-11.sql" : [ 3 ], "lnpls/dml-triggers-44.sql" : [ 6 ], "lnpls/dml-triggers-45.sql" : [ 8 ], "lnpls/expressions-48.sql" : [ 3 ], "lnpls/expressions-50.sql" : [ 3 ], "lnpls/expressions-57.sql" : [ 3 ], "lnpls/expressions-59.sql" : [ 3 ], "lnpls/invokers-rights-and-definers-rights-authid-property-3.sql" : [ 4 ], "lnpls/pl-sql-function-result-cache-10.sql" : [ 3 ], "lnpls/pl-sql-function-result-cache-13.sql" : [ 3, 4, 5, 9 ], "lnpls/pl-sql-function-result-cache-9.sql" : [ 2, 3 ], "lnpls/scope-and-visibility-identifiers-0.sql" : [ 3 ], "lnpls/sequential-control-statements-2.sql" : [ 3 ], "lnpls/sql-data-types-48.sql" : [ 3 ], "lnpls/sql-data-types-52.sql" : [ 3 ], "lnpls/user-defined-pl-sql-subtypes-9.sql" : [ 3 ], "sqlrf/CAST-7.sql" : [ 12 ], "sqlrf/CREATE-TABLE-42.sql" : [ 6 ], "sqlrf/CREATE-TABLE-57.sql" : [ 6 ], "sqlrf/Concatenation-Operator-1.sql" : [ 2, 3 ], "sqlrf/Pattern-matching-Conditions-10.sql" : [ 2 ], "sqlrf/constraint-3.sql" : [ 8 ], "sqlrf/constraint-4.sql" : [ 8 ], "sqlrf/domain_display-5.sql" : [ 6 ], "sqlrf/domain_name-5.sql" : [ 6 ], "sqlrf/domain_order-5.sql" : [ 6 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/ColumnsShouldHaveTableNameCheck.json ================================================ { "lnpls/dbms_sql-package-4.sql" : [ 14, 14, 14 ], "lnpls/processing-query-result-sets-8.sql" : [ 4, 4 ], "lnpls/record-variables-21.sql" : [ 4, 4, 4 ], "sqlrf/Comments-0.sql" : [ 2, 2, 3 ], "sqlrf/Comments-50.sql" : [ 2 ], "sqlrf/Comments-51.sql" : [ 2 ], "sqlrf/Expression-Lists-3.sql" : [ 3, 3, 3, 3 ], "sqlrf/JSON_TABLE-10.sql" : [ 2 ], "sqlrf/JSON_TABLE-9.sql" : [ 2, 2 ], "sqlrf/ROW_NUMBER-1.sql" : [ 10, 10, 23, 23 ], "sqlrf/SELECT-108.sql" : [ 2, 2 ], "sqlrf/SELECT-24.sql" : [ 4 ], "sqlrf/SELECT-56.sql" : [ 2, 2 ], "sqlrf/SELECT-64.sql" : [ 3, 4, 5 ], "sqlrf/SELECT-77.sql" : [ 2, 2, 2 ], "sqlrf/SELECT-79.sql" : [ 2, 2, 2 ], "sqlrf/STATS_ONE_WAY_ANOVA-0.sql" : [ 2 ], "sqlrf/XMLTABLE-2.sql" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/CommitRollbackCheck.json ================================================ { "lnpls/bulk-sql-and-bulk-binding-15.sql" : [ 19, 32 ], "lnpls/bulk-sql-and-bulk-binding-22.sql" : [ 19, 44 ], "lnpls/exception-propagation-0.sql" : [ 18 ], "lnpls/transaction-processing-and-control-0.sql" : [ 25 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/ComparisonWithBooleanCheck.json ================================================ { "adjsn/json_table-generalizes-sql-json-query-functions-and-conditions-0.sql" : [ 7 ], "lnpls/assigning-values-variables-7.sql" : [ 7 ], "lnpls/expressions-12.sql" : [ 9 ], "lnpls/expressions-46.sql" : [ 8, 14 ], "lnpls/expressions-57.sql" : [ 17 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/ComparisonWithNullCheck.json ================================================ { "lnpls/declarations-1.sql" : [ 7 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/ConcatenationWithNullCheck.json ================================================ { "lnpls/expressions-2.sql" : [ 3, 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/CursorBodyInPackageSpecCheck.json ================================================ { "lnpls/serially_reusable-packages-3.sql" : [ 10 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/DbmsOutputPutCheck.json ================================================ { "adjsn/using-online-redefinition-migrate-json-data-type-4.sql" : [ 10 ], "adjsn/using-pl-sql-object-types-json-0.sql" : [ 11 ], "adjsn/using-pl-sql-object-types-json-1.sql" : [ 17 ], "lnpls/ALTER-TYPE-statement-6.sql" : [ 13 ], "lnpls/CONTINUE-statement-0.sql" : [ 6, 11, 16 ], "lnpls/CONTINUE-statement-2.sql" : [ 6, 9, 13 ], "lnpls/COVERAGE-pragma-3.sql" : [ 15, 17 ], "lnpls/CREATE-FUNCTION-statement-6.sql" : [ 3 ], "lnpls/CREATE-FUNCTION-statement-8.sql" : [ 3 ], "lnpls/EXIT-statement-0.sql" : [ 6, 13 ], "lnpls/EXIT-statement-2.sql" : [ 6, 11 ], "lnpls/GOTO-statement-0.sql" : [ 16 ], "lnpls/GOTO-statement-5.sql" : [ 12 ], "lnpls/SQLERRM-function-1.sql" : [ 3 ], "lnpls/SQLERRM-function-4.sql" : [ 3 ], "lnpls/Supresses-warning-pragma-6009-11.sql" : [ 7 ], "lnpls/Supresses-warning-pragma-6009-2.sql" : [ 6 ], "lnpls/Supresses-warning-pragma-6009-6.sql" : [ 5, 10 ], "lnpls/Supresses-warning-pragma-6009-9.sql" : [ 8 ], "lnpls/WHILE-LOOP-statement-0.sql" : [ 6, 11 ], "lnpls/assigning-values-collection-variables-2.sql" : [ 13, 15 ], "lnpls/assigning-values-collection-variables-4.sql" : [ 15, 17, 22 ], "lnpls/assigning-values-record-variables-1.sql" : [ 16, 17 ], "lnpls/assigning-values-record-variables-10.sql" : [ 13 ], "lnpls/assigning-values-record-variables-13.sql" : [ 31, 36 ], "lnpls/assigning-values-record-variables-15.sql" : [ 19 ], "lnpls/assigning-values-record-variables-17.sql" : [ 18, 19, 20, 21 ], "lnpls/assigning-values-record-variables-3.sql" : [ 13, 15 ], "lnpls/assigning-values-record-variables-5.sql" : [ 18, 24 ], "lnpls/assigning-values-record-variables-7.sql" : [ 33 ], "lnpls/assigning-values-variables-3.sql" : [ 9 ], "lnpls/assigning-values-variables-5.sql" : [ 19, 24 ], "lnpls/basic-LOOP-statement-0.sql" : [ 19 ], "lnpls/basic-LOOP-statement-2.sql" : [ 9, 13, 17, 22 ], "lnpls/bulk-sql-and-bulk-binding-15.sql" : [ 30 ], "lnpls/bulk-sql-and-bulk-binding-22.sql" : [ 31, 34, 37, 41, 47 ], "lnpls/bulk-sql-and-bulk-binding-3.sql" : [ 42, 43, 44, 45 ], "lnpls/bulk-sql-and-bulk-binding-32.sql" : [ 12, 14, 17 ], "lnpls/bulk-sql-and-bulk-binding-34.sql" : [ 23 ], "lnpls/bulk-sql-and-bulk-binding-37.sql" : [ 8, 9, 12, 23, 24 ], "lnpls/bulk-sql-and-bulk-binding-42.sql" : [ 14, 15, 18, 25, 26, 30 ], "lnpls/bulk-sql-and-bulk-binding-47.sql" : [ 10, 12, 15, 18, 21, 30, 31, 35, 39, 43 ], "lnpls/bulk-sql-and-bulk-binding-53.sql" : [ 25, 27, 30, 36, 41, 49, 55 ], "lnpls/bulk-sql-and-bulk-binding-55.sql" : [ 28 ], "lnpls/bulk-sql-and-bulk-binding-57.sql" : [ 16, 18 ], "lnpls/collection-comparisons-0.sql" : [ 11, 13, 17, 19 ], "lnpls/collection-comparisons-2.sql" : [ 16, 20 ], "lnpls/collection-comparisons-4.sql" : [ 15, 23 ], "lnpls/collection-methods-11.sql" : [ 8, 9, 18, 24 ], "lnpls/collection-methods-13.sql" : [ 8, 9, 18, 24 ], "lnpls/collection-methods-15.sql" : [ 9, 12, 14, 17, 21 ], "lnpls/collection-methods-17.sql" : [ 8, 11, 13, 16, 18, 20, 25 ], "lnpls/collection-methods-19.sql" : [ 8, 9 ], "lnpls/collection-methods-21.sql" : [ 8, 9, 24, 26, 29 ], "lnpls/collection-methods-23.sql" : [ 15, 16, 18, 19, 21, 22, 24, 25, 27, 28, 30, 31 ], "lnpls/collection-methods-25.sql" : [ 13, 14 ], "lnpls/collection-methods-27.sql" : [ 8, 11, 12, 14, 15 ], "lnpls/collection-methods-29.sql" : [ 8, 11, 12, 16, 18, 21, 22 ], "lnpls/collection-methods-3.sql" : [ 12, 15, 16, 21 ], "lnpls/collection-methods-9.sql" : [ 10, 12 ], "lnpls/collection-types-defined-package-specifications-0.sql" : [ 11 ], "lnpls/column-name-precedence-6.sql" : [ 21 ], "lnpls/compile-time-warnings-7.sql" : [ 6, 8 ], "lnpls/conditional-compilation1-10.sql" : [ 3, 4, 5, 6, 7, 8 ], "lnpls/conditional-compilation1-14.sql" : [ 6, 7 ], "lnpls/conditional-selection-statements-10.sql" : [ 21 ], "lnpls/conditional-selection-statements-14.sql" : [ 15 ], "lnpls/conditional-selection-statements-16.sql" : [ 8, 10, 12, 14, 16, 18 ], "lnpls/conditional-selection-statements-19.sql" : [ 8, 9, 10, 11, 12, 13 ], "lnpls/conditional-selection-statements-24.sql" : [ 8, 9, 10, 11, 12, 13 ], "lnpls/conditional-selection-statements-26.sql" : [ 8, 9, 10, 11, 12, 16 ], "lnpls/conditional-selection-statements-5.sql" : [ 22 ], "lnpls/conditional-selection-statements-8.sql" : [ 17 ], "lnpls/continuing-execution-handling-exceptions-2.sql" : [ 14, 19, 22 ], "lnpls/correlation-names-and-pseudorecords-15.sql" : [ 9, 10, 14 ], "lnpls/correlation-names-and-pseudorecords-22.sql" : [ 4 ], "lnpls/correlation-names-and-pseudorecords-8.sql" : [ 10, 11, 12, 13 ], "lnpls/cursor-expressions-1.sql" : [ 24, 29 ], "lnpls/cursor-variables-10.sql" : [ 10, 20, 21, 26, 36, 37 ], "lnpls/cursor-variables-12.sql" : [ 17 ], "lnpls/cursor-variables-3.sql" : [ 24, 27, 34 ], "lnpls/cursor-variables-5.sql" : [ 20 ], "lnpls/cursor-variables-8.sql" : [ 18, 19, 20 ], "lnpls/cursors-overview-10.sql" : [ 26, 27, 28, 29, 30 ], "lnpls/cursors-overview-12.sql" : [ 17, 18, 19 ], "lnpls/cursors-overview-14.sql" : [ 12, 17, 18, 24, 29, 30 ], "lnpls/cursors-overview-16.sql" : [ 15 ], "lnpls/cursors-overview-18.sql" : [ 18, 24, 25, 26, 31, 32, 33 ], "lnpls/cursors-overview-20.sql" : [ 21, 26, 27, 30, 33, 34 ], "lnpls/cursors-overview-22.sql" : [ 20, 26, 27, 28, 33, 34, 35 ], "lnpls/cursors-overview-25.sql" : [ 15 ], "lnpls/cursors-overview-27.sql" : [ 17 ], "lnpls/cursors-overview-29.sql" : [ 14, 16 ], "lnpls/cursors-overview-8.sql" : [ 23, 26, 32 ], "lnpls/dbms_sql-package-4.sql" : [ 49, 50, 51, 55, 60 ], "lnpls/declarations-11.sql" : [ 6, 7 ], "lnpls/declarations-5.sql" : [ 8 ], "lnpls/declarations-9.sql" : [ 5 ], "lnpls/dml-triggers-0.sql" : [ 11, 13, 15, 17 ], "lnpls/dml-triggers-24.sql" : [ 30 ], "lnpls/exception-propagation-11.sql" : [ 6, 9, 10, 15, 16 ], "lnpls/exception-propagation-13.sql" : [ 12, 19, 20, 24, 25 ], "lnpls/exception-propagation-15.sql" : [ 14, 21, 22, 26, 27, 32, 33 ], "lnpls/exception-propagation-3.sql" : [ 8 ], "lnpls/exception-propagation-5.sql" : [ 12 ], "lnpls/exception-propagation-7.sql" : [ 4, 7, 8 ], "lnpls/exception-propagation-9.sql" : [ 4, 7, 8, 15 ], "lnpls/expressions-0.sql" : [ 6 ], "lnpls/expressions-10.sql" : [ 8, 9, 13, 14, 18, 23, 27 ], "lnpls/expressions-12.sql" : [ 8, 10, 12 ], "lnpls/expressions-19.sql" : [ 7, 9, 11 ], "lnpls/expressions-2.sql" : [ 3 ], "lnpls/expressions-21.sql" : [ 7, 9, 11 ], "lnpls/expressions-26.sql" : [ 10 ], "lnpls/expressions-35.sql" : [ 9, 11 ], "lnpls/expressions-37.sql" : [ 6, 8 ], "lnpls/expressions-4.sql" : [ 6, 7 ], "lnpls/expressions-48.sql" : [ 15 ], "lnpls/expressions-50.sql" : [ 16 ], "lnpls/expressions-57.sql" : [ 27 ], "lnpls/expressions-59.sql" : [ 16 ], "lnpls/expressions-6.sql" : [ 5 ], "lnpls/expressions-62.sql" : [ 10, 19 ], "lnpls/expressions-8.sql" : [ 6, 7 ], "lnpls/external-subprograms-2.sql" : [ 10, 12 ], "lnpls/external-subprograms-5.sql" : [ 13, 21 ], "lnpls/invokers-rights-and-definers-rights-authid-property-3.sql" : [ 7 ], "lnpls/lexical-units-12.sql" : [ 6, 7 ], "lnpls/lexical-units-15.sql" : [ 3 ], "lnpls/lexical-units-17.sql" : [ 3 ], "lnpls/lexical-units-23.sql" : [ 20 ], "lnpls/lexical-units-4.sql" : [ 5 ], "lnpls/lexical-units-6.sql" : [ 5 ], "lnpls/lexical-units-8.sql" : [ 7, 8, 9 ], "lnpls/loop-statements-0.sql" : [ 5 ], "lnpls/loop-statements-10.sql" : [ 6 ], "lnpls/loop-statements-13.sql" : [ 4 ], "lnpls/loop-statements-15.sql" : [ 4 ], "lnpls/loop-statements-17.sql" : [ 4 ], "lnpls/loop-statements-19.sql" : [ 4 ], "lnpls/loop-statements-2.sql" : [ 4, 7 ], "lnpls/loop-statements-25.sql" : [ 4 ], "lnpls/loop-statements-27.sql" : [ 4 ], "lnpls/loop-statements-33.sql" : [ 8 ], "lnpls/loop-statements-37.sql" : [ 4 ], "lnpls/loop-statements-39.sql" : [ 4 ], "lnpls/loop-statements-4.sql" : [ 6, 9 ], "lnpls/loop-statements-6.sql" : [ 7 ], "lnpls/loop-statements-8.sql" : [ 8 ], "lnpls/main-features-pl-sql-1.sql" : [ 9 ], "lnpls/minimizing-cpu-overhead-0.sql" : [ 16, 21, 34, 40 ], "lnpls/minimizing-cpu-overhead-2.sql" : [ 35, 36, 37, 38 ], "lnpls/multidimensional-collections-0.sql" : [ 13 ], "lnpls/native-dynamic-sql-1.sql" : [ 5 ], "lnpls/native-dynamic-sql-13.sql" : [ 15 ], "lnpls/native-dynamic-sql-19.sql" : [ 9 ], "lnpls/native-dynamic-sql-3.sql" : [ 26, 27 ], "lnpls/native-dynamic-sql-5.sql" : [ 14 ], "lnpls/native-dynamic-sql-7.sql" : [ 13 ], "lnpls/native-dynamic-sql-9.sql" : [ 13, 16 ], "lnpls/overloaded-subprograms-0.sql" : [ 11, 19 ], "lnpls/overloaded-subprograms-13.sql" : [ 11, 15 ], "lnpls/overview-exception-handling-1.sql" : [ 29, 31 ], "lnpls/package-body-0.sql" : [ 10 ], "lnpls/package-body-4.sql" : [ 6 ], "lnpls/package-example-0.sql" : [ 90, 144, 181, 184 ], "lnpls/package-specification-2.sql" : [ 14 ], "lnpls/pls_integer-and-binary_integer-data-types-6.sql" : [ 7, 11 ], "lnpls/predefined-exceptions-0.sql" : [ 8, 11 ], "lnpls/predefined-exceptions-4.sql" : [ 9, 10, 14, 17, 18 ], "lnpls/processing-query-result-sets-0.sql" : [ 11 ], "lnpls/processing-query-result-sets-10.sql" : [ 14 ], "lnpls/processing-query-result-sets-2.sql" : [ 10 ], "lnpls/processing-query-result-sets-4.sql" : [ 11 ], "lnpls/processing-query-result-sets-6.sql" : [ 10 ], "lnpls/processing-query-result-sets-8.sql" : [ 16 ], "lnpls/raising-exceptions-explicitly-0.sql" : [ 14 ], "lnpls/raising-exceptions-explicitly-2.sql" : [ 14 ], "lnpls/raising-exceptions-explicitly-5.sql" : [ 16, 17, 25 ], "lnpls/raising-exceptions-explicitly-9.sql" : [ 22 ], "lnpls/record-variables-0.sql" : [ 6, 7 ], "lnpls/record-variables-1.sql" : [ 20, 21 ], "lnpls/record-variables-11.sql" : [ 13, 14 ], "lnpls/record-variables-14.sql" : [ 14, 15, 16, 17 ], "lnpls/record-variables-16.sql" : [ 5, 7, 19, 20, 22, 23 ], "lnpls/record-variables-19.sql" : [ 13 ], "lnpls/record-variables-3.sql" : [ 7, 8 ], "lnpls/record-variables-30.sql" : [ 7 ], "lnpls/record-variables-5.sql" : [ 12, 13, 14, 15 ], "lnpls/record-variables-7.sql" : [ 19 ], "lnpls/record-variables-9.sql" : [ 14 ], "lnpls/recursive-subprograms-1.sql" : [ 17 ], "lnpls/recursive-subprograms-3.sql" : [ 21, 23, 27 ], "lnpls/redeclared-predefined-exceptions-1.sql" : [ 8 ], "lnpls/redeclared-predefined-exceptions-3.sql" : [ 10 ], "lnpls/redeclared-predefined-exceptions-5.sql" : [ 10 ], "lnpls/release-changes-0.sql" : [ 16 ], "lnpls/retrieving-error-code-and-error-message-0.sql" : [ 19 ], "lnpls/scope-and-visibility-identifiers-1.sql" : [ 10, 12 ], "lnpls/scope-and-visibility-identifiers-3.sql" : [ 19, 23 ], "lnpls/scope-and-visibility-identifiers-7.sql" : [ 8, 16 ], "lnpls/scope-and-visibility-identifiers-9.sql" : [ 9, 10 ], "lnpls/sequential-control-statements-2.sql" : [ 7, 8, 9, 10, 11 ], "lnpls/serially_reusable-packages-1.sql" : [ 17, 18 ], "lnpls/serially_reusable-packages-3.sql" : [ 17, 19, 24, 27 ], "lnpls/sql-data-types-1.sql" : [ 6, 7 ], "lnpls/sql-data-types-12.sql" : [ 8 ], "lnpls/sql-data-types-14.sql" : [ 9 ], "lnpls/sql-data-types-22.sql" : [ 8 ], "lnpls/sql-data-types-26.sql" : [ 8 ], "lnpls/sql-data-types-3.sql" : [ 8 ], "lnpls/sql-data-types-32.sql" : [ 12 ], "lnpls/sql-data-types-34.sql" : [ 13 ], "lnpls/sql-data-types-38.sql" : [ 29, 30, 31, 32, 33, 34, 35 ], "lnpls/sql-data-types-42.sql" : [ 6, 7, 8 ], "lnpls/sql-data-types-52.sql" : [ 9, 10 ], "lnpls/sql-data-types-6.sql" : [ 8 ], "lnpls/sql-injection-1.sql" : [ 17, 19 ], "lnpls/sql-injection-18.sql" : [ 22, 24 ], "lnpls/sql-injection-23.sql" : [ 14, 18 ], "lnpls/sql-injection-28.sql" : [ 23, 30 ], "lnpls/sql-injection-30.sql" : [ 21, 23 ], "lnpls/sql-injection-6.sql" : [ 17 ], "lnpls/subprogram-parameters-13.sql" : [ 11, 13, 14, 16, 17, 19, 20, 22, 39, 41, 42, 44, 45, 47, 48, 50, 58, 60, 61, 63, 64, 66, 67, 69, 71, 73, 74, 76, 84, 86, 87, 89 ], "lnpls/subprogram-parameters-15.sql" : [ 6, 8, 9, 11, 17, 19, 20, 22 ], "lnpls/subprogram-parameters-17.sql" : [ 13, 14, 15 ], "lnpls/subprogram-parameters-19.sql" : [ 23 ], "lnpls/subprogram-parameters-21.sql" : [ 12, 14, 19 ], "lnpls/subprogram-parameters-27.sql" : [ 7, 16, 21, 26, 29 ], "lnpls/subprogram-parameters-29.sql" : [ 7 ], "lnpls/subprogram-parameters-32.sql" : [ 9, 11 ], "lnpls/subprogram-parameters-4.sql" : [ 8 ], "lnpls/subprogram-parameters-6.sql" : [ 5, 10 ], "lnpls/subprogram-parameters-8.sql" : [ 6, 11 ], "lnpls/subprogram-parts-0.sql" : [ 22, 30, 33 ], "lnpls/subprogram-parts-11.sql" : [ 4, 6, 8 ], "lnpls/subprogram-parts-2.sql" : [ 15 ], "lnpls/subprogram-parts-4.sql" : [ 13, 18 ], "lnpls/subprogram-parts-7.sql" : [ 18 ], "lnpls/subprogram-parts-9.sql" : [ 5, 7, 11 ], "lnpls/trigger-restrictions-0.sql" : [ 21 ], "lnpls/views-information-triggers-0.sql" : [ 8 ], "lnpls/views-information-triggers-5.sql" : [ 6 ], "lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms-3.sql" : [ 6, 9 ], "lnpls/wrapping-pl-sql-source-text-pl-sql-wrapper-utility-4.sql" : [ 10 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/DeadCodeCheck.json ================================================ { "lnpls/subprogram-parts-11.sql" : [ 6 ], "lnpls/subprogram-parts-9.sql" : [ 7 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/EmptyBlockCheck.json ================================================ { "lnpls/conditional-compilation1-25.sql" : [ 6 ], "lnpls/cursor-variables-1.sql" : [ 13 ], "lnpls/cursor-variables-2.sql" : [ 11 ], "lnpls/cursors-overview-6.sql" : [ 19 ], "lnpls/declarations-0.sql" : [ 8 ], "lnpls/declarations-1.sql" : [ 9 ], "lnpls/declarations-2.sql" : [ 9 ], "lnpls/declarations-3.sql" : [ 7 ], "lnpls/declarations-4.sql" : [ 10 ], "lnpls/exception-propagation-3.sql" : [ 5 ], "lnpls/exception-propagation-5.sql" : [ 7 ], "lnpls/forward-declaration-0.sql" : [ 19 ], "lnpls/minimizing-cpu-overhead-2.sql" : [ 16, 21 ], "lnpls/overloaded-subprograms-12.sql" : [ 8, 9 ], "lnpls/record-variables-21.sql" : [ 11 ], "lnpls/scope-and-visibility-identifiers-0.sql" : [ 14, 22 ], "lnpls/sequential-control-statements-1.sql" : [ 7 ], "lnpls/subprogram-invocation-resolution-0.sql" : [ 22, 30, 39, 43 ], "lnpls/subprogram-parameters-10.sql" : [ 6 ], "lnpls/trigger-design-guidelines-1.sql" : [ 5 ], "lnpls/user-defined-pl-sql-subtypes-2.sql" : [ 27 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/ExplicitInParameterCheck.json ================================================ { "adjsn/handling-input-values-sql-json-generation-functions-0.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-6.sql" : [ 8, 11 ], "lnpls/CREATE-FUNCTION-statement-2.sql" : [ 2 ], "lnpls/CREATE-FUNCTION-statement-4.sql" : [ 2 ], "lnpls/CREATE-PACKAGE-BODY-statement-0.sql" : [ 6, 6, 7, 7, 8, 8, 22, 22, 34, 40, 47, 47, 60, 60 ], "lnpls/CREATE-TYPE-statement-1.sql" : [ 4, 8 ], "lnpls/CREATE-TYPE-statement-15.sql" : [ 11, 11 ], "lnpls/CREATE-TYPE-statement-16.sql" : [ 4, 4 ], "lnpls/DEPRECATE-pragma-8.sql" : [ 3, 3, 3, 5, 5 ], "lnpls/Supresses-warning-pragma-6009-3.sql" : [ 2 ], "lnpls/Supresses-warning-pragma-6009-4.sql" : [ 2 ], "lnpls/Supresses-warning-pragma-6009-5.sql" : [ 3 ], "lnpls/Supresses-warning-pragma-6009-6.sql" : [ 3 ], "lnpls/assigning-values-collection-variables-4.sql" : [ 11 ], "lnpls/assigning-values-record-variables-1.sql" : [ 13 ], "lnpls/assigning-values-record-variables-13.sql" : [ 16 ], "lnpls/assigning-values-variables-5.sql" : [ 6, 8 ], "lnpls/autonomous-transactions-1.sql" : [ 3, 3, 9, 9 ], "lnpls/autonomous-transactions-2.sql" : [ 3, 3 ], "lnpls/autonomous-transactions-9.sql" : [ 5, 9 ], "lnpls/bulk-sql-and-bulk-binding-32.sql" : [ 9 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-12.sql" : [ 11, 11 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-13.sql" : [ 4, 5 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-17.sql" : [ 4, 9 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-2.sql" : [ 4 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-3.sql" : [ 3 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-8.sql" : [ 10, 14 ], "lnpls/collection-comparisons-4.sql" : [ 10, 11 ], "lnpls/collection-methods-15.sql" : [ 6 ], "lnpls/collection-methods-17.sql" : [ 6 ], "lnpls/collection-types-defined-package-specifications-0.sql" : [ 4, 8 ], "lnpls/conditional-selection-statements-10.sql" : [ 4, 5, 6 ], "lnpls/conditional-selection-statements-14.sql" : [ 3 ], "lnpls/conditional-selection-statements-5.sql" : [ 4, 5, 6 ], "lnpls/conditional-selection-statements-8.sql" : [ 4, 5, 6 ], "lnpls/cursor-variables-15.sql" : [ 4, 8 ], "lnpls/cursor-variables-16.sql" : [ 4, 8 ], "lnpls/dbms_sql-package-6.sql" : [ 7, 8, 9 ], "lnpls/dbms_sql-package-7.sql" : [ 3 ], "lnpls/exception-propagation-11.sql" : [ 2 ], "lnpls/exception-propagation-13.sql" : [ 2 ], "lnpls/exception-propagation-15.sql" : [ 2 ], "lnpls/exception-propagation-7.sql" : [ 2 ], "lnpls/exception-propagation-9.sql" : [ 2 ], "lnpls/expressions-12.sql" : [ 3, 4 ], "lnpls/expressions-13.sql" : [ 4, 5 ], "lnpls/expressions-15.sql" : [ 4, 5 ], "lnpls/expressions-17.sql" : [ 4 ], "lnpls/expressions-35.sql" : [ 4, 5 ], "lnpls/expressions-37.sql" : [ 3 ], "lnpls/expressions-57.sql" : [ 9 ], "lnpls/external-subprograms-1.sql" : [ 3, 4 ], "lnpls/forward-declaration-0.sql" : [ 4, 7, 13 ], "lnpls/native-dynamic-sql-1.sql" : [ 2 ], "lnpls/native-dynamic-sql-19.sql" : [ 3, 4, 5, 6 ], "lnpls/native-dynamic-sql-3.sql" : [ 6, 6, 11, 11 ], "lnpls/native-dynamic-sql-5.sql" : [ 7, 11 ], "lnpls/native-dynamic-sql-7.sql" : [ 6, 10 ], "lnpls/native-dynamic-sql-9.sql" : [ 6, 10 ], "lnpls/overloaded-subprograms-0.sql" : [ 9, 17 ], "lnpls/overloaded-subprograms-10.sql" : [ 3, 4, 4 ], "lnpls/overloaded-subprograms-12.sql" : [ 3, 3, 4, 4, 8, 8, 9, 9 ], "lnpls/overloaded-subprograms-13.sql" : [ 4, 5, 9, 13 ], "lnpls/overloaded-subprograms-5.sql" : [ 3, 4 ], "lnpls/overloaded-subprograms-6.sql" : [ 5, 6 ], "lnpls/overloaded-subprograms-8.sql" : [ 5, 6 ], "lnpls/overview-exception-handling-1.sql" : [ 3, 4 ], "lnpls/package-body-0.sql" : [ 3, 8 ], "lnpls/package-body-4.sql" : [ 4 ], "lnpls/package-example-0.sql" : [ 17, 18, 19, 20, 21, 22, 23, 24, 25, 29, 30, 32, 32, 33, 49, 50, 51, 52, 53, 54, 55, 56, 57, 95, 100, 108, 109, 124, 125, 148 ], "lnpls/package-specification-2.sql" : [ 7 ], "lnpls/pl-sql-function-result-cache-10.sql" : [ 2 ], "lnpls/pl-sql-function-result-cache-13.sql" : [ 3, 4 ], "lnpls/pl-sql-function-result-cache-15.sql" : [ 3, 4 ], "lnpls/pl-sql-function-result-cache-16.sql" : [ 3, 4, 11 ], "lnpls/pl-sql-function-result-cache-4.sql" : [ 12, 20 ], "lnpls/pl-sql-function-result-cache-6.sql" : [ 3, 4, 5 ], "lnpls/pl-sql-function-result-cache-7.sql" : [ 2 ], "lnpls/pl-sql-function-result-cache-9.sql" : [ 2, 2 ], "lnpls/plsql-program-limits-0.sql" : [ 4, 9 ], "lnpls/qualified-names-and-dot-notation-6.sql" : [ 8, 9, 13, 33 ], "lnpls/raising-exceptions-explicitly-0.sql" : [ 3, 4 ], "lnpls/raising-exceptions-explicitly-2.sql" : [ 4 ], "lnpls/raising-exceptions-explicitly-9.sql" : [ 3, 4 ], "lnpls/record-variables-11.sql" : [ 7, 11 ], "lnpls/record-variables-16.sql" : [ 2 ], "lnpls/recursive-subprograms-1.sql" : [ 3 ], "lnpls/recursive-subprograms-3.sql" : [ 3 ], "lnpls/release-changes-0.sql" : [ 2 ], "lnpls/scope-and-visibility-identifiers-3.sql" : [ 2 ], "lnpls/sequential-control-statements-1.sql" : [ 3, 4 ], "lnpls/sequential-control-statements-2.sql" : [ 3 ], "lnpls/sql-injection-28.sql" : [ 3, 4, 5 ], "lnpls/subprogram-invocation-resolution-0.sql" : [ 4, 5, 12, 18, 19, 26, 27 ], "lnpls/subprogram-parameters-10.sql" : [ 3 ], "lnpls/subprogram-parameters-13.sql" : [ 3 ], "lnpls/subprogram-parameters-2.sql" : [ 8, 9 ], "lnpls/subprogram-parameters-29.sql" : [ 3, 4 ], "lnpls/subprogram-parameters-32.sql" : [ 3, 4, 5 ], "lnpls/subprogram-parameters-36.sql" : [ 7, 8 ], "lnpls/subprogram-parameters-37.sql" : [ 3, 4 ], "lnpls/subprogram-parameters-4.sql" : [ 6 ], "lnpls/subprogram-parameters-6.sql" : [ 3 ], "lnpls/subprogram-parameters-8.sql" : [ 3 ], "lnpls/subprogram-parts-0.sql" : [ 11, 12, 13 ], "lnpls/subprogram-parts-2.sql" : [ 5 ], "lnpls/subprogram-parts-4.sql" : [ 5 ], "lnpls/subprogram-parts-6.sql" : [ 2 ], "lnpls/subprogram-parts-7.sql" : [ 2 ], "lnpls/transaction-processing-and-control-0.sql" : [ 12, 13, 14 ], "lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms-0.sql" : [ 5, 13 ], "lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms-2.sql" : [ 2, 2, 3 ], "lnpls/wrapping-pl-sql-source-text-pl-sql-wrapper-utility-4.sql" : [ 15 ], "sqlrf/CURSOR-Expressions-1.sql" : [ 2, 2 ], "sqlrf/SELECT-23.sql" : [ 3 ], "sqlrf/Using-Extensible-Indexing-1.sql" : [ 12, 12, 12, 13, 14, 15, 16, 17, 17, 18, 18, 19, 19, 19, 20, 21, 21, 21, 22, 22, 23, 24, 24, 25, 25, 25, 26, 26, 27, 28, 30, 41, 41, 41, 55, 55, 65, 65, 74, 74, 75, 75, 86, 86, 86, 87, 98, 98, 98, 99, 99, 109, 110, 110, 111, 111, 111, 112, 112, 174, 175, 202 ], "sqlrf/Using-Extensible-Indexing-2.sql" : [ 3, 3, 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/FunctionWithOutParameterCheck.json ================================================ { "lnpls/overview-polymorphic-table-functions-16.sql" : [ 3 ], "lnpls/overview-polymorphic-table-functions-17.sql" : [ 4 ], "lnpls/overview-polymorphic-table-functions-30.sql" : [ 4 ], "sqlrf/Using-Extensible-Indexing-1.sql" : [ 10, 23, 27, 28, 35, 109, 174, 175 ], "sqlrf/Using-Extensible-Indexing-2.sql" : [ 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/IdenticalExpressionCheck.json ================================================ { "lnpls/CREATE-PACKAGE-BODY-statement-0.sql" : [ 57 ], "lnpls/expressions-28.sql" : [ 16 ], "sqlrf/CREATE-MATERIALIZED-VIEW-10.sql" : [ 5 ], "sqlrf/INSERT-42.sql" : [ 4 ], "sqlrf/JSON_TABLE-1.sql" : [ 4 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/IfWithExitCheck.json ================================================ { "lnpls/EXIT-statement-0.sql" : [ 8 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/InequalityUsageCheck.json ================================================ { "lnpls/assigning-values-variables-7.sql" : [ 7 ], "lnpls/collection-comparisons-2.sql" : [ 19 ], "lnpls/declarations-1.sql" : [ 7 ], "lnpls/dml-triggers-36.sql" : [ 10 ], "lnpls/expressions-19.sql" : [ 6 ], "lnpls/expressions-21.sql" : [ 8 ], "lnpls/expressions-28.sql" : [ 6, 7, 8 ], "lnpls/overview-polymorphic-table-functions-30.sql" : [ 38 ], "sqlrf/Comparison-Conditions-1.sql" : [ 4 ], "sqlrf/Literals-11.sql" : [ 5 ], "sqlrf/Literals-9.sql" : [ 5 ], "sqlrf/SELECT-106.sql" : [ 5 ], "sqlrf/Using-Extensible-Indexing-1.sql" : [ 130, 130, 131, 131, 150 ], "sqlrf/Using-Extensible-Indexing-2.sql" : [ 39 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/InsertWithoutColumnsCheck.json ================================================ { "adjsn/creating-multivalue-function-based-indexes-json_exists-0.sql" : [ 3, 6 ], "adjsn/json-schema-14.sql" : [ 6 ], "adjsn/multiple-data-guides-document-set-0.sql" : [ 2 ], "adjsn/multiple-data-guides-document-set-1.sql" : [ 2 ], "adjsn/sql-json-function-json_object-19.sql" : [ 10 ], "adjsn/tables-json-columns-2.sql" : [ 2, 33 ], "adjsn/using-geojson-geographic-data-0.sql" : [ 5 ], "lnpls/CREATE-PACKAGE-BODY-statement-0.sql" : [ 14, 29 ], "lnpls/CREATE-TYPE-statement-10.sql" : [ 5 ], "lnpls/CREATE-TYPE-statement-12.sql" : [ 3 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-5.sql" : [ 3, 4, 5 ], "lnpls/continuing-execution-handling-exceptions-2.sql" : [ 18 ], "lnpls/correlation-names-and-pseudorecords-15.sql" : [ 4 ], "lnpls/dml-triggers-17.sql" : [ 2 ], "lnpls/dml-triggers-23.sql" : [ 2 ], "lnpls/dml-triggers-4.sql" : [ 2 ], "lnpls/dml-triggers-50.sql" : [ 10 ], "lnpls/native-dynamic-sql-16.sql" : [ 2 ], "lnpls/native-dynamic-sql-18.sql" : [ 2 ], "lnpls/raising-exceptions-explicitly-2.sql" : [ 10, 15 ], "lnpls/redeclared-predefined-exceptions-1.sql" : [ 5, 9 ], "lnpls/redeclared-predefined-exceptions-3.sql" : [ 7, 11 ], "lnpls/redeclared-predefined-exceptions-5.sql" : [ 7, 11 ], "lnpls/sql-data-types-32.sql" : [ 4, 5, 6 ], "lnpls/sql-data-types-36.sql" : [ 11, 13 ], "lnpls/trigger-restrictions-0.sql" : [ 14 ], "lnpls/trigger-restrictions-6.sql" : [ 4, 5, 6, 9, 10, 11 ], "lnpls/triggers-publishing-events-12.sql" : [ 2 ], "lnpls/triggers-publishing-events-16.sql" : [ 2 ], "lnpls/triggers-publishing-events-20.sql" : [ 2 ], "lnpls/triggers-publishing-events-24.sql" : [ 2 ], "lnpls/triggers-publishing-events-28.sql" : [ 2 ], "lnpls/triggers-publishing-events-38.sql" : [ 2 ], "lnpls/triggers-publishing-events-42.sql" : [ 2 ], "lnpls/triggers-publishing-events-48.sql" : [ 14 ], "lnpls/triggers-publishing-events-50.sql" : [ 2 ], "lnpls/triggers-publishing-events-52.sql" : [ 2 ], "lnpls/triggers-publishing-events-6.sql" : [ 2 ], "lnpls/triggers-publishing-events-8.sql" : [ 2 ], "sqlrf/ALTER-SESSION-14.sql" : [ 4 ], "sqlrf/ALTER-TABLE-118.sql" : [ 2, 4 ], "sqlrf/ALTER-TABLE-31.sql" : [ 3, 4, 5, 6, 7 ], "sqlrf/ALTER-TABLE-95.sql" : [ 4, 5, 6 ], "sqlrf/COLLATION-0.sql" : [ 5 ], "sqlrf/COMMIT-0.sql" : [ 2 ], "sqlrf/CREATE-TABLE-51.sql" : [ 2 ], "sqlrf/CREATE-VIEW-8.sql" : [ 2 ], "sqlrf/CURRENT_TIMESTAMP-2.sql" : [ 2 ], "sqlrf/CURRENT_TIMESTAMP-3.sql" : [ 2 ], "sqlrf/Comments-48.sql" : [ 3 ], "sqlrf/DEREF-0.sql" : [ 2, 4 ], "sqlrf/Data-Types-19.sql" : [ 2 ], "sqlrf/Data-Types-20.sql" : [ 2 ], "sqlrf/Data-Types-22.sql" : [ 2, 3, 4, 5, 6, 7, 8, 9 ], "sqlrf/Data-Types-3.sql" : [ 3, 4, 5, 6 ], "sqlrf/HEXTORAW-0.sql" : [ 3 ], "sqlrf/INSERT-11.sql" : [ 2 ], "sqlrf/INSERT-12.sql" : [ 2 ], "sqlrf/INSERT-13.sql" : [ 2 ], "sqlrf/INSERT-15.sql" : [ 2, 3, 4 ], "sqlrf/INSERT-16.sql" : [ 2, 4, 6 ], "sqlrf/INSERT-19.sql" : [ 2 ], "sqlrf/INSERT-32.sql" : [ 2 ], "sqlrf/INSERT-33.sql" : [ 2 ], "sqlrf/INSERT-5.sql" : [ 2 ], "sqlrf/INSERT-6.sql" : [ 2 ], "sqlrf/INSERT-8.sql" : [ 2 ], "sqlrf/INSERT-9.sql" : [ 2 ], "sqlrf/JSON_ARRAYAGG-0.sql" : [ 3, 4, 5, 6 ], "sqlrf/JSON_TABLE-5.sql" : [ 2 ], "sqlrf/LOCALTIMESTAMP-2.sql" : [ 2 ], "sqlrf/LOCALTIMESTAMP-3.sql" : [ 2 ], "sqlrf/Literals-15.sql" : [ 2, 3 ], "sqlrf/Literals-18.sql" : [ 2 ], "sqlrf/Literals-19.sql" : [ 2 ], "sqlrf/Literals-20.sql" : [ 2 ], "sqlrf/MERGE-1.sql" : [ 14, 15, 16, 17, 18 ], "sqlrf/NANVL-0.sql" : [ 2 ], "sqlrf/NLSSORT-1.sql" : [ 3, 4, 5 ], "sqlrf/Pattern-matching-Conditions-10.sql" : [ 3 ], "sqlrf/SELECT-115.sql" : [ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 ], "sqlrf/SELECT-73.sql" : [ 2 ], "sqlrf/SELECT-90.sql" : [ 5, 6, 7, 8 ], "sqlrf/SELECT-99.sql" : [ 2 ], "sqlrf/SQL-JSON-Conditions-15.sql" : [ 2, 3, 4, 5, 6, 7, 8 ], "sqlrf/SQL-JSON-Conditions-20.sql" : [ 2, 3, 4 ], "sqlrf/SQL-JSON-Conditions-29.sql" : [ 2, 3, 4, 5, 6, 7 ], "sqlrf/SQL-JSON-Conditions-37.sql" : [ 2, 4, 6 ], "sqlrf/Sequence-Pseudocolumns-4.sql" : [ 2 ], "sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-0.sql" : [ 2 ], "sqlrf/TO_BINARY_DOUBLE-0.sql" : [ 4 ], "sqlrf/TO_CHAR-character-2.sql" : [ 12, 14, 16, 18 ], "sqlrf/TO_CHAR-datetime-10.sql" : [ 12, 14, 16, 18 ], "sqlrf/TO_CHAR-datetime-2.sql" : [ 3, 7 ], "sqlrf/TO_CHAR-number-5.sql" : [ 12, 14, 16, 18 ], "sqlrf/Type-Constructor-Expressions-0.sql" : [ 8 ], "sqlrf/Using-XML-in-SQL-Statements-1.sql" : [ 2 ], "sqlrf/Using-XML-in-SQL-Statements-5.sql" : [ 2 ], "sqlrf/XMLTRANSFORM-0.sql" : [ 3 ], "sqlrf/create-domain-18.sql" : [ 2 ], "sqlrf/create-domain-19.sql" : [ 2 ], "sqlrf/domain_name-2.sql" : [ 2 ], "sqlrf/domain_name-6.sql" : [ 2 ], "sqlrf/sys_row_etag-0.sql" : [ 3 ], "sqlrf/to_vector-1.sql" : [ 2 ], "sqlrf/to_vector-2.sql" : [ 2 ], "sqlrf/vector-0.sql" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/ParsingErrorCheck.json ================================================ { "adjsn/change-triggers-data-guide-enabled-search-index-0.sql" : [ 3 ], "adjsn/change-triggers-data-guide-enabled-search-index-1.sql" : [ 25 ], "adjsn/creating-b-tree-indexes-json_value-0.sql" : [ 2 ], "adjsn/creating-b-tree-indexes-json_value-1.sql" : [ 2 ], "adjsn/creating-b-tree-indexes-json_value-2.sql" : [ 2 ], "adjsn/creating-b-tree-indexes-json_value-3.sql" : [ 2 ], "adjsn/creating-bitmap-indexes-json_value-0.sql" : [ 2 ], "adjsn/creating-multivalue-function-based-indexes-json_exists-1.sql" : [ 2 ], "adjsn/creating-multivalue-function-based-indexes-json_exists-2.sql" : [ 2 ], "adjsn/creating-view-json-data-using-json_table-1.sql" : [ 3 ], "adjsn/json-collections-2.sql" : [ 2 ], "adjsn/json-collections-3.sql" : [ 2 ], "adjsn/json-collections-4.sql" : [ 2 ], "adjsn/json-query-rewrite-use-materialized-view-json_table-0.sql" : [ 3 ], "adjsn/json-query-rewrite-use-materialized-view-json_table-2.sql" : [ 2 ], "adjsn/json-schema-11.sql" : [ 5 ], "adjsn/json-schema-16.sql" : [ 4 ], "adjsn/json-schema-3.sql" : [ 2 ], "adjsn/json-schema-5.sql" : [ 2 ], "adjsn/json-schema-9.sql" : [ 2 ], "adjsn/json-search-index-ad-hoc-queries-and-full-text-search-1.sql" : [ 2 ], "adjsn/json-search-index-ad-hoc-queries-and-full-text-search-2.sql" : [ 2 ], "adjsn/json-search-index-ad-hoc-queries-and-full-text-search-3.sql" : [ 2 ], "adjsn/json-search-index-ad-hoc-queries-and-full-text-search-5.sql" : [ 2 ], "adjsn/json-search-index-ad-hoc-queries-and-full-text-search-6.sql" : [ 2 ], "adjsn/json-search-index-ad-hoc-queries-and-full-text-search-7.sql" : [ 14 ], "adjsn/json_transform-operation-handlers-3.sql" : [ 4 ], "adjsn/json_transform-operation-handlers-5.sql" : [ 4 ], "adjsn/json_transform-operator-rename-0.sql" : [ 3 ], "adjsn/loading-external-json-data-1.sql" : [ 3 ], "adjsn/loading-external-json-data-4.sql" : [ 2 ], "adjsn/oracle-sql-function-json_transform-4.sql" : [ 4 ], "adjsn/partitioning-json-data-0.sql" : [ 2 ], "adjsn/passing-clause-sql-functions-and-conditions-1.sql" : [ 4 ], "adjsn/persistent-data-guide-information-part-json-search-index-0.sql" : [ 2 ], "adjsn/persistent-data-guide-information-part-json-search-index-1.sql" : [ 2 ], "adjsn/persistent-data-guide-information-part-json-search-index-2.sql" : [ 2 ], "adjsn/populate-json-type-column-querying-textual-json-0.sql" : [ 2 ], "adjsn/populate-json-type-column-querying-textual-json-2.sql" : [ 3 ], "adjsn/populating-json-data-memory-column-store-0.sql" : [ 6 ], "adjsn/populating-json-data-memory-column-store-1.sql" : [ 2 ], "adjsn/sql-json-conditions-is-json-and-is-not-json-6.sql" : [ 6 ], "adjsn/sql-json-function-json_object-14.sql" : [ 3 ], "adjsn/sql-json-function-json_object-21.sql" : [ 2 ], "adjsn/sql-json-path-expression-item-methods-4.sql" : [ 4 ], "adjsn/tables-json-columns-3.sql" : [ 5 ], "adjsn/type-clause-sql-functions-and-conditions-6.sql" : [ 4 ], "adjsn/use-bind-variables-json_transform-0.sql" : [ 2 ], "adjsn/using-geojson-geographic-data-5.sql" : [ 2 ], "adjsn/using-online-redefinition-migrate-json-data-type-2.sql" : [ 2 ], "adjsn/using-sql-json-function-json_value-boolean-json-value-3.sql" : [ 4 ], "lnpls/ALTER-LIBRARY-statement-0.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-1.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-11.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-12.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-14.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-2.sql" : [ 5 ], "lnpls/ALTER-TYPE-statement-3.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-4.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-5.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-7.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-8.sql" : [ 2 ], "lnpls/ALTER-TYPE-statement-9.sql" : [ 2 ], "lnpls/CREATE-FUNCTION-statement-0.sql" : [ 2 ], "lnpls/CREATE-FUNCTION-statement-5.sql" : [ 5 ], "lnpls/CREATE-FUNCTION-statement-7.sql" : [ 2 ], "lnpls/CREATE-LIBRARY-statement-0.sql" : [ 2 ], "lnpls/CREATE-LIBRARY-statement-1.sql" : [ 2 ], "lnpls/CREATE-LIBRARY-statement-2.sql" : [ 2 ], "lnpls/CREATE-LIBRARY-statement-3.sql" : [ 2 ], "lnpls/CREATE-LIBRARY-statement-4.sql" : [ 2 ], "lnpls/CREATE-PACKAGE-statement-0.sql" : [ 2 ], "lnpls/CREATE-PROCEDURE-statement-0.sql" : [ 2 ], "lnpls/CREATE-PROCEDURE-statement-2.sql" : [ 5 ], "lnpls/CREATE-PROCEDURE-statement-5.sql" : [ 2 ], "lnpls/CREATE-TYPE-statement-17.sql" : [ 2 ], "lnpls/CREATE-TYPE-statement-6.sql" : [ 2 ], "lnpls/CREATE-TYPE-statement-7.sql" : [ 2 ], "lnpls/DEPRECATE-pragma-18.sql" : [ 2 ], "lnpls/SQL_MACRO-clause-1.sql" : [ 3 ], "lnpls/SQL_MACRO-clause-13.sql" : [ 10 ], "lnpls/SQL_MACRO-clause-16.sql" : [ 2 ], "lnpls/SQL_MACRO-clause-19.sql" : [ 3 ], "lnpls/SQL_MACRO-clause-2.sql" : [ 4 ], "lnpls/SQL_MACRO-clause-24.sql" : [ 4 ], "lnpls/SQL_MACRO-clause-3.sql" : [ 5 ], "lnpls/SQL_MACRO-clause-4.sql" : [ 6 ], "lnpls/SQL_MACRO-clause-5.sql" : [ 6 ], "lnpls/SQL_MACRO-clause-6.sql" : [ 7 ], "lnpls/assigning-values-record-variables-12.sql" : [ 2 ], "lnpls/autonomous-transactions-3.sql" : [ 3 ], "lnpls/autonomous-transactions-4.sql" : [ 3 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-2.sql" : [ 2 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-8.sql" : [ 5 ], "lnpls/bulk-sql-and-bulk-binding-1.sql" : [ 3 ], "lnpls/bulk-sql-and-bulk-binding-2.sql" : [ 3 ], "lnpls/bulk-sql-and-bulk-binding-28.sql" : [ 3 ], "lnpls/bulk-sql-and-bulk-binding-30.sql" : [ 3 ], "lnpls/bulk-sql-and-bulk-binding-5.sql" : [ 3 ], "lnpls/bulk-sql-and-bulk-binding-52.sql" : [ 10 ], "lnpls/bulk-sql-and-bulk-binding-59.sql" : [ 3 ], "lnpls/bulk-sql-and-bulk-binding-6.sql" : [ 8 ], "lnpls/bulk-sql-and-bulk-binding-61.sql" : [ 3 ], "lnpls/bulk-sql-and-bulk-binding-63.sql" : [ 3 ], "lnpls/bulk-sql-and-bulk-binding-65.sql" : [ 3 ], "lnpls/column-name-precedence-0.sql" : [ 3 ], "lnpls/column-name-precedence-2.sql" : [ 3 ], "lnpls/column-name-precedence-4.sql" : [ 3 ], "lnpls/compile-time-warnings-8.sql" : [ 2 ], "lnpls/compiling-pl-sql-units-native-execution-0.sql" : [ 2 ], "lnpls/compiling-pl-sql-units-native-execution-4.sql" : [ 2 ], "lnpls/compiling-pl-sql-units-native-execution-5.sql" : [ 2 ], "lnpls/conditional-compilation1-18.sql" : [ 46 ], "lnpls/conditional-compilation1-20.sql" : [ 2 ], "lnpls/conditional-compilation1-21.sql" : [ 2 ], "lnpls/conditional-compilation1-23.sql" : [ 4 ], "lnpls/conditional-selection-statements-21.sql" : [ 8 ], "lnpls/continuing-execution-handling-exceptions-0.sql" : [ 3 ], "lnpls/correlation-names-and-pseudorecords-17.sql" : [ 4 ], "lnpls/cursors-overview-0.sql" : [ 3 ], "lnpls/cursors-overview-2.sql" : [ 3 ], "lnpls/cursors-overview-7.sql" : [ 2 ], "lnpls/description-static-sql-0.sql" : [ 3 ], "lnpls/description-static-sql-2.sql" : [ 3 ], "lnpls/dml-triggers-38.sql" : [ 3 ], "lnpls/dml-triggers-42.sql" : [ 2 ], "lnpls/expressions-52.sql" : [ 8 ], "lnpls/expressions-54.sql" : [ 8 ], "lnpls/external-subprograms-4.sql" : [ 6 ], "lnpls/lexical-units-10.sql" : [ 7 ], "lnpls/loop-statements-31.sql" : [ 2 ], "lnpls/native-dynamic-sql-11.sql" : [ 2 ], "lnpls/overview-exception-handling-6.sql" : [ 22 ], "lnpls/overview-polymorphic-table-functions-18.sql" : [ 3 ], "lnpls/overview-polymorphic-table-functions-2.sql" : [ 5 ], "lnpls/overview-polymorphic-table-functions-29.sql" : [ 12 ], "lnpls/overview-polymorphic-table-functions-4.sql" : [ 2 ], "lnpls/overview-polymorphic-table-functions-5.sql" : [ 2 ], "lnpls/package-writing-guidelines-1.sql" : [ 4 ], "lnpls/record-variables-22.sql" : [ 7 ], "lnpls/record-variables-26.sql" : [ 2 ], "lnpls/record-variables-28.sql" : [ 2 ], "lnpls/release-changes-2.sql" : [ 2 ], "lnpls/release-changes-3.sql" : [ 2 ], "lnpls/retrying-transactions-handling-exceptions-0.sql" : [ 7 ], "lnpls/scope-and-visibility-identifiers-11.sql" : [ 3 ], "lnpls/sql-data-types-29.sql" : [ 8 ], "lnpls/sql-data-types-31.sql" : [ 3 ], "lnpls/sql-data-types-44.sql" : [ 3 ], "lnpls/subprograms-invoked-triggers-0.sql" : [ 8 ], "lnpls/transaction-processing-and-control-11.sql" : [ 3 ], "lnpls/transaction-processing-and-control-5.sql" : [ 3 ], "lnpls/transaction-processing-and-control-6.sql" : [ 3 ], "lnpls/transaction-processing-and-control-7.sql" : [ 3 ], "lnpls/transaction-processing-and-control-9.sql" : [ 3 ], "lnpls/triggers-publishing-events-0.sql" : [ 2 ], "lnpls/what-is-capture-2.sql" : [ 2 ], "lnpls/wrapping-pl-sql-source-text-pl-sql-wrapper-utility-7.sql" : [ 4 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-10.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-11.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-12.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-13.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-14.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-15.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-16.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-17.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-18.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-19.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-20.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-21.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-23.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-24.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-25.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-26.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-27.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-28.sql" : [ 3 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-29.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-3.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-30.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-31.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-32.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-33.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-34.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-35.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-36.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-37.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-6.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-7.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-8.sql" : [ 2 ], "sqlrf/ADMINISTER-KEY-MANAGEMENT-9.sql" : [ 2 ], "sqlrf/ALTER-ANALYTIC-VIEW-0.sql" : [ 2 ], "sqlrf/ALTER-ANALYTIC-VIEW-1.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-0.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-1.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-10.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-11.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-12.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-13.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-14.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-2.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-3.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-4.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-5.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-6.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-7.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-8.sql" : [ 2 ], "sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-9.sql" : [ 2 ], "sqlrf/ALTER-CLUSTER-0.sql" : [ 2 ], "sqlrf/ALTER-CLUSTER-1.sql" : [ 2 ], "sqlrf/ALTER-CLUSTER-2.sql" : [ 2 ], "sqlrf/ALTER-CLUSTER-4.sql" : [ 2 ], "sqlrf/ALTER-CLUSTER-6.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-1.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-10.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-11.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-12.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-13.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-14.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-15.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-16.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-17.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-18.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-19.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-2.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-20.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-21.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-22.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-23.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-24.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-25.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-26.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-27.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-28.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-3.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-4.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-5.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-6.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-7.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-8.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-9.sql" : [ 2 ], "sqlrf/ALTER-DATABASE-LINK-0.sql" : [ 2 ], "sqlrf/ALTER-DIMENSION-0.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-1.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-10.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-11.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-12.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-13.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-14.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-15.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-16.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-2.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-3.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-4.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-5.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-6.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-7.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-8.sql" : [ 2 ], "sqlrf/ALTER-DISKGROUP-9.sql" : [ 2 ], "sqlrf/ALTER-HIERARCHY-0.sql" : [ 2 ], "sqlrf/ALTER-INDEX-0.sql" : [ 2 ], "sqlrf/ALTER-INDEX-1.sql" : [ 2 ], "sqlrf/ALTER-INDEX-10.sql" : [ 2 ], "sqlrf/ALTER-INDEX-11.sql" : [ 2 ], "sqlrf/ALTER-INDEX-12.sql" : [ 2 ], "sqlrf/ALTER-INDEX-2.sql" : [ 2 ], "sqlrf/ALTER-INDEX-3.sql" : [ 2 ], "sqlrf/ALTER-INDEX-4.sql" : [ 2 ], "sqlrf/ALTER-INDEX-5.sql" : [ 2 ], "sqlrf/ALTER-INDEX-6.sql" : [ 2 ], "sqlrf/ALTER-INDEX-7.sql" : [ 2 ], "sqlrf/ALTER-INDEX-8.sql" : [ 2 ], "sqlrf/ALTER-INDEX-9.sql" : [ 2 ], "sqlrf/ALTER-INDEXTYPE-0.sql" : [ 2 ], "sqlrf/ALTER-INMEMORY-JOIN-GROUP-0.sql" : [ 2 ], "sqlrf/ALTER-INMEMORY-JOIN-GROUP-1.sql" : [ 2 ], "sqlrf/ALTER-JAVA-0.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-10.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-11.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-12.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-13.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-14.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-15.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-16.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-17.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-18.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-19.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-2.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-20.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-21.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-22.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-23.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-24.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-25.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-3.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-4.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-5.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-6.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-7.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-8.sql" : [ 2 ], "sqlrf/ALTER-LOCKDOWN-PROFILE-9.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-0.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-1.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-2.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-3.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-4.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-5.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-6.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-7.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-LOG-0.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-VIEW-LOG-1.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-ZONEMAP-0.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-ZONEMAP-1.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-ZONEMAP-2.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-ZONEMAP-3.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-ZONEMAP-4.sql" : [ 2 ], "sqlrf/ALTER-MATERIALIZED-ZONEMAP-5.sql" : [ 2 ], "sqlrf/ALTER-OPERATOR-0.sql" : [ 2 ], "sqlrf/ALTER-OUTLINE-0.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-0.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-1.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-10.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-11.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-12.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-13.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-14.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-15.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-16.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-17.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-18.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-19.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-2.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-20.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-21.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-3.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-6.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-7.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-8.sql" : [ 2 ], "sqlrf/ALTER-PLUGGABLE-DATABASE-9.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-0.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-1.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-2.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-3.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-4.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-5.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-6.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-7.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-8.sql" : [ 2 ], "sqlrf/ALTER-PROFILE-9.sql" : [ 2 ], "sqlrf/ALTER-RESOURCE-COST-0.sql" : [ 2 ], "sqlrf/ALTER-RESOURCE-COST-2.sql" : [ 2 ], "sqlrf/ALTER-ROLE-0.sql" : [ 2 ], "sqlrf/ALTER-ROLE-1.sql" : [ 2 ], "sqlrf/ALTER-ROLE-2.sql" : [ 2 ], "sqlrf/ALTER-ROLLBACK-SEGMENT-0.sql" : [ 2 ], "sqlrf/ALTER-ROLLBACK-SEGMENT-1.sql" : [ 2 ], "sqlrf/ALTER-SEQUENCE-0.sql" : [ 2 ], "sqlrf/ALTER-SEQUENCE-1.sql" : [ 2 ], "sqlrf/ALTER-SYNONYM-0.sql" : [ 2 ], "sqlrf/ALTER-SYNONYM-1.sql" : [ 2 ], "sqlrf/ALTER-SYNONYM-2.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-0.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-1.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-10.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-11.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-12.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-13.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-14.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-15.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-16.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-17.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-18.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-19.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-20.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-21.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-22.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-23.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-24.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-25.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-27.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-28.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-5.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-7.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-8.sql" : [ 2 ], "sqlrf/ALTER-SYSTEM-9.sql" : [ 2 ], "sqlrf/ALTER-TABLE-0.sql" : [ 2 ], "sqlrf/ALTER-TABLE-10.sql" : [ 2 ], "sqlrf/ALTER-TABLE-100.sql" : [ 3 ], "sqlrf/ALTER-TABLE-101.sql" : [ 3 ], "sqlrf/ALTER-TABLE-103.sql" : [ 2 ], "sqlrf/ALTER-TABLE-104.sql" : [ 2 ], "sqlrf/ALTER-TABLE-105.sql" : [ 2 ], "sqlrf/ALTER-TABLE-106.sql" : [ 2 ], "sqlrf/ALTER-TABLE-107.sql" : [ 2 ], "sqlrf/ALTER-TABLE-108.sql" : [ 9 ], "sqlrf/ALTER-TABLE-109.sql" : [ 4 ], "sqlrf/ALTER-TABLE-11.sql" : [ 2 ], "sqlrf/ALTER-TABLE-110.sql" : [ 2 ], "sqlrf/ALTER-TABLE-112.sql" : [ 2 ], "sqlrf/ALTER-TABLE-113.sql" : [ 3 ], "sqlrf/ALTER-TABLE-114.sql" : [ 3 ], "sqlrf/ALTER-TABLE-117.sql" : [ 2 ], "sqlrf/ALTER-TABLE-122.sql" : [ 2 ], "sqlrf/ALTER-TABLE-123.sql" : [ 2 ], "sqlrf/ALTER-TABLE-124.sql" : [ 2 ], "sqlrf/ALTER-TABLE-125.sql" : [ 2 ], "sqlrf/ALTER-TABLE-126.sql" : [ 2 ], "sqlrf/ALTER-TABLE-127.sql" : [ 2 ], "sqlrf/ALTER-TABLE-129.sql" : [ 3 ], "sqlrf/ALTER-TABLE-17.sql" : [ 2 ], "sqlrf/ALTER-TABLE-18.sql" : [ 2 ], "sqlrf/ALTER-TABLE-19.sql" : [ 2 ], "sqlrf/ALTER-TABLE-20.sql" : [ 2 ], "sqlrf/ALTER-TABLE-21.sql" : [ 3 ], "sqlrf/ALTER-TABLE-22.sql" : [ 3 ], "sqlrf/ALTER-TABLE-24.sql" : [ 3 ], "sqlrf/ALTER-TABLE-25.sql" : [ 3 ], "sqlrf/ALTER-TABLE-27.sql" : [ 3 ], "sqlrf/ALTER-TABLE-29.sql" : [ 3 ], "sqlrf/ALTER-TABLE-30.sql" : [ 3 ], "sqlrf/ALTER-TABLE-33.sql" : [ 3 ], "sqlrf/ALTER-TABLE-35.sql" : [ 3 ], "sqlrf/ALTER-TABLE-37.sql" : [ 2 ], "sqlrf/ALTER-TABLE-38.sql" : [ 2 ], "sqlrf/ALTER-TABLE-39.sql" : [ 2 ], "sqlrf/ALTER-TABLE-4.sql" : [ 2 ], "sqlrf/ALTER-TABLE-40.sql" : [ 2 ], "sqlrf/ALTER-TABLE-41.sql" : [ 2 ], "sqlrf/ALTER-TABLE-43.sql" : [ 2 ], "sqlrf/ALTER-TABLE-47.sql" : [ 2 ], "sqlrf/ALTER-TABLE-48.sql" : [ 2 ], "sqlrf/ALTER-TABLE-49.sql" : [ 2 ], "sqlrf/ALTER-TABLE-5.sql" : [ 2 ], "sqlrf/ALTER-TABLE-50.sql" : [ 2 ], "sqlrf/ALTER-TABLE-51.sql" : [ 2 ], "sqlrf/ALTER-TABLE-52.sql" : [ 13 ], "sqlrf/ALTER-TABLE-53.sql" : [ 3 ], "sqlrf/ALTER-TABLE-54.sql" : [ 3 ], "sqlrf/ALTER-TABLE-55.sql" : [ 3 ], "sqlrf/ALTER-TABLE-56.sql" : [ 3 ], "sqlrf/ALTER-TABLE-57.sql" : [ 2 ], "sqlrf/ALTER-TABLE-58.sql" : [ 3 ], "sqlrf/ALTER-TABLE-59.sql" : [ 2 ], "sqlrf/ALTER-TABLE-6.sql" : [ 2 ], "sqlrf/ALTER-TABLE-60.sql" : [ 3 ], "sqlrf/ALTER-TABLE-61.sql" : [ 2 ], "sqlrf/ALTER-TABLE-63.sql" : [ 10 ], "sqlrf/ALTER-TABLE-64.sql" : [ 2 ], "sqlrf/ALTER-TABLE-65.sql" : [ 2 ], "sqlrf/ALTER-TABLE-66.sql" : [ 3 ], "sqlrf/ALTER-TABLE-67.sql" : [ 2 ], "sqlrf/ALTER-TABLE-68.sql" : [ 3 ], "sqlrf/ALTER-TABLE-69.sql" : [ 2 ], "sqlrf/ALTER-TABLE-7.sql" : [ 2 ], "sqlrf/ALTER-TABLE-70.sql" : [ 2 ], "sqlrf/ALTER-TABLE-71.sql" : [ 4 ], "sqlrf/ALTER-TABLE-73.sql" : [ 3 ], "sqlrf/ALTER-TABLE-74.sql" : [ 2 ], "sqlrf/ALTER-TABLE-75.sql" : [ 3 ], "sqlrf/ALTER-TABLE-76.sql" : [ 3 ], "sqlrf/ALTER-TABLE-77.sql" : [ 2 ], "sqlrf/ALTER-TABLE-79.sql" : [ 2 ], "sqlrf/ALTER-TABLE-8.sql" : [ 4 ], "sqlrf/ALTER-TABLE-81.sql" : [ 2 ], "sqlrf/ALTER-TABLE-82.sql" : [ 2 ], "sqlrf/ALTER-TABLE-83.sql" : [ 2 ], "sqlrf/ALTER-TABLE-85.sql" : [ 2 ], "sqlrf/ALTER-TABLE-87.sql" : [ 2 ], "sqlrf/ALTER-TABLE-88.sql" : [ 3 ], "sqlrf/ALTER-TABLE-89.sql" : [ 3 ], "sqlrf/ALTER-TABLE-9.sql" : [ 2 ], "sqlrf/ALTER-TABLE-90.sql" : [ 3 ], "sqlrf/ALTER-TABLE-91.sql" : [ 3 ], "sqlrf/ALTER-TABLE-92.sql" : [ 3 ], "sqlrf/ALTER-TABLE-94.sql" : [ 3 ], "sqlrf/ALTER-TABLE-96.sql" : [ 2 ], "sqlrf/ALTER-TABLE-98.sql" : [ 3 ], "sqlrf/ALTER-TABLE-99.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-0.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-1.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-10.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-11.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-12.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-13.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-14.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-15.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-16.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-2.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-3.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-4.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-5.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-6.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-7.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-8.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-9.sql" : [ 2 ], "sqlrf/ALTER-TABLESPACE-SET-0.sql" : [ 2 ], "sqlrf/ALTER-USER-0.sql" : [ 2 ], "sqlrf/ALTER-USER-1.sql" : [ 2 ], "sqlrf/ALTER-USER-10.sql" : [ 2 ], "sqlrf/ALTER-USER-11.sql" : [ 2 ], "sqlrf/ALTER-USER-12.sql" : [ 2 ], "sqlrf/ALTER-USER-13.sql" : [ 2 ], "sqlrf/ALTER-USER-14.sql" : [ 2 ], "sqlrf/ALTER-USER-15.sql" : [ 2 ], "sqlrf/ALTER-USER-2.sql" : [ 2 ], "sqlrf/ALTER-USER-4.sql" : [ 2 ], "sqlrf/ALTER-USER-5.sql" : [ 2 ], "sqlrf/ALTER-USER-6.sql" : [ 2 ], "sqlrf/ALTER-USER-7.sql" : [ 2 ], "sqlrf/ALTER-USER-8.sql" : [ 2 ], "sqlrf/ALTER-USER-9.sql" : [ 2 ], "sqlrf/ALTER-VIEW-0.sql" : [ 2 ], "sqlrf/ALTER-VIEW-1.sql" : [ 2 ], "sqlrf/ANALYZE-0.sql" : [ 2 ], "sqlrf/ANALYZE-1.sql" : [ 2 ], "sqlrf/ANALYZE-2.sql" : [ 2 ], "sqlrf/ANALYZE-3.sql" : [ 2 ], "sqlrf/ANALYZE-4.sql" : [ 2 ], "sqlrf/ANALYZE-5.sql" : [ 2 ], "sqlrf/ANALYZE-6.sql" : [ 2 ], "sqlrf/APPROX_COUNT-0.sql" : [ 8 ], "sqlrf/APPROX_MEDIAN-0.sql" : [ 3 ], "sqlrf/APPROX_MEDIAN-1.sql" : [ 3 ], "sqlrf/APPROX_MEDIAN-2.sql" : [ 3 ], "sqlrf/APPROX_PERCENTILE-0.sql" : [ 3 ], "sqlrf/APPROX_PERCENTILE-1.sql" : [ 3 ], "sqlrf/APPROX_PERCENTILE-2.sql" : [ 3 ], "sqlrf/APPROX_PERCENTILE-3.sql" : [ 4 ], "sqlrf/APPROX_PERCENTILE_DETAIL-0.sql" : [ 3 ], "sqlrf/APPROX_RANK-0.sql" : [ 4 ], "sqlrf/APPROX_SUM-0.sql" : [ 8 ], "sqlrf/ASSOCIATE-STATISTICS-0.sql" : [ 2 ], "sqlrf/ASSOCIATE-STATISTICS-1.sql" : [ 2 ], "sqlrf/AUDIT-Unified-Auditing-0.sql" : [ 2 ], "sqlrf/AUDIT-Unified-Auditing-2.sql" : [ 2 ], "sqlrf/AUDIT-Unified-Auditing-4.sql" : [ 2 ], "sqlrf/AUDIT-Unified-Auditing-6.sql" : [ 2 ], "sqlrf/AUDIT-Unified-Auditing-8.sql" : [ 2 ], "sqlrf/CALL-0.sql" : [ 2 ], "sqlrf/CALL-1.sql" : [ 2 ], "sqlrf/CALL-2.sql" : [ 2 ], "sqlrf/CALL-3.sql" : [ 2 ], "sqlrf/CALL-4.sql" : [ 9 ], "sqlrf/CAST-13.sql" : [ 2 ], "sqlrf/CAST-16.sql" : [ 2 ], "sqlrf/CHR-5.sql" : [ 2 ], "sqlrf/CLUSTER_DETAILS-0.sql" : [ 3 ], "sqlrf/CLUSTER_DETAILS-1.sql" : [ 4 ], "sqlrf/CLUSTER_DISTANCE-0.sql" : [ 6 ], "sqlrf/CLUSTER_ID-0.sql" : [ 2 ], "sqlrf/CLUSTER_ID-1.sql" : [ 4 ], "sqlrf/CLUSTER_PROBABILITY-0.sql" : [ 4 ], "sqlrf/CLUSTER_SET-0.sql" : [ 3 ], "sqlrf/COLLATE-Operator-0.sql" : [ 4 ], "sqlrf/COLUMN_VALUE-Pseudocolumn-4.sql" : [ 7 ], "sqlrf/CORR-2.sql" : [ 3 ], "sqlrf/CREATE-ANALYTIC-VIEW-1.sql" : [ 2 ], "sqlrf/CREATE-ATTRIBUTE-DIMENSION-1.sql" : [ 2 ], "sqlrf/CREATE-ATTRIBUTE-DIMENSION-3.sql" : [ 2 ], "sqlrf/CREATE-ATTRIBUTE-DIMENSION-5.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-1.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-10.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-11.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-14.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-16.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-17.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-19.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-20.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-21.sql" : [ 4 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-22.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-23.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-24.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-25.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-26.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-27.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-28.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-30.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-9.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-0.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-1.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-10.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-2.sql" : [ 3 ], "sqlrf/CREATE-CLUSTER-3.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-4.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-5.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-6.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-7.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-8.sql" : [ 4 ], "sqlrf/CREATE-CLUSTER-9.sql" : [ 6 ], "sqlrf/CREATE-CONTEXT-0.sql" : [ 2 ], "sqlrf/CREATE-CONTROLFILE-0.sql" : [ 4 ], "sqlrf/CREATE-DATABASE-0.sql" : [ 2 ], "sqlrf/CREATE-DATABASE-1.sql" : [ 2 ], "sqlrf/CREATE-DATABASE-LINK-0.sql" : [ 2 ], "sqlrf/CREATE-DATABASE-LINK-2.sql" : [ 2 ], "sqlrf/CREATE-DATABASE-LINK-6.sql" : [ 2 ], "sqlrf/CREATE-DIMENSION-0.sql" : [ 2 ], "sqlrf/CREATE-DIMENSION-1.sql" : [ 2 ], "sqlrf/CREATE-DIMENSION-2.sql" : [ 2 ], "sqlrf/CREATE-DISKGROUP-0.sql" : [ 2 ], "sqlrf/CREATE-EDITION-1.sql" : [ 2 ], "sqlrf/CREATE-EDITION-2.sql" : [ 3 ], "sqlrf/CREATE-EDITION-3.sql" : [ 3 ], "sqlrf/CREATE-FLASHBACK-ARCHIVE-0.sql" : [ 2 ], "sqlrf/CREATE-FLASHBACK-ARCHIVE-2.sql" : [ 3 ], "sqlrf/CREATE-FLASHBACK-ARCHIVE-3.sql" : [ 3 ], "sqlrf/CREATE-HIERARCHY-0.sql" : [ 2 ], "sqlrf/CREATE-HIERARCHY-1.sql" : [ 2 ], "sqlrf/CREATE-HIERARCHY-2.sql" : [ 2 ], "sqlrf/CREATE-INDEX-0.sql" : [ 2 ], "sqlrf/CREATE-INDEX-10.sql" : [ 2 ], "sqlrf/CREATE-INDEX-12.sql" : [ 2 ], "sqlrf/CREATE-INDEX-14.sql" : [ 2 ], "sqlrf/CREATE-INDEX-15.sql" : [ 2 ], "sqlrf/CREATE-INDEX-17.sql" : [ 2 ], "sqlrf/CREATE-INDEX-19.sql" : [ 2 ], "sqlrf/CREATE-INDEX-20.sql" : [ 2 ], "sqlrf/CREATE-INDEX-21.sql" : [ 2 ], "sqlrf/CREATE-INDEX-22.sql" : [ 2 ], "sqlrf/CREATE-INDEX-23.sql" : [ 2 ], "sqlrf/CREATE-INDEX-24.sql" : [ 2 ], "sqlrf/CREATE-INDEX-25.sql" : [ 30 ], "sqlrf/CREATE-INDEX-26.sql" : [ 2 ], "sqlrf/CREATE-INDEX-27.sql" : [ 2 ], "sqlrf/CREATE-INDEX-28.sql" : [ 2 ], "sqlrf/CREATE-INDEX-29.sql" : [ 2 ], "sqlrf/CREATE-INDEX-4.sql" : [ 2 ], "sqlrf/CREATE-INDEX-6.sql" : [ 2 ], "sqlrf/CREATE-INDEX-7.sql" : [ 2 ], "sqlrf/CREATE-INDEX-8.sql" : [ 2 ], "sqlrf/CREATE-INDEX-9.sql" : [ 2 ], "sqlrf/CREATE-INDEXTYPE-0.sql" : [ 2 ], "sqlrf/CREATE-INMEMORY-JOIN-GROUP-0.sql" : [ 2 ], "sqlrf/CREATE-INMEMORY-JOIN-GROUP-1.sql" : [ 2 ], "sqlrf/CREATE-JAVA-1.sql" : [ 2 ], "sqlrf/CREATE-JAVA-2.sql" : [ 2 ], "sqlrf/CREATE-JAVA-3.sql" : [ 2 ], "sqlrf/CREATE-LOCKDOWN-PROFILE-0.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-11.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-12.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-2.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-3.sql" : [ 4 ], "sqlrf/CREATE-MATERIALIZED-VIEW-4.sql" : [ 5 ], "sqlrf/CREATE-MATERIALIZED-VIEW-5.sql" : [ 3 ], "sqlrf/CREATE-MATERIALIZED-VIEW-6.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-7.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-8.sql" : [ 5 ], "sqlrf/CREATE-MATERIALIZED-VIEW-9.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-LOG-1.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-LOG-2.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-LOG-3.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-LOG-4.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-LOG-5.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-LOG-6.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-LOG-7.sql" : [ 3 ], "sqlrf/CREATE-MATERIALIZED-VIEW-LOG-8.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-ZONEMAP-4.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-ZONEMAP-5.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-ZONEMAP-6.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-ZONEMAP-7.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-ZONEMAP-8.sql" : [ 2 ], "sqlrf/CREATE-OPERATOR-0.sql" : [ 9 ], "sqlrf/CREATE-OUTLINE-0.sql" : [ 2 ], "sqlrf/CREATE-OUTLINE-1.sql" : [ 2 ], "sqlrf/CREATE-OUTLINE-2.sql" : [ 2 ], "sqlrf/CREATE-PFILE-0.sql" : [ 2 ], "sqlrf/CREATE-PLUGGABLE-DATABASE-10.sql" : [ 2 ], "sqlrf/CREATE-PLUGGABLE-DATABASE-11.sql" : [ 2 ], "sqlrf/CREATE-PLUGGABLE-DATABASE-3.sql" : [ 2 ], "sqlrf/CREATE-PLUGGABLE-DATABASE-4.sql" : [ 2 ], "sqlrf/CREATE-PLUGGABLE-DATABASE-9.sql" : [ 2 ], "sqlrf/CREATE-PROFILE-1.sql" : [ 2 ], "sqlrf/CREATE-PROFILE-2.sql" : [ 2 ], "sqlrf/CREATE-PROFILE-4.sql" : [ 2 ], "sqlrf/CREATE-PROFILE-5.sql" : [ 2 ], "sqlrf/CREATE-PROFILE-6.sql" : [ 2 ], "sqlrf/CREATE-PROFILE-7.sql" : [ 2 ], "sqlrf/CREATE-RESTORE-POINT-0.sql" : [ 2 ], "sqlrf/CREATE-ROLE-1.sql" : [ 2 ], "sqlrf/CREATE-ROLE-2.sql" : [ 2 ], "sqlrf/CREATE-ROLE-3.sql" : [ 2 ], "sqlrf/CREATE-ROLE-4.sql" : [ 2 ], "sqlrf/CREATE-ROLE-5.sql" : [ 2 ], "sqlrf/CREATE-ROLE-6.sql" : [ 2 ], "sqlrf/CREATE-ROLE-7.sql" : [ 2 ], "sqlrf/CREATE-ROLLBACK-SEGMENT-0.sql" : [ 2 ], "sqlrf/CREATE-ROLLBACK-SEGMENT-1.sql" : [ 2 ], "sqlrf/CREATE-SCHEMA-0.sql" : [ 2 ], "sqlrf/CREATE-SEQUENCE-4.sql" : [ 6 ], "sqlrf/CREATE-SPFILE-0.sql" : [ 2 ], "sqlrf/CREATE-SPFILE-2.sql" : [ 2 ], "sqlrf/CREATE-TABLE-1.sql" : [ 2 ], "sqlrf/CREATE-TABLE-11.sql" : [ 2 ], "sqlrf/CREATE-TABLE-12.sql" : [ 2 ], "sqlrf/CREATE-TABLE-13.sql" : [ 3 ], "sqlrf/CREATE-TABLE-15.sql" : [ 26 ], "sqlrf/CREATE-TABLE-20.sql" : [ 2 ], "sqlrf/CREATE-TABLE-21.sql" : [ 2 ], "sqlrf/CREATE-TABLE-22.sql" : [ 4 ], "sqlrf/CREATE-TABLE-23.sql" : [ 2 ], "sqlrf/CREATE-TABLE-25.sql" : [ 2 ], "sqlrf/CREATE-TABLE-27.sql" : [ 3 ], "sqlrf/CREATE-TABLE-28.sql" : [ 3 ], "sqlrf/CREATE-TABLE-31.sql" : [ 13 ], "sqlrf/CREATE-TABLE-32.sql" : [ 15 ], "sqlrf/CREATE-TABLE-33.sql" : [ 9 ], "sqlrf/CREATE-TABLE-34.sql" : [ 13 ], "sqlrf/CREATE-TABLE-35.sql" : [ 11 ], "sqlrf/CREATE-TABLE-36.sql" : [ 7 ], "sqlrf/CREATE-TABLE-37.sql" : [ 2 ], "sqlrf/CREATE-TABLE-38.sql" : [ 2 ], "sqlrf/CREATE-TABLE-39.sql" : [ 5 ], "sqlrf/CREATE-TABLE-40.sql" : [ 5 ], "sqlrf/CREATE-TABLE-41.sql" : [ 5 ], "sqlrf/CREATE-TABLE-46.sql" : [ 2 ], "sqlrf/CREATE-TABLE-49.sql" : [ 8 ], "sqlrf/CREATE-TABLE-5.sql" : [ 2 ], "sqlrf/CREATE-TABLE-54.sql" : [ 13 ], "sqlrf/CREATE-TABLE-56.sql" : [ 10 ], "sqlrf/CREATE-TABLE-58.sql" : [ 16 ], "sqlrf/CREATE-TABLE-6.sql" : [ 2 ], "sqlrf/CREATE-TABLE-60.sql" : [ 2 ], "sqlrf/CREATE-TABLE-61.sql" : [ 6 ], "sqlrf/CREATE-TABLE-62.sql" : [ 5 ], "sqlrf/CREATE-TABLE-63.sql" : [ 4 ], "sqlrf/CREATE-TABLE-64.sql" : [ 15 ], "sqlrf/CREATE-TABLE-65.sql" : [ 2 ], "sqlrf/CREATE-TABLE-66.sql" : [ 2 ], "sqlrf/CREATE-TABLE-67.sql" : [ 2 ], "sqlrf/CREATE-TABLE-69.sql" : [ 2 ], "sqlrf/CREATE-TABLE-7.sql" : [ 2 ], "sqlrf/CREATE-TABLE-70.sql" : [ 2 ], "sqlrf/CREATE-TABLE-71.sql" : [ 2 ], "sqlrf/CREATE-TABLE-72.sql" : [ 3 ], "sqlrf/CREATE-TABLE-73.sql" : [ 2 ], "sqlrf/CREATE-TABLE-74.sql" : [ 3 ], "sqlrf/CREATE-TABLE-75.sql" : [ 2 ], "sqlrf/CREATE-TABLE-8.sql" : [ 2 ], "sqlrf/CREATE-TABLE-9.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-0.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-1.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-10.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-11.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-12.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-14.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-15.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-16.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-2.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-3.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-4.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-5.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-6.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-7.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-8.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-9.sql" : [ 2 ], "sqlrf/CREATE-TABLESPACE-SET-0.sql" : [ 2 ], "sqlrf/CREATE-USER-0.sql" : [ 2 ], "sqlrf/CREATE-USER-1.sql" : [ 2 ], "sqlrf/CREATE-USER-2.sql" : [ 2 ], "sqlrf/CREATE-USER-3.sql" : [ 2 ], "sqlrf/CREATE-USER-4.sql" : [ 2 ], "sqlrf/CREATE-USER-5.sql" : [ 2 ], "sqlrf/CREATE-USER-6.sql" : [ 2 ], "sqlrf/CREATE-USER-7.sql" : [ 2 ], "sqlrf/CREATE-USER-8.sql" : [ 2 ], "sqlrf/CREATE-USER-9.sql" : [ 2 ], "sqlrf/CREATE-VIEW-11.sql" : [ 3 ], "sqlrf/CREATE-VIEW-14.sql" : [ 15 ], "sqlrf/CREATE-VIEW-2.sql" : [ 2 ], "sqlrf/CREATE-VIEW-3.sql" : [ 2 ], "sqlrf/CUME_DIST-0.sql" : [ 3 ], "sqlrf/CV-0.sql" : [ 6 ], "sqlrf/Comments-1.sql" : [ 6 ], "sqlrf/Comments-2.sql" : [ 2 ], "sqlrf/Comments-29.sql" : [ 2 ], "sqlrf/Comments-4.sql" : [ 2 ], "sqlrf/Comments-44.sql" : [ 2 ], "sqlrf/Comments-49.sql" : [ 3 ], "sqlrf/DELETE-0.sql" : [ 3 ], "sqlrf/DELETE-12.sql" : [ 2 ], "sqlrf/DELETE-5.sql" : [ 2 ], "sqlrf/DELETE-7.sql" : [ 11 ], "sqlrf/DENSE_RANK-0.sql" : [ 3 ], "sqlrf/DISASSOCIATE-STATISTICS-0.sql" : [ 2 ], "sqlrf/DROP-DATABASE-0.sql" : [ 4 ], "sqlrf/Data-Types-16.sql" : [ 2 ], "sqlrf/Data-Types-17.sql" : [ 5 ], "sqlrf/Data-Types-36.sql" : [ 4 ], "sqlrf/EXPLAIN-PLAN-0.sql" : [ 2 ], "sqlrf/EXPLAIN-PLAN-3.sql" : [ 2 ], "sqlrf/FEATURE_COMPARE-0.sql" : [ 2 ], "sqlrf/FEATURE_COMPARE-1.sql" : [ 2 ], "sqlrf/FEATURE_DETAILS-0.sql" : [ 3 ], "sqlrf/FEATURE_DETAILS-1.sql" : [ 4 ], "sqlrf/FEATURE_ID-0.sql" : [ 2 ], "sqlrf/FEATURE_SET-0.sql" : [ 21 ], "sqlrf/FEATURE_VALUE-0.sql" : [ 3 ], "sqlrf/FLASHBACK-DATABASE-0.sql" : [ 4 ], "sqlrf/FLASHBACK-DATABASE-1.sql" : [ 6 ], "sqlrf/FLASHBACK-TABLE-1.sql" : [ 3 ], "sqlrf/FLASHBACK-TABLE-3.sql" : [ 3 ], "sqlrf/FLASHBACK-TABLE-6.sql" : [ 2 ], "sqlrf/FLASHBACK-TABLE-8.sql" : [ 2 ], "sqlrf/FLASHBACK-TABLE-9.sql" : [ 2 ], "sqlrf/Floating-Point-Conditions-1.sql" : [ 3 ], "sqlrf/Floating-Point-Conditions-3.sql" : [ 3 ], "sqlrf/Graphic-Syntax-Diagrams-2.sql" : [ 2 ], "sqlrf/INSERT-26.sql" : [ 8 ], "sqlrf/ITERATION_NUMBER-0.sql" : [ 6 ], "sqlrf/Interval-Expressions-0.sql" : [ 2 ], "sqlrf/JSON_SERIALIZE-0.sql" : [ 2 ], "sqlrf/JSON_TRANSFORM-1.sql" : [ 2 ], "sqlrf/LOCK-TABLE-1.sql" : [ 2 ], "sqlrf/LOCK-TABLE-2.sql" : [ 2 ], "sqlrf/MERGE-10.sql" : [ 11 ], "sqlrf/MERGE-12.sql" : [ 11 ], "sqlrf/Model-Conditions-0.sql" : [ 6 ], "sqlrf/Model-Conditions-1.sql" : [ 6 ], "sqlrf/Model-Expressions-0.sql" : [ 6 ], "sqlrf/Multiset-Operators-0.sql" : [ 2 ], "sqlrf/Multiset-Operators-2.sql" : [ 3 ], "sqlrf/NCHR-0.sql" : [ 4 ], "sqlrf/NOAUDIT-Traditional-Auditing-0.sql" : [ 2 ], "sqlrf/NOAUDIT-Traditional-Auditing-1.sql" : [ 2 ], "sqlrf/NOAUDIT-Traditional-Auditing-2.sql" : [ 2 ], "sqlrf/NOAUDIT-Traditional-Auditing-3.sql" : [ 2 ], "sqlrf/NOAUDIT-Traditional-Auditing-4.sql" : [ 2 ], "sqlrf/NOAUDIT-Unified-Auditing-0.sql" : [ 2 ], "sqlrf/NOAUDIT-Unified-Auditing-3.sql" : [ 2 ], "sqlrf/NOAUDIT-Unified-Auditing-5.sql" : [ 2 ], "sqlrf/NOAUDIT-Unified-Auditing-7.sql" : [ 2 ], "sqlrf/ORA_DM_PARTITION_NAME-0.sql" : [ 2 ], "sqlrf/PERCENTILE_CONT-1.sql" : [ 3 ], "sqlrf/PERCENTILE_CONT-2.sql" : [ 3 ], "sqlrf/PERCENTILE_DISC-0.sql" : [ 3 ], "sqlrf/PERCENT_RANK-0.sql" : [ 3 ], "sqlrf/PREDICTION-0.sql" : [ 4 ], "sqlrf/PREDICTION-2.sql" : [ 6 ], "sqlrf/PREDICTION_BOUNDS-0.sql" : [ 5 ], "sqlrf/PREDICTION_COST-2.sql" : [ 4 ], "sqlrf/PREDICTION_DETAILS-0.sql" : [ 2 ], "sqlrf/PREDICTION_DETAILS-1.sql" : [ 6 ], "sqlrf/PREDICTION_PROBABILITY-0.sql" : [ 6 ], "sqlrf/PREDICTION_PROBABILITY-1.sql" : [ 7 ], "sqlrf/PREDICTION_SET-0.sql" : [ 4 ], "sqlrf/PRESENTNNV-0.sql" : [ 6 ], "sqlrf/PRESENTV-0.sql" : [ 6 ], "sqlrf/PREVIOUS-0.sql" : [ 5 ], "sqlrf/PURGE-1.sql" : [ 2 ], "sqlrf/PURGE-2.sql" : [ 2 ], "sqlrf/PURGE-3.sql" : [ 2 ], "sqlrf/RANK-0.sql" : [ 3 ], "sqlrf/RANK-1.sql" : [ 3 ], "sqlrf/REF-1.sql" : [ 2 ], "sqlrf/REFTOHEX-0.sql" : [ 2 ], "sqlrf/RENAME-0.sql" : [ 2 ], "sqlrf/RENAME-1.sql" : [ 3 ], "sqlrf/REVOKE-0.sql" : [ 2 ], "sqlrf/REVOKE-1.sql" : [ 2 ], "sqlrf/REVOKE-10.sql" : [ 2 ], "sqlrf/REVOKE-12.sql" : [ 2 ], "sqlrf/REVOKE-15.sql" : [ 2 ], "sqlrf/REVOKE-16.sql" : [ 2 ], "sqlrf/REVOKE-19.sql" : [ 4 ], "sqlrf/REVOKE-2.sql" : [ 2 ], "sqlrf/REVOKE-3.sql" : [ 2 ], "sqlrf/REVOKE-5.sql" : [ 2 ], "sqlrf/REVOKE-6.sql" : [ 2 ], "sqlrf/REVOKE-8.sql" : [ 2 ], "sqlrf/SCN_TO_TIMESTAMP-2.sql" : [ 4 ], "sqlrf/SELECT-10.sql" : [ 4 ], "sqlrf/SELECT-11.sql" : [ 4 ], "sqlrf/SELECT-116.sql" : [ 4 ], "sqlrf/SELECT-117.sql" : [ 4 ], "sqlrf/SELECT-17.sql" : [ 3 ], "sqlrf/SELECT-20.sql" : [ 5 ], "sqlrf/SELECT-21.sql" : [ 2 ], "sqlrf/SELECT-31.sql" : [ 6 ], "sqlrf/SELECT-33.sql" : [ 3 ], "sqlrf/SELECT-35.sql" : [ 3 ], "sqlrf/SELECT-37.sql" : [ 4 ], "sqlrf/SELECT-42.sql" : [ 2 ], "sqlrf/SELECT-44.sql" : [ 2 ], "sqlrf/SELECT-45.sql" : [ 2 ], "sqlrf/SELECT-46.sql" : [ 2 ], "sqlrf/SELECT-48.sql" : [ 3 ], "sqlrf/SELECT-49.sql" : [ 3 ], "sqlrf/SELECT-5.sql" : [ 3 ], "sqlrf/SELECT-50.sql" : [ 4 ], "sqlrf/SELECT-65.sql" : [ 6 ], "sqlrf/SELECT-66.sql" : [ 8 ], "sqlrf/SELECT-74.sql" : [ 3 ], "sqlrf/SELECT-75.sql" : [ 2 ], "sqlrf/SELECT-82.sql" : [ 3 ], "sqlrf/SELECT-87.sql" : [ 7 ], "sqlrf/SELECT-91.sql" : [ 2 ], "sqlrf/SELECT-94.sql" : [ 3 ], "sqlrf/SELECT-95.sql" : [ 3 ], "sqlrf/SELECT-97.sql" : [ 8 ], "sqlrf/SELECT-98.sql" : [ 14 ], "sqlrf/SET-CONSTRAINTS-1.sql" : [ 3 ], "sqlrf/SQL-JSON-Conditions-36.sql" : [ 2 ], "sqlrf/SYS_GUID-0.sql" : [ 2 ], "sqlrf/SYS_OP_ZONE_ID-0.sql" : [ 2 ], "sqlrf/SYS_OP_ZONE_ID-1.sql" : [ 2 ], "sqlrf/SYS_OP_ZONE_ID-2.sql" : [ 2 ], "sqlrf/SYS_OP_ZONE_ID-3.sql" : [ 2 ], "sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-3.sql" : [ 4 ], "sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-4.sql" : [ 3 ], "sqlrf/TRANSLATE-USING-0.sql" : [ 10 ], "sqlrf/TRUNCATE-CLUSTER-0.sql" : [ 2 ], "sqlrf/Type-Constructor-Expressions-1.sql" : [ 2 ], "sqlrf/UPDATE-0.sql" : [ 4 ], "sqlrf/UPDATE-5.sql" : [ 2 ], "sqlrf/UPDATE-6.sql" : [ 2 ], "sqlrf/UPDATE-9.sql" : [ 4 ], "sqlrf/Using-Extensible-Indexing-3.sql" : [ 2 ], "sqlrf/Using-Extensible-Indexing-4.sql" : [ 2 ], "sqlrf/Using-Extensible-Indexing-6.sql" : [ 2 ], "sqlrf/Using-XML-in-SQL-Statements-0.sql" : [ 2 ], "sqlrf/Using-XML-in-SQL-Statements-4.sql" : [ 2 ], "sqlrf/Using-XML-in-SQL-Statements-6.sql" : [ 2 ], "sqlrf/Using-XML-in-SQL-Statements-8.sql" : [ 5 ], "sqlrf/Using-XML-in-SQL-Statements-9.sql" : [ 5 ], "sqlrf/VALIDATE_CONVERSION-0.sql" : [ 2 ], "sqlrf/VALIDATE_CONVERSION-1.sql" : [ 2 ], "sqlrf/VALIDATE_CONVERSION-2.sql" : [ 2 ], "sqlrf/XMLDATA-Pseudocolumn-0.sql" : [ 2 ], "sqlrf/XMLDATA-Pseudocolumn-1.sql" : [ 3 ], "sqlrf/XMLDATA-Pseudocolumn-2.sql" : [ 3 ], "sqlrf/alter-domain-0.sql" : [ 2 ], "sqlrf/alter-domain-1.sql" : [ 2 ], "sqlrf/alter-domain-2.sql" : [ 2 ], "sqlrf/alter-domain-3.sql" : [ 2 ], "sqlrf/alter-domain-4.sql" : [ 2 ], "sqlrf/alter-domain-5.sql" : [ 2 ], "sqlrf/alter-domain-6.sql" : [ 2 ], "sqlrf/alter-mle-env-0.sql" : [ 2 ], "sqlrf/alter-mle-module-0.sql" : [ 2 ], "sqlrf/analytic-view-measure-expressions-5.sql" : [ 5 ], "sqlrf/annotations_clause-0.sql" : [ 2 ], "sqlrf/annotations_clause-1.sql" : [ 2 ], "sqlrf/annotations_clause-2.sql" : [ 2 ], "sqlrf/annotations_clause-3.sql" : [ 2 ], "sqlrf/annotations_clause-4.sql" : [ 4 ], "sqlrf/annotations_clause-5.sql" : [ 3 ], "sqlrf/constraint-1.sql" : [ 10 ], "sqlrf/constraint-15.sql" : [ 2 ], "sqlrf/constraint-16.sql" : [ 2 ], "sqlrf/constraint-17.sql" : [ 2 ], "sqlrf/constraint-2.sql" : [ 4 ], "sqlrf/constraint-27.sql" : [ 10 ], "sqlrf/constraint-29.sql" : [ 5 ], "sqlrf/constraint-31.sql" : [ 10 ], "sqlrf/constraint-5.sql" : [ 3 ], "sqlrf/constraint-8.sql" : [ 10 ], "sqlrf/create-domain-10.sql" : [ 2 ], "sqlrf/create-domain-11.sql" : [ 2 ], "sqlrf/create-domain-12.sql" : [ 2 ], "sqlrf/create-domain-13.sql" : [ 2 ], "sqlrf/create-domain-14.sql" : [ 2 ], "sqlrf/create-domain-15.sql" : [ 2 ], "sqlrf/create-domain-16.sql" : [ 2 ], "sqlrf/create-domain-20.sql" : [ 2 ], "sqlrf/create-domain-21.sql" : [ 2 ], "sqlrf/create-domain-24.sql" : [ 2 ], "sqlrf/create-domain-27.sql" : [ 2 ], "sqlrf/create-domain-29.sql" : [ 2 ], "sqlrf/create-domain-35.sql" : [ 3 ], "sqlrf/create-domain-4.sql" : [ 2 ], "sqlrf/create-domain-43.sql" : [ 2 ], "sqlrf/create-domain-5.sql" : [ 2 ], "sqlrf/create-domain-6.sql" : [ 2 ], "sqlrf/create-domain-7.sql" : [ 2 ], "sqlrf/create-domain-8.sql" : [ 2 ], "sqlrf/create-domain-9.sql" : [ 2 ], "sqlrf/create-mle-env-0.sql" : [ 2 ], "sqlrf/create-mle-env-1.sql" : [ 2 ], "sqlrf/create-property-graph-0.sql" : [ 2 ], "sqlrf/create-property-graph-1.sql" : [ 2 ], "sqlrf/create-property-graph-11.sql" : [ 2 ], "sqlrf/create-property-graph-12.sql" : [ 2 ], "sqlrf/create-property-graph-14.sql" : [ 2 ], "sqlrf/create-property-graph-16.sql" : [ 2 ], "sqlrf/create-property-graph-17.sql" : [ 2 ], "sqlrf/create-property-graph-18.sql" : [ 2 ], "sqlrf/create-property-graph-19.sql" : [ 2 ], "sqlrf/create-property-graph-2.sql" : [ 2 ], "sqlrf/create-property-graph-23.sql" : [ 2 ], "sqlrf/create-property-graph-3.sql" : [ 2 ], "sqlrf/create-property-graph-4.sql" : [ 2 ], "sqlrf/create-property-graph-8.sql" : [ 2 ], "sqlrf/create-property-graph-9.sql" : [ 2 ], "sqlrf/create-vector-index-0.sql" : [ 2 ], "sqlrf/create-vector-index-1.sql" : [ 2 ], "sqlrf/create-vector-index-2.sql" : [ 2 ], "sqlrf/create-vector-index-3.sql" : [ 2 ], "sqlrf/domain_check-0.sql" : [ 2 ], "sqlrf/domain_check-1.sql" : [ 2 ], "sqlrf/domain_check-3.sql" : [ 2 ], "sqlrf/domain_check-6.sql" : [ 2 ], "sqlrf/domain_check-7.sql" : [ 2 ], "sqlrf/domain_check-9.sql" : [ 10 ], "sqlrf/domain_check_type-0.sql" : [ 2 ], "sqlrf/domain_check_type-2.sql" : [ 2 ], "sqlrf/domain_check_type-5.sql" : [ 2 ], "sqlrf/domain_check_type-6.sql" : [ 2 ], "sqlrf/domain_check_type-8.sql" : [ 10 ], "sqlrf/domain_display-0.sql" : [ 2 ], "sqlrf/domain_display-2.sql" : [ 3 ], "sqlrf/domain_display-6.sql" : [ 3 ], "sqlrf/domain_name-0.sql" : [ 2 ], "sqlrf/domain_order-0.sql" : [ 2 ], "sqlrf/domain_order-2.sql" : [ 3 ], "sqlrf/domain_order-6.sql" : [ 3 ], "sqlrf/file_specification-0.sql" : [ 2 ], "sqlrf/file_specification-1.sql" : [ 2 ], "sqlrf/file_specification-2.sql" : [ 2 ], "sqlrf/file_specification-3.sql" : [ 2 ], "sqlrf/file_specification-4.sql" : [ 2 ], "sqlrf/file_specification-5.sql" : [ 2 ], "sqlrf/from_vector-2.sql" : [ 2 ], "sqlrf/from_vector-3.sql" : [ 2 ], "sqlrf/from_vector-4.sql" : [ 2 ], "sqlrf/from_vector-5.sql" : [ 2 ], "sqlrf/graph-pattern-0.sql" : [ 4 ], "sqlrf/graph-pattern-10.sql" : [ 4 ], "sqlrf/graph-pattern-11.sql" : [ 4 ], "sqlrf/graph-pattern-13.sql" : [ 5 ], "sqlrf/graph-pattern-15.sql" : [ 4 ], "sqlrf/graph-pattern-17.sql" : [ 4 ], "sqlrf/graph-pattern-19.sql" : [ 4 ], "sqlrf/graph-pattern-2.sql" : [ 4 ], "sqlrf/graph-pattern-21.sql" : [ 4 ], "sqlrf/graph-pattern-23.sql" : [ 4 ], "sqlrf/graph-pattern-25.sql" : [ 4 ], "sqlrf/graph-pattern-27.sql" : [ 4 ], "sqlrf/graph-pattern-29.sql" : [ 4 ], "sqlrf/graph-pattern-3.sql" : [ 5 ], "sqlrf/graph-pattern-31.sql" : [ 4 ], "sqlrf/graph-pattern-33.sql" : [ 4 ], "sqlrf/graph-pattern-35.sql" : [ 4 ], "sqlrf/graph-pattern-37.sql" : [ 4 ], "sqlrf/graph-pattern-38.sql" : [ 4 ], "sqlrf/graph-pattern-40.sql" : [ 5 ], "sqlrf/graph-pattern-42.sql" : [ 4 ], "sqlrf/graph-pattern-44.sql" : [ 4 ], "sqlrf/graph-pattern-5.sql" : [ 4 ], "sqlrf/graph-pattern-7.sql" : [ 4 ], "sqlrf/graph-pattern-9.sql" : [ 4 ], "sqlrf/graph-reference-0.sql" : [ 4 ], "sqlrf/graph-reference-3.sql" : [ 5 ], "sqlrf/graph-reference-4.sql" : [ 4 ], "sqlrf/graph-table-shape-0.sql" : [ 4 ], "sqlrf/graph-table-shape-10.sql" : [ 4 ], "sqlrf/graph-table-shape-2.sql" : [ 4 ], "sqlrf/graph-table-shape-4.sql" : [ 5 ], "sqlrf/graph-table-shape-6.sql" : [ 4 ], "sqlrf/graph-table-shape-8.sql" : [ 4 ], "sqlrf/graph_table-operator-0.sql" : [ 3 ], "sqlrf/graph_table-operator-1.sql" : [ 3 ], "sqlrf/graph_table-operator-2.sql" : [ 3 ], "sqlrf/graph_table-operator-3.sql" : [ 3 ], "sqlrf/graph_table-operator-4.sql" : [ 2 ], "sqlrf/graph_table-operator-5.sql" : [ 4 ], "sqlrf/storage_clause-0.sql" : [ 6 ], "sqlrf/value-expressions-graph_table-0.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-10.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-12.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-13.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-14.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-16.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-17.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-19.sql" : [ 2 ], "sqlrf/value-expressions-graph_table-2.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-20.sql" : [ 5 ], "sqlrf/value-expressions-graph_table-21.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-23.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-25.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-27.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-4.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-6.sql" : [ 4 ], "sqlrf/value-expressions-graph_table-8.sql" : [ 5 ], "sqlrf/vector_chunks-1.sql" : [ 11 ], "sqlrf/vector_chunks-2.sql" : [ 15 ], "sqlrf/vector_embedding-0.sql" : [ 2 ], "sqlrf/vector_serialize-1.sql" : [ 2 ], "sqlrf/vector_serialize-2.sql" : [ 2 ], "sqlrf/vector_serialize-3.sql" : [ 2 ], "sqlrf/vector_serialize-4.sql" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/QueryWithoutExceptionHandlingCheck.json ================================================ { "adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-0.sql" : [ 5 ], "lnpls/CREATE-PACKAGE-BODY-statement-0.sql" : [ 11, 26, 45, 50, 63 ], "lnpls/CREATE-TYPE-statement-13.sql" : [ 7 ], "lnpls/GOTO-statement-5.sql" : [ 6 ], "lnpls/assigning-values-record-variables-10.sql" : [ 9 ], "lnpls/assigning-values-record-variables-15.sql" : [ 10 ], "lnpls/assigning-values-variables-3.sql" : [ 5 ], "lnpls/assigning-values-variables-5.sql" : [ 15 ], "lnpls/autonomous-transactions-1.sql" : [ 17 ], "lnpls/autonomous-transactions-9.sql" : [ 25 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-10.sql" : [ 6, 12, 18 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-7.sql" : [ 6 ], "lnpls/column-name-precedence-6.sql" : [ 8 ], "lnpls/external-subprograms-5.sql" : [ 8 ], "lnpls/lexical-units-20.sql" : [ 7 ], "lnpls/minimizing-cpu-overhead-0.sql" : [ 8, 19, 25, 38 ], "lnpls/minimizing-cpu-overhead-2.sql" : [ 25 ], "lnpls/package-example-0.sql" : [ 115 ], "lnpls/pl-sql-function-result-cache-10.sql" : [ 9 ], "lnpls/pl-sql-function-result-cache-13.sql" : [ 11 ], "lnpls/pl-sql-function-result-cache-15.sql" : [ 12 ], "lnpls/pl-sql-function-result-cache-4.sql" : [ 26, 30, 35 ], "lnpls/pl-sql-function-result-cache-6.sql" : [ 36 ], "lnpls/pl-sql-function-result-cache-9.sql" : [ 9 ], "lnpls/record-variables-30.sql" : [ 5 ], "lnpls/release-changes-0.sql" : [ 15 ], "lnpls/sequential-control-statements-0.sql" : [ 6 ], "lnpls/sql-data-types-32.sql" : [ 11 ], "lnpls/subprogram-parameters-37.sql" : [ 10 ], "lnpls/transaction-processing-and-control-8.sql" : [ 10, 15, 20 ], "lnpls/trigger-restrictions-0.sql" : [ 20 ], "lnpls/views-information-triggers-0.sql" : [ 7 ], "lnpls/views-information-triggers-5.sql" : [ 5 ], "lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms-3.sql" : [ 5, 8 ], "sqlrf/BIN_TO_NUM-1.sql" : [ 11 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/RaiseStandardExceptionCheck.json ================================================ { "lnpls/raising-exceptions-explicitly-2.sql" : [ 8 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/SameBranchCheck.json ================================================ { "lnpls/system-triggers-1.sql" : [ 8 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/SameConditionCheck.json ================================================ { "sqlrf/boolean_and_agg-6.sql" : [ 2, 2 ], "sqlrf/boolean_or_agg-6.sql" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/SelectAllColumnsCheck.json ================================================ { "adjsn/creating-view-json-data-using-json_table-0.sql" : [ 3 ], "adjsn/json-data-type-7.sql" : [ 2 ], "adjsn/querying-data-guide-0.sql" : [ 4 ], "adjsn/querying-data-guide-1.sql" : [ 7 ], "adjsn/sql-json-function-json_table-2.sql" : [ 2 ], "adjsn/sql-json-function-json_table-3.sql" : [ 2 ], "adjsn/sql-nested-clause-instead-json_table-4.sql" : [ 2 ], "adjsn/type-clause-sql-functions-and-conditions-2.sql" : [ 2 ], "adjsn/types-filter-condition-comparisons-0.sql" : [ 2 ], "adjsn/using-geojson-geographic-data-3.sql" : [ 2 ], "adjsn/using-json_table-json-arrays-0.sql" : [ 2 ], "adjsn/using-json_table-json-arrays-1.sql" : [ 2 ], "adjsn/using-json_table-json-arrays-2.sql" : [ 2 ], "adjsn/using-json_table-json-arrays-4.sql" : [ 2 ], "adjsn/using-json_value-function-based-index-json_table-queries-0.sql" : [ 2 ], "lnpls/PIPELINED-clause-1.sql" : [ 2 ], "lnpls/SQL_MACRO-clause-11.sql" : [ 6 ], "lnpls/SQL_MACRO-clause-17.sql" : [ 2 ], "lnpls/SQL_MACRO-clause-20.sql" : [ 2 ], "lnpls/SQL_MACRO-clause-22.sql" : [ 6 ], "lnpls/SQL_MACRO-clause-25.sql" : [ 2 ], "lnpls/SQL_MACRO-clause-27.sql" : [ 2 ], "lnpls/SQL_MACRO-clause-29.sql" : [ 2 ], "lnpls/SQL_MACRO-clause-31.sql" : [ 2 ], "lnpls/autonomous-transactions-6.sql" : [ 16 ], "lnpls/autonomous-transactions-7.sql" : [ 4 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-0.sql" : [ 10 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-3.sql" : [ 2 ], "lnpls/bulk-sql-and-bulk-binding-19.sql" : [ 2 ], "lnpls/bulk-sql-and-bulk-binding-26.sql" : [ 2 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-0.sql" : [ 2 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-1.sql" : [ 2 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-10.sql" : [ 2, 2 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-14.sql" : [ 2, 4, 5 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-4.sql" : [ 2 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-6.sql" : [ 2 ], "lnpls/chaining-pipelined-table-functions-multiple-transformations-8.sql" : [ 36, 38 ], "lnpls/correlation-names-and-pseudorecords-15.sql" : [ 19 ], "lnpls/correlation-names-and-pseudorecords-6.sql" : [ 2 ], "lnpls/cursor-variables-12.sql" : [ 14 ], "lnpls/cursor-variables-14.sql" : [ 10 ], "lnpls/cursor-variables-15.sql" : [ 11, 15, 19 ], "lnpls/cursor-variables-16.sql" : [ 11, 13, 15 ], "lnpls/cursor-variables-17.sql" : [ 3, 4, 5 ], "lnpls/cursors-overview-6.sql" : [ 10, 16 ], "lnpls/dml-triggers-45.sql" : [ 22 ], "lnpls/dml-triggers-47.sql" : [ 8 ], "lnpls/dml-triggers-52.sql" : [ 2 ], "lnpls/dml-triggers-54.sql" : [ 2 ], "lnpls/dml-triggers-56.sql" : [ 2 ], "lnpls/inserting-records-tables-0.sql" : [ 48 ], "lnpls/main-features-pl-sql-1.sql" : [ 4 ], "lnpls/overview-polymorphic-table-functions-0.sql" : [ 2 ], "lnpls/overview-polymorphic-table-functions-1.sql" : [ 3, 4 ], "lnpls/overview-polymorphic-table-functions-10.sql" : [ 2 ], "lnpls/overview-polymorphic-table-functions-12.sql" : [ 2 ], "lnpls/overview-polymorphic-table-functions-14.sql" : [ 2 ], "lnpls/overview-polymorphic-table-functions-19.sql" : [ 2 ], "lnpls/overview-polymorphic-table-functions-23.sql" : [ 6 ], "lnpls/overview-polymorphic-table-functions-25.sql" : [ 10 ], "lnpls/overview-polymorphic-table-functions-6.sql" : [ 2 ], "lnpls/overview-polymorphic-table-functions-8.sql" : [ 2 ], "lnpls/package-writing-guidelines-0.sql" : [ 8 ], "lnpls/pl-sql-function-result-cache-16.sql" : [ 17 ], "lnpls/plsql-program-limits-2.sql" : [ 2 ], "lnpls/predefined-exceptions-3.sql" : [ 18, 21 ], "lnpls/processing-query-result-sets-4.sql" : [ 4 ], "lnpls/sql-data-types-34.sql" : [ 5 ], "lnpls/sql-data-types-36.sql" : [ 18 ], "lnpls/sql-injection-10.sql" : [ 2 ], "lnpls/sql-injection-14.sql" : [ 2 ], "lnpls/sql-injection-16.sql" : [ 2 ], "lnpls/subprogram-parameters-24.sql" : [ 14 ], "lnpls/transaction-processing-and-control-1.sql" : [ 2 ], "lnpls/transaction-processing-and-control-3.sql" : [ 2 ], "lnpls/trigger-restrictions-12.sql" : [ 2 ], "lnpls/trigger-restrictions-14.sql" : [ 2 ], "lnpls/trigger-restrictions-7.sql" : [ 2 ], "lnpls/trigger-restrictions-9.sql" : [ 2 ], "lnpls/updating-rows-records-0.sql" : [ 22 ], "lnpls/what-is-capture-1.sql" : [ 4 ], "sqlrf/ALTER-SESSION-23.sql" : [ 4 ], "sqlrf/ALTER-TABLE-119.sql" : [ 2 ], "sqlrf/ALTER-TABLE-121.sql" : [ 2 ], "sqlrf/ALTER-TABLE-14.sql" : [ 2 ], "sqlrf/ALTER-TABLE-23.sql" : [ 2 ], "sqlrf/ALTER-TABLE-44.sql" : [ 2 ], "sqlrf/ALTER-TABLE-46.sql" : [ 2 ], "sqlrf/APPROX_PERCENTILE_DETAIL-8.sql" : [ 6 ], "sqlrf/Arithmetic-Operators-0.sql" : [ 2, 7 ], "sqlrf/BETWEEN-Condition-5.sql" : [ 2 ], "sqlrf/COLUMN_VALUE-Pseudocolumn-0.sql" : [ 2 ], "sqlrf/CONVERT-1.sql" : [ 2 ], "sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-15.sql" : [ 2 ], "sqlrf/CREATE-CLUSTER-12.sql" : [ 2 ], "sqlrf/CREATE-CONTEXT-1.sql" : [ 3 ], "sqlrf/CREATE-DATABASE-LINK-3.sql" : [ 2 ], "sqlrf/CREATE-DATABASE-LINK-5.sql" : [ 2 ], "sqlrf/CREATE-INDEX-18.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-0.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-1.sql" : [ 3 ], "sqlrf/CREATE-TABLE-47.sql" : [ 2 ], "sqlrf/Comments-16.sql" : [ 2 ], "sqlrf/Comments-17.sql" : [ 2 ], "sqlrf/Comments-22.sql" : [ 2 ], "sqlrf/Comments-25.sql" : [ 2 ], "sqlrf/Comments-30.sql" : [ 2 ], "sqlrf/Comments-31.sql" : [ 3 ], "sqlrf/Comments-35.sql" : [ 2 ], "sqlrf/Comments-36.sql" : [ 2 ], "sqlrf/Comments-37.sql" : [ 2 ], "sqlrf/Comments-48.sql" : [ 4 ], "sqlrf/Comments-52.sql" : [ 2 ], "sqlrf/Comments-59.sql" : [ 2 ], "sqlrf/Comments-60.sql" : [ 2 ], "sqlrf/Comments-61.sql" : [ 2 ], "sqlrf/Comments-63.sql" : [ 5 ], "sqlrf/Comments-64.sql" : [ 2 ], "sqlrf/Comments-9.sql" : [ 2 ], "sqlrf/Comparison-Conditions-0.sql" : [ 2 ], "sqlrf/Comparison-Conditions-1.sql" : [ 2 ], "sqlrf/Comparison-Conditions-2.sql" : [ 2, 5 ], "sqlrf/Comparison-Conditions-3.sql" : [ 2, 5 ], "sqlrf/Comparison-Conditions-4.sql" : [ 2 ], "sqlrf/Comparison-Conditions-5.sql" : [ 2 ], "sqlrf/DELETE-10.sql" : [ 2 ], "sqlrf/DELETE-13.sql" : [ 2 ], "sqlrf/DELETE-3.sql" : [ 2 ], "sqlrf/Data-Types-23.sql" : [ 2 ], "sqlrf/Data-Types-24.sql" : [ 2 ], "sqlrf/Data-Types-25.sql" : [ 2 ], "sqlrf/Data-Types-26.sql" : [ 2 ], "sqlrf/Data-Types-27.sql" : [ 2 ], "sqlrf/Data-Types-28.sql" : [ 2 ], "sqlrf/Data-Types-29.sql" : [ 2 ], "sqlrf/Data-Types-3.sql" : [ 7 ], "sqlrf/Data-Types-30.sql" : [ 2, 3, 4, 5 ], "sqlrf/Data-Types-31.sql" : [ 2 ], "sqlrf/Expression-Lists-1.sql" : [ 2 ], "sqlrf/FIRST_VALUE-0.sql" : [ 5 ], "sqlrf/FIRST_VALUE-1.sql" : [ 5 ], "sqlrf/FIRST_VALUE-2.sql" : [ 5, 11 ], "sqlrf/FIRST_VALUE-3.sql" : [ 5, 11 ], "sqlrf/FLASHBACK-TABLE-0.sql" : [ 2, 3 ], "sqlrf/IN-Condition-1.sql" : [ 2, 6 ], "sqlrf/IN-Condition-3.sql" : [ 2, 8 ], "sqlrf/INSERT-21.sql" : [ 2 ], "sqlrf/INSERT-25.sql" : [ 2 ], "sqlrf/INSERT-36.sql" : [ 9 ], "sqlrf/INSERT-38.sql" : [ 9 ], "sqlrf/INSERT-40.sql" : [ 24 ], "sqlrf/INSERT-42.sql" : [ 29 ], "sqlrf/IS-OF-type-Condition-0.sql" : [ 2, 4 ], "sqlrf/JSON_TABLE-0.sql" : [ 2 ], "sqlrf/JSON_TABLE-1.sql" : [ 2 ], "sqlrf/JSON_TABLE-11.sql" : [ 2 ], "sqlrf/JSON_TABLE-12.sql" : [ 2 ], "sqlrf/JSON_TABLE-13.sql" : [ 2 ], "sqlrf/JSON_TABLE-14.sql" : [ 2 ], "sqlrf/JSON_TABLE-15.sql" : [ 2 ], "sqlrf/JSON_TABLE-16.sql" : [ 2 ], "sqlrf/JSON_TABLE-2.sql" : [ 2 ], "sqlrf/JSON_TABLE-8.sql" : [ 2 ], "sqlrf/Joins-3.sql" : [ 2 ], "sqlrf/LAST_VALUE-0.sql" : [ 6 ], "sqlrf/LAST_VALUE-1.sql" : [ 6 ], "sqlrf/LAST_VALUE-2.sql" : [ 6, 13 ], "sqlrf/LAST_VALUE-3.sql" : [ 6, 13 ], "sqlrf/Literals-15.sql" : [ 4, 6, 9 ], "sqlrf/Literals-16.sql" : [ 2 ], "sqlrf/Literals-17.sql" : [ 2 ], "sqlrf/Logical-Conditions-1.sql" : [ 2, 6 ], "sqlrf/Logical-Conditions-3.sql" : [ 2 ], "sqlrf/Logical-Conditions-5.sql" : [ 2 ], "sqlrf/Logical-Conditions-6.sql" : [ 2 ], "sqlrf/MERGE-0.sql" : [ 7, 17 ], "sqlrf/MERGE-11.sql" : [ 2 ], "sqlrf/MERGE-13.sql" : [ 2 ], "sqlrf/MERGE-3.sql" : [ 2 ], "sqlrf/MERGE-5.sql" : [ 2 ], "sqlrf/MERGE-7.sql" : [ 2 ], "sqlrf/MERGE-9.sql" : [ 2 ], "sqlrf/NANVL-0.sql" : [ 4 ], "sqlrf/NLSSORT-1.sql" : [ 6, 9 ], "sqlrf/NLSSORT-2.sql" : [ 2, 6 ], "sqlrf/NLSSORT-3.sql" : [ 4 ], "sqlrf/NOAUDIT-Unified-Auditing-1.sql" : [ 2 ], "sqlrf/NOAUDIT-Unified-Auditing-6.sql" : [ 2 ], "sqlrf/PURGE-0.sql" : [ 2, 3 ], "sqlrf/ROWNUM-Pseudocolumn-0.sql" : [ 2 ], "sqlrf/ROWNUM-Pseudocolumn-1.sql" : [ 2 ], "sqlrf/ROWNUM-Pseudocolumn-2.sql" : [ 2, 3 ], "sqlrf/ROWNUM-Pseudocolumn-3.sql" : [ 2 ], "sqlrf/SELECT-102.sql" : [ 2 ], "sqlrf/SELECT-103.sql" : [ 2 ], "sqlrf/SELECT-12.sql" : [ 2 ], "sqlrf/SELECT-22.sql" : [ 2 ], "sqlrf/SELECT-24.sql" : [ 11 ], "sqlrf/SELECT-39.sql" : [ 2 ], "sqlrf/SELECT-4.sql" : [ 2 ], "sqlrf/SELECT-43.sql" : [ 2 ], "sqlrf/SELECT-61.sql" : [ 2 ], "sqlrf/SELECT-76.sql" : [ 2, 6 ], "sqlrf/SELECT-93.sql" : [ 2 ], "sqlrf/TO_BINARY_DOUBLE-0.sql" : [ 6 ], "sqlrf/Using-XML-in-SQL-Statements-7.sql" : [ 2, 5 ], "sqlrf/create-domain-22.sql" : [ 2 ], "sqlrf/create-domain-25.sql" : [ 2 ], "sqlrf/create-domain-30.sql" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/SelectWithRownumAndOrderByCheck.json ================================================ { "lnpls/cursors-overview-25.sql" : [ 5 ], "lnpls/cursors-overview-27.sql" : [ 5 ], "lnpls/cursors-overview-29.sql" : [ 5 ], "lnpls/processing-query-result-sets-6.sql" : [ 7 ], "sqlrf/ROWNUM-Pseudocolumn-1.sql" : [ 4 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/ToDateWithoutFormatCheck.json ================================================ { "adjsn/multiple-data-guides-document-set-0.sql" : [ 5 ], "adjsn/multiple-data-guides-document-set-1.sql" : [ 5 ], "adjsn/tables-json-columns-2.sql" : [ 5, 36 ], "sqlrf/ROUND-date-0.sql" : [ 2 ], "sqlrf/Sequence-Pseudocolumns-4.sql" : [ 4 ], "sqlrf/Sequence-Pseudocolumns-5.sql" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/UnhandledUserDefinedExceptionCheck.json ================================================ { "lnpls/exception-propagation-1.sql" : [ 10 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/UnnecessaryAliasInQueryCheck.json ================================================ { "adjsn/creating-view-json-data-using-json_table-0.sql" : [ 4 ], "adjsn/data-type-considerations-json_value-indexing-and-querying-0.sql" : [ 2 ], "adjsn/data-type-considerations-json_value-indexing-and-querying-1.sql" : [ 2 ], "adjsn/data-type-considerations-json_value-indexing-and-querying-2.sql" : [ 2 ], "adjsn/json-data-type-2.sql" : [ 11 ], "adjsn/json-data-type-3.sql" : [ 2 ], "adjsn/json-data-type-4.sql" : [ 2 ], "adjsn/json-data-type-6.sql" : [ 3 ], "adjsn/json-data-type-7.sql" : [ 3 ], "adjsn/json-data-type-8.sql" : [ 2 ], "adjsn/json-data-type-9.sql" : [ 2 ], "adjsn/json-schema-18.sql" : [ 2 ], "adjsn/oracle-sql-condition-json_textcontains-1.sql" : [ 3 ], "adjsn/overview-json-oracle-database-0.sql" : [ 2 ], "adjsn/partitioning-json-data-1.sql" : [ 2 ], "adjsn/performing-migration-check-1.sql" : [ 4 ], "adjsn/simple-dot-notation-access-json-data-0.sql" : [ 2 ], "adjsn/simple-dot-notation-access-json-data-1.sql" : [ 2 ], "adjsn/simple-dot-notation-access-json-data-2.sql" : [ 2 ], "adjsn/simple-dot-notation-access-json-data-3.sql" : [ 2 ], "adjsn/simple-dot-notation-access-json-data-5.sql" : [ 2 ], "adjsn/simple-dot-notation-access-json-data-6.sql" : [ 2 ], "adjsn/simple-dot-notation-access-json-data-7.sql" : [ 3 ], "adjsn/simple-dot-notation-access-json-data-8.sql" : [ 3 ], "adjsn/sql-json-condition-json_exists-1.sql" : [ 2 ], "adjsn/sql-json-function-json_arrayagg-1.sql" : [ 7, 9 ], "adjsn/sql-json-function-json_table-2.sql" : [ 3 ], "adjsn/sql-json-function-json_table-3.sql" : [ 3 ], "adjsn/sql-json-path-expression-syntax-4.sql" : [ 2 ], "adjsn/types-filter-condition-comparisons-0.sql" : [ 3 ], "adjsn/using-filters-json_exists-0.sql" : [ 2 ], "adjsn/using-filters-json_exists-1.sql" : [ 2, 5, 8 ], "adjsn/using-filters-json_exists-2.sql" : [ 2 ], "adjsn/using-filters-json_exists-3.sql" : [ 2 ], "adjsn/using-filters-json_exists-4.sql" : [ 2 ], "adjsn/using-json_table-json-arrays-4.sql" : [ 3 ], "adjsn/using-json_value-function-based-index-json_table-queries-0.sql" : [ 3 ], "adjsn/using-multivalue-function-based-index-1.sql" : [ 2, 4 ], "adjsn/using-pl-sql-object-types-json-2.sql" : [ 26 ], "lnpls/CREATE-TYPE-statement-13.sql" : [ 8, 13 ], "lnpls/SQL_MACRO-clause-7.sql" : [ 4 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-0.sql" : [ 10 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-10.sql" : [ 6, 12, 18 ], "lnpls/avoiding-inner-capture-select-and-dml-statements-7.sql" : [ 6 ], "lnpls/compiling-pl-sql-units-native-execution-1.sql" : [ 5, 5 ], "lnpls/cursor-expressions-1.sql" : [ 12, 16 ], "lnpls/cursors-overview-10.sql" : [ 5, 5 ], "lnpls/cursors-overview-20.sql" : [ 7, 7, 7 ], "lnpls/dbms_sql-package-4.sql" : [ 15, 15 ], "lnpls/dml-triggers-1.sql" : [ 5, 5 ], "lnpls/dml-triggers-12.sql" : [ 18, 23 ], "lnpls/dml-triggers-17.sql" : [ 4 ], "lnpls/dml-triggers-32.sql" : [ 21 ], "lnpls/dml-triggers-49.sql" : [ 6, 10 ], "lnpls/pl-sql-function-result-cache-4.sql" : [ 31, 31 ], "lnpls/processing-query-result-sets-8.sql" : [ 5 ], "sqlrf/ALTER-TABLE-23.sql" : [ 3, 3 ], "sqlrf/ANY_VALUE-0.sql" : [ 3, 3 ], "sqlrf/APPROX_COUNT_DISTINCT_DETAIL-0.sql" : [ 7, 7 ], "sqlrf/APPROX_PERCENTILE_DETAIL-7.sql" : [ 4, 4 ], "sqlrf/CASE-Expressions-1.sql" : [ 3 ], "sqlrf/CAST-11.sql" : [ 4, 8 ], "sqlrf/CAST-8.sql" : [ 8, 11 ], "sqlrf/CAST-9.sql" : [ 3 ], "sqlrf/COVAR_POP-2.sql" : [ 9 ], "sqlrf/CREATE-INDEX-11.sql" : [ 3 ], "sqlrf/CREATE-INDEX-18.sql" : [ 2 ], "sqlrf/CREATE-MATERIALIZED-VIEW-10.sql" : [ 4, 4 ], "sqlrf/CREATE-TABLE-48.sql" : [ 2, 2 ], "sqlrf/CREATE-VIEW-12.sql" : [ 4 ], "sqlrf/CREATE-VIEW-13.sql" : [ 3 ], "sqlrf/CREATE-VIEW-15.sql" : [ 2 ], "sqlrf/CREATE-VIEW-7.sql" : [ 4, 4 ], "sqlrf/CURSOR-Expressions-0.sql" : [ 3, 5 ], "sqlrf/Comments-0.sql" : [ 6 ], "sqlrf/Comments-10.sql" : [ 3 ], "sqlrf/Comments-13.sql" : [ 3 ], "sqlrf/Comments-16.sql" : [ 3 ], "sqlrf/Comments-17.sql" : [ 3 ], "sqlrf/Comments-18.sql" : [ 3 ], "sqlrf/Comments-19.sql" : [ 3 ], "sqlrf/Comments-20.sql" : [ 3 ], "sqlrf/Comments-21.sql" : [ 3 ], "sqlrf/Comments-22.sql" : [ 3, 3, 3 ], "sqlrf/Comments-25.sql" : [ 3, 3 ], "sqlrf/Comments-28.sql" : [ 3 ], "sqlrf/Comments-31.sql" : [ 3 ], "sqlrf/Comments-32.sql" : [ 3, 3 ], "sqlrf/Comments-35.sql" : [ 3, 3 ], "sqlrf/Comments-36.sql" : [ 3, 3 ], "sqlrf/Comments-37.sql" : [ 3, 3 ], "sqlrf/Comments-41.sql" : [ 3, 3, 3 ], "sqlrf/Comments-53.sql" : [ 3 ], "sqlrf/Comments-56.sql" : [ 3, 3, 3, 3 ], "sqlrf/Comments-59.sql" : [ 3 ], "sqlrf/Comments-60.sql" : [ 3, 3 ], "sqlrf/Comments-62.sql" : [ 3, 3 ], "sqlrf/Comments-64.sql" : [ 3, 3 ], "sqlrf/DEREF-0.sql" : [ 5 ], "sqlrf/EXISTS-Condition-1.sql" : [ 3, 5 ], "sqlrf/EXTRACTVALUE-0.sql" : [ 3 ], "sqlrf/GROUPING-0.sql" : [ 8, 8 ], "sqlrf/GROUP_ID-0.sql" : [ 4, 4, 4 ], "sqlrf/INSERT-29.sql" : [ 16, 16 ], "sqlrf/INSERT-30.sql" : [ 16, 16 ], "sqlrf/IS-OF-type-Condition-0.sql" : [ 2, 4 ], "sqlrf/JSON-Object-Access-Expressions-0.sql" : [ 3 ], "sqlrf/JSON-Object-Access-Expressions-1.sql" : [ 3 ], "sqlrf/JSON-Object-Access-Expressions-2.sql" : [ 3 ], "sqlrf/JSON_OBJECT-3.sql" : [ 3, 3 ], "sqlrf/JSON_OBJECT-9.sql" : [ 6 ], "sqlrf/JSON_TABLE-0.sql" : [ 4 ], "sqlrf/JSON_TABLE-15.sql" : [ 3 ], "sqlrf/JSON_TABLE-16.sql" : [ 3 ], "sqlrf/MERGE-0.sql" : [ 4, 4 ], "sqlrf/Multiset-Operators-3.sql" : [ 5, 11 ], "sqlrf/NULLIF-1.sql" : [ 3, 3 ], "sqlrf/Object-Access-Expressions-0.sql" : [ 5 ], "sqlrf/SELECT-100.sql" : [ 2 ], "sqlrf/SELECT-101.sql" : [ 2 ], "sqlrf/SELECT-102.sql" : [ 2 ], "sqlrf/SELECT-103.sql" : [ 3, 5 ], "sqlrf/SELECT-24.sql" : [ 5, 5 ], "sqlrf/SELECT-25.sql" : [ 10, 10 ], "sqlrf/SELECT-26.sql" : [ 12, 12 ], "sqlrf/SELECT-27.sql" : [ 10, 10 ], "sqlrf/SELECT-28.sql" : [ 11, 11 ], "sqlrf/SELECT-29.sql" : [ 11, 11 ], "sqlrf/SELECT-30.sql" : [ 10, 10 ], "sqlrf/SELECT-55.sql" : [ 6, 6 ], "sqlrf/SELECT-56.sql" : [ 4 ], "sqlrf/SELECT-71.sql" : [ 3, 3 ], "sqlrf/SELECT-72.sql" : [ 3, 3 ], "sqlrf/SELECT-85.sql" : [ 3, 3 ], "sqlrf/SELECT-86.sql" : [ 3, 3 ], "sqlrf/SELECT-88.sql" : [ 4, 4 ], "sqlrf/SELECT-89.sql" : [ 3, 3 ], "sqlrf/SELECT-99.sql" : [ 2 ], "sqlrf/SYS_TYPEID-0.sql" : [ 2 ], "sqlrf/SYS_TYPEID-1.sql" : [ 3 ], "sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-5.sql" : [ 3 ], "sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-6.sql" : [ 3 ], "sqlrf/TREAT-0.sql" : [ 3 ], "sqlrf/UPDATE-4.sql" : [ 9 ], "sqlrf/Unnesting-of-Nested-Subqueries-0.sql" : [ 3, 5 ], "sqlrf/Unnesting-of-Nested-Subqueries-1.sql" : [ 3, 5 ], "sqlrf/Unnesting-of-Nested-Subqueries-2.sql" : [ 3, 5, 5 ], "sqlrf/Using-XML-in-SQL-Statements-2.sql" : [ 2 ], "sqlrf/Using-XML-in-SQL-Statements-7.sql" : [ 2, 5 ], "sqlrf/VALUE-0.sql" : [ 2 ], "sqlrf/VAR_POP-2.sql" : [ 7, 7 ], "sqlrf/XMLAGG-0.sql" : [ 7 ], "sqlrf/XMLAGG-1.sql" : [ 5 ], "sqlrf/XMLCOLATTVAL-0.sql" : [ 4 ], "sqlrf/XMLCONCAT-0.sql" : [ 4 ], "sqlrf/XMLELEMENT-0.sql" : [ 5 ], "sqlrf/XMLELEMENT-1.sql" : [ 6 ], "sqlrf/XMLELEMENT-2.sql" : [ 4, 8 ], "sqlrf/XMLFOREST-0.sql" : [ 5 ], "sqlrf/XMLSEQUENCE-0.sql" : [ 5 ], "sqlrf/XMLTRANSFORM-1.sql" : [ 3, 3 ], "sqlrf/create-domain-22.sql" : [ 2 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/UnnecessaryElseCheck.json ================================================ { "lnpls/CREATE-PACKAGE-BODY-statement-0.sql" : [ 54, 69 ], "lnpls/cursors-overview-27.sql" : [ 16 ], "lnpls/dml-triggers-34.sql" : [ 37 ], "lnpls/dml-triggers-35.sql" : [ 31 ], "lnpls/exception-propagation-13.sql" : [ 11 ], "lnpls/exception-propagation-15.sql" : [ 13 ], "lnpls/pl-sql-function-result-cache-7.sql" : [ 10 ], "lnpls/raising-exceptions-explicitly-2.sql" : [ 9 ], "lnpls/recursive-subprograms-1.sql" : [ 10 ], "lnpls/release-changes-0.sql" : [ 5 ], "sqlrf/CURSOR-Expressions-1.sql" : [ 20 ], "sqlrf/Using-Extensible-Indexing-2.sql" : [ 68 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/UnnecessaryLikeCheck.json ================================================ { "lnpls/expressions-37.sql" : [ 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/UnusedCursorCheck.json ================================================ { "lnpls/cursors-overview-6.sql" : [ 5, 15 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/UnusedParameterCheck.json ================================================ { "lnpls/CREATE-FUNCTION-statement-2.sql" : [ 2 ], "lnpls/CREATE-PACKAGE-BODY-statement-0.sql" : [ 6, 6, 7, 7, 8, 8, 22, 22 ], "lnpls/CREATE-PROCEDURE-statement-1.sql" : [ 3 ], "lnpls/Supresses-warning-pragma-6009-6.sql" : [ 3 ], "lnpls/assigning-values-variables-5.sql" : [ 6 ], "lnpls/conditional-compilation1-25.sql" : [ 3 ], "lnpls/expressions-57.sql" : [ 9 ], "lnpls/external-subprograms-1.sql" : [ 3, 4 ], "lnpls/external-subprograms-2.sql" : [ 3 ], "lnpls/minimizing-cpu-overhead-2.sql" : [ 14, 19 ], "lnpls/overloaded-subprograms-12.sql" : [ 8, 8, 9, 9 ], "lnpls/overloaded-subprograms-13.sql" : [ 9, 13 ], "lnpls/pl-sql-function-result-cache-13.sql" : [ 4 ], "lnpls/sequential-control-statements-1.sql" : [ 3, 4 ], "lnpls/subprogram-invocation-resolution-0.sql" : [ 4, 5, 12, 18, 19, 26, 27 ], "lnpls/subprogram-parameters-10.sql" : [ 3 ], "sqlrf/Using-Extensible-Indexing-1.sql" : [ 41, 41, 55, 65, 75, 87, 98, 99, 110, 110, 112, 175, 202 ], "sqlrf/Using-Extensible-Indexing-2.sql" : [ 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/UnusedVariableCheck.json ================================================ { "adjsn/using-pl-sql-object-types-json-2.sql" : [ 5 ], "lnpls/autonomous-transactions-9.sql" : [ 21 ], "lnpls/cursor-variables-1.sql" : [ 6, 7, 8, 11 ], "lnpls/cursor-variables-2.sql" : [ 9 ], "lnpls/dbms_sql-package-6.sql" : [ 19 ], "lnpls/declarations-0.sql" : [ 3, 4, 5, 6 ], "lnpls/declarations-1.sql" : [ 3, 5, 7 ], "lnpls/declarations-2.sql" : [ 3, 4, 5, 6, 7 ], "lnpls/declarations-3.sql" : [ 3, 4, 5 ], "lnpls/declarations-4.sql" : [ 3, 4, 8 ], "lnpls/dml-triggers-41.sql" : [ 5 ], "lnpls/dml-triggers-50.sql" : [ 8 ], "lnpls/exception-propagation-3.sql" : [ 3 ], "lnpls/exception-propagation-5.sql" : [ 5 ], "lnpls/inserting-records-tables-0.sql" : [ 15 ], "lnpls/lexical-units-12.sql" : [ 4 ], "lnpls/lexical-units-6.sql" : [ 3 ], "lnpls/loop-statements-10.sql" : [ 3 ], "lnpls/loop-statements-6.sql" : [ 4 ], "lnpls/multidimensional-collections-0.sql" : [ 10 ], "lnpls/multidimensional-collections-2.sql" : [ 11 ], "lnpls/multidimensional-collections-3.sql" : [ 11 ], "lnpls/native-dynamic-sql-12.sql" : [ 7 ], "lnpls/record-variables-21.sql" : [ 8 ], "lnpls/redeclared-predefined-exceptions-3.sql" : [ 4 ], "lnpls/redeclared-predefined-exceptions-5.sql" : [ 4, 5 ], "lnpls/scope-and-visibility-identifiers-0.sql" : [ 3, 4, 10, 11, 19 ], "lnpls/scope-and-visibility-identifiers-1.sql" : [ 4 ], "lnpls/scope-and-visibility-identifiers-5.sql" : [ 4 ], "lnpls/scope-and-visibility-identifiers-9.sql" : [ 4 ], "lnpls/subprogram-parameters-4.sql" : [ 4 ], "lnpls/user-defined-pl-sql-subtypes-2.sql" : [ 5, 6, 7, 8, 12, 14, 15 ], "sqlrf/Type-Constructor-Expressions-0.sql" : [ 6 ], "sqlrf/Using-Extensible-Indexing-1.sql" : [ 113, 121, 180 ], "sqlrf/Using-Extensible-Indexing-2.sql" : [ 8 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/VariableHidingCheck.json ================================================ { "lnpls/assigning-values-record-variables-1.sql" : [ 14 ], "lnpls/scope-and-visibility-identifiers-0.sql" : [ 10 ], "lnpls/scope-and-visibility-identifiers-1.sql" : [ 7 ], "lnpls/scope-and-visibility-identifiers-3.sql" : [ 6 ], "lnpls/scope-and-visibility-identifiers-5.sql" : [ 3 ], "lnpls/scope-and-visibility-identifiers-9.sql" : [ 7 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/VariableInitializationWithFunctionCallCheck.json ================================================ { "lnpls/declarations-1.sql" : [ 3, 5 ], "lnpls/dml-triggers-24.sql" : [ 24 ], "lnpls/exception-propagation-0.sql" : [ 9 ], "lnpls/exception-propagation-1.sql" : [ 7 ], "lnpls/sql-data-types-38.sql" : [ 3, 4, 5, 6 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/VariableInitializationWithNullCheck.json ================================================ { "lnpls/expressions-19.sql" : [ 4 ], "lnpls/expressions-21.sql" : [ 3, 4 ], "lnpls/pls_integer-and-binary_integer-data-types-4.sql" : [ 4 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/oracle-database_23/VariableNameCheck.json ================================================ { "lnpls/cursors-overview-18.sql" : [ 11, 12, 13 ], "lnpls/cursors-overview-22.sql" : [ 13, 14, 15 ], "lnpls/lexical-units-12.sql" : [ 3, 4 ], "lnpls/lexical-units-4.sql" : [ 3 ], "lnpls/lexical-units-6.sql" : [ 3 ], "lnpls/lexical-units-8.sql" : [ 3, 4, 5 ], "lnpls/pl-sql-function-result-cache-15.sql" : [ 10 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/CharacterDatatypeUsageCheck.json ================================================ { "src/addons/pljson_table_impl.type.impl.sql" : [ 127, 366, 374, 398 ], "src/pljson_parser.impl.sql" : [ 277, 303, 306, 691 ], "src/pljson_printer.package.sql" : [ 74, 148, 206, 419 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/CollapsibleIfStatementsCheck.json ================================================ { "examples/ex8.sql" : [ 62, 66, 73 ], "src/addons/pljson_helper.package.sql" : [ 394, 397, 417, 420 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/ColumnsShouldHaveTableNameCheck.json ================================================ { "examples/ex_pljson_table.sql" : [ 151, 165, 189 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/CommitRollbackCheck.json ================================================ { "testsuite-utplsql/utplsql_pljson_table_test.sql" : [ 132 ], "testsuite/pljson_ut.package.sql" : [ 155 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/ComparisonWithBooleanCheck.json ================================================ { "src/pljson_parser.impl.sql" : [ 339, 437, 452, 467, 506, 511, 521 ], "testsuite-utplsql/utplsql_pljson_simple_test.sql" : [ 125, 126, 132, 133, 139, 140, 146, 147, 153, 154, 160, 161, 167, 168, 174, 175, 181, 182, 188, 189, 195, 196, 202, 203, 209, 210, 216, 217, 224, 225 ], "testsuite/pljson_simple.test.sql" : [ 77, 78, 84, 85, 91, 92, 98, 99, 105, 106, 112, 113, 119, 120, 126, 127, 133, 134, 140, 141, 147, 148, 154, 155, 161, 162, 168, 169, 176, 177 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/ComparisonWithNullCheck.json ================================================ { "src/addons/pljson_xml.package.sql" : [ 129 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/DbmsOutputPutCheck.json ================================================ { "examples/ex10.sql" : [ 46, 50, 54, 58, 62, 66, 70 ], "examples/ex11.sql" : [ 45, 46, 51, 52 ], "examples/ex12.sql" : [ 31, 33 ], "examples/ex13.sql" : [ 44 ], "examples/ex14.sql" : [ 35, 46 ], "examples/ex17.sql" : [ 45, 47, 48 ], "examples/ex2.sql" : [ 34, 35 ], "examples/ex3.sql" : [ 43, 45 ], "examples/ex4.sql" : [ 31, 31, 52, 55, 59 ], "examples/ex5.sql" : [ 31, 31, 54 ], "examples/ex6.sql" : [ 34, 34 ], "examples/ex7.sql" : [ 32, 32, 40 ], "examples/ex8.sql" : [ 94, 103, 117, 118, 119, 120, 121, 122 ], "examples/ex9.sql" : [ 53, 55, 58, 60, 64, 67, 76, 82, 88 ], "src/addons/pljson_dyn.package.sql" : [ 197, 371 ], "src/addons/pljson_object_cache.impl.sql" : [ 42, 43, 44, 45, 46 ], "src/addons/pljson_util_pkg.package.sql" : [ 345, 346, 349, 350 ], "src/pljson_ext.impl.sql" : [ 942 ], "src/pljson_parser.impl.sql" : [ 187, 192 ], "src/pljson_printer.package.sql" : [ 603, 615, 626, 637, 643 ], "testsuite-utplsql/utplsql_pljson_base64_test.sql" : [ 36, 44, 115, 116, 117, 119, 120, 121, 231, 232, 233, 234, 236, 237, 238 ], "testsuite-utplsql/utplsql_pljson_ext_test.sql" : [ 35, 43 ], "testsuite-utplsql/utplsql_pljson_helper_test.sql" : [ 140, 148 ], "testsuite-utplsql/utplsql_pljson_list_test.sql" : [ 80, 88 ], "testsuite-utplsql/utplsql_pljson_parser_test.sql" : [ 70, 78 ], "testsuite-utplsql/utplsql_pljson_path_test.sql" : [ 71, 79 ], "testsuite-utplsql/utplsql_pljson_simple_test.sql" : [ 32, 40 ], "testsuite-utplsql/utplsql_pljson_table_test.sql" : [ 30, 38, 76 ], "testsuite-utplsql/utplsql_pljson_test.sql" : [ 68, 76 ], "testsuite-utplsql/utplsql_pljson_unicode_test.sql" : [ 73, 81, 132 ], "testsuite/pljson_base64.test.sql" : [ 60, 61, 62, 64, 65, 66, 176, 177, 178, 179, 181, 182, 183 ], "testsuite/pljson_table.test.sql" : [ 24 ], "testsuite/pljson_unicode.test.sql" : [ 233 ], "testsuite/pljson_ut.package.sql" : [ 74, 83, 95, 112, 136, 137, 157, 204 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/DeadCodeCheck.json ================================================ { "src/addons/pljson_helper.package.sql" : [ 308 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/EmptyStringAssignmentCheck.json ================================================ { "src/addons/pljson_dyn.package.sql" : [ 102 ], "src/addons/pljson_table_impl.type.impl.sql" : [ 260, 263, 307, 321 ], "src/pljson_parser.impl.sql" : [ 320 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/ExplicitInParameterCheck.json ================================================ { "examples/ex4.sql" : [ 31 ], "examples/ex5.sql" : [ 31 ], "examples/ex6.sql" : [ 34 ], "examples/ex7.sql" : [ 32 ], "src/addons/pljson_dyn.package.sql" : [ 31, 31, 31, 32, 33, 37, 37, 37, 38, 39, 82, 82, 82, 128, 128, 128, 129, 130, 316, 316, 316, 317, 318 ], "src/addons/pljson_helper.package.sql" : [ 17, 17, 21, 21, 25, 25, 29, 29, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 37, 37, 38, 38, 39, 39, 40, 40, 48, 48, 48, 53, 53, 53, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 60, 60, 60, 65, 65, 65, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 79, 79, 116, 116, 128, 128, 143, 143, 155, 155, 169, 169, 182, 182, 195, 195, 208, 208, 230, 230, 230, 263, 263, 263, 321, 321, 321, 382, 382, 382, 408, 408, 408, 437, 437, 437, 440, 440, 440, 442, 442, 442, 444, 444, 444, 446, 446, 446, 455, 455, 455, 458, 458, 458, 460, 460, 460, 462, 462, 462, 464, 464, 464 ], "src/addons/pljson_object_cache.decl.sql" : [ 19, 20, 26, 26, 27, 28, 28 ], "src/addons/pljson_object_cache.impl.sql" : [ 7, 17, 55, 55, 66, 82, 82 ], "src/addons/pljson_table_impl.type.decl.sql" : [ 131, 131, 131, 132, 138, 138, 138, 139, 144, 144, 144, 145, 155, 155, 155, 156 ], "src/addons/pljson_table_impl.type.impl.sql" : [ 45, 45, 45, 46, 78, 78, 78, 79, 110, 110, 110, 111, 373, 397, 412, 412 ], "src/addons/pljson_xml.package.sql" : [ 37, 37, 45, 65, 84, 149, 149 ], "src/pljson.type.decl.sql" : [ 36, 38, 39, 40, 41, 43, 43, 46, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 53, 53, 53, 54, 54, 54, 56, 56, 56, 57, 57, 57, 60, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 74, 78, 78, 81, 81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 86, 86, 86, 87, 87, 87, 88, 88, 88, 89, 89, 89, 92, 92, 99, 99, 102, 102, 102 ], "src/pljson.type.impl.sql" : [ 14, 30, 40, 63, 71, 94, 94, 100, 117, 117, 117, 179, 179, 179, 188, 188, 188, 197, 197, 197, 207, 207, 207, 216, 216, 216, 225, 225, 225, 234, 234, 234, 248, 261, 270, 279, 288, 297, 306, 315, 324, 332, 345, 350, 365, 365, 371, 371, 371, 376, 376, 376, 385, 385, 385, 394, 394, 394, 404, 404, 404, 413, 413, 413, 422, 422, 422, 431, 431, 431, 440, 440, 468, 468, 503, 503, 503 ], "src/pljson_bool.type.sql" : [ 7, 7, 29, 29 ], "src/pljson_element.type.decl.sql" : [ 29, 29, 34, 34, 49, 50, 52, 52, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 61, 61, 64, 64, 64 ], "src/pljson_element.type.impl.sql" : [ 56, 56, 64, 64, 104, 109, 114, 114, 120, 120, 129, 129, 129, 138, 138, 138, 147, 147, 147, 157, 157, 163, 163, 163 ], "src/pljson_ext.decl.sql" : [ 26, 26, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 39, 39, 39, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 69, 70, 70, 73, 73, 74, 74, 75, 75, 78, 82, 84, 86, 88, 90, 90, 90, 91, 91, 91, 102, 104, 105, 107, 108, 113, 113 ], "src/pljson_ext.impl.sql" : [ 32, 66, 72, 83, 96, 106, 217, 217, 366, 366, 392, 392, 403, 403, 414, 414, 425, 425, 436, 436, 447, 447, 458, 458, 471, 471, 471, 518, 518, 518, 525, 525, 525, 536, 536, 536, 548, 548, 548, 559, 559, 559, 570, 570, 570, 581, 581, 581, 592, 592, 592, 604, 604, 625, 625, 625, 762, 762, 762, 770, 770, 779, 779, 788, 788, 797, 797, 806, 806, 815, 815, 824, 824, 833, 833, 843, 843, 843, 852, 852, 852, 862, 862, 862, 871, 871, 871, 880, 880, 880, 889, 889, 889, 898, 898, 898, 907, 907, 907, 916, 921, 921, 929, 929, 940, 940, 946, 946, 957, 984, 1002, 1017, 1037, 1037 ], "src/pljson_list.type.decl.sql" : [ 37, 38, 39, 39, 40, 41, 42, 43, 45, 45, 48, 48, 49, 49, 50, 50, 51, 51, 53, 53, 54, 54, 55, 55, 57, 57, 58, 58, 59, 59, 60, 60, 62, 62, 63, 63, 64, 64, 66, 71, 72, 73, 74, 75, 76, 77, 83, 83, 85, 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 88, 90, 90, 90, 91, 91, 91, 92, 92, 92, 95, 95, 98, 98, 101, 101, 101 ], "src/pljson_list.type.impl.sql" : [ 13, 20, 27, 27, 36, 48, 60, 67, 79, 79, 85, 85, 123, 123, 132, 132, 141, 141, 151, 151, 160, 160, 169, 169, 178, 178, 197, 197, 206, 206, 215, 215, 225, 225, 234, 234, 243, 243, 252, 283, 291, 300, 309, 318, 327, 336, 374, 374, 381, 381, 381, 394, 394, 394, 411, 411, 411, 428, 428, 428, 446, 446, 446, 463, 463, 463, 480, 480, 480, 498, 498, 506, 506, 519, 519, 519 ], "src/pljson_null.type.sql" : [ 5, 5, 23, 23 ], "src/pljson_number.type.sql" : [ 8, 10, 12, 12, 33, 44, 60, 79, 79, 124 ], "src/pljson_parser.decl.sql" : [ 44, 46, 48, 49, 49, 50, 55, 64, 65, 66, 67, 68, 69 ], "src/pljson_parser.impl.sql" : [ 29, 48, 82, 145, 145, 154, 173, 185, 190, 196, 196, 196, 201, 201, 206, 206, 206, 206, 297, 303, 575, 575, 580, 636, 636, 636, 684, 764, 786, 808, 830, 853, 872 ], "src/pljson_printer.package.sql" : [ 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 36, 36, 36, 37, 37, 39, 74, 103, 136, 147, 147, 155, 166, 171, 171, 183, 201, 201, 201, 203, 238, 238, 238, 280, 280, 280, 315, 315, 315, 329, 329, 329, 329, 344, 344, 344, 344, 361, 361, 361, 361, 416, 451, 451, 451, 453, 453, 453, 495, 495, 495, 530, 530, 530, 544, 544, 544, 553, 553, 553, 564, 564, 564, 595, 595, 595, 704, 704 ], "src/pljson_string.type.sql" : [ 9, 9, 10, 10, 11, 11, 12, 12, 14, 14, 16, 16, 27, 27, 28, 28, 42, 42, 43, 43, 77, 77, 82, 82 ], "testsuite-utplsql/utplsql_pljson_base64_test.sql" : [ 33, 41, 50, 50, 59, 59 ], "testsuite-utplsql/utplsql_pljson_ext_test.sql" : [ 32, 40, 49, 49, 58, 58, 68, 75 ], "testsuite-utplsql/utplsql_pljson_helper_test.sql" : [ 137, 145, 154, 154, 163, 163, 173, 180 ], "testsuite-utplsql/utplsql_pljson_list_test.sql" : [ 77, 85, 94, 94, 103, 103, 113, 120 ], "testsuite-utplsql/utplsql_pljson_parser_test.sql" : [ 67, 75, 84, 84, 93, 93, 102, 102, 114, 114 ], "testsuite-utplsql/utplsql_pljson_path_test.sql" : [ 68, 76, 85, 85, 94, 94 ], "testsuite-utplsql/utplsql_pljson_simple_test.sql" : [ 29, 37, 46, 46, 55, 55 ], "testsuite-utplsql/utplsql_pljson_table_test.sql" : [ 27, 35, 44, 44, 53, 53 ], "testsuite-utplsql/utplsql_pljson_test.sql" : [ 65, 73, 82, 82, 91, 91 ], "testsuite-utplsql/utplsql_pljson_unicode_test.sql" : [ 70, 78, 87, 87, 96, 96, 105, 105 ], "testsuite/pljson_ext.test.sql" : [ 11, 18 ], "testsuite/pljson_helper.test.sql" : [ 11, 18 ], "testsuite/pljson_list.test.sql" : [ 11, 18 ], "testsuite/pljson_parser.test.sql" : [ 15, 15, 26, 26 ], "testsuite/pljson_unicode.test.sql" : [ 39, 39 ], "testsuite/pljson_ut.package.sql" : [ 39, 39, 40, 42, 43, 45, 45, 46, 46, 66, 66, 77, 86, 99, 116, 116, 125, 125 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/FunctionWithOutParameterCheck.json ================================================ { "src/addons/pljson_table_impl.type.decl.sql" : [ 130, 136, 143, 149, 149 ], "src/addons/pljson_table_impl.type.impl.sql" : [ 44, 76, 109, 344, 344 ], "src/pljson.type.decl.sql" : [ 102 ], "src/pljson.type.impl.sql" : [ 503 ], "src/pljson_element.type.decl.sql" : [ 64 ], "src/pljson_element.type.impl.sql" : [ 163 ], "src/pljson_list.type.decl.sql" : [ 101 ], "src/pljson_list.type.impl.sql" : [ 519 ], "src/pljson_parser.decl.sql" : [ 48, 49, 50, 54 ], "src/pljson_parser.impl.sql" : [ 82, 145, 216, 216, 216, 275, 275, 275, 303, 303, 303, 415, 580, 636, 684 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/IfWithExitCheck.json ================================================ { "src/addons/pljson_table_impl.type.impl.sql" : [ 617 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/InequalityUsageCheck.json ================================================ { "src/addons/pljson_helper.package.sql" : [ 282, 341 ], "src/addons/pljson_table_impl.type.impl.sql" : [ 272, 275, 388, 518 ], "src/pljson_ext.impl.sql" : [ 166, 263, 268, 291, 299, 303, 320, 347 ], "src/pljson_number.type.sql" : [ 130, 133 ], "src/pljson_parser.impl.sql" : [ 312, 436, 451, 466, 590, 627, 746, 779, 801, 823, 846, 865, 883 ], "src/pljson_printer.package.sql" : [ 276, 320, 491, 535, 604 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/InsertWithoutColumnsCheck.json ================================================ { "examples/ex_pljson_table.sql" : [ 41, 53, 65 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/QueryWithoutExceptionHandlingCheck.json ================================================ { "examples/ex13.sql" : [ 46, 70 ], "src/addons/pljson_util_pkg.package.sql" : [ 260 ], "src/pljson_parser.impl.sql" : [ 70 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/ReturnOfBooleanExpressionCheck.json ================================================ { "src/addons/pljson_object_cache.impl.sql" : [ 19 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/SameBranchCheck.json ================================================ { "src/addons/pljson_helper.package.sql" : [ 366 ], "src/pljson_ext.impl.sql" : [ 503 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/SelectAllColumnsCheck.json ================================================ { "examples/ex_pljson_table.sql" : [ 129, 224, 249, 294 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/ToDateWithoutFormatCheck.json ================================================ { "src/pljson_ext.impl.sql" : [ 98 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/UnnecessaryElseCheck.json ================================================ { "src/addons/pljson_helper.package.sql" : [ 243 ], "src/addons/pljson_object_cache.impl.sql" : [ 21, 77 ], "src/addons/pljson_table_impl.type.impl.sql" : [ 380, 656 ], "src/pljson.type.impl.sql" : [ 555 ], "src/pljson_bool.type.sql" : [ 31 ], "src/pljson_element.type.impl.sql" : [ 124 ], "src/pljson_ext.impl.sql" : [ 87, 398, 409, 420, 431, 442, 453, 464, 531, 542, 554, 565, 576, 587, 598, 935 ], "src/pljson_list.type.impl.sql" : [ 368 ], "src/pljson_number.type.sql" : [ 161 ], "src/pljson_printer.package.sql" : [ 67, 139, 168, 175 ], "src/pljson_string.type.sql" : [ 98 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/UnusedParameterCheck.json ================================================ { "src/addons/pljson_table_impl.type.impl.sql" : [ 45, 46 ], "src/pljson_element.type.impl.sql" : [ 56, 56, 64, 64, 104, 109, 114, 114, 157, 157, 157, 163, 163, 163 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/UnusedVariableCheck.json ================================================ { "src/addons/pljson_helper.package.sql" : [ 323 ], "src/addons/pljson_table_impl.type.impl.sql" : [ 356, 357, 358 ], "src/pljson.type.impl.sql" : [ 119 ], "src/pljson_ext.impl.sql" : [ 474, 474, 962, 988, 1005, 1021 ], "src/pljson_parser.impl.sql" : [ 278, 856 ], "src/pljson_string.type.sql" : [ 47 ], "testsuite-utplsql/utplsql_pljson_base64_test.sql" : [ 28, 70, 80, 251, 384, 402, 420 ], "testsuite-utplsql/utplsql_pljson_ext_test.sql" : [ 27 ], "testsuite-utplsql/utplsql_pljson_helper_test.sql" : [ 132 ], "testsuite-utplsql/utplsql_pljson_list_test.sql" : [ 72, 157 ], "testsuite-utplsql/utplsql_pljson_parser_test.sql" : [ 62 ], "testsuite-utplsql/utplsql_pljson_path_test.sql" : [ 63 ], "testsuite-utplsql/utplsql_pljson_simple_test.sql" : [ 24 ], "testsuite-utplsql/utplsql_pljson_table_test.sql" : [ 22 ], "testsuite-utplsql/utplsql_pljson_test.sql" : [ 60, 160, 183, 196 ], "testsuite-utplsql/utplsql_pljson_unicode_test.sql" : [ 65 ], "testsuite/pljson.test.sql" : [ 77, 101, 115 ], "testsuite/pljson_base64.test.sql" : [ 15, 25, 198, 332, 351, 370 ], "testsuite/pljson_list.test.sql" : [ 63 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/VariableHidingCheck.json ================================================ { "src/addons/pljson_table_impl.type.impl.sql" : [ 374, 398 ], "testsuite-utplsql/utplsql_pljson_ext_test.sql" : [ 69, 76 ], "testsuite-utplsql/utplsql_pljson_helper_test.sql" : [ 174, 181 ], "testsuite-utplsql/utplsql_pljson_list_test.sql" : [ 114, 121 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/VariableInitializationWithFunctionCallCheck.json ================================================ { "examples/ex13.sql" : [ 30, 55 ], "examples/ex14.sql" : [ 29, 40 ], "src/addons/pljson_dyn.package.sql" : [ 83 ], "src/addons/pljson_helper.package.sql" : [ 345, 356, 357, 391, 414 ], "src/pljson.type.impl.sql" : [ 262, 271, 280, 289, 298, 307, 316 ], "src/pljson_ext.impl.sql" : [ 716, 732 ], "src/pljson_list.type.impl.sql" : [ 292, 301, 310, 319, 328, 337, 383, 396, 413, 430, 448, 465, 482 ], "src/pljson_printer.package.sql" : [ 331, 346, 364, 598 ], "testsuite-utplsql/utplsql_pljson_base64_test.sql" : [ 28 ], "testsuite-utplsql/utplsql_pljson_ext_test.sql" : [ 27 ], "testsuite-utplsql/utplsql_pljson_helper_test.sql" : [ 132 ], "testsuite-utplsql/utplsql_pljson_list_test.sql" : [ 72 ], "testsuite-utplsql/utplsql_pljson_parser_test.sql" : [ 62 ], "testsuite-utplsql/utplsql_pljson_path_test.sql" : [ 63 ], "testsuite-utplsql/utplsql_pljson_simple_test.sql" : [ 24 ], "testsuite-utplsql/utplsql_pljson_table_test.sql" : [ 22 ], "testsuite-utplsql/utplsql_pljson_test.sql" : [ 60 ], "testsuite-utplsql/utplsql_pljson_unicode_test.sql" : [ 65, 235 ], "testsuite/pljson_unicode.test.sql" : [ 211 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/pljson/VariableInitializationWithNullCheck.json ================================================ { "examples/ex8.sql" : [ 56, 99 ], "src/addons/pljson_ml.package.sql" : [ 29 ], "src/addons/pljson_xml.package.sql" : [ 46, 151 ], "src/pljson_parser.impl.sql" : [ 146, 217, 276, 304, 305, 894 ], "src/pljson_printer.package.sql" : [ 104, 148, 362, 496, 545, 554, 565 ], "testsuite-utplsql/utplsql_pljson_ext_test.sql" : [ 168 ], "testsuite-utplsql/utplsql_pljson_list_test.sql" : [ 350, 361, 362, 382, 393, 404 ], "testsuite-utplsql/utplsql_pljson_test.sql" : [ 275, 286, 287, 313, 324, 335, 346 ], "testsuite/pljson.test.sql" : [ 197, 209, 210, 237, 249, 261, 273 ], "testsuite/pljson_ext.test.sql" : [ 120 ], "testsuite/pljson_list.test.sql" : [ 267, 279, 280, 301, 313, 325 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/CharacterDatatypeUsageCheck.json ================================================ { "examples/employee_pipe.pkg" : [ 7, 68 ], "examples/filepath2.pkg" : [ 5, 45 ], "examples/te_employee.pkb" : [ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 43, 44 ], "source/ut_assert.pkb" : [ 601 ], "source/ut_assert.pks" : [ 34, 35, 296 ], "source/ut_assert2.pkb" : [ 304, 1675, 2011, 2220, 3425, 3426, 3532, 3580 ], "source/ut_assert2.pks" : [ 35, 36, 578, 590 ], "source/ut_config.pks" : [ 44, 46 ], "source/ut_config.tab" : [ 3, 4, 6, 15 ], "source/ut_eq.tab" : [ 11, 12 ], "source/ut_gen.pks" : [ 42, 43, 44, 122 ], "source/ut_outcome.pks" : [ 32, 33 ], "source/ut_plsql.pks" : [ 37, 38, 39, 40, 41, 42 ], "source/ut_plsql2.pks" : [ 32, 33 ], "source/ut_plsql_util.pkb" : [ 62, 880 ], "source/ut_result2.pkb" : [ 108, 168, 233 ], "source/ut_result2.pks" : [ 31, 32 ], "source/ut_suite.pks" : [ 37, 38 ], "source/ut_suiteutp.pkb" : [ 47 ], "source/ut_suiteutp.pks" : [ 31, 32 ], "source/ut_testcase.pks" : [ 32, 33 ], "source/ut_unittest.pks" : [ 32, 33 ], "source/ut_unittest.tab" : [ 9 ], "source/ut_utp.pkb" : [ 158 ], "source/ut_utp.pks" : [ 31, 32 ], "source/ut_utp.tab" : [ 19 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/ColumnsShouldHaveTableNameCheck.json ================================================ { "source/ut_result2.pkb" : [ 298, 298, 298, 298 ], "source/ut_result2.pks" : [ 46, 46, 46, 46 ], "source/utv_last_run.sql" : [ 3, 3 ], "source/utv_result_full.sql" : [ 3, 4, 5, 5 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/CommitRollbackCheck.json ================================================ { "examples/mybooks_setup.sql" : [ 55, 61, 67 ], "examples/test_te_employee.pkb" : [ 191, 237, 276, 315, 424, 466, 491, 516, 536, 565, 594, 615, 703, 756, 859, 885, 905 ], "examples/ut_te_employee.pkb" : [ 191, 237, 276, 315, 424, 466, 491, 516, 536, 565, 594, 615, 703, 756, 859, 885, 905 ], "source/ut_plsql2.pkb" : [ 333 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/CursorBodyInPackageSpecCheck.json ================================================ { "examples/te_employee.pks" : [ 50, 59, 68, 80, 92, 104, 115, 124, 136, 148, 160, 171, 191, 214, 237, 260 ], "source/ut_config.pks" : [ 62, 67 ], "source/ut_result2.pks" : [ 44 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/DbmsOutputPutCheck.json ================================================ { "examples/te_employee.pkb" : [ 1688, 1700 ], "examples/ut_betwnstr.pkb" : [ 6, 12 ], "examples/ut_bstr.pkb" : [ 6, 12 ], "examples/ut_mybooks_pkg.sql" : [ 287, 329 ], "examples/ut_str.pkb" : [ 6, 12 ], "source/ut_assert2.pkb" : [ 3620, 3626, 3647 ], "source/ut_output.pkb" : [ 123 ], "source/ut_outputreporter.pkb" : [ 84, 90, 99, 108, 113 ], "source/ut_plsql_util.pkb" : [ 329, 379, 391, 463, 489, 512, 519, 551, 566, 851, 856, 1026, 1159, 1183, 1187, 1227, 1245, 1375, 1382, 1389, 1396, 1451, 1458, 1465, 1472, 1486, 1499, 1506, 1529, 1530, 1532, 1535, 1549, 1563, 1568, 1576, 1590, 1610, 1617 ], "source/ut_suite.pkb" : [ 274, 276 ], "source/ut_utoutput.pkb" : [ 60, 66, 85, 86, 87, 101, 102, 103, 104, 137, 138, 160, 174, 175 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/DeadCodeCheck.json ================================================ { "examples/temp.sql" : [ 11 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/EmptyBlockCheck.json ================================================ { "examples/employee_pipe.pkg" : [ 220, 225 ], "examples/qu_betwnstr.pkb" : [ 8, 14 ], "examples/simple_example.sql" : [ 42, 48 ], "examples/str.pkb" : [ 57, 63 ], "examples/te_employee.pkb" : [ 1649 ], "examples/temp.sql" : [ 25, 31 ], "examples/ut_betwnstr_failures.pkb" : [ 6, 12 ], "examples/ut_betwnstr_gen.pkg" : [ 15, 21 ], "examples/ut_calc_secs_between.pkb" : [ 6, 12 ], "examples/ut_department2file.pkg" : [ 15, 21 ], "examples/ut_plvdate.pkb" : [ 6, 12 ], "examples/ut_plvstr.pkb" : [ 6, 12 ], "examples/ut_vda$strings1.pkg" : [ 20, 26 ], "source/ut_outputreporter.pkb" : [ 37, 43 ], "source/ut_result2.pkb" : [ 37 ], "source/ut_utoutput.pkb" : [ 49 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/ExplicitInParameterCheck.json ================================================ { "examples/mybooks_setup.sql" : [ 28, 29, 30, 31, 31, 31, 32, 32, 32, 33, 38, 45, 52, 52, 52, 58, 58, 58, 64, 70 ], "examples/te_employee.pkb" : [ 936 ], "examples/te_employee.pks" : [ 465 ], "source/ut_assert.pkb" : [ 477, 489 ], "source/ut_assert.pks" : [ 236, 243 ], "source/ut_assert2.pkb" : [ 1467, 1468, 2473, 2556, 2638, 2654, 3115, 3134, 3152, 3168, 3428 ], "source/ut_assert2.pks" : [ 266, 282, 484, 500 ], "source/ut_filereporter.pkb" : [ 44, 44, 44, 193 ], "source/ut_filereporter.pks" : [ 32, 35, 35, 35 ], "source/ut_htmlreporter.pkb" : [ 63, 147, 151 ], "source/ut_htmlreporter.pks" : [ 43 ], "source/ut_output.pkb" : [ 137, 137 ], "source/ut_output.pks" : [ 64, 64 ], "source/ut_outputreporter.pkb" : [ 50, 51, 52, 61, 213, 298, 302, 314 ], "source/ut_outputreporter.pks" : [ 42 ], "source/ut_package.pkb" : [ 352, 353, 354, 415, 416, 417 ], "source/ut_package.pks" : [ 70, 71, 72, 97, 98, 99 ], "source/ut_plsql_util.pkb" : [ 62, 88, 89, 90, 91, 92, 110, 111, 120, 121, 157, 158, 174, 175, 184, 185, 201, 202, 218, 219, 244, 264, 265, 266, 297, 321, 484, 501, 541, 571, 580, 581, 609, 632, 642, 756, 768, 784, 800, 800, 819, 819, 843, 860, 868, 869, 971, 993, 994, 995, 1035, 1036, 1037, 1099, 1120, 1120, 1136, 1137, 1138, 1154, 1192, 1209, 1281, 1281, 1311, 1312, 1338, 1339, 1340, 1341, 1342, 1441, 1514, 1515, 1516, 1517, 1518 ], "source/ut_plsql_util.pks" : [ 75, 76, 88, 89, 94, 95, 100, 101, 106, 107, 112, 113, 118, 119, 125, 126, 127, 131, 136, 141, 146, 147, 152, 154, 156, 159, 162, 162, 165, 167, 174, 175, 184, 187, 188, 189, 195, 196, 197, 200, 204, 205, 206, 207, 208 ], "source/ut_receq.pkb" : [ 34 ], "source/ut_report.pkb" : [ 213 ], "source/ut_report.pks" : [ 41, 42, 46, 51 ], "source/ut_result.pkb" : [ 233, 257, 266, 286 ], "source/ut_result.pks" : [ 106, 110, 115, 120 ], "source/ut_result2.pkb" : [ 335 ], "source/ut_result2.pks" : [ 106 ], "source/ut_suite.pkb" : [ 173, 174, 230, 231, 232 ], "source/ut_suite.pks" : [ 63, 64, 65, 71, 72, 73 ], "source/ut_test.pkb" : [ 138, 139, 140, 173, 174, 175 ], "source/ut_test.pks" : [ 59, 60, 61, 67, 68, 69 ], "source/ut_testcase.pkb" : [ 137, 138, 139, 172, 173, 174 ], "source/ut_testcase.pks" : [ 62, 63, 64, 70, 71, 72 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/FunctionWithOutParameterCheck.json ================================================ { "examples/employee_pipe.pkg" : [ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 45, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 170 ], "source/ut_output.pkb" : [ 54 ], "source/ut_output.pks" : [ 43 ], "source/ut_plsql_util.pkb" : [ 244, 297, 870, 871 ], "source/ut_plsql_util.pks" : [ 176, 177 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/IfWithExitCheck.json ================================================ { "source/ut_result2.pkb" : [ 347 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/InequalityUsageCheck.json ================================================ { "examples/employee_pipe.pkg" : [ 212 ], "source/ut_assert2.pkb" : [ 1409, 1739 ], "source/ut_pipe.pkb" : [ 52 ], "source/ut_plsql_util.pkb" : [ 1223, 1232, 1252, 1298, 1318 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/InsertWithoutColumnsCheck.json ================================================ { "examples/mybooks_setup.sql" : [ 19, 20, 21, 22, 23, 54 ], "source/ut_receq.pkb" : [ 245, 255 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/ParsingErrorCheck.json ================================================ { "examples/filepath1.pkg" : [ 104 ], "examples/str2list.pkg" : [ 62 ], "source/ut_assertion.tab" : [ 33 ], "source/ut_config.pkb" : [ 680 ], "source/ut_gen.pkb" : [ 222 ], "source/ut_i_preprocess.sql" : [ 23 ], "source/ut_i_synonyms.sql" : [ 24 ], "source/ut_outcome.tab" : [ 22 ], "source/ut_package.tab" : [ 21 ], "source/ut_plsql.pkb" : [ 778 ], "source/ut_receq.tab" : [ 12 ], "source/ut_suite.tab" : [ 17 ], "source/ut_test.tab" : [ 14 ], "source/ut_testcase.tab" : [ 25 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/QueryWithoutExceptionHandlingCheck.json ================================================ { "examples/mybooks_setup.sql" : [ 48 ], "examples/te_employee.pkb" : [ 863, 874, 890, 904, 918, 967 ], "examples/test_te_employee.pkb" : [ 369 ], "examples/ut_te_employee.pkb" : [ 369 ], "source/ut_plsql2.pkb" : [ 57 ], "source/ut_plsql_util.pkb" : [ 615, 959, 963 ], "source/ut_receq.pkb" : [ 151 ], "source/ut_result.pkb" : [ 291, 298 ], "source/ut_routcome.pkb" : [ 162 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/RaiseStandardExceptionCheck.json ================================================ { "examples/temp.sql" : [ 9 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/SameBranchCheck.json ================================================ { "source/ut_outputreporter.pkb" : [ 90 ], "source/ut_plsql_util.pkb" : [ 233 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/SelectAllColumnsCheck.json ================================================ { "examples/employee_pipe.pkg" : [ 199, 238 ], "examples/mybooks_setup.sql" : [ 41, 72 ], "examples/test_te_employee.pkb" : [ 179 ], "examples/ut_te_employee.pkb" : [ 179 ], "source/ut_plsql2.pkb" : [ 313, 413 ], "source/ut_receq.pkb" : [ 168 ], "source/ut_result.pkb" : [ 68, 95 ], "source/ut_suite.pkb" : [ 247, 265 ], "source/ut_utp.pkb" : [ 402 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/UnhandledUserDefinedExceptionCheck.json ================================================ { "source/ut_filereporter.pkb" : [ 130 ], "source/ut_htmlreporter.pkb" : [ 47 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/UnnecessaryAliasInQueryCheck.json ================================================ { "examples/showfailures.sql" : [ 33, 33, 33 ], "source/ut_assert2.pkb" : [ 808 ], "source/ut_outcome.pkb" : [ 104, 104, 104, 123, 123 ], "source/ut_result.pkb" : [ 302 ], "source/ut_result2.pkb" : [ 343 ], "source/ut_routcome.pkb" : [ 199, 199 ], "source/ut_rutp.pkb" : [ 174, 218 ], "source/ut_suiteutp.pkb" : [ 174, 174 ], "source/utv_last_run.sql" : [ 4 ], "source/utv_result_full.sql" : [ 7, 8, 9 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/UnnecessaryElseCheck.json ================================================ { "examples/str.pkb" : [ 40 ], "examples/te_employee.pkb" : [ 1439 ], "source/ut_assert2.pkb" : [ 96, 422, 3434 ], "source/ut_output.pkb" : [ 150 ], "source/ut_outputreporter.pkb" : [ 123 ], "source/ut_plsql_util.pkb" : [ 1130, 1149 ], "source/ut_rerror.pkb" : [ 43, 64 ], "source/ut_result.pkb" : [ 186 ], "source/ut_result2.pkb" : [ 144, 157, 207, 222, 272, 287 ], "source/ut_suite.pkb" : [ 129 ], "source/ut_suiteutp.pkb" : [ 129 ], "source/ut_unittest.pkb" : [ 109, 148, 185 ], "source/ut_utp.pkb" : [ 202, 277, 350 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/UnnecessaryNullStatementCheck.json ================================================ { "examples/te_employee.pkb" : [ 1707 ], "source/ut_routcome.pkb" : [ 59 ], "source/ut_rsuite.pkb" : [ 59 ], "source/ut_rtestcase.pkb" : [ 52 ], "source/ut_runittest.pkb" : [ 58 ], "source/ut_rutp.pkb" : [ 59 ], "source/ut_suiteutp.pkb" : [ 122 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/UnusedParameterCheck.json ================================================ { "examples/te_employee.pkb" : [ 70, 1212, 1213, 1373 ], "source/ut_assert.pkb" : [ 296, 297, 298, 299, 336, 337, 430, 442, 454, 466 ], "source/ut_assert2.pkb" : [ 294, 683, 1261, 1262, 1263, 1264, 1265, 1303, 1646, 1657, 1659, 1661, 1663, 1669, 1792, 2891, 2892, 2893, 2894, 2895, 3188 ], "source/ut_htmlreporter.pkb" : [ 118, 124, 139 ], "source/ut_outputreporter.pkb" : [ 253, 265, 281 ], "source/ut_plsql2.pkb" : [ 151, 308 ], "source/ut_plsql_util.pkb" : [ 995 ], "source/ut_result.pkb" : [ 48, 131, 154, 160, 177, 195, 211, 222 ], "source/ut_result2.pkb" : [ 32, 33 ], "source/ut_testprep.pkb" : [ 32, 39 ], "source/ut_utp.pkb" : [ 231 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/UnusedVariableCheck.json ================================================ { "examples/qu_betwnstr.pkb" : [ 23 ], "examples/te_employee.pkb" : [ 23, 44 ], "examples/test_te_employee.pkb" : [ 320, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440 ], "examples/ut_plvdate.pkb" : [ 28 ], "examples/ut_te_employee.pkb" : [ 320, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440 ], "source/ut_assert2.pkb" : [ 902, 950, 1674, 1675, 1676, 1677, 1678, 1679, 3261, 3262 ], "source/ut_filereporter.pkb" : [ 114 ], "source/ut_plsql2.pkb" : [ 155, 405, 406, 407, 408 ], "source/ut_plsql_util.pkb" : [ 586, 587, 600, 601, 602, 603, 604, 605, 1000 ], "source/ut_receq.pkb" : [ 115 ], "source/ut_result.pkb" : [ 32, 61, 63, 142 ], "source/ut_suite.pkb" : [ 166 ], "source/ut_suiteutp.pkb" : [ 189 ], "source/ut_unittest.pkb" : [ 102 ], "source/ut_utoutput.pkb" : [ 78 ], "source/ut_utp.pkb" : [ 195 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/VariableHidingCheck.json ================================================ { "source/ut_plsql.pks" : [ 44 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/VariableInitializationWithFunctionCallCheck.json ================================================ { "examples/filepath2.pkg" : [ 128 ], "examples/te_employee.pkb" : [ 88, 115, 137, 161, 185, 209, 236, 258, 282, 306, 330, 357, 379, 403, 427 ], "source/ut_assert2.pkb" : [ 819, 3266 ], "source/ut_output.pkb" : [ 59 ], "source/ut_outputreporter.pkb" : [ 59 ], "source/ut_package.pkb" : [ 63, 135, 139 ], "source/ut_plsql2.pkb" : [ 248, 266 ], "source/ut_result.pkb" : [ 62 ], "source/ut_result2.pkb" : [ 50 ], "source/ut_runittest.pkb" : [ 99 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL2/VariableInitializationWithNullCheck.json ================================================ { "examples/te_employee.pkb" : [ 24 ], "source/ut_filereporter.pkb" : [ 35 ], "source/ut_package.pkb" : [ 184, 227 ], "source/ut_plsql_util.pkb" : [ 300, 301, 586, 587 ], "source/ut_report.pkb" : [ 50, 82 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/AddParenthesesInNestedExpressionCheck.json ================================================ { "development/utplsql_style_check.sql" : [ 43, 44, 59, 60 ], "source/api/ut_runner.pkb" : [ 52 ], "source/core/output_buffers/ut_output_bulk_buffer.tpb" : [ 57 ], "source/core/output_buffers/ut_output_clob_table_buffer.tpb" : [ 48 ], "source/core/output_buffers/ut_output_table_buffer.tpb" : [ 57 ], "source/core/ut_suite_cache_manager.pkb" : [ 210 ], "source/core/ut_utils.pkb" : [ 357 ], "source/expectations/data_values/ut_compound_data_helper.pkb" : [ 735 ], "source/expectations/matchers/ut_be_within.tpb" : [ 114, 116 ], "source/install_above_12_1.sql" : [ 6 ], "test/install_above_12_1.sql" : [ 13 ], "test/install_below_12_2.sql" : [ 13 ], "test/ut3_tester_helper/run_helper.pkb" : [ 153, 154 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/CharacterDatatypeUsageCheck.json ================================================ { "source/core/types/ut_executable_test.tpb" : [ 151 ], "test/ut3_tester/core/test_ut_utils.pkb" : [ 290 ], "test/ut3_user/expectations/test_expectations_cursor.pkb" : [ 673 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/CommitRollbackCheck.json ================================================ { "source/api/ut_runner.pkb" : [ 32 ], "test/ut3_tester_helper/ut_example_tests.pkb" : [ 32 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/ComparisonWithBooleanCheck.json ================================================ { "source/core/annotations/ut_annotation_manager.pkb" : [ 68 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/ComparisonWithNullCheck.json ================================================ { "test/ut3_user/expectations/unary/test_expect_to_be_true_false.pkb" : [ 12, 44, 77, 109 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/ConcatenationWithNullCheck.json ================================================ { "source/core/ut_expectation_processor.pkb" : [ 89 ], "source/reporters/ut_coverage_report_html_helper.pkb" : [ 335 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/DbmsOutputPutCheck.json ================================================ { "development/mystats/mystats_pkg.sql" : [ 193, 194, 195, 196, 212, 218, 219, 331, 337, 346, 350, 351, 361, 367, 369, 421, 441 ], "examples/developer_examples/RunExampleTestAnnotationsParsingTimeHugePackage.sql" : [ 17, 18 ], "examples/developer_examples/RunExampleTestSuite.sql" : [ 39, 40, 41, 42, 45, 46, 49 ], "source/api/ut_runner.pkb" : [ 149, 150 ], "source/core/coverage/proftab.sql" : [ 25, 56, 88, 102 ], "source/core/coverage/ut_coverage_helper_block.pkb" : [ 45, 46, 47, 48 ], "source/core/coverage/ut_coverage_runs.sql" : [ 17 ], "source/core/output_buffers/ut_output_buffer_base.tpb" : [ 135, 138 ], "source/core/output_buffers/ut_output_bulk_buffer.tpb" : [ 82 ], "source/core/output_buffers/ut_output_table_buffer.tpb" : [ 82 ], "source/core/ut_expectation_processor.pkb" : [ 89, 91, 94 ], "source/core/ut_utils.pkb" : [ 70, 82, 567, 569 ], "source/expectations/json_objects_specs.sql" : [ 4, 10 ], "source/uninstall.sql" : [ 34, 35, 36 ], "source/uninstall_all.sql" : [ 36, 37, 38 ], "source/uninstall_coverage_tables.sql" : [ 15, 29 ], "source/uninstall_objects.sql" : [ 14, 16, 403, 416, 421, 426, 427 ], "source/uninstall_synonyms.sql" : [ 6, 20, 24, 27, 28, 35, 52, 57, 61, 62 ], "test/install_ut3_tester_helper.sql" : [ 63 ], "test/install_ut3_tester_tests.sql" : [ 73 ], "test/install_ut3_user_tests.sql" : [ 125 ], "test/ut3_tester/core/test_ut_executable.pkb" : [ 69 ], "test/ut3_user/api/test_ut_runner.pkb" : [ 182 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/EmptyBlockCheck.json ================================================ { "examples/RunWithDocumentationReporter.sql" : [ 27, 76 ], "examples/developer_examples/ut_exampletest.pkb" : [ 7, 13 ], "examples/developer_examples/ut_exampletest2.pkb" : [ 7, 13 ], "source/core/types/ut_reporter_base.tpb" : [ 44, 50, 55, 59, 64, 68, 74, 79, 83, 88, 92, 97, 101, 106, 112, 116, 121, 125, 130, 136 ], "test/ut3_tester/core/test_ut_executable.pkb" : [ 64 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/ExplicitInParameterCheck.json ================================================ { "examples/award_bonus/award_bonus.sql" : [ 4, 4 ], "examples/award_bonus/test_award_bonus.pkg" : [ 67, 67, 67 ], "examples/between_string/betwnstr.sql" : [ 1, 1, 1 ], "examples/custom_reporters/ut_custom_reporter.tpb" : [ 3, 19, 19, 24, 30, 36, 42 ], "examples/custom_reporters/ut_custom_reporter.tps" : [ 6, 14, 14, 15, 16, 17, 18 ], "examples/custom_reporters/ut_expectations_reporter.tpb" : [ 19, 36, 39, 57 ], "examples/custom_reporters/ut_expectations_reporter.tps" : [ 21, 23 ], "examples/remove_rooms_by_name/remove_rooms_by_name.sql" : [ 1 ], "source/api/ut.pkb" : [ 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101, 123, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 167, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 211, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782 ], "source/api/ut.pks" : [ 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281 ], "source/api/ut_runner.pkb" : [ 24, 24, 45, 45, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 158, 158, 163, 163, 168, 168, 187, 207, 207, 207, 219, 219, 231, 261 ], "source/api/ut_runner.pks" : [ 33, 33, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 89, 89, 97, 97, 107, 107, 114, 124, 124, 124, 132, 132, 139, 154 ], "source/api/ut_suite_item_info.tpb" : [ 18, 18, 18, 19, 19, 19, 19, 19, 20, 20 ], "source/api/ut_suite_item_info.tps" : [ 28, 28, 28, 29, 29, 29, 29, 29, 30, 30 ], "source/check_object_grants.sql" : [ 11 ], "source/core/annotations/ut_annotation_cache_manager.pkb" : [ 19, 68, 120, 120, 120, 138, 138, 153, 153, 163, 178, 178, 178, 200, 200 ], "source/core/annotations/ut_annotation_cache_manager.pks" : [ 28, 38, 38, 38, 40, 40, 42, 42, 47, 47, 47, 54, 61, 69, 69 ], "source/core/annotations/ut_annotation_manager.pkb" : [ 22, 29, 29, 56, 57, 58, 102, 102, 102, 133, 134, 135, 175, 176, 177, 222, 222, 232, 232, 232, 257, 257, 257, 308, 308, 308, 320, 320 ], "source/core/annotations/ut_annotation_manager.pks" : [ 33, 33, 33, 43, 43, 56, 56 ], "source/core/annotations/ut_annotation_parser.pkb" : [ 36, 37, 38, 58, 70, 71, 72, 92, 186, 218, 218 ], "source/core/annotations/ut_annotation_parser.pks" : [ 30, 30, 41 ], "source/core/coverage/ut_coverage.pkb" : [ 33, 33, 199, 226, 262 ], "source/core/coverage/ut_coverage.pks" : [ 67, 75 ], "source/core/coverage/ut_coverage_block.pkb" : [ 26 ], "source/core/coverage/ut_coverage_block.pks" : [ 19 ], "source/core/coverage/ut_coverage_helper.pkb" : [ 35, 73, 73, 86, 86, 86 ], "source/core/coverage/ut_coverage_helper.pks" : [ 54, 62, 62, 64, 64, 64 ], "source/core/coverage/ut_coverage_helper_block.pkb" : [ 26, 52, 52, 87, 87 ], "source/core/coverage/ut_coverage_helper_block.pks" : [ 23, 23 ], "source/core/coverage/ut_coverage_helper_profiler.pkb" : [ 34, 58, 58, 80, 80 ], "source/core/coverage/ut_coverage_helper_profiler.pks" : [ 27, 27 ], "source/core/coverage/ut_coverage_profiler.pkb" : [ 22 ], "source/core/coverage/ut_coverage_profiler.pks" : [ 19 ], "source/core/coverage/ut_coverage_reporter_base.tpb" : [ 19, 89, 89, 101, 101 ], "source/core/coverage/ut_coverage_reporter_base.tps" : [ 19, 40, 40, 41, 41 ], "source/core/events/ut_event_listener.tps" : [ 33, 33 ], "source/core/events/ut_event_manager.pkb" : [ 60, 60, 63, 64, 65, 88, 88, 93, 93, 100, 110 ], "source/core/events/ut_event_manager.pks" : [ 59, 59, 63 ], "source/core/output_buffers/ut_output_buffer_base.tpb" : [ 19, 19, 38, 66, 66, 66, 84, 84, 84, 113, 113, 122, 122, 144 ], "source/core/output_buffers/ut_output_buffer_base.tps" : [ 24, 24, 25, 26, 26, 26, 27, 27, 27, 29, 29, 30, 30, 31, 34, 34, 35, 35, 36, 36, 37, 37 ], "source/core/output_buffers/ut_output_bulk_buffer.tpb" : [ 19, 25, 25, 44, 44, 54, 54, 73, 73, 90, 90, 141, 141 ], "source/core/output_buffers/ut_output_bulk_buffer.tps" : [ 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25 ], "source/core/output_buffers/ut_output_clob_table_buffer.tpb" : [ 19, 25, 25, 35, 35, 45, 45, 55, 55, 85 ], "source/core/output_buffers/ut_output_clob_table_buffer.tps" : [ 19, 20, 20, 21, 21, 22, 22, 23, 23 ], "source/core/output_buffers/ut_output_table_buffer.tpb" : [ 19, 25, 25, 44, 44, 54, 54, 73, 73, 94, 94 ], "source/core/output_buffers/ut_output_table_buffer.tps" : [ 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24 ], "source/core/session_context/ut_session_context.pkb" : [ 20, 20, 25 ], "source/core/session_context/ut_session_context.pks" : [ 22, 22, 27 ], "source/core/session_context/ut_session_info.tpb" : [ 141, 141 ], "source/core/session_context/ut_session_info.tps" : [ 46, 46 ], "source/core/types/ut_console_reporter_base.tpb" : [ 19, 24, 29, 34, 39 ], "source/core/types/ut_console_reporter_base.tps" : [ 18, 20, 22, 24, 26 ], "source/core/types/ut_coverage_options.tpb" : [ 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 31 ], "source/core/types/ut_coverage_options.tps" : [ 30, 31, 32, 33, 34, 35, 36, 37, 38 ], "source/core/types/ut_executable.tpb" : [ 20, 20, 21, 21, 32 ], "source/core/types/ut_executable.tps" : [ 32, 32, 32, 32, 33 ], "source/core/types/ut_executable_test.tpb" : [ 20, 20, 21, 21, 59, 96 ], "source/core/types/ut_executable_test.tps" : [ 19, 19, 20, 20 ], "source/core/types/ut_expectation_result.tpb" : [ 20, 21, 21, 21 ], "source/core/types/ut_expectation_result.tps" : [ 37, 38, 38, 38 ], "source/core/types/ut_logical_suite.tpb" : [ 31, 31, 78 ], "source/core/types/ut_logical_suite.tps" : [ 25, 25, 28 ], "source/core/types/ut_object_name.tpb" : [ 18, 18, 25 ], "source/core/types/ut_object_name.tps" : [ 20, 20, 21 ], "source/core/types/ut_output_reporter_base.tpb" : [ 24, 24, 31, 37, 44, 44, 49, 49, 54, 54, 59, 59, 66, 66, 71, 71 ], "source/core/types/ut_output_reporter_base.tps" : [ 20, 20, 21, 22, 24, 24, 25, 25, 26, 26, 28, 28, 29, 29, 30, 30 ], "source/core/types/ut_path_item.tpb" : [ 18, 18, 18, 26, 26, 33, 33, 33, 33 ], "source/core/types/ut_path_item.tps" : [ 22, 22, 22, 23, 23, 24, 24, 24, 24 ], "source/core/types/ut_reporter_base.tpb" : [ 19, 26, 167, 167 ], "source/core/types/ut_reporter_base.tps" : [ 19, 20, 78, 78 ], "source/core/types/ut_results_counter.tpb" : [ 28, 36, 45 ], "source/core/types/ut_results_counter.tps" : [ 24, 25, 26 ], "source/core/types/ut_run.tpb" : [ 21, 22, 23, 24, 25, 26, 27, 71, 71, 95 ], "source/core/types/ut_run.tps" : [ 31, 32, 33, 34, 35, 36, 37, 41, 41, 43 ], "source/core/types/ut_stack.tpb" : [ 37 ], "source/core/types/ut_stack.tps" : [ 22 ], "source/core/types/ut_suite.tpb" : [ 20, 20, 20, 21, 37, 87 ], "source/core/types/ut_suite.tps" : [ 30, 30, 30, 31, 34 ], "source/core/types/ut_suite_context.tpb" : [ 20, 20, 20, 20 ], "source/core/types/ut_suite_context.tps" : [ 19, 19, 19, 19 ], "source/core/types/ut_suite_item.tpb" : [ 19, 19, 19, 19, 37, 37, 63, 94, 101, 101, 101, 116 ], "source/core/types/ut_suite_item.tps" : [ 71, 71, 71, 71, 74, 74, 77, 79, 88, 91, 92, 92, 92 ], "source/core/types/ut_test.tpb" : [ 20, 20, 20, 21, 21, 21, 119, 130 ], "source/core/types/ut_test.tps" : [ 59, 59, 59, 60, 60, 60, 65, 66 ], "source/core/ut_expectation_processor.pkb" : [ 36, 80, 151, 160, 164, 168, 177, 204, 210, 210 ], "source/core/ut_expectation_processor.pks" : [ 25, 35, 49, 51, 53, 53 ], "source/core/ut_file_mapper.pkb" : [ 25, 52, 53, 54, 55, 56, 57, 67, 68, 69, 70, 71, 72, 73 ], "source/core/ut_file_mapper.pks" : [ 27, 28, 29, 30, 31, 32, 36, 37, 38, 39, 40, 41, 42 ], "source/core/ut_metadata.pkb" : [ 24, 24, 24, 37, 55, 72, 72, 72, 103, 146, 156, 174, 174, 183, 183, 202, 222, 222, 273, 315 ], "source/core/ut_metadata.pks" : [ 52, 52, 52, 58, 64, 70, 70, 70, 83, 99, 111, 121, 121, 126, 131, 131, 136, 136, 151, 166 ], "source/core/ut_suite_builder.pkb" : [ 99, 100, 121, 135, 136, 137, 138, 148, 162, 163, 188, 190, 239, 255, 256, 257, 258, 304, 305, 306, 322, 323, 324, 325, 351, 352, 429, 430, 455, 456, 457, 469, 492, 520, 588, 589, 604, 627, 641, 642, 643, 690, 802, 820, 838, 864 ], "source/core/ut_suite_builder.pks" : [ 27 ], "source/core/ut_suite_cache_manager.pkb" : [ 71, 90, 128, 200, 235, 276, 288, 299, 300, 301, 302, 411, 431, 438, 453, 466, 467, 468 ], "source/core/ut_suite_cache_manager.pks" : [ 27, 28, 29, 30, 36, 41, 50, 58, 69, 73, 77, 86, 95, 96, 97 ], "source/core/ut_suite_manager.pkb" : [ 42, 107, 139, 140, 141, 142, 143, 255, 301, 329, 330, 353, 354, 355, 356, 377, 384, 385, 427, 449, 451, 452, 470, 471, 472, 473, 474, 475, 494, 494, 511, 518, 518, 526, 528, 529, 567, 599, 600, 601 ], "source/core/ut_suite_manager.pks" : [ 33, 33, 43, 43, 63, 71, 72, 73, 74, 75, 76, 86, 99, 100, 101 ], "source/core/ut_suite_tag_filter.pkb" : [ 53, 206, 224, 225, 274, 275 ], "source/core/ut_suite_tag_filter.pks" : [ 46, 50, 51 ], "source/core/ut_utils.pkb" : [ 28, 28, 33, 51, 67, 76, 90, 91, 110, 111, 132, 133, 153, 158, 163, 168, 173, 178, 183, 188, 194, 199, 204, 204, 204, 233, 233, 233, 246, 246, 246, 291, 291, 305, 305, 319, 319, 333, 333, 342, 342, 342, 362, 373, 386, 399, 409, 429, 429, 444, 454, 464, 477, 477, 484, 484, 509, 533, 533, 584, 589, 589, 596, 601, 612, 612, 661, 750, 777, 777, 795, 803, 820, 831, 846, 860, 860, 860, 875, 875, 875, 880, 880, 880, 885, 885, 891, 891, 897, 897, 928, 937, 971, 999 ], "source/core/ut_utils.pks" : [ 166, 168, 177, 179, 182, 183, 188, 189, 194, 195, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 236, 236, 236, 255, 255, 255, 274, 274, 274, 276, 276, 278, 278, 280, 280, 285, 285, 290, 290, 290, 301, 306, 311, 316, 321, 323, 323, 325, 327, 329, 331, 331, 333, 333, 342, 375, 377, 377, 383, 389, 408, 413, 418, 418, 423, 429, 435, 440, 440, 440, 442, 442, 442, 444, 444, 444, 452, 452, 457, 457, 462, 462, 468, 473, 478, 483 ], "source/expectations/data_values/ut_compound_data_helper.pkb" : [ 75, 76, 77, 129, 129, 154, 154, 181, 181, 203, 203, 225, 252, 253, 254, 321, 322, 323, 324, 325, 346, 397, 412, 412, 413, 413, 413, 414, 414, 414, 415, 563, 563, 563, 568, 568, 583, 600, 629, 629, 636, 644, 644, 644, 649, 649, 664, 674, 674, 745, 745, 745, 763, 775, 788 ], "source/expectations/data_values/ut_compound_data_helper.pks" : [ 83, 83, 83, 87, 87, 88, 88, 88, 89, 89, 89, 90, 93, 93, 93, 96, 97, 98, 99, 100, 103, 103, 105, 111, 115, 115, 117, 119, 119, 119, 121, 121, 126, 128, 128, 130, 130, 130, 132, 135, 137 ], "source/expectations/data_values/ut_cursor_column.tpb" : [ 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 58, 58, 59, 59, 59, 59, 60, 60, 61 ], "source/expectations/data_values/ut_cursor_column.tps" : [ 38, 38, 39, 39, 39, 39, 40, 40, 41, 44, 44, 45, 45, 45, 45, 46, 46, 47 ], "source/expectations/data_values/ut_cursor_details.tpb" : [ 3, 3, 18, 152, 167, 228 ], "source/expectations/data_values/ut_cursor_details.tps" : [ 26, 26, 29, 35, 36, 37 ], "source/expectations/data_values/ut_data_value.tpb" : [ 18, 33, 33, 48, 48 ], "source/expectations/data_values/ut_data_value.tps" : [ 25, 25, 26, 29, 29, 30 ], "source/expectations/data_values/ut_data_value_anydata.tpb" : [ 24, 39, 62, 101, 111, 119, 120, 121, 122 ], "source/expectations/data_values/ut_data_value_anydata.tps" : [ 20, 21, 22, 23, 24, 26, 27, 28, 29 ], "source/expectations/data_values/ut_data_value_blob.tpb" : [ 19, 47 ], "source/expectations/data_values/ut_data_value_blob.tps" : [ 19, 24 ], "source/expectations/data_values/ut_data_value_boolean.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_boolean.tps" : [ 19, 22 ], "source/expectations/data_values/ut_data_value_clob.tpb" : [ 19, 47 ], "source/expectations/data_values/ut_data_value_clob.tps" : [ 19, 24 ], "source/expectations/data_values/ut_data_value_date.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_date.tps" : [ 19, 22 ], "source/expectations/data_values/ut_data_value_dsinterval.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_dsinterval.tps" : [ 19, 22 ], "source/expectations/data_values/ut_data_value_json.tpb" : [ 19, 29, 35, 57, 57, 68, 79, 131, 138 ], "source/expectations/data_values/ut_data_value_json.tps" : [ 20, 21, 22, 26, 26, 27, 28, 28 ], "source/expectations/data_values/ut_data_value_number.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_number.tps" : [ 19, 22 ], "source/expectations/data_values/ut_data_value_refcursor.tpb" : [ 19, 26, 75, 135, 135, 155, 171, 171, 191, 191, 298, 304, 305, 306, 307, 315, 316, 317 ], "source/expectations/data_values/ut_data_value_refcursor.tps" : [ 38, 39, 40, 42, 42, 43, 45, 46, 47, 48 ], "source/expectations/data_values/ut_data_value_timestamp.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_timestamp.tps" : [ 19, 22 ], "source/expectations/data_values/ut_data_value_timestamp_ltz.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_timestamp_ltz.tps" : [ 19, 22 ], "source/expectations/data_values/ut_data_value_timestamp_tz.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_timestamp_tz.tps" : [ 19, 22 ], "source/expectations/data_values/ut_data_value_varchar2.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_varchar2.tps" : [ 19, 23 ], "source/expectations/data_values/ut_data_value_xmltype.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_xmltype.tps" : [ 19, 22 ], "source/expectations/data_values/ut_data_value_yminterval.tpb" : [ 19, 38 ], "source/expectations/data_values/ut_data_value_yminterval.tps" : [ 19, 22 ], "source/expectations/data_values/ut_json_leaf.tpb" : [ 4, 4, 4, 5, 5, 5, 6, 6, 6, 21, 21, 21, 22, 22, 22, 23, 23, 23 ], "source/expectations/data_values/ut_json_leaf.tps" : [ 32, 32, 32, 33, 33, 33, 34, 34, 34, 37, 37, 37, 38, 38, 38, 39, 39, 39 ], "source/expectations/data_values/ut_json_tree_details.tpb" : [ 3, 22, 22, 40, 40, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 83, 84, 85, 86, 136, 137, 138, 139, 186, 196 ], "source/expectations/data_values/ut_json_tree_details.tps" : [ 19, 20, 20, 21, 21, 24, 25, 26, 27, 28, 29, 32, 33, 37, 38, 39, 40, 44, 45, 46, 47, 49, 51 ], "source/expectations/data_values/ut_key_anyvalues.tpb" : [ 24, 31, 31, 36, 36, 41, 41, 46, 46, 51, 51, 56, 56, 60, 60, 65, 65, 70, 70, 75, 75, 80, 80, 85, 85 ], "source/expectations/data_values/ut_key_anyvalues.tps" : [ 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32 ], "source/expectations/matchers/ut_be_between.tpb" : [ 19, 19, 26, 26, 32, 32, 38, 38, 44, 44, 50, 50, 56, 56, 63, 63, 70, 70, 77, 94, 101 ], "source/expectations/matchers/ut_be_between.tps" : [ 20, 20, 21, 21, 23, 23, 25, 25, 27, 27, 29, 29, 31, 31, 33, 33, 35, 35, 37, 38, 39 ], "source/expectations/matchers/ut_be_empty.tpb" : [ 30 ], "source/expectations/matchers/ut_be_empty.tps" : [ 20 ], "source/expectations/matchers/ut_be_false.tpb" : [ 25 ], "source/expectations/matchers/ut_be_false.tps" : [ 19 ], "source/expectations/matchers/ut_be_greater_or_equal.tpb" : [ 19, 25, 31, 37, 43, 49, 55, 61, 67, 78, 83 ], "source/expectations/matchers/ut_be_greater_or_equal.tps" : [ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 ], "source/expectations/matchers/ut_be_greater_than.tpb" : [ 19, 25, 31, 37, 43, 49, 55, 61, 67, 78, 83 ], "source/expectations/matchers/ut_be_greater_than.tps" : [ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 ], "source/expectations/matchers/ut_be_less_or_equal.tpb" : [ 19, 25, 31, 37, 43, 49, 55, 61, 67, 78, 83 ], "source/expectations/matchers/ut_be_less_or_equal.tps" : [ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 ], "source/expectations/matchers/ut_be_less_than.tpb" : [ 19, 25, 31, 37, 44, 51, 58, 65, 72, 83, 88 ], "source/expectations/matchers/ut_be_less_than.tps" : [ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 ], "source/expectations/matchers/ut_be_like.tpb" : [ 27, 50, 62 ], "source/expectations/matchers/ut_be_like.tps" : [ 21, 22, 23 ], "source/expectations/matchers/ut_be_not_null.tpb" : [ 25 ], "source/expectations/matchers/ut_be_not_null.tps" : [ 19 ], "source/expectations/matchers/ut_be_null.tpb" : [ 25 ], "source/expectations/matchers/ut_be_null.tps" : [ 19 ], "source/expectations/matchers/ut_be_true.tpb" : [ 25 ], "source/expectations/matchers/ut_be_true.tps" : [ 19 ], "source/expectations/matchers/ut_be_within.tpb" : [ 19, 25, 31, 37, 48, 55, 66, 73, 84, 91, 102, 109, 126, 131 ], "source/expectations/matchers/ut_be_within.tps" : [ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 ], "source/expectations/matchers/ut_be_within_helper.pkb" : [ 20, 20, 20 ], "source/expectations/matchers/ut_be_within_helper.pks" : [ 20, 20, 20 ], "source/expectations/matchers/ut_be_within_pct.tpb" : [ 19, 25, 25, 31, 42, 49, 64, 69, 74 ], "source/expectations/matchers/ut_be_within_pct.tps" : [ 25, 26, 26, 27, 28, 29, 30, 31, 32 ], "source/expectations/matchers/ut_comparison_matcher.tpb" : [ 19 ], "source/expectations/matchers/ut_comparison_matcher.tps" : [ 20 ], "source/expectations/matchers/ut_contain.tpb" : [ 19, 26, 33, 48, 54, 67 ], "source/expectations/matchers/ut_contain.tps" : [ 26, 27, 28, 29, 30, 31 ], "source/expectations/matchers/ut_equal.tpb" : [ 19, 19, 19, 26, 26, 32, 32, 38, 38, 38, 50, 50, 50, 61, 61, 67, 67, 73, 73, 79, 79, 85, 85, 91, 91, 97, 97, 97, 108, 108, 108, 119, 119, 125, 125, 131, 131, 137, 137, 143, 143, 149, 149, 155, 155, 161, 161, 167, 174, 181, 186, 193, 200, 207, 212, 233, 241, 249, 254, 286, 304, 324 ], "source/expectations/matchers/ut_equal.tps" : [ 25, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 47, 48, 49, 50, 51, 52, 53, 56, 57, 58, 59, 60, 61, 62 ], "source/expectations/matchers/ut_have_count.tpb" : [ 19, 26, 39, 46 ], "source/expectations/matchers/ut_have_count.tps" : [ 21, 22, 23, 24 ], "source/expectations/matchers/ut_match.tpb" : [ 27, 40, 52 ], "source/expectations/matchers/ut_match.tps" : [ 21, 22, 23 ], "source/expectations/matchers/ut_matcher.tpb" : [ 19, 26, 46, 55, 60 ], "source/expectations/matchers/ut_matcher.tps" : [ 31, 32, 36, 37, 38 ], "source/expectations/matchers/ut_matcher_options_items.tpb" : [ 25, 38 ], "source/expectations/matchers/ut_matcher_options_items.tps" : [ 25, 26 ], "source/expectations/ut_expectation.tpb" : [ 69, 69, 74, 74, 74, 85, 85, 85, 96, 96, 101, 101, 106, 106, 111, 111, 116, 116, 121, 121, 126, 126, 126, 135, 135, 135, 144, 144, 149, 149, 154, 154, 159, 159, 164, 164, 169, 169, 174, 174, 179, 179, 184, 184, 189, 189, 189, 198, 198, 198, 207, 207, 212, 212, 217, 217, 222, 222, 227, 227, 232, 232, 237, 237, 237, 246, 246, 246, 255, 255, 260, 260, 265, 265, 270, 270, 275, 275, 280, 280, 285, 285, 314, 314, 319, 319, 324, 324, 329, 329, 334, 334, 339, 339, 344, 344, 349, 349, 355, 360, 365, 370, 375, 380, 385, 390, 395, 400, 405, 410, 415, 420, 426, 431, 436, 441, 446, 451, 456, 462, 467, 472, 477, 482, 487, 492, 498, 498, 503, 503, 508, 508, 513, 513, 518, 518, 523, 523, 528, 528, 533, 533, 539, 544, 549, 554, 559, 564, 569, 575, 580, 585, 590, 595, 600, 605, 611, 616, 621, 626, 631, 636, 641, 647, 652, 657, 662, 667, 672, 677, 682, 687, 692, 697, 702, 710, 718, 726, 734, 742, 750, 758 ], "source/expectations/ut_expectation.tps" : [ 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 112, 114, 115, 116, 117, 118, 119, 120, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 131, 132, 133, 134, 135, 136, 137, 139, 140, 141, 142, 143, 144, 145, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 168, 169, 170, 171, 172, 173, 174, 175 ], "source/expectations/ut_expectation_base.tpb" : [ 18, 33 ], "source/expectations/ut_expectation_base.tps" : [ 22, 23 ], "source/expectations/ut_expectation_compound.tpb" : [ 19, 19, 26, 31, 37, 37, 45, 45, 53, 53, 61, 61, 69, 77, 85, 93 ], "source/expectations/ut_expectation_compound.tps" : [ 20, 20, 22, 23, 25, 25, 26, 26, 27, 27, 28, 28, 29, 30, 31, 32 ], "source/expectations/ut_expectation_json.tpb" : [ 19, 19, 26, 26, 33, 33, 40, 45 ], "source/expectations/ut_expectation_json.tps" : [ 20, 20, 22, 22, 23, 23, 24, 25 ], "source/reporters/ut_ansiconsole_helper.pkb" : [ 25, 30, 30, 39, 44, 49, 54 ], "source/reporters/ut_ansiconsole_helper.pks" : [ 18, 20, 22, 24, 26 ], "source/reporters/ut_coverage_cobertura_reporter.tpb" : [ 37, 82, 83 ], "source/reporters/ut_coverage_html_reporter.tpb" : [ 21, 22 ], "source/reporters/ut_coverage_html_reporter.tps" : [ 22, 23 ], "source/reporters/ut_coverage_report_html_helper.pkb" : [ 38, 68, 68, 73, 86, 86, 91, 96, 105, 106, 107, 110, 121, 132, 132, 132, 132, 218, 229, 229, 284, 285, 286, 287, 288 ], "source/reporters/ut_coverage_report_html_helper.pks" : [ 20, 20, 22, 26, 28, 30, 30, 32, 35, 36, 37, 38, 39 ], "source/reporters/ut_coverage_sonar_reporter.tpb" : [ 30, 60, 61 ], "source/reporters/ut_coveralls_reporter.tpb" : [ 29, 62 ], "source/reporters/ut_debug_reporter.tpb" : [ 32, 32, 71 ], "source/reporters/ut_debug_reporter.tps" : [ 29, 29, 31 ], "source/reporters/ut_documentation_reporter.tpb" : [ 32, 32, 47, 47, 58, 64, 101, 115, 126, 144 ], "source/reporters/ut_documentation_reporter.tps" : [ 23, 23, 24, 24, 25, 26, 29 ], "source/reporters/ut_junit_reporter.tpb" : [ 30, 30, 35, 79, 143, 149 ], "source/reporters/ut_junit_reporter.tps" : [ 26, 27 ], "source/reporters/ut_sonar_test_reporter.tpb" : [ 29, 29, 45, 65, 65 ], "source/reporters/ut_teamcity_reporter.tpb" : [ 63, 63, 71, 71 ], "source/reporters/ut_teamcity_reporter_helper.pkb" : [ 27, 52, 52, 59, 59, 67, 67, 67, 81, 81, 81, 90, 90, 90, 100, 100, 100, 100, 100, 116 ], "source/reporters/ut_teamcity_reporter_helper.pks" : [ 19, 19, 20, 20, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 25, 25, 26 ], "source/reporters/ut_tfs_junit_reporter.tpb" : [ 33, 43, 49, 49, 54, 90, 156 ], "source/uninstall_objects.sql" : [ 3, 3 ], "test/ut3_tester/core/annotations/test_annotation_cache.pkb" : [ 3, 17, 30, 43, 58, 76, 97, 110, 126, 143 ], "test/ut3_tester/core/annotations/test_annotation_manager.pkb" : [ 3, 97, 117 ], "test/ut3_tester/core/annotations/test_before_after_annotations.pkb" : [ 8, 8, 13 ], "test/ut3_tester/core/annotations/test_before_after_annotations.pks" : [ 9, 9, 11 ], "test/ut3_tester/core/test_output_buffer.pkb" : [ 125 ], "test/ut3_tester/core/test_suite_builder.pkb" : [ 4, 5 ], "test/ut3_tester/core/test_ut_test.pkb" : [ 297 ], "test/ut3_tester/core/test_ut_utils.pkb" : [ 14, 36, 36, 36, 36, 234, 234, 234 ], "test/ut3_tester_helper/annotation_cache_helper.pkb" : [ 121, 136, 162 ], "test/ut3_tester_helper/annotation_cache_helper.pks" : [ 18 ], "test/ut3_tester_helper/coverage_helper.pkb" : [ 23, 23, 286, 286, 293, 293, 308, 338, 338, 367, 391, 445, 486 ], "test/ut3_tester_helper/coverage_helper.pks" : [ 7, 7, 23, 23, 24, 24, 26, 27, 28 ], "test/ut3_tester_helper/expectations_helper.pkb" : [ 4, 5, 6, 21, 22, 23, 24, 36, 37, 38, 39, 40 ], "test/ut3_tester_helper/expectations_helper.pks" : [ 4, 5, 6, 10, 11, 12, 13, 17, 18, 19, 20, 21 ], "test/ut3_tester_helper/main_helper.pkb" : [ 22, 31, 38, 94, 129, 134, 139, 144 ], "test/ut3_tester_helper/main_helper.pks" : [ 6, 8, 10, 28, 38, 40, 42, 44 ], "test/ut3_tester_helper/run_helper.pkb" : [ 688, 693, 693, 698, 698, 703, 703, 703, 713, 720, 720, 720, 732, 732, 740, 740, 748, 748, 760, 760, 765, 765, 765, 770, 770, 770, 775, 775, 782, 782, 782, 790, 790, 790, 798, 798, 798, 890, 891, 903, 904, 905 ], "test/ut3_tester_helper/run_helper.pks" : [ 31, 32, 32, 33, 33, 34, 34, 35, 36, 37, 37, 38, 39, 39, 41, 41, 43, 43, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 50, 50, 50, 52, 52, 52, 55, 55, 55, 67, 68, 72, 73, 74 ], "test/ut3_user/api/test_ut_runner.pkb" : [ 41, 123, 123 ], "test/ut3_user/expectations/binary/test_be_greater_or_equal.pkb" : [ 9, 10, 11, 20, 21, 22 ], "test/ut3_user/expectations/binary/test_be_greater_than.pkb" : [ 9, 10, 11, 20, 21, 22 ], "test/ut3_user/expectations/binary/test_be_less_or_equal.pkb" : [ 9, 10, 11, 20, 21, 22 ], "test/ut3_user/expectations/binary/test_equal.pkb" : [ 14, 15, 16, 17, 18, 19, 34, 35, 36, 37, 38, 48, 49, 50, 51, 59, 60, 61, 62, 63, 73, 74, 75, 76, 77, 87, 88, 89, 90 ], "test/ut3_user/expectations/binary/test_expect_to_be_less_than.pkb" : [ 9, 10, 11, 20, 21, 22 ], "test/ut3_user/expectations/binary/test_to_be_within.pkb" : [ 9, 10, 11, 12, 13, 14, 15, 16, 34, 35, 36, 37, 38, 39, 40, 52, 53, 54, 55, 56, 57, 58 ], "test/ut3_user/expectations/binary/test_to_be_within_pct.pkb" : [ 9, 10, 11, 12, 13, 14, 15, 16, 34, 35, 36, 37, 38, 39, 40, 41, 42, 59, 60, 61, 62, 63, 64, 65, 66, 79, 80, 81, 82, 83, 84, 85, 86, 87 ], "test/ut3_user/expectations/test_matchers.pkb" : [ 8, 8, 8, 8, 8, 8, 27, 27, 27, 27, 27, 47, 47, 47, 47, 47, 47, 67, 67, 67, 67, 67, 67, 87, 87, 87, 87, 87, 87 ], "test/ut3_user/reporters.pkb" : [ 161, 162, 177 ], "test/ut3_user/reporters.pks" : [ 13, 14, 18 ], "test/ut3_user/reporters/test_coverage/test_coverage_standalone.pkb" : [ 3, 3, 3 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/FunctionWithOutParameterCheck.json ================================================ { "source/core/annotations/ut_annotation_parser.pkb" : [ 134 ], "source/core/types/ut_executable.tpb" : [ 47, 47 ], "source/core/types/ut_executable.tps" : [ 40, 40 ], "source/core/types/ut_executable_test.tpb" : [ 42, 42, 49 ], "source/core/types/ut_executable_test.tps" : [ 29, 29 ], "source/core/types/ut_logical_suite.tpb" : [ 39 ], "source/core/types/ut_logical_suite.tps" : [ 26 ], "source/core/types/ut_run.tpb" : [ 47 ], "source/core/types/ut_run.tps" : [ 40 ], "source/core/types/ut_stack.tpb" : [ 26, 50 ], "source/core/types/ut_stack.tps" : [ 21, 24 ], "source/core/types/ut_suite.tpb" : [ 33 ], "source/core/types/ut_suite.tps" : [ 33 ], "source/core/types/ut_suite_item.tps" : [ 85 ], "source/core/types/ut_test.tpb" : [ 50 ], "source/core/types/ut_test.tps" : [ 63 ], "source/core/ut_suite_builder.pkb" : [ 689 ], "source/core/ut_suite_manager.pkb" : [ 52 ], "source/expectations/matchers/ut_be_between.tpb" : [ 77 ], "source/expectations/matchers/ut_be_between.tps" : [ 37 ], "source/expectations/matchers/ut_be_empty.tpb" : [ 30 ], "source/expectations/matchers/ut_be_empty.tps" : [ 20 ], "source/expectations/matchers/ut_be_false.tpb" : [ 25 ], "source/expectations/matchers/ut_be_false.tps" : [ 19 ], "source/expectations/matchers/ut_be_greater_or_equal.tpb" : [ 67 ], "source/expectations/matchers/ut_be_greater_or_equal.tps" : [ 26 ], "source/expectations/matchers/ut_be_greater_than.tpb" : [ 67 ], "source/expectations/matchers/ut_be_greater_than.tps" : [ 26 ], "source/expectations/matchers/ut_be_less_or_equal.tpb" : [ 67 ], "source/expectations/matchers/ut_be_less_or_equal.tps" : [ 26 ], "source/expectations/matchers/ut_be_less_than.tpb" : [ 72 ], "source/expectations/matchers/ut_be_less_than.tps" : [ 26 ], "source/expectations/matchers/ut_be_like.tpb" : [ 27 ], "source/expectations/matchers/ut_be_like.tps" : [ 21 ], "source/expectations/matchers/ut_be_not_null.tpb" : [ 25 ], "source/expectations/matchers/ut_be_not_null.tps" : [ 19 ], "source/expectations/matchers/ut_be_null.tpb" : [ 25 ], "source/expectations/matchers/ut_be_null.tps" : [ 19 ], "source/expectations/matchers/ut_be_true.tpb" : [ 25 ], "source/expectations/matchers/ut_be_true.tps" : [ 19 ], "source/expectations/matchers/ut_be_within.tpb" : [ 109 ], "source/expectations/matchers/ut_be_within.tps" : [ 31 ], "source/expectations/matchers/ut_be_within_pct.tpb" : [ 49 ], "source/expectations/matchers/ut_be_within_pct.tps" : [ 29 ], "source/expectations/matchers/ut_contain.tpb" : [ 33, 48 ], "source/expectations/matchers/ut_contain.tps" : [ 28, 29 ], "source/expectations/matchers/ut_equal.tpb" : [ 286 ], "source/expectations/matchers/ut_equal.tps" : [ 60 ], "source/expectations/matchers/ut_have_count.tpb" : [ 26 ], "source/expectations/matchers/ut_have_count.tps" : [ 22 ], "source/expectations/matchers/ut_match.tpb" : [ 27 ], "source/expectations/matchers/ut_match.tps" : [ 21 ], "source/expectations/matchers/ut_matcher.tpb" : [ 19, 26 ], "source/expectations/matchers/ut_matcher.tps" : [ 31, 32 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/IdenticalExpressionCheck.json ================================================ { "source/uninstall_objects.sql" : [ 407 ], "source/uninstall_synonyms.sql" : [ 43 ], "test/ut3_user/expectations/unary/test_expect_to_be_true_false.pkb" : [ 20, 60, 93, 117 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/InequalityUsageCheck.json ================================================ { "development/utplsql_style_check.sql" : [ 28, 45 ], "examples/award_bonus/test_award_bonus.pkg" : [ 53 ], "source/api/ut.pkb" : [ 225 ], "source/check_sys_grants.sql" : [ 8, 10 ], "source/core/annotations/ut_annotation_manager.pkb" : [ 149 ], "source/core/annotations/ut_annotation_parser.pkb" : [ 78 ], "source/core/output_buffers/ut_output_buffer_base.tpb" : [ 42, 51 ], "source/core/output_buffers/ut_output_bulk_buffer.tpb" : [ 57 ], "source/core/output_buffers/ut_output_clob_table_buffer.tpb" : [ 48 ], "source/core/output_buffers/ut_output_table_buffer.tpb" : [ 57 ], "source/core/types/ut_executable.tpb" : [ 94, 97, 170 ], "source/core/ut_suite_cache_manager.pkb" : [ 153 ], "source/core/ut_suite_manager.pkb" : [ 315 ], "source/core/ut_utils.pkb" : [ 849 ], "source/expectations/data_values/ut_compound_data_helper.pkb" : [ 682, 688, 724 ], "source/expectations/data_values/ut_cursor_details.tpb" : [ 178 ], "source/expectations/data_values/ut_data_value_json.tpb" : [ 124 ], "source/expectations/data_values/ut_data_value_refcursor.tpb" : [ 291 ], "source/expectations/matchers/ut_have_count.tpb" : [ 29 ], "source/reporters/ut_documentation_reporter.tpb" : [ 89, 96 ], "source/reporters/ut_junit_reporter.tpb" : [ 43 ], "source/reporters/ut_tfs_junit_reporter.tpb" : [ 131 ], "source/uninstall_synonyms.sql" : [ 14 ], "test/install_ut3_tester_helper.sql" : [ 53 ], "test/install_ut3_tester_tests.sql" : [ 63 ], "test/install_ut3_user_tests.sql" : [ 115 ], "test/ut3_tester_helper/main_helper.pkb" : [ 10, 13 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/InsertWithoutColumnsCheck.json ================================================ { "examples/award_bonus/employees_test.sql" : [ 2, 3, 4, 6 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/ParsingErrorCheck.json ================================================ { "development/mystats/mystats.sql" : [ 425 ], "source/core/annotations/ut_annotation_cache.sql" : [ 24 ], "source/core/annotations/ut_annotation_cache_info.sql" : [ 21 ], "source/core/annotations/ut_annotation_cache_schema.sql" : [ 20 ], "source/core/output_buffers/ut_output_buffer_info_tmp.sql" : [ 23 ], "source/core/output_buffers/ut_output_buffer_tmp.sql" : [ 30 ], "source/core/ut_savepoint_seq.sql" : [ 15 ], "source/core/ut_suite_cache.sql" : [ 15 ], "source/core/ut_suite_cache_package.sql" : [ 20 ], "source/core/ut_suite_cache_schema.sql" : [ 18 ], "source/create_grants.sql" : [ 38 ], "source/create_synonyms.sql" : [ 54 ], "source/create_utplsql_owner.sql" : [ 30 ], "source/define_ut3_owner_param.sql" : [ 49 ], "source/install.sql" : [ 37 ], "source/install_ddl_trigger.sql" : [ 22 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/QueryWithoutExceptionHandlingCheck.json ================================================ { "examples/award_bonus/award_bonus.sql" : [ 8 ], "source/api/ut.pkb" : [ 810 ], "source/check_sys_grants.sql" : [ 16 ], "source/core/coverage/dbms_plssqlcode.sql" : [ 4, 31, 50 ], "source/core/coverage/proftab.sql" : [ 4, 33, 64, 96 ], "source/core/coverage/ut_coverage_runs.sql" : [ 4 ], "source/core/output_buffers/ut_output_buffer_base.tpb" : [ 27 ], "source/core/output_buffers/ut_output_bulk_buffer.tpb" : [ 106 ], "source/core/ut_dbms_output_cache.sql" : [ 22 ], "source/core/ut_metadata.pkb" : [ 126, 160 ], "source/core/ut_suite_cache_manager.pkb" : [ 291, 321, 473, 482, 490 ], "source/core/ut_suite_manager.pkb" : [ 613 ], "source/core/ut_suite_tag_filter.pkb" : [ 62, 68 ], "source/core/ut_utils.pkb" : [ 654 ], "source/expectations/data_values/ut_cursor_details.tpb" : [ 6, 146, 231, 243 ], "source/reporters/ut_debug_reporter.tpb" : [ 74 ], "source/uninstall_coverage_tables.sql" : [ 23 ], "source/uninstall_objects.sql" : [ 6 ], "test/ut3_tester/core/annotations/test_annotation_manager.pkb" : [ 102, 154, 374, 408, 443 ], "test/ut3_tester/core/test_output_buffer.pkb" : [ 23, 31, 85, 119, 177, 195 ], "test/ut3_tester/core/test_suite_builder.pkb" : [ 33 ], "test/ut3_tester/core/test_ut_utils.pkb" : [ 10, 271 ], "test/ut3_tester_helper/other_dummy_object.tps" : [ 4 ], "test/ut3_tester_helper/run_helper.pkb" : [ 164 ], "test/ut3_tester_helper/test_dummy_dble_nest_lst_obj.tps" : [ 4 ], "test/ut3_tester_helper/test_dummy_double_nested_list.tps" : [ 4 ], "test/ut3_tester_helper/test_dummy_double_nested_object.tps" : [ 4 ], "test/ut3_tester_helper/test_dummy_nested_object.tps" : [ 4 ], "test/ut3_tester_helper/test_dummy_nested_object_list.tps" : [ 4 ], "test/ut3_tester_helper/test_dummy_number.tps" : [ 4 ], "test/ut3_tester_helper/test_dummy_object.tps" : [ 4 ], "test/ut3_tester_helper/test_dummy_object_list.tps" : [ 4 ], "test/ut3_tester_helper/test_event_object.tps" : [ 4 ], "test/ut3_tester_helper/test_nested_tab_varray.tps" : [ 4 ], "test/ut3_tester_helper/test_tab_varchar2.tps" : [ 4 ], "test/ut3_tester_helper/test_tab_varray.tps" : [ 4 ], "test/ut3_tester_helper/ut_test_table.sql" : [ 4 ], "test/ut3_user/api/test_ut_run.pkb" : [ 829 ], "test/ut3_user/expectations/test_expectations_cursor.pkb" : [ 1972, 1975, 1996, 1999, 2020, 2023, 2046, 2049, 2081, 2084 ], "test/ut3_user/reporters/test_junit_reporter.pkb" : [ 142 ], "test/ut3_user/reporters/test_realtime_reporter.pkb" : [ 254, 264, 275, 336, 350, 371, 388, 406, 423, 440, 456, 495, 513 ], "test/ut3_user/reporters/test_tfs_junit_reporter.pkb" : [ 198 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/RaiseStandardExceptionCheck.json ================================================ { "examples/remove_rooms_by_name/remove_rooms_by_name.sql" : [ 4 ], "source/api/ut.pkb" : [ 223 ], "source/expectations/data_values/ut_data_value.tpb" : [ 30 ], "source/expectations/data_values/ut_data_value_anydata.tpb" : [ 127, 138 ], "source/expectations/data_values/ut_data_value_boolean.tpb" : [ 52 ], "source/expectations/data_values/ut_data_value_date.tpb" : [ 52 ], "source/expectations/data_values/ut_data_value_json.tpb" : [ 101 ], "source/expectations/data_values/ut_data_value_number.tpb" : [ 52 ], "source/expectations/data_values/ut_data_value_refcursor.tpb" : [ 206, 361 ], "source/expectations/data_values/ut_data_value_timestamp.tpb" : [ 52 ], "source/expectations/data_values/ut_data_value_timestamp_ltz.tpb" : [ 52 ], "source/expectations/data_values/ut_data_value_timestamp_tz.tpb" : [ 52 ], "source/expectations/data_values/ut_data_value_varchar2.tpb" : [ 52 ], "test/ut3_tester/core/test_ut_executable.pkb" : [ 74 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/SameBranchCheck.json ================================================ { "source/core/ut_suite_tag_filter.pkb" : [ 124 ], "source/core/ut_utils.pkb" : [ 812 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/SelectAllColumnsCheck.json ================================================ { "examples/award_bonus/test_award_bonus.pkg" : [ 40, 53 ], "examples/remove_rooms_by_name/test_remove_rooms_by_name.pkg" : [ 52, 56, 64, 74, 83, 93 ], "source/core/annotations/ut_annotation_cache_manager.pkb" : [ 142 ], "source/core/output_buffers/ut_output_clob_table_buffer.tpb" : [ 80 ], "source/core/output_buffers/ut_output_table_buffer.tpb" : [ 115 ], "source/core/ut_suite_cache_manager.pkb" : [ 133, 172, 174, 176, 178 ], "source/core/ut_suite_manager.pkb" : [ 20, 372 ], "source/core/ut_utils.pkb" : [ 771 ], "test/ut3_tester/core/annotations/test_annot_disabled_reason.pkb" : [ 350, 373, 397, 422, 441, 466 ], "test/ut3_tester/core/annotations/test_annot_throws_exception.pkb" : [ 254 ], "test/ut3_tester/core/annotations/test_annotation_cache.pkb" : [ 8 ], "test/ut3_tester/core/annotations/test_annotation_manager.pkb" : [ 199, 209, 235 ], "test/ut3_tester/core/annotations/test_before_after_annotations.pkb" : [ 203, 218, 229, 242, 254, 267, 275, 294 ], "test/ut3_tester/core/test_output_buffer.pkb" : [ 53 ], "test/ut3_tester/core/test_suite_manager.pkb" : [ 1214, 1220, 1257, 1728, 1734, 1747 ], "test/ut3_tester/core/test_ut_test.pkb" : [ 305, 717 ], "test/ut3_tester_helper/main_helper.pkb" : [ 34 ], "test/ut3_tester_helper/run_helper.pkb" : [ 716, 723, 736, 744, 752, 778, 786, 794, 875, 896, 910 ], "test/ut3_user/api/test_ut_run.pkb" : [ 401, 416, 426, 470, 532, 558, 584, 630, 689, 754, 836, 856, 861, 876, 887, 889, 1085, 1431 ], "test/ut3_user/api/test_ut_runner.pkb" : [ 145, 151, 186, 288, 320, 342, 374, 399, 508, 521, 534, 547, 560, 574, 593 ], "test/ut3_user/expectations/test_expectations_cursor.pkb" : [ 113, 114, 157, 169, 181, 193, 205, 227, 239, 252, 1014, 2849, 2932 ], "test/ut3_user/expectations/unary/test_expect_to_be_empty.pkb" : [ 11, 22, 35, 52, 63 ], "test/ut3_user/expectations/unary/test_expect_to_have_count.pkb" : [ 12, 23, 36, 51, 62 ], "test/ut3_user/reporters.pkb" : [ 168, 183 ], "test/ut3_user/reporters/test_coverage/test_coverage_standalone.pkb" : [ 53 ], "test/ut3_user/reporters/test_debug_reporter.pkb" : [ 8 ], "test/ut3_user/reporters/test_documentation_reporter.pkb" : [ 47 ], "test/ut3_user/reporters/test_junit_reporter.pkb" : [ 84, 100, 114, 128, 147, 162, 189, 211, 274, 303 ], "test/ut3_user/reporters/test_sonar_test_reporter.pkb" : [ 18 ], "test/ut3_user/reporters/test_teamcity_reporter.pkb" : [ 102, 120, 138, 158, 180 ], "test/ut3_user/reporters/test_tfs_junit_reporter.pkb" : [ 137, 151, 165, 178, 203, 223, 248, 270, 292 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/ToDateWithoutFormatCheck.json ================================================ { "examples/RunWithDocumentationReporter.sql" : [ 45 ], "test/ut3_user/expectations/test_expectations_cursor.pkb" : [ 442 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/UnhandledUserDefinedExceptionCheck.json ================================================ { "examples/award_bonus/award_bonus.sql" : [ 13 ], "source/api/ut.pkb" : [ 117 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/UnnecessaryAliasInQueryCheck.json ================================================ { "source/check_sys_grants.sql" : [ 29, 30, 34 ], "source/core/annotations/ut_annotation_cache_manager.pkb" : [ 24, 37, 51, 73, 76, 84, 131, 144, 156, 167, 192, 193 ], "source/core/coverage/ut_coverage_helper.pkb" : [ 67, 78 ], "source/core/coverage/ut_coverage_helper_profiler.pkb" : [ 65, 66, 69 ], "source/core/output_buffers/ut_output_buffer_base.tpb" : [ 61, 150 ], "source/core/output_buffers/ut_output_bulk_buffer.tpb" : [ 107, 127 ], "source/core/output_buffers/ut_output_clob_table_buffer.tpb" : [ 82, 89 ], "source/core/ut_metadata.pkb" : [ 162 ], "source/core/ut_suite_cache_manager.pkb" : [ 31, 42, 43, 52, 54, 65, 79, 138, 138, 148, 148, 157, 157, 165, 207, 248, 253, 259, 293, 311, 315, 323, 329, 339, 350, 378, 404, 418, 422, 459, 476, 485, 493 ], "source/core/ut_suite_manager.pkb" : [ 318, 615, 618 ], "source/core/ut_utils.pkb" : [ 356, 770 ], "source/expectations/data_values/ut_compound_data_helper.pkb" : [ 768 ], "source/expectations/data_values/ut_cursor_details.tpb" : [ 190, 203 ], "source/uninstall_synonyms.sql" : [ 13, 15, 42 ], "test/install_ut3_tester_helper.sql" : [ 66 ], "test/install_ut3_user_tests.sql" : [ 128 ], "test/ut3_tester/core/test_ut_utils.pkb" : [ 10 ], "test/ut3_user/expectations/test_expectations_cursor.pkb" : [ 455, 456, 469, 470, 482, 483, 495, 496, 511, 512, 550, 551, 564, 565, 578, 579, 606, 607, 1042, 1267, 1268, 1290, 1291, 1315, 1316, 1338, 1339, 1361, 1362, 1383, 1384, 1508, 1509, 1522, 1523, 1536, 1537, 1550, 1551, 1564, 1565, 1578, 1579, 1592, 1593, 2265, 2266, 2279, 2280, 2293, 2294, 2307, 2308, 2443, 2444, 2456, 2457, 2469, 2470, 2482, 2483, 2495, 2497, 2498, 2513, 2514, 2515 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/UnnecessaryElseCheck.json ================================================ { "examples/award_bonus/award_bonus.sql" : [ 14 ], "source/core/output_buffers/ut_output_buffer_base.tpb" : [ 77, 95 ], "source/core/ut_suite_manager.pkb" : [ 31 ], "source/core/ut_utils.pkb" : [ 346 ], "source/expectations/data_values/ut_data_value_anydata.tpb" : [ 137 ], "source/expectations/data_values/ut_data_value_refcursor.tpb" : [ 196 ], "source/reporters/ut_ansiconsole_helper.pkb" : [ 34 ], "test/install_ut3_tester_helper.sql" : [ 62 ], "test/install_ut3_tester_tests.sql" : [ 72 ], "test/install_ut3_user_tests.sql" : [ 124 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/UnnecessaryLikeCheck.json ================================================ { "development/utplsql_style_check.sql" : [ 41, 58 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/UnnecessaryNullStatementCheck.json ================================================ { "source/expectations/json_objects_specs.sql" : [ 2 ], "source/uninstall_objects.sql" : [ 257 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/UnusedParameterCheck.json ================================================ { "source/core/output_buffers/ut_output_buffer_base.tpb" : [ 38 ], "source/core/session_context/ut_session_info.tpb" : [ 35, 83, 100, 107 ], "source/core/types/ut_reporter_base.tpb" : [ 42, 48, 53, 57, 62, 66, 72, 77, 81, 86, 90, 95, 99, 104, 110, 114, 119, 123, 128, 134 ], "source/core/ut_suite_manager.pkb" : [ 518 ], "source/expectations/data_values/ut_data_value.tpb" : [ 33, 33 ], "source/expectations/data_values/ut_data_value_json.tpb" : [ 138 ], "source/expectations/data_values/ut_json_tree_details.tpb" : [ 186 ], "source/reporters/ut_tfs_junit_reporter.tpb" : [ 156 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/UnusedVariableCheck.json ================================================ { "source/core/types/ut_logical_suite.tpb" : [ 40, 41 ], "source/expectations/data_values/ut_data_value_refcursor.tpb" : [ 32 ], "source/expectations/matchers/ut_be_empty.tpb" : [ 31 ], "source/expectations/matchers/ut_contain.tpb" : [ 68 ], "source/expectations/matchers/ut_equal.tpb" : [ 39, 325 ], "source/reporters/ut_coverage_cobertura_reporter.tpb" : [ 29, 86, 92 ], "source/reporters/ut_coverage_report_html_helper.pkb" : [ 27 ], "source/reporters/ut_tfs_junit_reporter.tpb" : [ 97 ], "test/ut3_tester/core/annotations/test_annotation_cache.pkb" : [ 19, 32, 45, 60, 78, 99, 112, 128, 145 ], "test/ut3_tester/core/annotations/test_annotation_manager.pkb" : [ 100, 118, 217, 218 ], "test/ut3_tester/core/expectations/test_expectation_processor.pkb" : [ 7, 45, 72 ], "test/ut3_tester/core/test_output_buffer.pkb" : [ 46, 62, 63 ], "test/ut3_tester/core/test_suite_manager.pkb" : [ 730, 822, 852, 1840, 2193 ], "test/ut3_tester/core/test_ut_test.pkb" : [ 10 ], "test/ut3_tester/core/test_ut_utils.pkb" : [ 220 ], "test/ut3_tester_helper/run_helper.pkb" : [ 184 ], "test/ut3_user/api/test_ut_run.pkb" : [ 582, 1000 ], "test/ut3_user/api/test_ut_runner.pkb" : [ 418 ], "test/ut3_user/expectations/test_expectation_anydata.pkb" : [ 220, 221, 367, 368, 693, 813, 832, 833, 1193, 1194 ], "test/ut3_user/expectations/test_expectations_cursor.pkb" : [ 761, 762, 1129, 1130, 1727, 1728, 1794, 1795, 1901, 1902 ], "test/ut3_user/expectations/test_expectations_json.pkb" : [ 10, 232, 233, 268, 269, 301, 302, 1720, 1721, 1756, 1757 ], "test/ut3_user/reporters/test_coverage/test_extended_coverage.pkb" : [ 302 ], "test/ut3_user/reporters/test_coverage/test_html_coverage_reporter.pkb" : [ 80 ], "test/ut3_user/reporters/test_junit_reporter.pkb" : [ 282, 283 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/VariableHidingCheck.json ================================================ { "source/core/types/ut_executable.tpb" : [ 89 ], "source/expectations/data_values/ut_data_value_refcursor.tpb" : [ 174, 320 ], "test/ut3_user/reporters/test_realtime_reporter.pkb" : [ 487 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/VariableInitializationWithFunctionCallCheck.json ================================================ { "examples/custom_reporters/ut_expectations_reporter.tpb" : [ 87 ], "examples/developer_examples/RunExampleTestSuiteWithCompositeReporter.sql" : [ 16, 17 ], "source/api/ut_runner.pkb" : [ 244 ], "source/check_object_grants.sql" : [ 13 ], "source/core/annotations/ut_annotation_manager.pkb" : [ 30, 62, 104, 259 ], "source/core/output_buffers/ut_output_buffer_base.tpb" : [ 145 ], "source/core/output_buffers/ut_output_bulk_buffer.tpb" : [ 91 ], "source/core/output_buffers/ut_output_clob_table_buffer.tpb" : [ 56 ], "source/core/output_buffers/ut_output_table_buffer.tpb" : [ 95 ], "source/core/types/ut_stack.tpb" : [ 51 ], "source/core/ut_file_mapper.pkb" : [ 75, 76, 77, 78, 79 ], "source/core/ut_metadata.pkb" : [ 58, 73, 104, 158 ], "source/core/ut_suite_builder.pkb" : [ 356, 609 ], "source/core/ut_suite_cache_manager.pkb" : [ 306, 307 ], "source/core/ut_suite_manager.pkb" : [ 56, 431, 605, 606, 607 ], "source/core/ut_suite_tag_filter.pkb" : [ 55, 229 ], "source/core/ut_utils.pkb" : [ 25, 95, 115, 137, 207, 248, 293, 307, 321, 672 ], "source/core/ut_utils.pks" : [ 132 ], "source/expectations/data_values/ut_compound_data_helper.pkb" : [ 132, 157, 417, 418, 419, 746 ], "source/expectations/data_values/ut_cursor_details.tpb" : [ 252 ], "source/expectations/data_values/ut_data_value_json.tpb" : [ 36 ], "source/reporters/ut_coverage_report_html_helper.pkb" : [ 234 ], "source/reporters/ut_debug_reporter.tpb" : [ 33, 36 ], "source/reporters/ut_documentation_reporter.tpb" : [ 113 ], "test/ut3_tester/core/expectations/test_expectation_processor.pkb" : [ 3 ], "test/ut3_tester/core/test_output_buffer.pkb" : [ 80 ], "test/ut3_tester/core/test_suite_manager.pkb" : [ 459 ], "test/ut3_tester/core/test_ut_utils.pkb" : [ 5, 147, 219, 289, 438, 445, 452, 459, 466, 473, 480, 487 ], "test/ut3_tester_helper/coverage_helper.pkb" : [ 393, 449, 489 ], "test/ut3_user/api/test_ut_run.pkb" : [ 3 ], "test/ut3_user/expectations/test_expectations_cursor.pkb" : [ 3, 4, 6, 12 ], "test/ut3_user/reporters/test_coverage/test_coverage_standalone.pkb" : [ 42, 72 ], "test/ut3_user/reporters/test_realtime_reporter.pkb" : [ 511 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/expected/utPLSQL3/VariableInitializationWithNullCheck.json ================================================ { "source/core/coverage/ut_coverage.pks" : [ 41, 42, 43, 56, 57, 58, 59 ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/README.md ================================================ This folder contains the PL/SQL code extracted from the Oracle Forms modulesavailable at https://github.com/Doag/Forms, under the MIT license. The exact commit from the original repository can be verified in the its/sources/Doag-Forms folder. ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/ABOUT/ABOUT__ABOUT_BUTTON__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin show_webutil_information; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/BROWSER/BROWSER__APPLET_PARAMS__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin get_applet_parameters; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/BROWSER/BROWSER__BROWSER_MESSAGE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin set_browser_message (:browser_mess_text); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/BROWSER/BROWSER__SEPARATE_FRAME__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin separate_frame_options; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/BUILTINS/BUILTINS__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin get_client_filename; If :builtins.file_name IS NOT NULL Then Go_Item('builtins.read_image'); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/BUILTINS/BUILTINS__GET_TOOL_ENV__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin client_getenv; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/BUILTINS/BUILTINS__READ_IMAGE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin If :builtins.file_name IS NULL then message ('Please enter image filename.'); GO_ITEM('builtins.filename'); SYNCHRONIZE; RAISE FORM_TRIGGER_FAILURE; End if; client_readimage; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/BUILTINS/BUILTINS__TEXT_IO_BUTTON__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin client_textio; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CLIENTINFO/CLIENTINFO__ACTION__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin get_clientinfo; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CLIENT_GETENV.pcd ================================================ PROCEDURE client_getenv IS BEGIN client_tool_env.getvar('NLS_LANG',:builtins.tool_env); SYNCHRONIZE; If :builtins.tool_env IS NULL Then :builtins.tool_env := 'NLS_LANG is not set.'; End if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CLIENT_READIMAGE.pcd ================================================ PROCEDURE client_readimage IS BEGIN client_image.read_image_file(:builtins.file_name, 'GIF', 'builtins.image'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CLIENT_TEXTIO.pcd ================================================ PROCEDURE client_textio IS l_out_file client_Text_IO.File_Type; BEGIN l_out_file := client_Text_IO.Fopen(:global.user_home ||'\helloworld.txt', 'w'); client_text_io.put_line(l_out_file, 'At '||TO_CHAR(SYSDATE,'HH24:MI')||' ' ||webutil_clientinfo.get_user_name||' wrote:'); client_text_io.put_line(l_out_file, :builtins.text_io_item); client_text_io.fclose (l_out_file); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__ACKNOWLEDGE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN show_window ('window1'); hide_window('w_hello'); go_block('clientinfo'); SYNCHRONIZE; clear_message; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT10__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT1__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT2__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT3__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT4__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT5__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT6__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT7__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT8__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/CTL/CTL__EXIT9__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/C_API/C_API__CALL_C_API__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- IMPORTANT -- Be sure to review the following My Oracle Support Note -- Doc ID: 285331.1 - "Exception When Calling PASCAL style Function Via WebUTIL_C_API" declare StringBuffer varchar2(255) := 'Text to overwrite'; StringLength pls_integer := length(StringBuffer); rc pls_integer; f_handle WEBUTIL_C_API.FUNCTIONHANDLE; args Webutil_c_api.parameterlist; param1 Webutil_c_api.ParameterHandle; param2 Webutil_c_api.ParameterHandle; begin f_handle := WEBUTIL_C_API.register_function('ffisamp.dll','PopulateString'); args := WEBUTIL_C_API.create_parameter_list; param1 := WEBUTIL_C_API.add_parameter(args,WEBUTIL_C_API.C_CHAR_PTR ,WEBUTIL_C_API.PARAM_INOUT ,StringBuffer, 255); param2 := WEBUTIL_C_API.add_parameter(args,WEBUTIL_C_API.C_INT_PTR ,WEBUTIL_C_API.PARAM_INOUT ,StringLength); rc := WEBUTIL_C_API.Invoke_Int( 'ffisamp.dll','PopulateString',args); message('The New value for String is: '||WEBUTIL_C_API.Get_Parameter_String(args,param1)); message('New Length '||to_char(WEBUTIL_C_API.Get_Parameter_Number(args,param2))); message('RC was '||to_char(RC)); WEBUTIL_C_API.Destroy_Parameter_List(args); WEBUTIL_C_API.Deregister_Function(f_handle); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/C_API/C_API__LOCKSTATION__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- IMPORTANT -- Be sure to review the following My Oracle Support Note -- Doc ID: 285331.1 - "Exception When Calling PASCAL style Function Via WebUTIL_C_API" declare rc pls_integer; f_handle WEBUTIL_C_API.FUNCTIONHANDLE; args Webutil_c_api.parameterlist; winSysDir varchar2(255) := Client_Win_API_ENVIRONMENT.Get_Windows_Directory || '\system32\'; --- IMPORTANT --- ----------------- -- -- WEBUTIL_C_API CURRENTLY ONLY SUPPORTS CALLING C STYLE LIBRARIES, THEREFORE SOME WINDOWS LIBRARIES CANNOT BE CALLED. -- ADDITIONALLY, IT IS NOT RECOMMENDED THAT YOU ATTEMPT TO CALL WINDOWS FUNCTIONS WHICH REQUIRE ARGS. -- -- USE EXTREME CAUTION WHEN CALLING WINDOWS APIS. -- BE SURE TO THOROUGHLY TEST BEFORE MOVING TO PRODUCTION -- LOOK CLOSELY AT BOTH STABILITY AND MEMORY USAGE AS SOME CALLS -- MAY RESULT IN THE APPEARANCE OF A MEMORY LEAK. ------------------------------------------------------------------------------------------ -- This call to USER32.DLL will reference the LOCKWORKSTATION function. -- If the current OS user does not have a password configured, the workstation may not lock. ------------------------------------------------------------------------------------------ -- The Windows LockWorkStation function requires no args to be passed in. -- WebUtil expects something to be passed in. So an empty paramlist will be created. begin If webutil_clientinfo.get_operating_system LIKE 'Win%' Then f_handle := WEBUTIL_C_API.register_function(winSysDir||'user32.dll','LockWorkStation'); args := WEBUTIL_C_API.create_parameter_list; /* If the function succeeds, the return value is nonzero. Because the function executes asynchronously, a nonzero return value indicates that the operation has been initiated. It does not indicate whether the workstation has been successfully locked. If the function fails, the return value is zero. http://msdn.microsoft.com/en-us/library/aa376875(v=VS.85).aspx */ rc := WEBUTIL_C_API.Invoke_Int(winSysDir||'user32.dll','LockWorkStation',args); End if; WEBUTIL_C_API.Destroy_Parameter_List(args); WEBUTIL_C_API.Deregister_Function(f_handle); SYNCHRONIZE; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/DOWNLOAD/DOWNLOAD__DOWNLOAD_AS__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin download_as; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/DOWNLOAD/DOWNLOAD__DOWNLOAD_DB__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin download_db; exception when others then message('File download failed: '||sqlerrm); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/DOWNLOAD/DOWNLOAD__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare l_filename varchar2(200); begin l_filename := webutil_file.file_save_dialog (directory_name => :global.user_home ,file_name => '1MByte.pdf' ,file_filter => null ,title => 'Select client side filename where App Server file will be saved' ); :download.file_name := l_filename; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/DOWNLOAD_AS.pcd ================================================ PROCEDURE DOWNLOAD_AS IS l_success boolean; l_bare_filename varchar2(50); l_value_start number; l_value_stop number; l_result number; l_bandwidth number; BEGIN -- THIS CODE ASSUMES THAT CLIENT IS WINDOWS BASED -- CHANGE THE serverFile PATH FROM C:\TEMP TO THE LOCATION SET IN WEBUTIL.CFG -- l_bare_filename := substr(:upload.file_name,instr(:upload.file_name,'\',-1)+1); clear_message; l_value_start := f_get_timer_value; l_success := webutil_file_transfer.AS_to_Client_with_progress (clientFile => :download.file_name ,serverFile => 'C:\temp\1MB.pdf' ,progressTitle => 'Download 1 MB from Application Server in progress' ,progressSubTitle => 'Please wait' ); l_value_stop := f_get_timer_value; l_result := (l_value_stop-l_value_start) /1000; l_bandwidth := 8 / l_result; Message('Bandbreite = ' || to_char(round(l_bandwidth,2)) || 'Mbit/s Messung ' || to_char(round(l_result,2)) || ' Sekunden'); if l_success then message('File downloaded successfully from the Application Server'); else message('File download from Application Server failed'); end if; exception when others then message('File download failed: '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/DOWNLOAD_DB.pcd ================================================ PROCEDURE DOWNLOAD_DB IS l_success boolean; BEGIN l_success := webutil_file_transfer.DB_To_Client_with_progress (clientFile => :download.file_name ,tableName => 'wu_fileupdown_demo' ,columnName => 'BLOB' ,whereClause => 'ID = 1' ,progressTitle => 'Download from Database in progress' ,progressSubTitle=> 'Please wait' ); if l_success then message('File downloaded successfully from the Database'); else message('File download from Database failed'); end if; exception when others then message('File download failed: '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/FILES/FILES__COPY_FILE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('COPY_FILE'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/FILES/FILES__DELETE_FILE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('DELETE_FILE'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/FILES/FILES__FILE_INFO__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('FILE_INFO'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/FILES/FILES__FILE_OPEN__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('FILE_OPEN'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/FILES/FILES__FILE_SAVE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('FILE_SAVE'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/FILES/FILES__LIST_DIRS__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('LIST_DIRS'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/FILES/FILES__LIST_FILES__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('LIST_FILES'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/FILES_WBP.pcd ================================================ PROCEDURE FILES_WBP (P_ACTION IN VARCHAR2) IS l_file_list webutil_file.file_list; l_temp_text varchar2(8000); l_filename varchar2(80) := :global.user_home ||'\helloworld.txt'; l_copy_name varchar2(80) := :global.user_home ||'\copy of helloworld.txt'; l_success boolean; BEGIN l_file_list.delete; if p_action = 'LIST_DIRS' then l_file_list := webutil_file.directory_root_list; elsif p_action = 'LIST_FILES' then l_file_list := webutil_file.directory_list(:global.user_home,true); elsif p_action = 'FILE_INFO' then l_file_list(1) := 'Exists: '||webutil_util.booltostr(webutil_file.file_exists(l_filename)); l_file_list(2) := 'Readable: '||webutil_util.booltostr(webutil_file.file_is_readable(l_filename)); l_file_list(3) := 'Writeable: '||webutil_util.booltostr(webutil_file.file_is_writable(l_filename)); l_file_list(4) := 'Hidden: '||webutil_util.booltostr(webutil_file.file_is_hidden(l_filename)); l_file_list(5) := 'Directory: '||webutil_util.booltostr(webutil_file.file_is_directory(l_filename)); l_file_list(6) := 'Size: '||to_char(webutil_file.file_size(l_filename))||' bytes'; elsif p_action = 'COPY_FILE' then l_success := webutil_file.copy_file(l_filename,l_copy_name); if l_success then message('Copy of file successfull'); else message('Copy failed'); end if; l_file_list := webutil_file.directory_list(:global.user_home,true); elsif p_action = 'DELETE_FILE' then l_success := webutil_file.delete_file(l_copy_name); if l_success then message('Delete of file successfull'); else message('Delete failed'); end if; l_file_list := webutil_file.directory_list(:global.user_home,true); elsif p_action = 'FILE_OPEN' then l_filename := webutil_file.file_open_dialog; l_file_list(1) := 'Selected file: '||l_filename; elsif p_action = 'FILE_SAVE' then l_copy_name := webutil_file.file_save_dialog; --l_success := webutil_file.copy_file(l_filename,l_copy_name); l_file_list(1) := 'File Saved as: '||l_copy_name; else message('Invalid Event passed to FILES_WBP'); end if; -- write file list to text box l_temp_text := ''; for i in 1 .. l_file_list.count loop l_temp_text := l_temp_text || l_file_list(i) || chr(10); end loop; :files.result_box := l_temp_text; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/F_GET_TIMER_VALUE.fun ================================================ -- Get the time in ms from 23.10.2015 until this moment FUNCTION f_get_timer_value RETURN number IS out_result number; begin select extract(day from(systimestamp - to_timestamp('2015-10-23', 'YYYY-MM-DD'))) * 86400000 + to_number(to_char(sys_extract_utc(systimestamp), 'SSSSSFF3')) into out_result from dual; return out_result; end f_get_timer_value; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/GET_APPLET_PARAMETERS.pcd ================================================ PROCEDURE get_applet_parameters IS BEGIN :applet_param_box := ' = '||webutil_browser.getappletparameter('lookAndFeel'); :applet_param_box := :applet_param_box || chr(10)|| ' = '||webutil_browser.getappletparameter('colorScheme'); :applet_param_box := :applet_param_box || chr(10)|| ' = '||webutil_browser.getappletparameter('separateFrame'); :applet_param_box := :applet_param_box || chr(10)|| 'Applet width and height = '||webutil_browser.getappletsize(); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/GET_CLIENTINFO.pcd ================================================ PROCEDURE GET_CLIENTINFO IS BEGIN :CLIENTINFO.USER_NAME := webutil_clientinfo.get_user_name; :CLIENTINFO.IP_ADDRESS := webutil_clientinfo.get_ip_address; :CLIENTINFO.HOST_NAME := webutil_clientinfo.get_host_name; :CLIENTINFO.OPERATING_SYSTEM := webutil_clientinfo.get_operating_system; :CLIENTINFO.JAVA_VERSION := webutil_clientinfo.get_java_version; :CLIENTINFO.PATH_SEPERATOR := webutil_clientinfo.get_path_separator; :CLIENTINFO.FILE_SEPERATOR := webutil_clientinfo.get_file_separator; :CLIENTINFO.LANGUAGE := webutil_clientinfo.get_language; :CLIENTINFO.TIME_ZONE := webutil_clientinfo.get_time_zone; :CLIENTINFO.DATE_TIME := webutil_clientinfo.get_date_time; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/GET_CLIENT_FILENAME.pcd ================================================ PROCEDURE get_client_filename IS l_filename varchar2(200); BEGIN l_filename := client_get_file_name(directory_name => :global.user_home ,file_name => null ,file_filter => 'GIF Files (*.gif)|*.gif|All Files (*.*)|*.*' ,message => null ,dialog_type => null ,select_file => null ); :builtins.file_name := l_filename; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/HOST/HOST__HOST_CALLBACK.tgg ================================================ BEGIN MESSAGE ('Host command called back into Forms'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/HOST/HOST__RUN_HOST__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN DECLARE fname VARCHAR2(255) := null; pid WEBUTIL_HOST.PROCESS_ID; BEGIN IF :HOST_ASK_FILENAME = 'true' THEN fname := CLIENT_GET_FILE_NAME(null,null,null,null,OPEN_FILE,TRUE); END IF; IF :BLOCKING_RADIO = 'BLOCKING' THEN CLIENT_HOST('CMD /C NOTEPAD '||fname); ELSIF :BLOCKING_RADIO = 'NON_BLOCKING' THEN WEBUTIL_HOST.NONBLOCKING('CMD /C NOTEPAD '||fname); ELSIF :BLOCKING_RADIO = 'NON_BLOCKING_CALLBACK' THEN pid := WEBUTIL_HOST.NONBLOCKING_WITH_CALLBACK('CMD /C NOTEPAD '||fname,'HOST_CALLBACK'); END IF; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/SEPARATE_FRAME_OPTIONS.pcd ================================================ PROCEDURE separate_frame_options IS BEGIN if WebUtil_SeparateFrame.IsSeparateFrame then WebUtil_SeparateFrame.SetTitle('WebUtil Demo Form'); end if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/SET_BROWSER_MESSAGE.pcd ================================================ PROCEDURE set_browser_message ( my_message varchar2) IS BEGIN If my_message IS NULL then WebUtil_Browser.BrowserMessage('Welcome ' ||webutil_clientinfo.get_user_name ||', your computer is called '||webutil_clientinfo.get_host_name ||', with IP address ' ||webutil_clientinfo.get_ip_address ||', running ' ||webutil_clientinfo.get_operating_system ); Else WebUtil_Browser.BrowserMessage (my_message); End if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/UPLOAD/UPLOAD__CREATE_TABLE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN /* THE FOLLOWING IS THE SQL FOUND IN "wu_fileupload_db_demo.sql". IF THE TRIGGER BELOW EXECUTES SUCCESSFULLY, THE SAME TABLE WILL BE CREATED AS SEEN IN THE SCRIPT THERE IS NO NEED TO RUN THE SCRIPT IF THIS TRIGGER HAS BEEN EXECUTED SUCCESSFULLY drop table wu_fileupdown_demo; create table wu_fileupdown_demo (blob blob, id number(2)); insert into wu_fileupdown_demo values (NULL,1); commit; */ BEGIN Forms_DDL('drop table wu_fileupdown_demo'); Forms_DDL('create table wu_fileupdown_demo (blob blob, id number(2))'); IF NOT Form_Success THEN -- Failure will most likely occur if the current user does not have permission to create tables Message ('Table Creation Failed'); ELSE Forms_DDL('insert into wu_fileupdown_demo values (NULL,1)'); Message ('Table "wu_fileupdown_demo" created.'); Message ('Table "wu_fileupdown_demo" created.'); -- Since the table was created successfully, we can now enable the appropriate buttons -- Also, we will remove the Create button since it is no longer needed SET_ITEM_PROPERTY ('upload.upload_db',enabled, property_true); SET_ITEM_PROPERTY ('download.download_db',enabled, property_true); GO_ITEM('upload.file_name'); SYNCHRONIZE; SET_ITEM_PROPERTY ('upload.create_table',enabled, property_false); SET_ITEM_PROPERTY ('upload.create_table',visible, property_false); END IF; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/UPLOAD/UPLOAD__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare l_filename varchar2(200); begin l_filename := client_get_file_name(directory_name => :global.user_home ,file_name => null ,file_filter => null ,message => null ,dialog_type => null ,select_file => null ); :upload.file_name := l_filename; SYNCHRONIZE; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/UPLOAD/UPLOAD__UPLOAD_AS__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin upload_as; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/UPLOAD/UPLOAD__UPLOAD_DB__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin upload_db; exception when others then message('File upload failed: '||sqlerrm); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/UPLOAD_AS.pcd ================================================ PROCEDURE UPLOAD_AS IS l_success boolean; l_bare_filename varchar2(50); BEGIN -- THIS CODE ASSUMES THAT CLIENT IS WINDOWS BASED -- CHANGE THE serverFile PATH FROM C:\TEMP TO THE LOCATION SET IN WEBUTIL.CFG l_bare_filename := substr(:upload.file_name,instr(:upload.file_name,'\',-1)+1); l_success := webutil_file_transfer.Client_To_AS_with_progress (clientFile => :upload.file_name ,serverFile => 'c:\kassandra\temp\'||l_bare_filename ,progressTitle => 'Upload to Application Server in progress' ,progressSubTitle => 'Please wait' ,asynchronous => false ,callbackTrigger => null ); if l_success then message('File uploaded successfully to the Application Server'); -- Added to make demo more user friendly. -- If file is successfully uploaded, move to "Download" tab. go_item('download.file_name'); else message('File upload to Application Server failed'); end if; exception when others then message('File upload failed: '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/UPLOAD_DB.pcd ================================================ PROCEDURE UPLOAD_DB IS l_success boolean; BEGIN l_success := webutil_file_transfer.Client_To_DB_with_progress (clientFile => :upload.file_name ,tableName => 'wu_fileupdown_demo' ,columnName => 'BLOB' ,whereClause => 'ID = 1' ,progressTitle => 'Upload to Database in progress' ,progressSubTitle=> 'Please wait' ,asynchronous => false ,callbackTrigger => null ); if l_success then -- -- Force commit to save file in db. -- This is not in the original Demo -- which causes the Demo to fail if -- you exit and return later to download. :System.Message_Level := '15'; commit; :System.Message_Level := '0'; message('File uploaded successfully into the Database'); -- Added to make demo more user friendly. -- If file is successfully uploaded, move to "Download" tab. go_item('download.file_name'); else message('File upload to Database failed'); end if; exception when others then message('File upload failed: '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN if :system.cursor_block = 'WEBUTIL' then next_block; end if; WebUtil_Core.ShowBeans(false); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL_DEMO/PRE-FORM.tgg ================================================ BEGIN DECLARE /* DOK:================================================================================================================ * - Login mit oder ohne Parameterübergabe, Fehlerbehandlung durch Fehler aus POST-LOGON Trigger * Autor : F.HOFFMANN * Erstellungsdatum: 12.2.2015 * Änd-Nr. Datum Name Beschreibung * --------------------------------------------------------------------------------------------------------------------- * 1 12.02.2015 HOFFMANNF Anzeige des letzten Logins integriert * 2 05.03.2015 HOFFMANNF Fehlerbehandlunga aus POST-LOGON Trigger * 3 25.03.2015 HOFFMANNF OT-25148/profi Browserversion einlesen * 4 16.04.2015 HOFFMANNF OT-25148/profi Browserschutz nur bei Profi-Anwendung, "Default" Wert ist "nicht geschützt" * 5 08.09.2015 HOFFMANNF OT-64520/profi Browserschutz nur nach erfolgreicher Anmeldung */ BEGIN -- Anmeldung über vorgeschaltete Maske, Password wird als Parameter übergeben if :parameter.p_password is not null then LOGON (:parameter.p_username, :parameter.p_password||'@' || :parameter.p_db,FALSE); IF Form_Failure THEN message('Internal Error - Connect did not work'); raise form_trigger_failure; else -- #1 Anzeige letztes Login --:id_letztes_login := :parameter.p_login_text; :parameter.P_START := f_get_timer_value; :parameter.p_password := null; --webutil_startup_timer; --:parameter.p_browser := WEB.JAVASCRIPT_EVAL_FUNCTION('document.getElementById("browserversion").value'); -- #004 --web.javascript_eval_expr('document.getElementById("closeprofi").value="profi_protect_browser"'); end if; else -- Anmeldung direkt - es wird nur ein Timer gestartet --webutil_startup_timer; null; end if; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL_DEMO/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN declare fake_timer TIMER; istable varchar2(2); begin -- -- Purpose of the fake timer is the we cannot call webutil in this trigger since the -- beans have not yet been instantiated. If we put the code in a when-timer-expired-trigger -- it means that this timer will not start running until Forms has focus (and so the webutil -- beans will be instantiated and so call canbe made. -- fake_timer:= CREATE_TIMER('webutil',150,NO_REPEAT); show_window ('w_hello'); hide_window ('window1'); -- Test to see if WebUtil Demo table exists (wu_test_table) -- This is used on the File Upload tab SELECT DECODE(count(*),0,'F','T') INTO istable FROM user_tables WHERE table_name = upper('wu_fileupdown_demo'); If istable = 'F' Then SET_ITEM_PROPERTY ('upload.upload_db',enabled, property_false); SET_ITEM_PROPERTY ('download.download_db',enabled, property_false); SET_ITEM_PROPERTY ('upload.create_table',visible, property_true); SET_ITEM_PROPERTY ('upload.create_table',enabled, property_true); end if; --:parameter.p_stop := f_get_timer_value; --message('latency := ' || to_char(round(26901/(:parameter.p_stop-:parameter.p_start),2)) || ' ms'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL_DEMO/WHEN-TAB-PAGE-CHANGED.tgg ================================================ BEGIN begin if not WebUtil_SeparateFrame.IsSeparateFrame then set_item_property('browser.separate_frame',enabled,property_false); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/WEBUTIL_DEMO/WHEN-TIMER-EXPIRED.tgg ================================================ BEGIN :global.user_home := webutil_clientinfo.get_system_property('user.home'); --:OLE.FILENAME := :global.user_home||'\temp.doc'; SET_ITEM_PROPERTY('builtins.text_io_item',PROMPT_TEXT,'Write to '||:global.user_home||'\helloworld.txt'); SET_ITEM_PROPERTY('files.userdothome',PROMPT_TEXT,:global.user_home); SET_APPLICATION_PROPERTY(CLIENT_IDLE_TIME,600); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0001/WEBUTIL_DEMO/metadata.json ================================================ { "alerts": [ "EXIT_ALERT", "WEBUTIL_ERROR" ], "blocks": [ { "name": "CLIENTINFO", "items": [ "ACTION", "DATE_TIME", "TIME_ZONE", "LANGUAGE", "FILE_SEPERATOR", "PATH_SEPERATOR", "JAVA_VERSION", "OPERATING_SYSTEM", "IP_ADDRESS", "USER_NAME", "HOST_NAME" ] }, { "name": "BUILTINS", "items": [ "IMAGE", "FILE_NAME", "GET_FILE_NAME", "READ_IMAGE", "GET_TOOL_ENV", "TOOL_ENV", "TEXT_IO_BUTTON", "TEXT_IO_ITEM" ] }, { "name": "FILES", "items": [ "LIST_DIRS", "LIST_FILES", "FILE_INFO", "COPY_FILE", "DELETE_FILE", "FILE_OPEN", "FILE_SAVE", "RESULT_BOX", "USERDOTHOME" ] }, { "name": "UPLOAD", "items": [ "FILE_NAME", "GET_FILE_NAME", "UPLOAD_DB", "UPLOAD_AS", "CREATE_TABLE" ] }, { "name": "DOWNLOAD", "items": [ "FILE_NAME", "GET_FILE_NAME", "DOWNLOAD_DB", "DOWNLOAD_AS" ] }, { "name": "BROWSER", "items": [ "BROWSER_MESS_TEXT", "BROWSER_MESSAGE", "SEPARATE_FRAME", "APPLET_PARAMS", "APPLET_PARAM_BOX" ] }, { "name": "HOST", "items": [ "RUN_HOST", "HOST_ASK_FILENAME", "BLOCKING_RADIO" ] }, { "name": "C_API", "items": [ "CALL_C_API", "LOCKSTATION" ] }, { "name": "ABOUT", "items": [ "ABOUT_BUTTON" ] }, { "name": "CTL", "items": [ "ACKNOWLEDGE", "TERMSOFUSE", "EXIT1", "EXIT2", "EXIT3", "EXIT4", "EXIT5", "EXIT6", "EXIT7", "EXIT8", "EXIT9", "EXIT10" ] }, { "name": "WEBUTIL", "items": [ "DUMMY", "WEBUTIL_CLIENTINFO_FUNCTIONS", "WEBUTIL_FILE_FUNCTIONS", "WEBUTIL_HOST_FUNCTIONS", "WEBUTIL_SESSION_FUNCTIONS", "WEBUTIL_FILETRANSFER_FUNCTIONS", "WEBUTIL_C_API_FUNCTIONS", "WEBUTIL_BROWSER_FUNCTIONS" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/BL_EMPLOYEES.pkb ================================================ PACKAGE BODY BL_Employees IS PROCEDURE PRQ IS BEGIN :Employees.Employee_ID := :Filter.TI_Employee_ID; :Employees.First_Name := '%' || :Filter.TI_First_Name || '%'; :Employees.Last_Name := '%' || :Filter.TI_Last_Name || '%'; :Employees.Email := '%' || :Filter.TI_Email || '%'; END; PROCEDURE POQ IS BEGIN NULL; END; PROCEDURE PRI IS BEGIN NULL; END; PROCEDURE PRU IS BEGIN NULL; END; PROCEDURE PRD IS BEGIN NULL; END; PROCEDURE WVR IS BEGIN NULL; END; PROCEDURE Initialize IS BEGIN NULL; END; PROCEDURE Destroy IS BEGIN NULL; END; PROCEDURE Query IS BEGIN NULL; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/BL_EMPLOYEES.pks ================================================ PACKAGE BL_Employees IS /* || Name : BL_ || Description : This Package is a template for all block-packages || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 07.04.2007, Volberg - Created */ PROCEDURE PRQ; PROCEDURE POQ; PROCEDURE PRI; PROCEDURE PRU; PROCEDURE PRD; PROCEDURE WVR; PROCEDURE Initialize; PROCEDURE Destroy; PROCEDURE Query; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/BL_MAINBLOCK.pkb ================================================ PACKAGE BODY BL_Mainblock IS PROCEDURE PRQ IS BEGIN NULL; END; PROCEDURE POQ IS BEGIN NULL; END; PROCEDURE PRI IS BEGIN NULL; END; PROCEDURE PRU IS BEGIN NULL; END; PROCEDURE PRD IS BEGIN NULL; END; PROCEDURE WVR IS BEGIN NULL; END; PROCEDURE Initialize IS BEGIN NULL; END; PROCEDURE Destroy IS BEGIN NULL; END; PROCEDURE Query IS BEGIN NULL; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/BL_MAINBLOCK.pks ================================================ PACKAGE BL_Mainblock IS /* || Name : BL_ || Description : This Package is a template for all block-packages || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 07.04.2007, Volberg - Created */ PROCEDURE PRQ; PROCEDURE POQ; PROCEDURE PRI; PROCEDURE PRU; PROCEDURE PRD; PROCEDURE WVR; PROCEDURE Initialize; PROCEDURE Destroy; PROCEDURE Query; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/CONST_LOCAL.pks ================================================ PACKAGE Const_local IS /* || Name : Const_local || Description : This Package is the local Form-Constant-Package || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 20.07.2007, Volberg - Created */ -- Blocks blk_Control CONSTANT VARCHAR2 (30) := upper ('Control'); blk_Filter CONSTANT VARCHAR2 (30) := upper ('Filter'); blk_Mainblock CONSTANT VARCHAR2 (30) := upper ('Employees'); -- One Time Timer ott_Query CONSTANT VARCHAR2 (40) := upper ('Query'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/CONTROL/CONTROL__BT_EXIT__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN exit_form (no_validate); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/CONTROL/CONTROL__BT_WIKI__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN web.show_document ('https://github.com/GerdVolberg/forms-framework/wiki/Demo-0002'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/DEMO0002/WHEN-TIMER-EXPIRED.tgg ================================================ BEGIN When_Timer_Expired; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/EMPLOYEES/EMPLOYEES__PRE-QUERY.tgg ================================================ BEGIN BL_Employees.PRQ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/FILTER/FILTER__BT_QUERY__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN Goto_Block_and_Query (Const_local.blk_Mainblock); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/FILTER/FILTER__WHEN-VALIDATE-ITEM.tgg ================================================ BEGIN One_Time_Timer.Initialize (Const_local.ott_Query); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/VERSION_FRW_FORMS.fun ================================================ FUNCTION Version_frw_Forms RETURN VARCHAR2 IS /* || Name : Version_frw_Forms || Description : Returns the Version of the current Form || Returns : VARCHAR2 || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 20.07.2007, Volberg - Created */ BEGIN RETURN ('1.0.001'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/WHEN_TIMER_EXPIRED.pcd ================================================ PROCEDURE When_Timer_Expired IS V_Item VARCHAR2 (61); BEGIN V_Item := Act.Item; IF One_Time_Timer.Get_Value = Const_local.ott_Query THEN Goto_Block_and_Query (Const_local.blk_Mainblock); Go_Item (V_Item); END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/WNB.pcd ================================================ PROCEDURE WNB IS /* || Name : WNB || Description : WHEN-NEW-BLOCK-INSTANCE || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 03.04.2011, Volberg - Created */ BEGIN Event.WNB; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/WNF.pcd ================================================ PROCEDURE WNF IS /* || Name : WNF || Description : WHEN-NEW-FORM-INSTANCE || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 03.04.2011, Volberg - Created */ BEGIN Event.WNF; Goto_Block_and_Query (Const_local.blk_Mainblock); Goto_Block (Const_local.blk_Filter); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/WNI.pcd ================================================ PROCEDURE WNI IS /* || Name : WNI || Description : WHEN-NEW-ITEM-INSTANCE || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 03.04.2011, Volberg - Created */ BEGIN Event.WNI; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/WNR.pcd ================================================ PROCEDURE WNR IS /* || Name : WNR || Description : WHEN-NEW-RECORD-INSTANCE || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 03.04.2011, Volberg - Created */ BEGIN Event.WNR; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/DEMO0002/metadata.json ================================================ { "alerts": [ "AL_ERROR", "AL_INFO", "AL_WARNING", "AL_YES_NO", "AL_YES_NO_CANCEL" ], "blocks": [ { "name": "FILTER", "items": [ "TI_EMPLOYEE_ID", "TI_FIRST_NAME", "TI_LAST_NAME", "TI_EMAIL", "BT_QUERY" ] }, { "name": "EMPLOYEES", "items": [ "EMPLOYEE_ID", "FIRST_NAME", "LAST_NAME", "EMAIL", "PHONE_NUMBER", "JOB_ID", "SALARY", "MANAGER_ID", "DEPARTMENT_ID", "COMMISSION_PCT", "HIRE_DATE" ] }, { "name": "CONTROL", "items": [ "BT_WIKI", "BT_EXIT" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/FRW_REF/ON-ERROR.tgg ================================================ BEGIN Error_Handling; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/FRW_REF/WHEN-NEW-BLOCK-INSTANCE.tgg ================================================ BEGIN WNB; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/FRW_REF/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN WNF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/FRW_REF/WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN WNI; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/FRW_REF/WHEN-NEW-RECORD-INSTANCE.tgg ================================================ BEGIN WNR; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/WNB.pcd ================================================ PROCEDURE WNB IS BEGIN NULL; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/WNF.pcd ================================================ PROCEDURE WNF IS BEGIN NULL; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/WNI.pcd ================================================ PROCEDURE WNI IS BEGIN NULL; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/WNR.pcd ================================================ PROCEDURE WNR IS BEGIN NULL; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0002/FRW_REF/metadata.json ================================================ { "alerts": [ "AL_ERROR", "AL_INFO", "AL_WARNING", "AL_YES_NO", "AL_YES_NO_CANCEL" ], "blocks": [ { "name": "BL", "items": [ "TI" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/BL_MAINBLOCK.pkb ================================================ PACKAGE BODY BL_Mainblock IS PROCEDURE PRQ IS BEGIN NULL; END; PROCEDURE POQ IS BEGIN NULL; END; PROCEDURE PRI IS BEGIN NULL; END; PROCEDURE PRU IS BEGIN NULL; END; PROCEDURE PRD IS BEGIN NULL; END; PROCEDURE WVR IS BEGIN NULL; END; PROCEDURE Initialize IS BEGIN NULL; END; PROCEDURE Destroy IS BEGIN NULL; END; PROCEDURE Query IS BEGIN NULL; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/BL_MAINBLOCK.pks ================================================ PACKAGE BL_Mainblock IS /* || Name : BL_ || Description : This Package is a template for all block-packages || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 07.04.2007, Volberg - Created */ PROCEDURE PRQ; PROCEDURE POQ; PROCEDURE PRI; PROCEDURE PRU; PROCEDURE PRD; PROCEDURE WVR; PROCEDURE Initialize; PROCEDURE Destroy; PROCEDURE Query; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/CONST_LOCAL.pks ================================================ PACKAGE Const_local IS /* || Name : Const_local || Description : This Package is the local Form-Constant-Package || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 20.07.2007, Volberg - Created */ -- Blocks blk_Control CONSTANT VARCHAR2 (30) := upper ('Control'); blk_Mainblock CONSTANT VARCHAR2 (30) := upper (''); blk_Employees CONSTANT VARCHAR2 (30) := upper ('Employees'); blk_Employees_LI CONSTANT VARCHAR2 (30) := upper ('Employees_LI'); -- One Time Timer ott_Query CONSTANT VARCHAR2 (40) := upper ('Query'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/CONTROL/CONTROL__BT_EXIT__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN exit_form (no_validate); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/CONTROL/CONTROL__BT_ONE_TIME_TIMER__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN goto_block_and_query (Const_local.blk_Employees_LI); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/CONTROL/CONTROL__BT_UNDO__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN goto_block_and_query (Const_local.blk_Employees); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/CONTROL/CONTROL__BT_WIKI__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN web.show_document ('https://github.com/GerdVolberg/forms-framework/wiki/Demo-0003'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/CONTROL/CONTROL__BT__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN call_form ('demo0002'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/DEMO0003/WHEN-TIMER-EXPIRED.tgg ================================================ BEGIN When_Timer_Expired; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/EMPLOYEES_CONTROL/EMPLOYEES_CONTROL__BT_UNDO__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN Undo; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/EMPLOYEES_CONTROL/EMPLOYEES_CONTROL__ITEM47__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN exit_form (no_validate); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/EMPLOYEES_LI/EMPLOYEES_LI__PRE-QUERY.tgg ================================================ BEGIN IF :EMPLOYEES_LI_CONTROL.LI_JOB_ID != '0' THEN :Employees.JOB_ID := :EMPLOYEES_LI_CONTROL.LI_JOB_ID; END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/EMPLOYEES_LI_CONTROL/EMPLOYEES_LI_CONTROL__BT_EXIT__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN exit_form (no_validate); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/UNDO.pcd ================================================ PROCEDURE Undo IS V_Block VARCHAR2 (30) := :SYSTEM.CURSOR_BLOCK; V_Field VARCHAR2 (61); V_Item VARCHAR2 (61); BEGIN Validate (Item_Scope); IF :SYSTEM.RECORD_STATUS = 'CHANGED' THEN V_Field := Get_Block_Property (V_Block, FIRST_ITEM); V_Item := V_Block || '.' || V_Field; WHILE V_Field IS NOT NULL LOOP IF Get_Item_Property (V_Item, ITEM_TYPE) IN ('DISPLAY ITEM', 'CHECKBOX', 'LIST', 'RADIO GROUP', 'TEXT ITEM') AND Get_Item_Property (V_Item, BASE_TABLE) = 'TRUE' THEN COPY (Get_Item_Property (V_Item, DATABASE_VALUE), V_Item); END IF; V_Field := Get_Item_Property (V_Item, NextItem); V_Item := V_Block || '.' || V_Field; END LOOP; END IF; Set_Record_Property (:SYSTEM.CURSOR_RECORD, :SYSTEM.CURSOR_BLOCK, STATUS, QUERY_STATUS); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/VERSION_FRW_FORMS.fun ================================================ FUNCTION Version_frw_Forms RETURN VARCHAR2 IS /* || Name : Version_frw_Forms || Description : Returns the Version of the current Form || Returns : VARCHAR2 || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 20.07.2007, Volberg - Created */ BEGIN RETURN ('1.0.001'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/WHEN_TIMER_EXPIRED.pcd ================================================ PROCEDURE When_Timer_Expired IS V_Item VARCHAR2 (61); BEGIN V_Item := Act.Item; IF One_Time_Timer.Get_Value = Const_local.ott_Query THEN Goto_Block_and_Query (Const_local.blk_Mainblock); Go_Item (V_Item); END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/WNB.pcd ================================================ PROCEDURE WNB IS /* || Name : WNB || Description : WHEN-NEW-BLOCK-INSTANCE || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 03.04.2011, Volberg - Created */ BEGIN Event.WNB; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/WNF.pcd ================================================ PROCEDURE WNF IS /* || Name : WNF || Description : WHEN-NEW-FORM-INSTANCE || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 03.04.2011, Volberg - Created */ BEGIN Event.WNF; Init_List_Item (P_Item => 'EMPLOYEES_LI_CONTROL.LI_JOB_ID', P_Query => 'SELECT JOB_ID, JOB_ID FROM Employees UNION ' || Const.sel_All_from_Dual, P_Default => 0); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/WNI.pcd ================================================ PROCEDURE WNI IS /* || Name : WNI || Description : WHEN-NEW-ITEM-INSTANCE || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 03.04.2011, Volberg - Created */ BEGIN Event.WNI; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/WNR.pcd ================================================ PROCEDURE WNR IS /* || Name : WNR || Description : WHEN-NEW-RECORD-INSTANCE || || Version Updates Author Change-Description || ------- ---------- ------- ------------------ || 1.0.001 03.04.2011, Volberg - Created */ BEGIN Event.WNR; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0003/DEMO0003/metadata.json ================================================ { "alerts": [ "AL_ERROR", "AL_INFO", "AL_WARNING", "AL_YES_NO", "AL_YES_NO_CANCEL" ], "blocks": [ { "name": "CONTROL", "items": [ "BT_UNDO", "BT_ONE_TIME_TIMER", "BT", "BT_WIKI", "BT_EXIT" ] }, { "name": "EMPLOYEES", "items": [ "EMPLOYEE_ID", "FIRST_NAME", "LAST_NAME", "EMAIL", "PHONE_NUMBER", "HIRE_DATE", "JOB_ID", "SALARY", "COMMISSION_PCT", "MANAGER_ID", "DEPARTMENT_ID" ] }, { "name": "EMPLOYEES_CONTROL", "items": [ "BT_UNDO", "ITEM47" ] }, { "name": "EMPLOYEES_LI", "items": [ "EMPLOYEE_ID", "FIRST_NAME", "LAST_NAME", "EMAIL", "PHONE_NUMBER", "HIRE_DATE", "JOB_ID", "SALARY", "COMMISSION_PCT", "MANAGER_ID", "DEPARTMENT_ID" ] }, { "name": "EMPLOYEES_LI_CONTROL", "items": [ "LI_JOB_ID", "BT_EXIT" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/ERRORMESSAGE.pcd ================================================ PROCEDURE ErrorMessage (v_text varchar2) IS BEGIN Message(v_text); if SQLCODE <> 0 then Message ('Oracle-Error: ' || SQLERRM); Message ('Oracle-Error: ' || SQLERRM); end if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/IS_DBA.fun ================================================ FUNCTION Is_DBA RETURN boolean IS v_Anzahl number(1); BEGIN select count(*) into v_Anzahl from User_Role_Privs where Granted_Role = 'DBA' ; if v_Anzahl = 0 then return FALSE; else return TRUE; end if; exception when OTHERS then ErrorMessage('Fehler bei "select count(*) from User_Role_Privs".'); return FALSE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/KILL_SESSION.pcd ================================================ PROCEDURE Kill_Session IS v_DDL_Text varchar2(500); BEGIN v_DDL_Text := 'alter system disconnect session ''' || to_char(:v$session.SID) || ',' || to_char(:v$session.Serial#) || ''' immediate'; Forms_DDL(v_DDL_Text); Refresh; exception when OTHERS then ErrorMessage('Fehler bei "' || v_DDL_Text || '".'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/LOG_SYSTEM_SCHLIESSEN.pcd ================================================ PROCEDURE Log_System_Schliessen IS BEGIN Go_Item('v$session.PB_Kill_Session'); Hide_View('Logon_Leinwand'); Hide_Window('Logon_Fenster'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/REFRESH.pcd ================================================ PROCEDURE Refresh IS BEGIN Go_Block('V$Lock'); Execute_Query; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/RELEASE_LOCKS/POST-FORM.tgg ================================================ BEGIN declare v_User varchar2(30) := get_application_property(USERNAME); begin if nvl(v_User, ' ') != :global.User then logout; logon(:global.User, :global.Pwd || '@' || :global.Con, FALSE); end if; erase('global.User'); erase('global.PWD'); erase('global.Con'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/RELEASE_LOCKS/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN :global.User := get_application_property(USERNAME); :global.Pwd := get_application_property(PASSWORD); :global.Con := get_application_property(CONNECT_STRING); Refresh; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/STEUERBLOCK/STEUERBLOCK__PB_CANCEL__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN Log_System_Schliessen; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/STEUERBLOCK/STEUERBLOCK__PB_CONNECT__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare v_User varchar2(30) := get_application_property(USERNAME); v_Pwd varchar2(30) := get_application_property(PASSWORD); v_Con varchar2(30) := get_application_property(CONNECT_STRING); begin if v_Con is null and :steuerblock.Database is not null then v_Con := :steuerblock.Database; end if; logout; logon('SYSTEM', :steuerblock.Password || '@' || v_Con, TRUE); if not FORM_SUCCESS then raise FORM_TRIGGER_FAILURE; end if; if Is_DBA then Kill_session; Log_System_Schliessen; else Message('You do not have the permission to kill this session!'); Log_System_Schliessen; end if; exception when OTHERS then Message('Connection failed, try to reconnect ...'); logout; logon(v_User, v_Pwd || '@' || v_Con, FALSE); Log_System_Schliessen; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/STEUERBLOCK/STEUERBLOCK__PB_EXIT__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN Do_Key('Exit_Form'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/STEUERBLOCK/STEUERBLOCK__PB_REFRESH__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN Refresh; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/V$LOCK/V$LOCK__POST-QUERY.tgg ================================================ BEGIN declare v_Mode_Case int; v_SQL_Address v$session.SQL_Address%type; v_SQL_Hash_Value v$session.SQL_Hash_Value%type; begin if :v$lock.Request = 0 then if :v$lock.Block = 1 then :v$lock.Holder_Waiter := 'Holder'; else :v$lock.Holder_Waiter := 'Lock'; end if; v_Mode_Case := :v$lock.LMode; else :v$lock.Holder_Waiter := 'Waiter'; v_Mode_Case := :v$lock.Request; end if; case v_Mode_Case when 0 then :v$lock.Mode := 'none'; when 1 then :v$lock.Mode := 'null'; when 2 then :v$lock.Mode := 'row-S (SS)'; when 3 then :v$lock.Mode := 'row-X (SX)'; when 4 then :v$lock.Mode := 'share (S)'; when 5 then :v$lock.Mode := 'S/Row-X (SSX)'; when 6 then :v$lock.Mode := 'exclusive (X)'; else :v$lock.Mode := '??'; end case; if :v$lock.Type = 'TM' then begin select Owner || '.' || Object_Name into :v$lock.Object from dba_Objects where Object_Id = :v$lock.Id1 ; exception when OTHERS then ErrorMessage('Fehler bei "select Owner.Object_Name from dba_Objects".'); end; end if; begin select Username, decode(SQL_Hash_Value, 0, Prev_SQL_Addr, SQL_Address) SQL_Address, decode(SQL_Hash_Value, 0, Prev_Hash_Value, SQL_Hash_Value) SQL_Hash_Value into :v$lock.Username, v_SQL_Address, v_SQL_Hash_Value from v$session where SID = :v$lock.SID ; exception when OTHERS then ErrorMessage('Fehler bei "select Username, ... from v$session".'); raise NO_DATA_FOUND; end; begin select SQL_Text into :v$lock.SQL_Text from v$sqlarea where Address = v_SQL_Address and Hash_Value = v_SQL_Hash_Value ; exception when OTHERS then ErrorMessage('Fehler bei "select SQL_Text from v$sqlarea".'); end; exception when NO_DATA_FOUND then null; when FORM_TRIGGER_FAILURE then raise; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/V$SESSION/V$SESSION__PB_KILL_SESSION__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare v_Anzahl number(1); v_User varchar2(30); begin if :v$session.SID is null then Message('No session to kill'); Message('No session to kill'); else if Show_Alert('Daten_Verloren_Warnung') = ALERT_BUTTON1 then -- OK if Is_DBA then Kill_session; else Set_Item_Property('steuerblock.Database', VISIBLE, PROPERTY_FALSE); Go_Item('steuerblock.Password'); end if; end if; end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0004/RELEASE_LOCKS/metadata.json ================================================ { "alerts": [ "DATEN_VERLOREN_WARNUNG" ], "blocks": [ { "name": "V$LOCK", "items": [ "HOLDER_WAITER", "USERNAME", "SID", "MODE", "SQL_TEXT", "OBJECT", "ID1", "ID2", "LMODE", "REQUEST", "CTIME", "BLOCK", "TYPE" ] }, { "name": "V$SESSION", "items": [ "SID", "SERIAL#", "LOGON_TIME", "USERNAME", "STATUS", "OSUSER", "PROGRAM", "MACHINE", "PB_KILL_SESSION" ] }, { "name": "STEUERBLOCK", "items": [ "PB_REFRESH", "PASSWORD", "DATABASE", "PB_CONNECT", "PB_CANCEL", "PB_EXIT" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/PL_RESET_FORMSTIMER_ITEMS.pcd ================================================ PROCEDURE pl_reset_formstimer_items IS BEGIN :when_timer_expired_event := null; :when_custom_item_event := null; :custom_time := null; :expired_time := null; :starttime := :system.current_datetime; :timername := 'FormsTimer'; synchronize; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/PL_START.pcd ================================================ PROCEDURE pl_start IS BEGIN :when_timer_expired_event := null; :when_custom_item_event := null; :custom_time := null; :expired_time := null; :starttime := :system.current_datetime; synchronize; set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'TIMER_NAME',:timername); if :standardtimer is not null then set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'ENABLE_STANDARDTIMER',:standardtimer); end if; if :intervaltimer is not null then set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'ENABLE_INTERVALTIMER',:intervaltimer); end if; if :events = 'true' then set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'RECORDING_EVENTS','ALL'); else set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'RECORDING_EVENTS',''); end if; set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'ENABLE_DEBUGGING',:debug); set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'TIMER_SLEEP_TIME',:sleeptime); -- ms set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'START_TIMER',:maxinactivity); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/PL_WHEN_CUSTOM_ITEM_EVENT.pcd ================================================ PROCEDURE pl_when_custom_item_event IS vch_eventName varchar2(100); timer_name varchar2(100); timer_id timer; begin vch_eventName := name_in('system.custom_item_event'); :when_custom_item_event := vch_eventName; :custom_time := :System.Current_Datetime; if instr(vch_eventName,':ST',1,1) > 0 then timer_name := substr(vch_eventName,instr(vch_eventName,':',1,1)+1); timer_id := find_timer(timer_name); if id_null(timer_id) then timer_id := create_timer(timer_name,1,no_repeat); else set_timer(timer_name,1, no_repeat); end if; end if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__DEBUG__WHEN-CHECKBOX-CHANGED.tgg ================================================ BEGIN set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'ENABLE_DEBUGGING',:debug); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__FORMSTIMER500__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare timer_name varchar2(100); timer_id timer; begin pl_reset_formstimer_items; timer_name := 'FormsTimer'; timer_id := find_timer(timer_name); if id_null(timer_id) then timer_id := create_timer(timer_name,500,no_repeat); else set_timer(timer_name,500, no_repeat); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__FORMSTIMER60000__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare timer_name varchar2(100); timer_id timer; begin timer_name := 'FormsTimer'; pl_reset_formstimer_items; timer_id := find_timer(timer_name); if id_null(timer_id) then timer_id := create_timer(timer_name,60000,no_repeat); else set_timer(timer_name,60000, no_repeat); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__FORMS_TIMER1000__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare timer_name varchar2(100); timer_id timer; begin pl_reset_formstimer_items; timer_name := 'FormsTimer'; timer_id := find_timer(timer_name); if id_null(timer_id) then timer_id := create_timer(timer_name,1000,no_repeat); else set_timer(timer_name,1000, no_repeat); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__FORMS_TIMER5000__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare timer_name varchar2(100); timer_id timer; begin pl_reset_formstimer_items; timer_name := 'FormsTimer'; timer_id := find_timer(timer_name); if id_null(timer_id) then timer_id := create_timer(timer_name,5000,no_repeat); else set_timer(timer_name,5000, no_repeat); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__ITEM28__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN :when_timer_expired_event := null; :when_custom_item_event := null; :custom_time := null; :expired_time := null; :starttime := :system.current_datetime; :timername := 'ST'; synchronize; set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'END_TIMER',''); -- Beispiel für das Aufrufen von OULOOK via JAVA Script --web.javascript_eval_expr('document.getElementById("closeprofi").value="unprotect"'); --web.javascript_eval_expr('window.open("mailto:test@example.com?subject=subject&body=body","_self")'); --web.javascript_eval_expr('document.getElementById("closeprofi").value="protect"'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__PRESET1__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN :maxinactivity := 500; :sleeptime := 100; :debug := 'true'; :events := 'true'; :timername := 'ST500ms'; :intervaltimer := ''; :standardtimer := 'true'; pl_start; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__PRESET2__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN :maxinactivity := 2000; :sleeptime := 100; :debug := 'true'; :events := 'true'; :timername := 'ST2000ms'; :intervaltimer := ''; :standardtimer := 'true'; pl_start; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__PRESET3__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN :maxinactivity := 10000; :sleeptime := 1000; :debug := 'true'; :events := 'true'; :timername := 'IT_10s_1s'; :intervaltimer := 'true'; :standardtimer := ''; pl_start; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__PRESET4__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN :maxinactivity := 60000; :sleeptime := 10000; :debug := 'true'; :events := 'true'; :timername := 'IT_60s_10s'; :intervaltimer := 'true'; :standardtimer := ''; pl_start; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__PRESET5__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN :maxinactivity := 3600000; :sleeptime := 240000; :debug := 'true'; :events := 'true'; :timername := 'IT_60min_4min'; :intervaltimer := 'true'; :standardtimer := ''; pl_start; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__PRESET6__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN :maxinactivity := 36000000; :sleeptime := 10000; :debug := 'true'; :events := 'true'; :timername := 'RT_10h_10s'; :intervaltimer := 'true'; :standardtimer := ''; pl_start; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__PRESET7__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN :maxinactivity := 36000000; :sleeptime := 60000; :debug := 'true'; :events := 'true'; :timername := 'RT_10h_1min'; :intervaltimer := 'true'; :standardtimer := ''; pl_start; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TEST/TEST__STARTTIMER__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN pl_start; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TIMEOUTPJC_TEST/ON-LOGON.tgg ================================================ BEGIN null; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TIMEOUTPJC_TEST/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN --webutil_start_profi_radio_11g; go_item('MAXINACTIVITY'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TIMEOUTPJC_TEST/WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN if :whennewiteminstancefires = 'true' then set_custom_property('WEBUTIL.WEBUTIL_TIMER_FUNCTIONS',1,'FORMS_WHEN_NEW_ITEM_INSTANCE',''); end if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/TIMEOUTPJC_TEST/WHEN-TIMER-EXPIRED.tgg ================================================ BEGIN declare vch_timer varchar2(200); begin vch_timer := get_application_property(TIMER_NAME); :WHEN_TIMER_EXPIRED_EVENT := vch_timer || ' has fired'; :expired_time := :System.Current_Datetime; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/WEBUTIL/WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN if :system.cursor_block = 'WEBUTIL' then next_block; end if; WebUtil_Core.ShowBeans(false); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/WEBUTIL/WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/WEBUTIL/WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/WEBUTIL/WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/WEBUTIL/WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/WEBUTIL/WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/WEBUTIL/WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/WEBUTIL/WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/WEBUTIL/WEBUTIL__WEBUTIL_TIMER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN pl_when_custom_item_event; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0005/TIMEOUTPJC_TEST/metadata.json ================================================ { "alerts": [ "WEBUTIL_ERROR" ], "blocks": [ { "name": "TEST", "items": [ "MAXINACTIVITY", "SLEEPTIME", "DEBUG", "TIMERNAME", "EVENTS", "ITEM28", "INTERVALTIMER", "WHEN_CUSTOM_ITEM_EVENT", "WHEN_TIMER_EXPIRED_EVENT", "STANDARDTIMER", "PRESET1", "PRESET2", "PRESET3", "PRESET4", "PRESET5", "PRESET6", "PRESET7", "WHENNEWITEMINSTANCEFIRES", "FORMSTIMER500", "FORMS_TIMER1000", "FORMS_TIMER5000", "FORMSTIMER60000", "STARTTIME", "CUSTOM_TIME", "EXPIRED_TIME", "STARTTIMER" ] }, { "name": "WEBUTIL", "items": [ "DUMMY", "WEBUTIL_CLIENTINFO_FUNCTIONS", "WEBUTIL_FILE_FUNCTIONS", "WEBUTIL_HOST_FUNCTIONS", "WEBUTIL_SESSION_FUNCTIONS", "WEBUTIL_FILETRANSFER_FUNCTIONS", "WEBUTIL_C_API_FUNCTIONS", "WEBUTIL_BROWSER_FUNCTIONS", "WEBUTIL_TIMER_FUNCTIONS" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0006/TIMEOUT_SYS_CLIENT_IDL/DEMOBLOCK/DEMOBLOCK__BUT_CLOSE_FORM__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN exit_form(no_validate); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0006/TIMEOUT_SYS_CLIENT_IDL/DEMOBLOCK/DEMOBLOCK__DEMO_1__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- idle heartbeat time (sec) :heartbeat := 10; -- idle max_time (sec) :max_time := 10; :parameter.p_timer_countdown := null; :countdown:=1; p_clear_diagnostic_items; -- Set Client Idle Timer (sec) SET_APPLICATION_PROPERTY(CLIENT_IDLE_TIME,10); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0006/TIMEOUT_SYS_CLIENT_IDL/DEMOBLOCK/DEMOBLOCK__DEMO_2__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- idle heartbeat time (sec) :heartbeat := 10; -- idle max_time (sec) :max_time := 30; :parameter.p_timer_countdown := null; :countdown := 3; p_clear_diagnostic_items; -- Set Client Idle Timer (sec) SET_APPLICATION_PROPERTY(CLIENT_IDLE_TIME,10); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0006/TIMEOUT_SYS_CLIENT_IDL/DEMOBLOCK/DEMOBLOCK__DEMO_3__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- idle heartbeat time (sec) :heartbeat := 60; -- idle max_time (sec) :max_time := 300; :parameter.p_timer_countdown := null; :countdown := 5; p_clear_diagnostic_items; -- Set Client Idle Timer to 5 Seconds for an initial start SET_APPLICATION_PROPERTY(CLIENT_IDLE_TIME,60); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0006/TIMEOUT_SYS_CLIENT_IDL/F_GET_TIMER_VALUE.fun ================================================ -- Get the time in ms from 23.10.2015 until this moment FUNCTION f_get_timer_value RETURN number IS out_result number; begin select extract(day from(systimestamp - to_timestamp('2015-10-23', 'YYYY-MM-DD'))) * 86400000 + to_number(to_char(sys_extract_utc(systimestamp), 'SSSSSFF3')) into out_result from dual; return out_result; end f_get_timer_value; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0006/TIMEOUT_SYS_CLIENT_IDL/P_CLEAR_DIAGNOSTIC_ITEMS.pcd ================================================ PROCEDURE p_clear_diagnostic_items IS BEGIN :stoptime := '?'; :result := '?'; :idle_heartbeat := '?'; :time_left := '?'; :max_inactivity := '?'; :parameter.p_timer_starttime := f_get_timer_value; :starttime := to_char(:parameter.p_timer_starttime) || ' ms since 23rd October 2015'; :last_action_event := 'Demo started ' || to_char(sysdate,'HH24:MI:SS'); :start_date := sysdate; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0006/TIMEOUT_SYS_CLIENT_IDL/TIMEOUT_SYS_CLIENT_IDL/PRE-FORM.tgg ================================================ BEGIN SET_APPLICATION_PROPERTY(CLIENT_IDLE_TIME,0); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0006/TIMEOUT_SYS_CLIENT_IDL/metadata.json ================================================ { "alerts": [], "blocks": [ { "name": "DEMOBLOCK", "items": [ "BUT_CLOSE_FORM", "DEMO_1", "DEMO_2", "DEMO_3", "STARTTIME", "STOPTIME", "RESULT", "IDLE_HEARTBEAT", "MAX_INACTIVITY", "TIME_LEFT", "LAST_ACTION_EVENT", "HEARTBEAT", "MAX_TIME", "COUNTDOWN", "START_DATE" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/ALL_OBJECTS/ALL_OBJECTS__BT_ALL__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN set_block_property('ALL_OBJECTS',DEFAULT_WHERE,'where owner = ''SYS'' and rownum < 1001'); execute_query; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/ALL_OBJECTS/ALL_OBJECTS__BT_PACKAGES__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN set_block_property('ALL_OBJECTS',DEFAULT_WHERE,'where owner = ''SYS'' and object_type = ''PACKAGE'''); execute_query; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/ALL_OBJECTS/ALL_OBJECTS__BT_TABLES__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN set_block_property('ALL_OBJECTS',DEFAULT_WHERE,'where owner = ''SYS'' and object_type = ''TABLE'''); execute_query; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/ALL_OBJECTS/ALL_OBJECTS__CALL_EXCEL__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare vch_return_value varchar2(2000); begin :last_query := get_block_property('ALL_OBJECTS',last_query); vch_return_value := pdw_temp_blob_export.f_make_blob(:last_query,'EXCEL'); synchronize; p_get_blob('EXCEL'); if vch_return_value != '0' then message(vch_return_value); end if; pdw_temp_blob_export.p_drop_blob; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/CD_DEMO_EXCEL/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN execute_query; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/CD_DEMO_EXCEL/WHEN-WINDOW-CLOSED.tgg ================================================ BEGIN exit_form; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/P_GET_BLOB.pcd ================================================ PROCEDURE p_get_blob(p_type in varchar2) IS boolean_success boolean; vch_file_bez varchar2(500); vch_dir_and_file varchar2(500); BEGIN vch_file_bez := 'Exceltest_' || to_char(sysdate,'YYYYDDMM_HH24MISS')|| '.' ||'csv'; vch_dir_and_file := webutil_clientinfo.get_system_property('user.home')|| '\' || vch_file_bez; --message('Dir=' || vch_dir_and_file || ' ID=' || p_id); -- Anzeige des Dokumentes if vch_dir_and_file is not null then -- #3 Webutil Donwload nur wenn das Dokument nicht bereits geladen ist, sonst nur Aufruf if not webutil_file.FILE_EXISTS(vch_dir_and_file) then boolean_success := webutil_file_transfer.DB_To_Client_with_progress (clientFile => vch_dir_and_file ,tableName => 'TEMP_BLOB_EXPORT' ,columnName => 'TBE_COL' ,whereClause => 'TBE_TYPE=''' || p_type || '''' ,progressTitle => 'Dokument wird geladen' ,progressSubTitle=> 'Bitte Warten' ); end if; -- Nach erfolgreichem "Runterladen" wird die Datei mit der verknüpften Anwendung auf dem PC gestartet if webutil_file.FILE_EXISTS(vch_dir_and_file) or boolean_success then --WEBUTIL_CLIENT_FUNCTIONS.HOST('cmd /c rundll32.exe url.dll,FileProtocolHandler "'||vch_dir_and_file||'"',NO_SCREEN); --Client_Host( 'cmd /c start "" "' || vch_dir_and_file || '"'); -- pdw_webutil_blobtab.p_update_status ( p_ind => p_id, p_status => 'Y'); -- #3 Aufruf wie in dokument.fmb webutil_host.NonBlocking( 'rundll32 url.dll,FileProtocolHandler ' || vch_dir_and_file); else message('Not result for Excel File Generation.'); --Fehler in p_get_blob : Dokument ' || vch_dir_and_file || ' konnte nicht geladen werden!'); end if; end if; exception when others then message('The Excel File did not succeed : '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/WEBUTIL/WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN if :system.cursor_block = 'WEBUTIL' then next_block; end if; WebUtil_Core.ShowBeans(false); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/WEBUTIL/WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/WEBUTIL/WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/WEBUTIL/WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/WEBUTIL/WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/WEBUTIL/WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/WEBUTIL/WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/WEBUTIL/WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0007/CD_DEMO_EXCEL/metadata.json ================================================ { "alerts": [ "WEBUTIL_ERROR" ], "blocks": [ { "name": "ALL_OBJECTS", "items": [ "OWNER", "OBJECT_NAME", "OBJECT_ID", "STATUS", "SUBOBJECT_NAME", "OBJECT_TYPE", "CREATED", "CALL_EXCEL", "LAST_QUERY", "BT_TABLES", "BT_PACKAGES", "BT_ALL" ] }, { "name": "WEBUTIL", "items": [ "DUMMY", "WEBUTIL_CLIENTINFO_FUNCTIONS", "WEBUTIL_FILE_FUNCTIONS", "WEBUTIL_HOST_FUNCTIONS", "WEBUTIL_SESSION_FUNCTIONS", "WEBUTIL_FILETRANSFER_FUNCTIONS", "WEBUTIL_C_API_FUNCTIONS", "WEBUTIL_BROWSER_FUNCTIONS" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/F_GET_CURRENT_TIME_MS.fun ================================================ function f_get_current_time_ms return number /* DOK:================================================================================================= * Bezeichnung : Funktion f_current_time_ms * Inhalt : Ermittlung eines Zeitstempels in ms * * Returnwert : -/- * Autor : F.Hoffmann / Cologne Data * Erstellungsdatum : 31.03.2017 * Änd-Nr. Datum Name Beschreibung * ----------------------------------------------------------------------------------------------------------------------------- * 1 21.1.2018 Fhoffmann Optimization by PGutiérrez */ is out_result number; begin out_result := JAVA_SYSTEM.CURRENTTIMEMILLIS; --select extract(day from(systimestamp - to_timestamp('2017-01-01', 'YYYY-MM-DD'))) * 86400000 -- + to_number(to_char(sys_extract_utc(systimestamp), 'SSSSSFF3')) --into out_result --from dual; return out_result; end f_get_current_time_ms; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/LATENCY_TEST/ON-LOGON.tgg ================================================ BEGIN begin null; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/LATENCY_TEST/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN declare webutil_timer timer; begin :TEST.VERSION := 'Forms Version '||GET_APPLICATION_PROPERTY(VERSION); webutil_timer:= CREATE_TIMER('WEBUTIL',3500,NO_REPEAT); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/LATENCY_TEST/WHEN-TIMER-EXPIRED.tgg ================================================ BEGIN declare /* DOK:=============================================================================================================================================================== * Bezeichnung : Trigger WHEN-TIMER-EXPIRED * Inhalt : * * Returnwert : -/- * Autor : F.Hoffmann / Cologne Data * Erstellungsdatum : 11.09.2014 * Änd-Nr. Datum Name Beschreibung * ------------------------------------------------------------------------------------------------------------------------------------------------------------------- * 1 9.9.2015 HOFFMANNF OT-64520 Timer berücksichtigt Zeiten für Inaktivitäten nicht, Neu: Prüfung ob formswebutil.jar und profi jacob.jar geladen sind * */ vch_timer varchar2(200); vch_log_check varchar2(30); begin vch_timer := get_application_property(TIMER_NAME); -- Webutil Einmaliger Aufruf zum Systemstart if vch_timer = 'WEBUTIL' then P_WHEN_NEW_FORM_INSTANCE; else -- form wird geschlossen message('Exit!!'); exit_form(no_validate); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/P_DOWNLOAD_DOKUMENT_AS.pcd ================================================ PROCEDURE p_download_dokument_as(p_dokument in varchar2) is vch_dokument varchar2(100) := :parameter.p_dokument_name; boolean_success boolean; vch_client_dir_and_file varchar2(500); vch_server_dir_and_file varchar2(500); vch_server_dir varchar2(200) := :parameter.p_working_directory; vch_user_home varchar2(200) := :parameter.p_userhome; vch_slash varchar2(1); begin -- Defaultbelegung von Verzeichnissen und INI Dateien vch_server_dir_and_file := webutil_get_as_tmp_dir || p_dokument; vch_client_dir_and_file := vch_user_home|| '\' || p_dokument; :status := 'Copy: '|| vch_client_dir_and_file; boolean_success := webutil_file_transfer.as_To_Client( serverfile => vch_server_dir_and_file, clientfile => vch_client_dir_and_file); if not boolean_success then :status := 'Error : ' || vch_server_dir_and_file || ' nach ' || vch_client_dir_and_file; raise form_trigger_failure; end if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/P_WAIT_AND_EXIT.pcd ================================================ PROCEDURE P_WAIT_AND_EXIT IS BEGIN -- Kurze Zeit um die Meldung sichtbar zu machen for i in 1..100000000 loop null; end loop; exit_form(no_validate); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/P_WHEN_NEW_FORM_INSTANCE.pcd ================================================ PROCEDURE P_WHEN_NEW_FORM_INSTANCE IS webutil_timer timer; BEGIN :parameter.p_working_directory := webutil_browser.getappletparameter('WorkingDirectory'); :parameter.p_userhome := webutil_clientinfo.get_system_property('user.home'); --:parameter.p_use_testfile; :status := 'Keyboardclick'; synchronize; for i in 1..3 loop :parameter.p_start := f_get_current_time_ms; go_item('TASTATUR_1'); go_item('TASTATUR_2'); go_item('TASTATUR_3'); synchronize; :parameter.p_stop := f_get_current_time_ms; if i = 1 then :Tastatur_1 := webutil_get_latency(p_roundtrips_number=>3, p_estimated_time_ms=>1); elsif i = 2 then :Tastatur_2 := webutil_get_latency(p_roundtrips_number=>3, p_estimated_time_ms=>1); else :Tastatur_3 := webutil_get_latency(p_roundtrips_number=>3, p_estimated_time_ms=>1); end if; synchronize; end loop; :Tastatur_AVG := (:Tastatur_1+:Tastatur_2+:Tastatur_3) / 3; synchronize; go_item('TASTATUR_AVG'); :status := 'Webutil Download: 1 KB'; p_download_dokument_as('test_01k.txt'); for i in 1..3 loop synchronize; :parameter.p_start := f_get_current_time_ms; p_download_dokument_as('test_01k.txt'); :parameter.p_stop := f_get_current_time_ms; if i = 1 then :DATEI_01KB_1 := webutil_get_latency(p_roundtrips_number=>4, p_estimated_time_ms=>1); elsif i = 2 then :DATEI_01KB_2 := webutil_get_latency(p_roundtrips_number=>4, p_estimated_time_ms=>1); else :DATEI_01KB_3 := webutil_get_latency(p_roundtrips_number=>4, p_estimated_time_ms=>1); end if; end loop; :DATEI_01KB_AVG := (:DATEI_01KB_1+:DATEI_01KB_2+:DATEI_01KB_3) / 3; go_item('DATEI_01KB_AVG'); :status := 'Webutil Download: 16 KB'; p_download_dokument_as('test_16k.txt'); for i in 1..3 loop synchronize; :parameter.p_start := f_get_current_time_ms; p_download_dokument_as('test_16k.txt'); :parameter.p_stop := f_get_current_time_ms; if i = 1 then :DATEI_16KB_1 := webutil_get_latency(p_roundtrips_number=>4, p_estimated_time_ms=>5); elsif i = 2 then :DATEI_16KB_2 := webutil_get_latency(p_roundtrips_number=>4, p_estimated_time_ms=>5); else :DATEI_16KB_3 := webutil_get_latency(p_roundtrips_number=>4, p_estimated_time_ms=>5); end if; end loop; :DATEI_16KB_AVG := (:DATEI_16KB_1+:DATEI_16KB_2+:DATEI_16KB_3) / 3; go_item('DATEI_16KB_AVG'); :status := 'Webutil Download: 64 KB'; p_download_dokument_as('test_64k.txt'); for i in 1..3 loop synchronize; :parameter.p_start := f_get_current_time_ms; p_download_dokument_as('test_64k.txt'); :parameter.p_stop := f_get_current_time_ms; if i = 1 then :DATEI_64KB_1 := webutil_get_latency(p_roundtrips_number=>4, p_estimated_time_ms=>5); elsif i = 2 then :DATEI_64KB_2 := webutil_get_latency(p_roundtrips_number=>4, p_estimated_time_ms=>5); else :DATEI_64KB_3 := webutil_get_latency(p_roundtrips_number=>4, p_estimated_time_ms=>5); end if; end loop; :DATEI_64KB_AVG := (:DATEI_64KB_1+:DATEI_64KB_2+:DATEI_64KB_3) / 3; go_item('DATEI_64KB_AVG'); :status := 'Latencycheck finished'; :ergebnis := 'The average latency is ' || to_char(round((:tastatur_avg+:DATEI_01KB_AVG+:DATEI_16KB_AVG+:DATEI_64KB_AVG)/4,2)) || ' ms'; webutil_timer:= CREATE_TIMER('EXIT',25000,NO_REPEAT); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL/WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN if :system.cursor_block = 'WEBUTIL' then next_block; end if; WebUtil_Core.ShowBeans(false); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL/WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL/WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL/WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL/WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL/WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL/WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL/WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL_GET_AS_TMP_DIR.fun ================================================ FUNCTION webutil_get_as_tmp_dir RETURN VARCHAR2 IS BEGIN return('C:\temp\'); end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL_GET_LATENCY.fun ================================================ FUNCTION webutil_get_latency (p_roundtrips_number in number, p_estimated_time_ms in number) RETURN NUMBER IS /* DOK:===================================================================================================================== * Bezeichnung : webutil_get_latency * Inhalt : Berechnung der Latenzzeit für die jeweilige Messung * * Paramter p_roundtrips_number, Anzahl der Roundtrips für die Messung * p_estimated_time_ms, Prozessdauer ohne Latenzen * * Autor : F.Hoffmann / Cologne Data * Erstellungsdatum : 31.03.2017 * * Änd-Nr. Datum Name Beschreibung * -------------------------------------------------------------------------------------------------------------------------- * 1 */ BEGIN return (to_number(name_in(':parameter.p_stop') - to_number(name_in('parameter.p_start') - p_estimated_time_ms)) / p_roundtrips_number); -- Differenz in Millisekunden abzüglich Verzögerung in Millisekunden und datenbankzugriffe für 20 Roundtrips END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/WEBUTIL_PREPARE_TESTFILE.pcd ================================================ PROCEDURE webutil_prepare_testfile IS /* DOK:================================================================================================ * Bezeichnung : webutil_prepare_profi_testfile * Inhalt : Diese Prozedur dient der Testdateienerstellung für den Latenztest * Autor : F.Hoffmann / Cologne Data * Erstellungsdatum : 07.04.2015 * * Änd-Nr. Datum Name Beschreibung * ---------------------------------------------------------------------------------------------------- */ -- webutil add_on vch_temp_verzeichnis varchar2(200); vch_dateiname_1k varchar2(50) := 'test_01k.txt'; vch_dateiname_16k varchar2(50) := 'test_16k.txt'; vch_dateiname_64k varchar2(50) := 'test_64k.txt'; vch_slash varchar2(1); bol_success boolean; bol_falsche_konfig boolean := false; ftype text_io.file_type; begin -- Unterscheidung MAC-OS, Linux etc. "\" oder Windows File-System "/" vch_slash := webutil_clientinfo.get_file_separator; -- Defaultbelegung von Verzeichnissen und INI Dateien vch_temp_verzeichnis := webutil_get_as_tmp_dir; :status := vch_temp_verzeichnis || vch_dateiname_1k; if not webutil_file.file_exists(vch_temp_verzeichnis || vch_dateiname_1k) then ftype := text_io.fopen(vch_temp_verzeichnis || vch_dateiname_1k,'W'); text_io.put_line(ftype,'Testdatei 1 KB'); for i in 1..5 loop text_io.put_line(ftype,'12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); end loop; synchronize; text_io.fclose(ftype); synchronize; end if; :status := vch_temp_verzeichnis || vch_dateiname_16k; if not webutil_file.file_exists(vch_temp_verzeichnis || vch_dateiname_16k) then ftype := text_io.fopen(vch_temp_verzeichnis || vch_dateiname_16k,'W'); text_io.put_line(ftype,'Testdatei 16 KB'); for i in 1..80 loop text_io.put_line(ftype,'12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); end loop; synchronize; text_io.fclose(ftype); synchronize; end if; :status := vch_temp_verzeichnis || vch_slash || vch_dateiname_64k; if not webutil_file.file_exists(vch_temp_verzeichnis || vch_dateiname_64k) then ftype := text_io.fopen(vch_temp_verzeichnis || vch_dateiname_64k,'W'); text_io.put_line(ftype,'Testdatei 64 KB'); for i in 1..320 loop text_io.put_line(ftype,'12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); end loop; synchronize; text_io.fclose(ftype); synchronize; end if; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0008/LATENCY_TEST/metadata.json ================================================ { "alerts": [ "WEBUTIL_ERROR" ], "blocks": [ { "name": "TEST", "items": [ "TASTATUR_1", "TASTATUR_2", "TASTATUR_3", "TASTATUR_AVG", "DATEI_01KB_1", "DATEI_01KB_2", "DATEI_01KB_3", "DATEI_01KB_AVG", "DATEI_16KB_1", "DATEI_16KB_2", "DATEI_16KB_3", "DATEI_16KB_AVG", "DATEI_64KB_1", "DATEI_64KB_2", "DATEI_64KB_3", "DATEI_64KB_AVG", "STATUS", "ERGEBNIS", "VERSION" ] }, { "name": "WEBUTIL", "items": [ "DUMMY", "WEBUTIL_CLIENTINFO_FUNCTIONS", "WEBUTIL_FILE_FUNCTIONS", "WEBUTIL_HOST_FUNCTIONS", "WEBUTIL_SESSION_FUNCTIONS", "WEBUTIL_FILETRANSFER_FUNCTIONS", "WEBUTIL_C_API_FUNCTIONS", "WEBUTIL_BROWSER_FUNCTIONS" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__BT_CHECK_SINGLE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN BEGIN g.msg_push('W-B-P:BT_CHECK_SINGLE'); prc_set_statistik_SINGLE; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__BT_COMPILE_SINGLE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN DECLARE l_fname_blank VARCHAR2(128); l_in_file Text_IO.File_Type; l_cnt NUMBER(3); -- 11.02.2017 - F.Matz BEGIN g.msg_push('W-B-P:BT_COMPILE_SINGLE'); IF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT IN ( 'FMB', 'PLL', 'MMB') AND :BLK_HANDLG.STATUS_CHECK <> 'ERROR' AND :BLK_HANDLG.STATUS_MIGRATE <> 'ERROR' THEN l_fname_blank:= substr(:BLK_HANDLG.FNAME, 1, length(:BLK_HANDLG.FNAME)-4); IF webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmx') THEN IF webutil_file.delete_file(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmx') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmb-compile.txt') THEN IF webutil_file.delete_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmb-compile.txt') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx') THEN IF webutil_file.delete_file(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx-compile.txt') THEN IF webutil_file.delete_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx-compile.txt') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx') THEN IF webutil_file.delete_file(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx-compile.txt') THEN IF webutil_file.delete_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx-compile.txt') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.err') THEN IF webutil_file.delete_file(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.err') THEN NULL; END IF; END IF; -- 23.02.2017 - F.Matz : FormsAPI Master Compile active -- pkg_FAM_RUN_Script.prc_run_batch_compile_cmd(:BLK_HANDLG.FNAME); prc_Set_Compile_result(:BLK_HANDLG.FNAME); SYNCHRONIZE; prc_Set_Compile_result(:BLK_HANDLG.FNAME); -- 02.03.2017 : nicht gepr?ft -- ELSIF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT IN ('RDF') AND :BLK_HANDLG.STATUS_CHECK <> 'ERROR' AND :BLK_HANDLG.STATUS_MIGRATE <> 'ERROR' THEN IF :PARAMETER.P_REPORTS_RUN='YES' THEN pkg_FAM_RUN_Script.prc_run_batch_comp_reports_cmd(:BLK_HANDLG.FNAME,replace(lower(:BLK_HANDLG.FNAME),'.rdf','.rep')); prc_Set_Compile_result(:BLK_HANDLG.FNAME); END IF; END IF; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__BT_MIGRATE_SINGLE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- 11.02.2017, 14.05.2017 - F.Matz BEGIN prc_MIGRATION; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__BT_SELECT__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- F.Matz: 02.02.2017 DECLARE l_set VARCHAR2(10); BEGIN go_block('BLK_HANDLG'); first_record; IF :BLK_HANDLG.CB='Y' THEN l_set := 'N'; ELSE l_set:= 'Y'; END IF; LOOP :BLK_HANDLG.CB:= l_set; go_block('BLK_HANDLG'); -- ${open} -- pkg_BLK_DATA.prc_update_DATA(NAME_IN(:SYSTEM.CURRENT_BLOCK||'.'||'RNO'), 'BLK_HANDLG'); go_block('BLK_HANDLG'); IF :SYSTEM.LAST_RECORD='TRUE' THEN EXIT; END IF; next_record; SYNCHRONIZE; END LOOP; go_block('BLK_HANDLG'); first_record; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__BT_VIEW_CHECK__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- 11.02.2017 - F.Matz BEGIN prc_view_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-all.log'); EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__BT_VIEW_COMPILE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- 11.02.2017 - F.Matz, 22.02.2017 - .err; 23.02.2017 - deactivated DECLARE l_fname_blank VARCHAR2(128); BEGIN prc_view_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-compile.txt'); EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__BT_VIEW_MIGRATE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- 11.02.2017 - F.Matz BEGIN prc_view_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||lower(:BLK_HANDLG.FNAME)||'-mig_main_one-all.log'); EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__CBOX_FAM_ACTION__WHEN-LIST-CHANGED.tgg ================================================ BEGIN -- 16.01.2017 - F.Matz DECLARE l_action VARCHAR2(128); l_p1 VARCHAR2(1024); l_p2 VARCHAR2(1024); l_p3 VARCHAR2(1024); l_p4 VARCHAR2(1024); l_p5 VARCHAR2(1024); l_p6 VARCHAR2(1024); l_p7 VARCHAR2(1024); BEGIN /* {obsolete} :CTL_UPGR.IT_PARAMETER:= NULL; IF :BLK_UPGR.CBOX_FAM_ACTION IS NOT NULL AND :BLK_UPGR.CB='Y' THEN l_action:= get_list_element_label('BLK_UPGR.CBOX_FAM_ACTION', :BLK_UPGR.CBOX_FAM_ACTION); pkg_FAM_LIBS.prc_get_Parameters4Script(l_action, l_p1, l_p2, l_p3, l_p4, l_p5, l_p6, l_p7); IF l_p1 IS NOT NULL THEN :CTL_UPGR.IT_PARAMETER:= l_p1; prc_Visible_Item('CTL_UPGR.IT_PARAMETER'); ELSE :CTL_UPGR.IT_PARAMETER:= NULL; prc_Visible_Item('CTL_UPGR.IT_PARAMETER', FALSE); END IF; END IF; */ NULL; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__CB__WHEN-CHECKBOX-CHANGED.tgg ================================================ BEGIN BEGIN /* {obsolete} g.p:= 'W-CB-C: BLK_UPGR.CB'; prc_flog('--- ACTION: '||g.p||' ---', p_type=>'DEBUG'); pkg_BLK_DATA.prc_update_DATA(NAME_IN(:SYSTEM.CURRENT_BLOCK||'.'||defs.DBI_RNO), defs.C_BLK_UPGR); prc_flog('--- <<< UPDATE UPGR >>> ---'); pkg_TABLE_DUMP.prc_UPGR_dmp; */ NULL; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/BLK_HANDLG/BLK_HANDLG__POST-QUERY.tgg ================================================ BEGIN BEGIN :BLK_HANDLG.DFILE:= replace(:BLK_HANDLG.DFILE, '-', '.'); END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/CTL_BASIC/CTL_BASIC__BT_ALL__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN ---------------------------------------------------------------------------------- -- F.Matz: 25.01.2017, 20.02.2017 - BO UNIX, 22.02.2017, 26.04.2017, 19.05.2017 ---------------------------------------------------------------------------------- DECLARE l_fname_blank VARCHAR2(128); BEGIN ----------------------------------------------- -- 1.) Configuration -- passive: 19.05.2017 -- ----------------------------------------------- BEGIN -- ablk_Konfiguration clear_message; :PARAMETER.P_START_TIME := fnc_get_timer_value; g.msg_push('W-B-P:BT_ALL: KONFIGURATION'); -- 19.05.2017 -- -- prc_CONFIGURATION; -- SYNCHRONIZE; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END ablk_Konfiguration; ------------------------------------------ -- 2.) Running Checks. -- ------------------------------------------ BEGIN -- ablk_Migration g.msg_push('W-B-P:BT_ALL: CHECKS'); prc_set_Statistik; SYNCHRONIZE; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END ablk_Konfiguration; ------------------------------------------ -- 3.) Running Migration. -- ------------------------------------------ BEGIN -- ablk_Migration g.msg_push('W-B-P:BT_ALL: MIGRATION'); go_block('BLK_HANDLG'); first_record; LOOP prc_MIGRATION; IF :SYSTEM.LAST_RECORD='TRUE' THEN EXIT; END IF; SYNCHRONIZE; next_record; END LOOP; first_record; -- re-query -- g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END ablk_Migration; ------------------------------------------ -- 4.) Running Compiling. -- ------------------------------------------ DECLARE -- ablk_Kompilierung l_fname_blank VARCHAR2(128); BEGIN g.msg_push('W-B-P:BT_ALL: KOMPILIERUNG'); go_block('BLK_HANDLG'); first_record; LOOP prc_COMPILATION; IF :SYSTEM.LAST_RECORD='TRUE' THEN EXIT; END IF; SYNCHRONIZE; next_record; END LOOP; first_record; -- re-query -- prc_show_duration; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END ablk_Kompilierung; END BT_ALL; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/CTL_BASIC/CTL_BASIC__BT_CHECK__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- F.Matz: 25.01.2017 BEGIN clear_message; :PARAMETER.P_START_TIME := fnc_get_timer_value; prc_set_statistik; prc_show_duration; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/CTL_BASIC/CTL_BASIC__BT_COMPILE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- F.Matz: 09.02.2017 DECLARE l_fname_blank VARCHAR2(128); BEGIN clear_message; :PARAMETER.P_START_TIME := fnc_get_timer_value; g.msg_push('W-B-P:BT_MIGRATE'); go_block('BLK_HANDLG'); first_record; LOOP prc_COMPILATION; IF :SYSTEM.LAST_RECORD='TRUE' THEN EXIT; END IF; SYNCHRONIZE; next_record; END LOOP; prc_show_duration; first_record; -- re-query -- g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/CTL_BASIC/CTL_BASIC__BT_CONFIGURE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -------------------------------------------------------------------------- -- F.Matz: 25.01.2017, 20.02.2017 - BO UNIX; 23.02.2107 ADDON => UNIX_dir -- : 20.04.2017, 26.04.2017 -------------------------------------------------------------------------- BEGIN prc_CONFIGURATION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/CTL_BASIC/CTL_BASIC__BT_MIGRATE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- F.Matz: 09.02.2017 BEGIN clear_message; :PARAMETER.P_START_TIME := fnc_get_timer_value; g.msg_push('W-B-P:BT_MIGRATE'); go_block('BLK_HANDLG'); first_record; LOOP prc_MIGRATION; IF :SYSTEM.LAST_RECORD='TRUE' THEN EXIT; END IF; SYNCHRONIZE; next_record; END LOOP; prc_show_duration; first_record; -- re-query -- g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/CTL_INIT/CTL_INIT__BT_CLOSE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- F.Matz: 19.05.2017 -- BEGIN prc_show_init('CLOSE'); :PARAMETER.P_SHOW_INIT:= 'NO'; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/FNC_FILE_EXISTS_HOST.fun ================================================ FUNCTION fnc_File_Exists_HOST(p_fname VARCHAR2) RETURN BOOLEAN IS l_file Text_IO.File_Type; BEGIN l_file := Text_IO.Fopen(p_fname, 'r'); Text_IO.Fclose(l_file); RETURN(TRUE); EXCEPTION WHEN OTHERS THEN RETURN(FALSE); END fnc_File_Exists_HOST; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/FNC_GET_FILE_SEPARATOR.fun ================================================ FUNCTION fnc_get_file_separator RETURN VARCHAR2 IS BEGIN IF :PARAMETER.P_WIN_UNIX='WINDOWS' THEN RETURN('\'); ELSE RETURN('/'); END IF; END fnc_get_file_separator; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/FNC_GET_TIMER_VALUE.fun ================================================ FUNCTION fnc_get_timer_value RETURN VARCHAR2 IS -- 07.03.2017 - F.Matz : DateTime from Middle Tier. BEGIN RETURN (to_char(webutil_clientinfo.get_date_time, 'DD.MM.YYYY HH24:MI:SS')); END fnc_get_timer_value; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/FORMSAPI_WIZARD_2905/MODULE_FEATURES.tgg ================================================ BEGIN /*----------------------------------------------------------------------------- This forms module was developed from Friedhold Matz fmatz.com@gmail.com and contributed from the Cologne Data GmbH, many thanks to Frank Hoffmann. ----------------------------------------------------------------------------- */ NULL; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The module includes following special programming features, final version from 29.Juny 2017 : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # This module works normally without any DB connection. # Triggers and the mostly routines includes a prc_EXCEPTION. # There is a 'message-stack' for reading the EXCEPTION place: thats why following structure exists: BEGIN g.msg_push('block-name-(trigger-name/proc.-name..)'); ->(*) ... g.msg_free; -- it's ok. EXCEPTION prc_EXCEPTION; -- includes the g.msg_pop <-(*) END; # As I described in my blog http://friedhold-matz.blogspot.de/2013/02/forms-11g-alert-prozedur.html the using of message parameter substituing is realized in: - prc_msg - prc_flog . # prc_flog is important for writing a log file in the %userhome% directory # I am using here 'indexed record tables' (associative arrays) directly binded at the quasi DB table block: BLK_HANDLING for reading the directory files, coordinating the button actions and viewing the action states. # For handling the dynamic DOS command lines I am using also the parameter substitution: init_cmd CONSTANT VARCHAR2(1024):= 'CMD /C notepad.exe "${p_file}" '; .. final_cmd:= replace( init_cmd, '${p_file}', p_file ); -- p_file as dynamic parameter .. # The initializing is realized with the config-basis.ini: - intern defined in P_CONFIG_INI_BLANK if P_CONFIG_INI=NULL: placed in the \forms directory - if P_CONFIG_INI IS NOT NULL then is using the config.ini there defined; so you can define your own config.ini with the '&otherparams=p_config_ini=c:\works\myconfing.ini' # short definition of a config.ini: # --- BEGIN of INI File --- [DATABASE] db.connect = scott/tiger@orcl [PATH] formsapi.execute= "C:\FormsAPI_Master_V3.0\FapiMaster.exe" formsapi.scripts = C:\Works\Migr\scripts user.sources_dir = C:\Works\Migr\Sources user.addons_dir = C:\Works\Migr\Addons user.olb = webutil_no_ole.olb workspace.home = C:\migration # workspace.home\workspace.place workspace.place = mydestination\works # --- END of INI File --- # Open tasks: ~~~~~~~~~~~~~ # The module works in the moment as a HOST running module, see P_HOST_CLIENT. The CLIENT running mode is implemented, but the checks are not completed. ----------------------------------------------------------------------------- Hope you enjoy it, Friedhold. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/FORMSAPI_WIZARD_2905/ON-LOGON.tgg ================================================ BEGIN DECLARE -- 07.03.2017 : DateTime from middle tier. -- BEGIN NULL; END ON_LOGON; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/FORMSAPI_WIZARD_2905/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN -- F.Matz: 25.01.2017, 18.05.2017, .., 29.06.2017 (final) DECLARE un VARCHAR2(80); pw VARCHAR2(80); cn VARCHAR2(80); start_timer TIMER; BEGIN g.msg_push('W-N-F-I'); prc_Get_Connect_Info(un,pw,cn); set_window_property('WIN_MAIN', TITLE, :PARAMETER.P_TITLE ||' - ' || :PARAMETER.P_MODULE ||' - Version ' || :PARAMETER.P_MODULE_VERSION ||' - ' || ' ['||un||'@'||nvl(cn,'NULL') ||']' ); -- 08.05.2017 -- start_timer:= CREATE_TIMER('webutil_userhome', 150, NO_REPEAT); --18.05.2017 -- hide_view('CNV_INIT'); g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END W_N_F_I; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/FORMSAPI_WIZARD_2905/WHEN-TIMER-EXPIRED.tgg ================================================ BEGIN -- F.Matz : .., 19.05.2017 DECLARE tm VARCHAR2(30); BEGIN g.msg_push('W-TIMER-EXPIRED'); tm := GET_APPLICATION_PROPERTY(TIMER_NAME); IF tm='WEBUTIL_USERHOME' THEN BEGIN -- 19.05.2017 -- :PARAMETER.P_SHOW_INIT:= 'YES'; prc_CONFIGURATION; EXCEPTION WHEN OTHERS THEN prc_info('$$$ Fehler in der Konfigurierung WEBUTIL - ABBRUCH ! $$$'); EXIT_Form; --- <<< SENSE <<< END ablk_chkwebutil; END IF; -- END 'WEBUTIL_USERHOME' -- g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END W_T_E; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/FORMSAPI_WIZARD_2905/WHEN-WINDOW-CLOSED.tgg ================================================ BEGIN BEGIN g.msg_push('W-W-CLOSED'); IF :SYSTEM.EVENT_WINDOW='WIN_INFO' THEN go_item('CTL_MAIN.CMD_DUMMY'); hide_window('WIN_INFO'); g.msg_free; RETURN; END IF; do_key('exit'); g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END W_W_CLOSED; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/G.pkb ================================================ PACKAGE BODY g IS -- F.Matz: 02.02.107 TYPE t_var_msg IS VARRAY(100) OF VARCHAR2(256); var_msg t_var_msg := t_var_msg('none','none','none','none','none','none','none','none','none','none', 'none','none','none','none','none','none','none','none','none','none', 'none','none','none','none','none','none','none','none','none','none', 'none','none','none','none','none','none','none','none','none','none', 'none','none','none','none','none','none','none','none','none','none', 'none','none','none','none','none','none','none','none','none','none', 'none','none','none','none','none','none','none','none','none','none', 'none','none','none','none','none','none','none','none','none','none', 'none','none','none','none','none','none','none','none','none','none', 'none','none','none','none','none','none','none','none','none','none'); C_MAX_VAR CONSTANT NUMBER(4):=100; m_ix PLS_INTEGER:=1; m_cntw PLS_INTEGER:=0; m_cntr PLS_INTEGER:=0; PROCEDURE msg_push(p_msg VARCHAR2) IS BEGIN var_msg(m_ix):= p_msg; IF m_ix=C_MAX_VAR THEN m_ix:=0; -- loop END IF; m_ix:= m_ix+1; -- ix at next free ! var_msg(m_ix):= 'none'; m_cntw:= m_cntw+1; END msg_push; FUNCTION msg_pop_chk RETURN BOOLEAN IS l_ix NUMBER(4); l_msg VARCHAR2(256); BEGIN l_ix:= m_ix; IF l_ix=1 THEN l_msg:= var_msg(C_MAX_VAR); ELSE l_msg:= var_msg(l_ix-1); END IF; RETURN(l_msg<>'none'); END msg_pop_chk; FUNCTION msg_pop RETURN VARCHAR2 IS l_msg VARCHAR(256); BEGIN IF m_ix=1 THEN l_msg:= var_msg(C_MAX_VAR); var_msg(C_MAX_VAR):= 'none'; m_ix:= C_MAX_VAR; ELSE m_ix:= m_ix-1; l_msg:= var_msg(m_ix); var_msg(m_ix):= 'none'; END IF; RETURN(l_msg); END msg_pop; PROCEDURE msg_free IS l_msg VARCHAR(256); BEGIN IF m_ix=1 THEN l_msg:= var_msg(C_MAX_VAR); var_msg(C_MAX_VAR):= 'none'; m_ix:= C_MAX_VAR; ELSE m_ix:= m_ix-1; l_msg:= var_msg(m_ix); var_msg(m_ix):= 'none'; END IF; RETURN; -- dummy pop -- END msg_free; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/G.pks ================================================ PACKAGE g IS -- F.Matz: 02.02.2017, 18.05.2017 -- -- Package forr globals. -- rstate VARCHAR2(32):= 'INIT'; result VARCHAR2(64):= ''; rcnt NUMBER(2); show_state VARCHAR2(32); p VARCHAR2(256) := 'Init in Package g'; state VARCHAR2(20) := 'OK'; -- Global FormsAPI State -- state_last_msg VARCHAR2(1024) := ''; -- not used - -- error_no VARCHAR2(5); error_code VARCHAR2(10); C_VLIGHTPOC CONSTANT VARCHAR2(20):= 'Light-PoC'; C_VLIGHT CONSTANT VARCHAR2(20):= 'Light'; C_VENTERPRISE CONSTANT VARCHAR2(20):= 'Enterprise'; PROCEDURE msg_push (p_msg VARCHAR2); FUNCTION msg_pop_chk RETURN BOOLEAN; FUNCTION msg_pop RETURN VARCHAR2; PROCEDURE msg_free; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PKG_BLK_DATA.pkb ================================================ PACKAGE BODY pkg_blk_data IS -- F.Matz: 02.02.2017, 20.04.2017, 27.04.2017 C_cmd_read_dir_HOST CONSTANT VARCHAR2(256):= 'dir ${p_directory} /O:N /A:-D > ${p_script_dir}\dir-list.txt'; m_run_cmd_read_dir_HOST VARCHAR2(4098); m_log CONSTANT BOOLEAN := FALSE; ------------------------------------------------------------------------------------------------------- PROCEDURE prc_iflog (p_log VARCHAR2, p_1 VARCHAR2 DEFAULT NULL, p_2 VARCHAR2 DEFAULT NULL, p_3 VARCHAR2 DEFAULT NULL, p_4 VARCHAR2 DEFAULT NULL, p_5 VARCHAR2 DEFAULT NULL, p_msg2 VARCHAR2 DEFAULT '.', p_TYPE VARCHAR2 DEFAULT 'INFO') IS BEGIN IF m_log THEN prc_flog(p_log, p_1, p_2, p_3, p_4, p_5, p_msg2, p_TYPE); END IF; END prc_iflog; ------------------------------------------------------------------------------------------------------- -- 27.04.2017 -- PROCEDURE prc_wrt_CMD(p_cmd_name VARCHAR2, p_script VARCHAR2) IS l_io_file Text_IO.File_Type; l_io_file_C client_Text_IO.File_Type; BEGIN g.msg_push('pkg_blk_data.prc_wrt_CMD'); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN SYNCHRONIZE; l_io_file := Text_IO.Fopen(:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||p_cmd_name, 'w'); Text_IO.put_line(l_io_file, p_script); Text_IO.fclose (l_io_file); SYNCHRONIZE; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN SYNCHRONIZE; l_io_file_C:= client_Text_IO.Fopen(:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||p_cmd_name, 'w'); client_Text_IO.put_line(l_io_file_C, p_script); client_Text_IO.fclose(l_io_file_C); SYNCHRONIZE; END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_wrt_CMD; -------------------------------------------------------------------------------------------------------- PROCEDURE prc_get_from_directory IS BEGIN NULL; END prc_get_from_directory; -------------------------------------------------------------------------------------------------------- PROCEDURE prc_HANDLG_tableid2name (p_id NUMBER) IS l_name VARCHAR2(128); BEGIN g.msg_push('pkg_BLOCK_TABLE.prc_HANDLG_tableid2name'); l_name:= pkg_BLK_DATA.HANDLG_byid(p_id).FNAME; pkg_BLK_DATA.HANDLG_byname(l_name).PNO := pkg_BLK_DATA.HANDLG_byid(p_id).PNO; pkg_BLK_DATA.HANDLG_byname(l_name).RNO := pkg_BLK_DATA.HANDLG_byid(p_id).RNO; pkg_BLK_DATA.HANDLG_byname(l_name).FNAME := pkg_BLK_DATA.HANDLG_byid(p_id).FNAME; pkg_BLK_DATA.HANDLG_byname(l_name).FEXTENT := pkg_BLK_DATA.HANDLG_byid(p_id).FEXTENT; pkg_BLK_DATA.HANDLG_byname(l_name).FSIZE := pkg_BLK_DATA.HANDLG_byid(p_id).FSIZE; pkg_BLK_DATA.HANDLG_byname(l_name).DFILE := pkg_BLK_DATA.HANDLG_byid(p_id).DFILE; pkg_BLK_DATA.HANDLG_byname(l_name).FORMS_OBJ_VNO := pkg_BLK_DATA.HANDLG_byid(p_id).FORMS_OBJ_VNO; pkg_BLK_DATA.HANDLG_byname(l_name).FAM_VERSION := pkg_BLK_DATA.HANDLG_byid(p_id).FAM_VERSION; pkg_BLK_DATA.HANDLG_byname(l_name).FSTATUS := pkg_BLK_DATA.HANDLG_byid(p_id).FSTATUS; pkg_BLK_DATA.HANDLG_byname(l_name).FMESSAGE := pkg_BLK_DATA.HANDLG_byid(p_id).FMESSAGE; pkg_BLK_DATA.HANDLG_byname(l_name).CB := pkg_BLK_DATA.HANDLG_byid(p_id).CB; pkg_BLK_DATA.HANDLG_byname(l_name).STATUS := pkg_BLK_DATA.HANDLG_byid(p_id).STATUS; pkg_BLK_DATA.HANDLG_byname(l_name).TYPE := pkg_BLK_DATA.HANDLG_byid(p_id).TYPE; pkg_BLK_DATA.HANDLG_byname(l_name).OPERAT := pkg_BLK_DATA.HANDLG_byid(p_id).OPERAT; pkg_BLK_DATA.HANDLG_byname(l_name).MSG := pkg_BLK_DATA.HANDLG_byid(p_id).MSG; pkg_BLK_DATA.HANDLG_byname(l_name).RESULT := pkg_BLK_DATA.HANDLG_byid(p_id).RESULT; pkg_BLK_DATA.HANDLG_byname(l_name).SPECIAL := pkg_BLK_DATA.HANDLG_byid(p_id).SPECIAL; pkg_BLK_DATA.HANDLG_byname(l_name).HISTORY := pkg_BLK_DATA.HANDLG_byid(p_id).HISTORY; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_HANDLG_tableid2name; -------------------------------------------------------------------------------------------------------- PROCEDURE prc_param2table(p_block VARCHAR2, p_pno VARCHAR2, p_id NUMBER, p_fname VARCHAR2, p_fextend VARCHAR2, p_fsize NUMBER, p_status VARCHAR2, p_user VARCHAR2 ) IS l_date VARCHAR2(32); BEGIN g.msg_push('pkg_BLK_DATA.prc_param2table'); prc_iflog('--- pkg_BLK_DATA.prc_param2table: HANDLG : '||p_fname||' ---', p_type=>'DEBUG'); l_date := webutil_clientinfo.get_date_time; pkg_BLK_DATA.HANDLG_byid(p_id).PNO := :PARAMETER.P_PNO; pkg_BLK_DATA.HANDLG_byid(p_id).RNO := p_id; pkg_BLK_DATA.HANDLG_byid(p_id).FNAME := p_fname; pkg_BLK_DATA.HANDLG_byid(p_id).FEXTENT := p_fextend; pkg_BLK_DATA.HANDLG_byid(p_id).FSIZE := p_fsize; pkg_BLK_DATA.HANDLG_byid(p_id).REC_STATUS := 'I'; pkg_BLK_DATA.HANDLG_byid(p_id).REC_USER := :PARAMETER.P_USER; pkg_BLK_DATA.HANDLG_byid(p_id).REC_DREAD := NULL; -- marking: INSERT pkg_BLK_DATA.HANDLG_byid(p_id).REC_DUPDATE := l_date; pkg_BLK_DATA.HANDLG_byid(p_id).REC_DCREATED := l_date; pkg_BLK_DATA.HANDLG_byid(p_id).CB := 'Y'; prc_HANDLG_tableid2name(p_id); g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_param2table; -------------------------------------------------------------------------------------------------------- PROCEDURE prc_table2block(p_id NUMBER, p_block VARCHAR2) IS l_ix NUMBER(4); BEGIN g.msg_push('pkg_BLOCK_TABLE.prc_table2block'); prc_iflog('--- pkg_BLOCK_TABLE.prc_table2block: HANDLG : '||p_id||' / '||p_block||' ---', p_type=>'DEBUG'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).PNO, p_block||'.'||'PNO'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).RNO, p_block||'.'||'RNO'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).FNAME, p_block||'.'||'FNAME'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).FEXTENT, p_block||'.'||'FEXTENT'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).FSIZE, p_block||'.'||'FSIZE'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).DFILE, p_block||'.'||'DFILE'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).FORMS_OBJ_VNO, p_block||'.'||'FORMS_OBJ_VNO'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).FAM_VERSION, p_block||'.'||'FAM_VERSION'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).FSTATUS, p_block||'.'||'FSTATUS'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).FMESSAGE, p_block||'.'||'FMESSAGE'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).CB, p_block||'.'||'CB'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).STATUS, p_block||'.'||'STATUS'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).TYPE, p_block||'.'||'TYPE'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).OPERAT, p_block||'.'||'OPERAT'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).MSG, p_block||'.'||'MSG'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).RESULT, p_block||'.'||'RESULT'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).SPECIAL, p_block||'.'||'SPECIAL'); COPY(pkg_BLK_DATA.HANDLG_byid(p_id).HISTORY, p_block||'.'||'HISTORY'); END prc_table2block; -------------------------------------------------------------------------------------------------------- PROCEDURE prc_exec_from_directory(p_data_type VARCHAR2, p_path VARCHAR2, p_fextend VARCHAR2 DEFAULT '*.fmb') IS l_file_list webutil_file.file_list; l_date VARCHAR2(32); l_temp_text VARCHAR2(1000); l_fname VARCHAR2(256); l_fsize NUMBER(12); l_fextent VARCHAR2(3); l_fselect BOOLEAN; l_rno NUMBER(4); l_cbselcnt NUMBER(4); l_source_dir VARCHAR2(2048); l_data_blk VARCHAR2(32):= 'BLK_HANDLG'; --l_data_ix NUMBER(2); BEGIN g.msg_push('pkg_BLK_DATA.prc_exec_from_directory'); l_source_dir := p_path; l_file_list := webutil_file.directory_filtered_list(l_source_dir, '*.*', TRUE); go_block( l_data_blk ); clear_block; first_record; -- INSERT - loop : New data's ! -- l_rno:=1; prc_iflog('--- pkg_BLK_DATA.prc_exec_from_directory ---'); FOR i IN 1 .. l_file_list.count LOOP l_fname := l_file_list(i); -- FH 4.3.2017 if instr(lower(l_fname),'.rdf',1,1) > 0 or instr(lower(l_fname),'.fmb',1,1) > 0 or instr(lower(l_fname),'.pll',1,1) > 0 or instr(lower(l_fname),'.mmb',1,1) > 0 then l_fextent := lower(substr(l_fname, instr(l_fname,'.')+1, 3)); l_fsize := replace(webutil_file.file_size(l_source_dir||:PARAMETER.P_FILE_SEPARATOR||l_fname), ',', '.'); prc_param2table( l_data_blk, :PARAMETER.P_PNO, l_rno, l_fname, UPPER(l_fextent), l_fsize, 'I', :PARAMETER.P_USER ); prc_table2block(l_rno, l_data_blk); end if; l_rno:= l_rno+1; IF i0 THEN swap; l_res:= wsp; IF l_res='SECTION' THEN l_section:= section; --prc_info(l_section); ELSIF l_res='TOKE' THEN keyvalue(l_key, l_value); --prc_info(l_key||' : '||l_value); IF l_section='DATABASE' THEN CASE l_key WHEN 'db.connect' THEN :PARAMETER.P_DB_CONNECT := l_value; END CASE; END IF; IF l_section='PATH' THEN CASE l_key WHEN 'formsapi.execute' THEN :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE := l_value; WHEN 'formsapi.scripts' THEN :PARAMETER.P_CONFIG_FORMSAPI_SCRIPTS := l_value; WHEN 'user.sources_dir' THEN :PARAMETER.P_CONFIG_USER_SOURCES := l_value; WHEN 'user.addons_dir' THEN :PARAMETER.P_CONFIG_USER_ADDONS := l_value; WHEN 'user.olb' THEN :PARAMETER.P_CONFIG_OLB_FILE := l_value; WHEN 'workspace.home' THEN :PARAMETER.P_CONFIG_HOME := l_value; WHEN 'workspace.place' THEN :PARAMETER.P_CONFIG_PLACE := l_value; END CASE; END IF; END IF; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN Text_IO.Fclose(l_in_File); prc_info(sqlerrm); EXIT; EXIT; END ; END LOOP; --prc_iflog('--- db.connect: '|| :PARAMETER.P_DB_CONNECT); --prc_iflog('--- formsapi.execute: '|| :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE); --prc_iflog('--- formsapi.scripts: '|| :PARAMETER.P_CONFIG_FORMSAPI_SCRIPTS); --prc_iflog('--- user.sources_dir: '|| :PARAMETER.P_CONFIG_USER_SOURCES); --prc_iflog('--- user.addons_dir: '|| :PARAMETER.P_CONFIG_USER_ADDONS); --prc_iflog('--- user.olb: '|| :PARAMETER.P_CONFIG_OLB_FILE); --prc_iflog('--- workspace.home: '|| :PARAMETER.P_CONFIG_HOME); --prc_iflog('--- workspace.place: '|| :PARAMETER.P_CONFIG_PLACE); EXCEPTION WHEN OTHERS THEN NULL; -- ignore -- END prc_get_config; ------------------------------------------------------------------------------------------------------- END pkg_CONFIG; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PKG_CONFIG.pks ================================================ PACKAGE pkg_CONFIG IS -- F.Matz: 15.01.2017, 26.04.2017 -- PROCEDURE prc_create_DIRS; PROCEDURE prc_create_DIRS_HOST; PROCEDURE prc_set_Config_INI; PROCEDURE prc_get_config(p_fname VARCHAR2); PROCEDURE prc_set_Config_INI_Source(p_srcfile VARCHAR2); PROCEDURE prc_Copy_Dir(p_srcdir VARCHAr2, p_destdir VARCHAR2); PROCEDURE prc_Copy_Dir_HOST(p_srcdir VARCHAR2, p_destdir VARCHAR2); PROCEDURE prc_Copy_Dir_RDF(p_srcdir VARCHAR2, p_destdir VARCHAR2); PROCEDURE prc_Copy_Dir_RDF_HOST(p_srcdir VARCHAR2, p_destdir VARCHAR2); END pkg_CONFIG; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PKG_FAM_RUN_SCRIPT.pkb ================================================ PACKAGE BODY pkg_FAM_run_Script IS -- F.Matz: 15.01.2017 / 10.02.2017 / FH 4.3.2017 / FM 22.03.2017 -- C_SCRIPT_ONE_UPGR) := 'CMD /C call ${p_formsapi_home} /SCRIPT /API=11g /RUN="${p_wsp_prj_scripts_upgr}\${p_script_name}" '; --/INFILES="${p_wsp_prj_souces}\${p_srcfile}" /DEBUGLOG="${p_wsp_logs_upgr}\${p_srcfile}.log" '; C_BATCH_VERSION_def CONSTANT VARCHAR2(2048) := '${p_config_formsapi_execute} /BATCH /MODE=CHECKVERSION /FILES="${p_source_dir}\${p_srcfile}" /TARGETDIR="${p_script_dir}" /OUT="${p_script_dir}\check.txt" '; C_FAM_SCRIPT_chkref CONSTANT VARCHAR2(2048):= 'DECLARE frm : number; // --- Main BEGIN logadd(\''--- BO Start Check - Subclass References ---\''); API_IgnoreMissingReferences(false); try frm := API_LoadModule(\''${p_source_dir}\${p_srcfile}\''); except logadd(\''$$$ EXCEPTION: Fehler beim Modul Laden - Subclassing ? $$$\''); RETURN; end; logadd(\''--- EO Start Check - Subclass References ---\''); API_DestroyModule(frm); END; // --- Main '; -- check 'references' script -- C_CMD_RUN_SCRIPT_chkref CONSTANT VARCHAR2(2048):= 'SET FORMS_PATH=${p_source_dir}'||chr(10)|| 'CD ${p_addon_dir}'||chr(10)|| '"${p_config_formsapi_execute}" /SCRIPT /API=12c /RUN="${p_script_dir}\${p_script_name}" '; -- migration scripts -- C_CMD_RUN_SCRIPT_def_mig CONSTANT VARCHAR2(2048):= '${p_source_network}'||chr(10)|| 'CD ${p_addon_dir}'||chr(10)|| '"${p_config_formsapi_execute}" /SCRIPT /API=12c /RUN="${p_script_dir}\${p_script_name}" '; -- migration scripts -- C_CMD_RUN_SCRIPT_def_win2unix CONSTANT VARCHAR2(2048):= 'SET FORMS_PATH=${p_addon_dir}'||chr(10)|| '"${p_config_formsapi_execute}" /SCRIPT /API=12c /RUN="${p_script_dir}\${p_script_name}" '; -- Migration -- cmd /c call %cddir_installfam% /script /API=11g /HOMES="c:\oracle\weblogic1036\Oracle_FRHome1\BIN" /RUN=%cddir_skripte%\mig_main_one.p2s /LOG=%cddir_skripte%\log_migration_one_fmb.txt -- echo Win2Unix Verarbeitung -- c: -- cd %cddir% -- cmd /c call %cddir_installfam% /script /API=11g /HOMES="c:\oracle\weblogic1036\Oracle_FRHome1\BIN" /RUN=%cddir_skripte%\mig_Win2Unix_one.p2s /LOG=%cddir_skripte%\log_win2unix_one.txt C_BATCH_COMPILE_def CONSTANT VARCHAR2(2048):= '${p_source_network}'||chr(10)|| 'CD ${p_addon_dir}'||chr(10)|| '${p_config_formsapi_execute} /BATCH /MODE=COMPILE /COMPILEALL=Y /USERID="${p_db_connect}" /FILES="${p_unix_dir}\${p_srcfile}" /TARGETDIR="${p_comp_dir}" /OUT="${p_log_dir}\${p_log_file}" '; C_BATCH_FORMS_COMPILE_def CONSTANT VARCHAR2(2048):= '${p_source_network}'||chr(10)|| 'CD ${p_addon_dir}'||chr(10)|| 'frmcmp "${p_unix_dir}\${p_srcfile}" userid=${p_db_connect} module_type=${p_type} batch=yes window_state=minimize output_file="${p_comp_dir}\${p_compfile}" compile_all=yes'; C_BATCH_REPORTS_COMPILE_def CONSTANT VARCHAR2(2048):= '${p_source_network}'||chr(10)|| 'CD ${p_addon_dir}'||chr(10)|| 'rwconverter userid=${p_db_connect} stype=RDFFILE source="${p_unix_dir}\${p_srcfile}" dest="${p_comp_dir}\${p_compfile}" dtype=REPFILE overwrite=YES compile_all=yes batch=YES'; m_CMD_RUN_chkref VARCHAR2(2048); m_CMD_RUN_SCRIPT VARCHAR2(2048); m_FAM_SCRIPT_chkref VARCHAR2(4096); m_BATCH_VERSION_run VARCHAR2(2048); m_BATCH_COMPILE_run VARCHAR2(4096); m_log CONSTANT BOOLEAN := FALSE; ------------------------------------------------------------------------------------------------------- PROCEDURE prc_iflog (p_log VARCHAR2, p_1 VARCHAR2 DEFAULT NULL, p_2 VARCHAR2 DEFAULT NULL, p_3 VARCHAR2 DEFAULT NULL, p_4 VARCHAR2 DEFAULT NULL, p_5 VARCHAR2 DEFAULT NULL, p_msg2 VARCHAR2 DEFAULT '.', p_TYPE VARCHAR2 DEFAULT 'INFO') IS BEGIN IF m_log THEN prc_flog(p_log, p_1, p_2, p_3, p_4, p_5, p_msg2, p_TYPE); END IF; END prc_iflog; ------------------------------------------------------------------------------------------------------- PROCEDURE prc_wrt_CMD(p_cmd_name VARCHAR2, p_script VARCHAR2) IS l_io_file Text_IO.File_Type; l_io_file_C client_Text_IO.File_Type; BEGIN g.msg_push('pkg_run_FAM_script.prc_wrt_CMD'); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN SYNCHRONIZE; l_io_file := Text_IO.Fopen(:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||p_cmd_name, 'w'); Text_IO.put_line(l_io_file, p_script); Text_IO.fclose (l_io_file); SYNCHRONIZE; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN SYNCHRONIZE; l_io_file_C := client_Text_IO.Fopen(:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||p_cmd_name, 'w'); client_Text_IO.put_line(l_io_file_C, p_script); client_Text_IO.fclose (l_io_file_C); SYNCHRONIZE; END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_wrt_CMD; ------------------------------------------------------------------------------------------------------- PROCEDURE prc_run_batch_version_cmd (p_srcfile VARCHAR2) IS -- p_batch : dummy . BEGIN g.msg_push('pkg_FAM_run_Script.prc_run_batch_version_cmd'); -- save actual source file -- :PARAMETER.P_SOURCE_FILE:= p_srcfile; m_BATCH_VERSION_run:= C_BATCH_VERSION_def; m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_source_network}', substr(:PARAMETER.P_ADDON_DIR,1,2)); m_BATCH_VERSION_run:= replace(m_BATCH_VERSION_run, '${p_config_formsapi_execute}', :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE); m_BATCH_VERSION_run:= replace(m_BATCH_VERSION_run, '${p_srcfile}', p_srcfile); m_BATCH_VERSION_run:= replace(m_BATCH_VERSION_run, '${p_source_dir}', :PARAMETER.P_SOURCE_DIR); m_BATCH_VERSION_run:= replace(m_BATCH_VERSION_run, '${p_script_dir}', :PARAMETER.P_SCRIPT_DIR); prc_iflog('--- BO SCRIP-CHECK : '|| m_BATCH_VERSION_run); -- 22.03.2017 / 26.04.2017 -- IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN WEBUTIL_HOST.BLOCKING( m_BATCH_VERSION_run ); ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN HOST( m_BATCH_VERSION_run, NO_SCREEN ); END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_run_batch_version_cmd; ---------------------------------------------------------------------------------------------------------------------------- --- ACHTUNG: SOURCE-DIR := UNIX-DIR !!! <<<<<<<<<<<<<<<<<<< ----------------------------------------------------------- PROCEDURE prc_run_batch_comp_forms_cmd (p_srcfile VARCHAR2, p_compfile VARCHAR2, p_type VARCHAR2 DEFAULT 'FORM') IS -- p_batch : dummy . BEGIN g.msg_push('pkg_FAM_run_Script.prc_run_batch_compile_forms_cmd'); -- save actual source file -- :PARAMETER.P_SOURCE_FILE:= p_srcfile; ------------------- BO - write BATCH --------------------- m_BATCH_COMPILE_run:= C_BATCH_FORMS_COMPILE_def; -- m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_config_formsapi_execute}', :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_source_network}', substr(:PARAMETER.P_ADDON_DIR,1,2)); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_source_dir}', :PARAMETER.P_UNIX_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_addon_dir}', :PARAMETER.P_ADDON_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_srcfile}', p_srcfile); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_unix_dir}', :PARAMETER.P_UNIX_DIR); -- m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_script_dir}', :PARAMETER.P_SCRIPT_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_db_connect}', :PARAMETER.P_DB_CONNECT); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_comp_dir}', :PARAMETER.P_COMP_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_compfile}', p_compfile); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_type}', p_type); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_log_dir}', :PARAMETER.P_LOG_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_log_file}', p_srcfile||'-compile.txt'); prc_wrt_CMD('do_forms_compile.cmd', m_BATCH_COMPILE_run); SYNCHRONIZE; -- ??? -- ------------------- EO - write BATCH --------------------- prc_iflog('--- BO BATCH-COMPILE : '|| m_BATCH_COMPILE_run); -- 22.03.2017 -- IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN WEBUTIL_HOST.BLOCKING( 'CMD /C call ' || :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'do_forms_compile.cmd' ); ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN HOST('CMD /C call ' || :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'do_forms_compile.cmd' , NO_SCREEN ); END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_run_batch_comp_forms_cmd; ------------------------------------------------------------------------------------------------------- PROCEDURE prc_run_batch_comp_reports_cmd (p_srcfile VARCHAR2, p_compfile VARCHAR2, p_type VARCHAR2 DEFAULT 'REPORTS') IS -- p_batch : dummy . BEGIN g.msg_push('pkg_FAM_run_Script.prc_run_batch_compile_reports_cmd'); -- save actual source file -- :PARAMETER.P_SOURCE_FILE:= p_srcfile; ------------------- BO - write BATCH --------------------- m_BATCH_COMPILE_run:= C_BATCH_REPORTS_COMPILE_def; -- m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_config_formsapi_execute}', :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_source_network}', substr(:PARAMETER.P_ADDON_DIR,1,2)); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_source_dir}', :PARAMETER.P_UNIX_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_addon_dir}', :PARAMETER.P_ADDON_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_srcfile}', p_srcfile); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_unix_dir}', :PARAMETER.P_UNIX_DIR); -- m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_script_dir}', :PARAMETER.P_SCRIPT_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_db_connect}', :PARAMETER.P_DB_CONNECT); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_comp_dir}', :PARAMETER.P_COMP_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_compfile}', p_compfile); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_type}', p_type); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_log_dir}', :PARAMETER.P_LOG_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_log_file}', p_srcfile||'-compile.txt'); prc_wrt_CMD('do_reports_compile.cmd', m_BATCH_COMPILE_run); SYNCHRONIZE; -- ??? -- ------------------- EO - write BATCH --------------------- prc_iflog('--- BO BATCH-COMPILE : '|| m_BATCH_COMPILE_run); -- 22.03.2017 -- IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN WEBUTIL_HOST.BLOCKING( 'CMD /C call ' || :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'do_reports_compile.cmd' ); ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN HOST('CMD /C call ' || :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'do_reports_compile.cmd' , NO_SCREEN ); END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_run_batch_comp_reports_cmd; ---------------------------------------------------------------------------------------------------------------------------- --- ACHTUNG: SOURCE-DIR := UNIX-DIR !!! <<<<<<<<<<<<<<<<<<< ----------------------------------------------------------- PROCEDURE prc_run_batch_compile_cmd (p_srcfile VARCHAR2) IS -- p_batch : dummy . BEGIN g.msg_push('pkg_FAM_run_Script.prc_run_batch_compile_cmd'); -- save actual source file -- :PARAMETER.P_SOURCE_FILE:= p_srcfile; ------------------- BO - write BATCH --------------------- m_BATCH_COMPILE_run:= C_BATCH_COMPILE_def; m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_source_network}', substr(:PARAMETER.P_ADDON_DIR,1,2)); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_config_formsapi_execute}', :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_source_dir}', :PARAMETER.P_UNIX_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_addon_dir}', :PARAMETER.P_ADDON_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_srcfile}', p_srcfile); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_unix_dir}', :PARAMETER.P_UNIX_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_script_dir}', :PARAMETER.P_SCRIPT_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_db_connect}', :PARAMETER.P_DB_CONNECT); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_comp_dir}', :PARAMETER.P_COMP_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_log_dir}', :PARAMETER.P_LOG_DIR); m_BATCH_COMPILE_run:= replace(m_BATCH_COMPILE_run, '${p_log_file}', p_srcfile||'-compile.txt'); prc_wrt_CMD('do_compile.cmd', m_BATCH_COMPILE_run); SYNCHRONIZE; ------------------- EO - write BATCH --------------------- prc_iflog('--- BO BATCH-COMPILE : '|| m_BATCH_COMPILE_run); -- 22.03.2017 -- IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN WEBUTIL_HOST.BLOCKING( 'CMD /C call ' || :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'do_compile.cmd' ); ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN HOST( 'CALL '||:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'do_compile.cmd' , NO_SCREEN ); END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_run_batch_compile_cmd; ---------------------------------------------------------------------------------------------------------------------------- PROCEDURE prc_run_FAM_check_script(p_srcfile VARCHAR2) IS BEGIN g.msg_push('pkg_run_FAM_script.prc_run_FAM_check_script'); -- save actual source file -- :PARAMETER.P_SOURCE_FILE:= p_srcfile; ------------------- BO - write SCRIPT --------------------- m_FAM_SCRIPT_chkref:= C_FAM_SCRIPT_chkref; m_FAM_SCRIPT_chkref:= replace(C_FAM_SCRIPT_chkref, '\''', ''''); m_FAM_SCRIPT_chkref:= replace(m_FAM_SCRIPT_chkref, '${p_source_dir}',:PARAMETER.P_SOURCE_DIR); m_FAM_SCRIPT_chkref:= replace(m_FAM_SCRIPT_chkref, '${p_srcfile}',p_srcfile); prc_wrt_CMD('check-ref.p2s', m_FAM_SCRIPT_chkref); ------------------- EO - write SCRIPT --------------------- ------------------- BO - write CMD ------------------------ m_CMD_RUN_chkref:= C_CMD_RUN_SCRIPT_chkref; --- 1.) set FORMS_PATH ! then check references ! -- m_CMD_RUN_chkref:= replace(m_CMD_RUN_chkref, '${p_source_dir}',:PARAMETER.P_SOURCE_DIR); m_CMD_RUN_chkref:= replace(m_CMD_RUN_chkref, '${p_addon_dir}',:PARAMETER.P_ADDON_DIR); m_CMD_RUN_chkref:= replace(m_CMD_RUN_chkref, '${p_srcfile}',p_srcfile); -- 2.) set & write CMD -- m_CMD_RUN_chkref:= replace(m_CMD_RUN_chkref, '${p_config_formsapi_execute}', :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE); m_CMD_RUN_chkref:= replace(m_CMD_RUN_chkref, '${p_script_dir}', :PARAMETER.P_SCRIPT_DIR); m_CMD_RUN_chkref:= replace(m_CMD_RUN_chkref, '${p_script_name}', 'check-ref.p2s'); --prc_info(m_CMD_RUN_chkref); prc_wrt_CMD('check-ref.cmd', m_CMD_RUN_chkref); SYNCHRONIZE; ------------------- EO - write CMD ------------------------ -- 3.) run CMD -- prc_iflog('--- BO SCRIPT-CHECK-REF : '||m_CMD_RUN_chkref); -- 22.03.2017 /26.04.2017 -- IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN WEBUTIL_HOST.BLOCKING( 'CMD /C CALL '||:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.cmd' ); ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN HOST( 'CMD /C CALL '||:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.cmd' , NO_SCREEN ); END IF; prc_iflog('--- EO SCRIPT-CHECK-REF --- '); g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_run_FAM_check_script; ---------------------------------------------------------------------------------------------------------------------------- PROCEDURE prc_run_FAM_script_mig(p_script_name VARCHAR2) IS BEGIN g.msg_push('pkg_run_FAM_script.prc_run_FAM_script_mig'); m_CMD_RUN_SCRIPT:= C_CMD_RUN_SCRIPT_def_mig; -- 1.) set FORMS_PATH -- m_CMD_RUN_SCRIPT:=replace(m_CMD_RUN_SCRIPT, '${p_addon_dir}', :PARAMETER.P_ADDON_DIR); m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_source_dir}', :PARAMETER.P_SOURCE_DIR); m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_source_network}', substr(:PARAMETER.P_ADDON_DIR,1,2)); -- 2.) set & write CMD -- m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_config_formsapi_execute}', :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE); m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_script_dir}', :PARAMETER.P_SCRIPT_DIR); m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_script_name}', p_script_name); prc_wrt_CMD('run_migration_one.cmd', m_CMD_RUN_SCRIPT); SYNCHRONIZE; -- 3.) run CMD -- prc_iflog('--- BO SCRIPT-MIGRATE-ONE : '|| m_CMD_RUN_SCRIPT); -- 22.03.2017 /26.04.2017 -- IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN WEBUTIL_HOST.BLOCKING( 'CMD /C CALL '||:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'run_migration_one.cmd' ); ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN HOST( 'CMD /C CALL '||:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'run_migration_one.cmd' , NO_SCREEN ); END IF; prc_iflog('--- EO SCRIPT-MIGRATE-ONE --- '); g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_run_FAM_script_mig; ---------------------------------------------------------------------------------------------------------------------------- PROCEDURE prc_run_FAM_script_win2unix(p_script_name VARCHAR2) IS BEGIN g.msg_push('pkg_run_FAM_script.prc_run_FAM_script_w2unix'); m_CMD_RUN_SCRIPT:= C_CMD_RUN_SCRIPT_def_win2unix; -- 1.) set FORMS_PATH -- m_CMD_RUN_SCRIPT:=replace(m_CMD_RUN_SCRIPT, '${p_addon_dir}', :PARAMETER.P_ADDON_DIR); m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_source_dir}', :PARAMETER.P_SOURCE_DIR); m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_source_network}', substr(:PARAMETER.P_ADDON_DIR,1,2)); -- 2.) set & write CMD -- m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_config_formsapi_execute}', :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE); m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_script_dir}', :PARAMETER.P_SCRIPT_DIR); m_CMD_RUN_SCRIPT:= replace(m_CMD_RUN_SCRIPT, '${p_script_name}', p_script_name); prc_wrt_CMD('run_win2unix.cmd', m_CMD_RUN_SCRIPT); SYNCHRONIZE; -- 3.) run CMD -- prc_iflog('--- BO SCRIPT-MIGRATE-ONE : '|| m_CMD_RUN_SCRIPT); -- 22.03.2017 /26.04.2017 -- IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN WEBUTIL_HOST.BLOCKING( 'CMD /C CALL '||:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'run_win2unix.cmd' ); ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN HOST( 'CMD /C CALL '||:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'run_win2unix.cmd' , NO_SCREEN ); END IF; prc_iflog('--- EO SCRIPT-MIGRATE-ONE --- '); g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_run_FAM_script_win2unix; --------------------------------------------------------------------------------------------------------------------------------- END pkg_FAM_run_Script; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PKG_FAM_RUN_SCRIPT.pks ================================================ PACKAGE pkg_FAM_run_Script IS -- F.Matz: 15.01.2017 , 21.02.2017 PROCEDURE prc_run_batch_version_cmd (p_srcfile VARCHAR2); PROCEDURE prc_run_batch_comp_forms_cmd (p_srcfile VARCHAR2, p_compfile VARCHAR2, p_type VARCHAR2 DEFAULT 'FORM'); PROCEDURE prc_run_batch_comp_reports_cmd (p_srcfile VARCHAR2, p_compfile VARCHAR2, p_type VARCHAR2 DEFAULT 'REPORTS'); PROCEDURE prc_run_batch_compile_cmd (p_srcfile VARCHAR2); PROCEDURE prc_run_FAM_script_mig(p_script_name VARCHAR2); PROCEDURE prc_run_FAM_script_win2unix(p_script_name VARCHAR2); PROCEDURE prc_run_FAM_check_script(p_srcfile VARCHAR2); PROCEDURE prc_wrt_CMD(p_cmd_name VARCHAR2, p_script VARCHAR2); END pkg_FAM_run_Script; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_ABORT.pcd ================================================ PROCEDURE prc_ABORT IS BEGIN prc_info('$$$ The module is now closed ! $$$'); EXIT_FORM; -- <<< SENSE <<< END prc_ABORT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_CHECK_FAM.pcd ================================================ PROCEDURE prc_Check_FAM IS C_SCRIPT_CHECK CONSTANT VARCHAR2(512) := '${p_formsapi_execute} /SCRIPT /RUN="${p_script_dir}\${p_script_name}" /output="${p_log_dir}"'; C_SCRIPT_CHECK_def CONSTANT VARCHAR2(512):= 'PROGRAM Check_FAM; //Begin Main BEGIN // -- get the current FormsAPI Master Version logadd(\''Version : \''+GetFormsAPIMasterVersionInfo); logadd(\''license Name : \''+getLicenseName ); // -- who is running me? logadd(GetUserName+\''@\''+GetComputerName); // -- what is my script name? logadd(GetScriptName); logadd( \''drives : \''+getDrives ); END. //End Main '; l_script_check VARCHAR2(4096); l_in_file Text_IO.File_Type; l_in_file_C client_Text_IO.File_Type; l_in_buff VARCHAR2(400); l_buff_all VARCHAR2(4000); l_cnt NUMBER(4); l_cmd VARCHAR2(4096); BEGIN g.msg_push('prc_check_FAM'); IF :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE IS NULL THEN prc_ERROR('$$$ FormsAPI Master not found - ABORT ! $$$'); EXIT_FORM; END IF; -- write check script -- prc_write_script(:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-fam.p2s', replace(C_SCRIPT_CHECK_def, '\''', '''')); SYNCHRONIZE; -- set rdy => run -- l_script_check := C_SCRIPT_CHECK; l_script_check:= replace(l_script_check, '${p_formsapi_execute}', :PARAMETER.P_CONFIG_FORMSAPI_EXECUTE); l_script_check:= replace(l_script_check, '${p_script_dir}', :PARAMETER.P_SCRIPT_DIR); l_script_check:= replace(l_script_check, '${p_script_name}', 'check-fam.p2s'); l_script_check:= replace(l_script_check, '${p_log_dir}', :PARAMETER.P_LOG_DIR); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN l_cmd:= 'CMD /C IF EXIST '||:PARAMETER.P_SCRIPT_DIR||'\check-fam.log'||' DEL '||:PARAMETER.P_SCRIPT_DIR||'\check-fam.log'; HOST( l_cmd, NO_SCREEN ); SYNCHRONIZE; pkg_FAM_run_Script.prc_wrt_CMD('do_check_fam.cmd', l_script_check); SYNCHRONIZE; HOST( 'CMD /C CALL '||:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'do_check_fam.cmd', NO_SCREEN); SYNCHRONIZE; --- Read results --- l_cnt:=1; l_buff_all:=''; l_in_file := Text_IO.Fopen(:PARAMETER.P_SCRIPT_DIR||'\check-fam.log', 'r'); LOOP BEGIN Text_IO.get_line(l_in_File, l_in_buff); l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF l_cnt=2 THEN :PARAMETER.P_FORMSAPI_VERSION := substr(l_in_buff, 35, length(l_in_buff)+1-35); ELSIF l_cnt=3 THEN :PARAMETER.P_FORMSAPI_LICENSE:= substr(l_in_buff, 35, length(l_in_buff)+1-35); END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN Text_IO.Fclose(l_in_File); prc_error('$$$ Fehler in prc_Check_FAM: '||sqlerrm); EXIT; EXIT; END ; END LOOP; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN IF webutil_file.file_exists(:PARAMETER.P_SCRIPT_DIR||'\check-fam.log') THEN IF webutil_file.delete_file(:PARAMETER.P_SCRIPT_DIR||'\check-fam.log') THEN NULL; END IF; END IF; pkg_FAM_run_Script.prc_wrt_CMD('do_check_fam.cmd', l_script_check); SYNCHRONIZE; WEBUTIL_HOST.BLOCKING( 'CMD /C CALL '||:PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'do_check_fam.cmd' ); SYNCHRONIZE; --- Read results --- l_cnt:=1; l_buff_all:=''; l_in_file_C := client_Text_IO.Fopen(:PARAMETER.P_SCRIPT_DIR||'\check-fam.log', 'r'); LOOP BEGIN client_Text_IO.get_line(l_in_File_C, l_in_buff); l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF l_cnt=2 THEN :PARAMETER.P_FORMSAPI_VERSION := substr(l_in_buff, 35, length(l_in_buff)+1-35); ELSIF l_cnt=3 THEN :PARAMETER.P_FORMSAPI_LICENSE:= substr(l_in_buff, 35, length(l_in_buff)+1-35); END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN client_Text_IO.Fclose(l_in_File_C); EXIT; WHEN OTHERS THEN client_Text_IO.Fclose(l_in_File_C); prc_error('$$$ Fehler in prc_Check_FAM: '||sqlerrm); EXIT; EXIT; END ; END LOOP; END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_check_FAM; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_CMD_HOST_CLIENT.pcd ================================================ -- 09.03.2017 -- PROCEDURE prc_CMD_HOST_CLIENT(p_command VARCHAR2, p_blocking BOOLEAN DEFAULT TRUE) IS BEGIN CASE WHEN UPPER(:PARAMETER.P_HOST_CLIENT)='HOST' THEN HOST( p_COMMAND, NO_SCREEN ); WHEN UPPER(:PARAMETER.P_HOST_CLIENT)='CLIENT' THEN IF p_blocking THEN WEBUTIL_HOST.BLOCKING( p_command ); ELSE WEBUTIL_HOST.NONBLOCKING( p_command ); END IF; END CASE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_CNG_MONTH_TIME.pcd ================================================ PROCEDURE prc_cng_month_time IS l_time VARCHAR2(32); l_h VARCHAR2(16); l_m VARCHAR2(16); l_mon VARCHAR2(3); BEGIN l_mon:= upper(substr(:BLK_HANDLG.DFILE, 4,3)); IF l_mon = ('JAN') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'JAN', '01'); ELSIF l_mon = ('FEB') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'FEB', '02'); ELSIF l_mon = ('MAR') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'MAR', '03'); ELSIF l_mon = ('MRZ') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'MRZ', '03'); ELSIF l_mon = ('APR') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'APR', '04'); ELSIF l_mon = ('MAI') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'MAI', '05'); ELSIF l_mon = ('MAY') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'MAY', '05'); ELSIF l_mon = ('JUN') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'JUN', '06'); ELSIF l_mon = ('JUL') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'JUL', '07'); ELSIF l_mon = ('AUG') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'AUG', '08'); ELSIF l_mon = ('SEP') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'SEP', '09'); ELSIF l_mon = ('OCT') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'OCT', '10'); ELSIF l_mon = ('OKT') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'OKT', '10'); ELSIF l_mon = ('NOV') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'NOV', '11'); ELSIF l_mon = ('DEC') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'DEC', '12'); ELSIF l_mon = ('DEZ') THEN :BLK_HANDLG.DFILE:= replace( upper(:BLK_HANDLG.DFILE), 'DEZ', '12'); END IF; l_time:= substr( :BLK_HANDLG.DFILE, instr(:BLK_HANDLG.DFILE,' ')+1, length(:BLK_HANDLG.DFILE)-instr(:BLK_HANDLG.DFILE,' ')); l_h:= substr (:BLK_HANDLG.DFILE, instr(:BLK_HANDLG.DFILE,' ')+1, instr(:BLK_HANDLG.DFILE,':')-instr(:BLK_HANDLG.DFILE,' ')-1); IF length(l_h)<2 THEN l_h:= '0'||l_h; END IF; l_m:= substr (:BLK_HANDLG.DFILE, instr(:BLK_HANDLG.DFILE,':')+1, length(:BLK_HANDLG.DFILE)-instr(:BLK_HANDLG.DFILE,':') ); IF length(l_m)<2 THEN l_m:= '0'||l_m; END IF; l_time:= l_h||':'||l_m; :BLK_HANDLG.DFILE:= replace(substr(:BLK_HANDLG.DFILE, 1, instr(:BLK_HANDLG.DFILE,' ')-1)||' '||l_time, '-', '.'); END prc_cng_month_time; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_COMPILATION.pcd ================================================ PROCEDURE prc_COMPILATION IS l_fname_blank VARCHAR2(128); PROCEDURE prc_clear_results IS BEGIN IF webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmx') THEN IF webutil_file.delete_file(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmx') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmb-compile.txt') THEN IF webutil_file.delete_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmb-compile.txt') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx') THEN IF webutil_file.delete_file(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx-compile.txt') THEN IF webutil_file.delete_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx-compile.txt') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx') THEN IF webutil_file.delete_file(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx-compile.txt') THEN IF webutil_file.delete_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx-compile.txt') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.err') THEN IF webutil_file.delete_file(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.err') THEN NULL; END IF; END IF; END prc_clear_results; PROCEDURE prc_clear_results_HOST IS l_cmd VARCHAR2(2048); BEGIN -- HOST( 'IF EXIST '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx'||' DEL '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx', NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmx'|| ' DEL '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmx', NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmb-compile.txt'|| ' DEL '||:PARAMETER.P_LOG_DIR ||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmb-compile.txt', NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx'|| ' DEL '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx', NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx-compile.txt'|| ' DEL '||:PARAMETER.P_LOG_DIR ||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx-compile.txt', NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx'|| ' DEL '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx', NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx-compile.txt'|| ' DEL '||:PARAMETER.P_LOG_DIR ||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx-compile.txt', NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.err'|| ' DEL '||:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.err', NO_SCREEN); END prc_clear_results_HOST; BEGIN l_fname_blank:= substr(:BLK_HANDLG.FNAME, 1, length(:BLK_HANDLG.FNAME)-4); IF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT IN ('FMB', 'PLL', 'MMB') AND :BLK_HANDLG.STATUS_CHECK <> 'ERROR' AND :BLK_HANDLG.STATUS_MIGRATE <> 'ERROR' THEN IF :PARAMETER.P_HOST_CLIENT='HOST' THEN prc_clear_results_HOST; pkg_FAM_RUN_Script.prc_run_batch_compile_cmd(:BLK_HANDLG.FNAME); prc_Set_Compile_result(:BLK_HANDLG.FNAME); SYNCHRONIZE; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN prc_clear_results; pkg_FAM_RUN_Script.prc_run_batch_compile_cmd(:BLK_HANDLG.FNAME); prc_Set_Compile_result(:BLK_HANDLG.FNAME); SYNCHRONIZE; END IF; ELSIF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT IN ('RDF') AND :BLK_HANDLG.STATUS_CHECK <> 'ERROR' AND :BLK_HANDLG.STATUS_MIGRATE <> 'ERROR' THEN IF :PARAMETER.P_REPORTS_RUN='YES' THEN pkg_FAM_RUN_Script.prc_run_batch_comp_reports_cmd(:BLK_HANDLG.FNAME,replace(lower(:BLK_HANDLG.FNAME),'.rdf','.rep')); prc_Set_Compile_result(:BLK_HANDLG.FNAME); END IF; END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_CONFIGURATION.pcd ================================================ PROCEDURE prc_CONFIGURATION IS BEGIN prc_show_init; prc_set_UserHome; SYNCHRONIZE; -- 20.02.2017 / 26.04.2017 - FM - BO UNIX :PARAMETER.P_FILE_SEPARATOR:= fnc_get_file_separator; --- webutil_file.GET_FILE_SEPARATOR; -- 20.02.2017 - F.Matz -- IF :PARAMETER.P_CONFIG_INI IS NOT NULL THEN pkg_Config.prc_get_config(:PARAMETER.P_CONFIG_INI); ELSIF :PARAMETER.P_CONFIG_INI_BLANK IS NOT NULL THEN pkg_Config.prc_get_config(:PARAMETER.P_CONFIG_INI_BLANK); ELSE prc_ERROR('$$$ ERROR: Config.INI not used ! $$$'||chr(10)|| ' - Modul Abort ! - '); EXIT_FORM; --- <<< SENSE <<< END IF; -- 19.05.2017 -- prc_show_init('STEP1', 'Read configuration from config.ini', 'SUCCESS'); IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN pkg_Config.prc_Create_DIRS; -- copy from user.space & fam.scripts to workspace . -- pkg_Config.prc_Copy_Dir( :PARAMETER.P_CONFIG_USER_SOURCES, :PARAMETER.P_SOURCE_DIR ); pkg_Config.prc_Copy_Dir( :PARAMETER.P_CONFIG_USER_ADDONS, :PARAMETER.P_ADDON_DIR ); pkg_Config.prc_Copy_Dir( :PARAMETER.P_CONFIG_FORMSAPI_SCRIPTS, :PARAMETER.P_SCRIPT_DIR ); -- 19.05.2017 -- prc_show_init('STEP2', 'Create directories and copy files', 'SUCCESS'); pkg_BLK_DATA.prc_exec_from_directory('HANDLG', :PARAMETER.P_SOURCE_DIR, '*.*'); -- 19.05.2017 -- prc_show_init('STEP3', 'Read from source directory into block', 'SUCCESS'); ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN pkg_Config.prc_Create_DIRS_HOST; pkg_Config.prc_Copy_Dir_HOST( :PARAMETER.P_CONFIG_USER_SOURCES, :PARAMETER.P_SOURCE_DIR ); pkg_Config.prc_Copy_Dir_HOST( :PARAMETER.P_CONFIG_USER_ADDONS, :PARAMETER.P_ADDON_DIR ); pkg_Config.prc_Copy_Dir_HOST( :PARAMETER.P_CONFIG_FORMSAPI_SCRIPTS, :PARAMETER.P_SCRIPT_DIR ); -- 19.05.2017 -- prc_show_init('STEP2', 'Create directories and copy files', 'SUCCESS'); pkg_BLK_DATA.prc_exec_from_directory_HOST(:PARAMETER.P_SOURCE_DIR); -- 19.05.2017 -- prc_show_init('STEP3', 'Read from source directory into block', 'SUCCESS'); ELSE prc_ERROR('$$$ Parameter HOST / CLIENT NOT defined >>> ABORT ! $$$'); EXIT_FORM; -- <<< SENSE ! END IF; prc_Check_FAM; -- 19.05.2017 -- prc_show_init('STEP4', 'Check script processing of FormsAPI', 'SUCCESS'); EXCEPTION WHEN OTHERS THEN g.result:= '$$$ ERROR in Configuration. $$$'; prc_EXCEPTION; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_COPY_FILE.pcd ================================================ PROCEDURE prc_copy_file(p_srcfile VARCHAR2, p_destfile VARCHAR2) IS l_success BOOLEAN; BEGIN g.msg_push('pkg_Script.prc_DOS_file_copy'); l_success := webutil_file.copy_file(p_srcfile, p_destfile); if l_success then NULL; -- prc_info('Copy of file successfull'); else prc_error('$$$ Copy failed. Source: "' || p_srcfile|| '" nach "' || p_destfile || '" $$$'); end if; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_copy_file; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_COPY_FILE_HOST.pcd ================================================ PROCEDURE PRC_COPY_FILE_HOST(p_srcfile VARCHAR2, p_destfile VARCHAR2) IS l_success BOOLEAN; BEGIN g.msg_push('pkg_Script.prc_DOS_file_copy_HOST'); HOST(' COPY '||p_srcfile||' '||p_destfile, NO_SCREEN ); g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_copy_file_HOST; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_ERROR.pcd ================================================ PROCEDURE prc_error(s VARCHAR2) IS al_button PLS_INTEGER; al_id Alert; BEGIN al_id:= FIND_ALERT('ERROR'); SET_ALERT_PROPERTY(al_id, ALERT_MESSAGE_TEXT, s ); al_button := SHOW_ALERT( al_id ); END prc_error; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_EXCEPTION.pcd ================================================ PROCEDURE prc_EXCEPTION (p_code NUMBER DEFAULT NULL, p_place VARCHAR2 DEFAULT NULL) IS -- F.Matz: 15.01.107 l_place VARCHAR2(256); BEGIN IF p_code IS NOT NULL THEN IF p_place IS NOT NULL THEN -- actual g.p -- g.p := p_place; -- msg stack free ! -- IF g.msg_pop_chk THEN g.msg_free; END IF; END IF; prc_msg(p_code, p_type=>'EXCEPTION'); ELSE -- IF place<> 'none' THEN .. IF g.msg_pop_chk THEN l_place:= g.msg_pop; ELSE l_place:= g.p; END IF; IF ERROR_CODE <> 0 THEN -- prc_info(ERROR_TYPE || '-' || to_char(ERROR_CODE )|| ': ' || ERROR_TEXT); prc_msg( '$$$ {1} in: {2}'||chr(10)||':: {3} - {4}', 'EXCEPTION', l_place , (ERROR_TYPE || '-' || to_char(ERROR_CODE )|| ': ' || ERROR_TEXT), sqlerrm, p_type=>'EXCEPTION' ); ELSE -- prc_alert_exception('$$$ EXCEPTION: Code=0 in '||g.p); prc_msg( '$$$ {1} in: {2}'||chr(10)||':: - {3}', 'EXCEPTION', l_place, -- (ERROR_TYPE || '-' || to_char(ERROR_CODE )|| ': ' || ERROR_TEXT), sqlerrm, p_type=>'EXCEPTION' ); END IF; END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_FILE_MERGE.pcd ================================================ PROCEDURE prc_file_merge(p_first_file VARCHAR2, p_second_file VARCHAR2, p_result_file VARCHAR2, p_title2 VARCHAR2) IS -- F.Matz: 11.02.2017 l_in_file client_Text_IO.File_Type; l_out_file client_Text_IO.File_Type; l_buff VARCHAR2(1024); BEGIN g.msg_push('prc_file_merge'); prc_copy_file(p_first_file, p_result_file); l_in_file := client_Text_IO.Fopen(p_second_file, 'r'); l_out_file := client_Text_IO.Fopen(p_result_file, 'a'); client_Text_IO.put_line(l_out_file,''); client_Text_IO.put_line(l_out_file, p_title2); client_Text_IO.put_line(l_out_file,''); LOOP BEGIN client_Text_IO.get_line(l_in_File, l_buff); EXCEPTION WHEN NO_DATA_FOUND THEN client_Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN client_Text_IO.Fclose(l_in_File); prc_msg('$$$ Fehler in prc_file_merge: '||sqlerrm); EXIT; END ; client_Text_IO.put_line(l_out_file, l_buff); END LOOP; client_Text_IO.Fclose(l_out_file); g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_file_merge; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_FILE_MERGE_HOST.pcd ================================================ PROCEDURE prc_file_merge_HOST(p_first_file VARCHAR2, p_second_file VARCHAR2, p_result_file VARCHAR2, p_title2 VARCHAR2) IS -- F.Matz: 11.02.2017 l_in_file Text_IO.File_Type; l_out_file Text_IO.File_Type; l_buff VARCHAR2(1024); BEGIN g.msg_push('prc_file_merge_HOST'); prc_copy_file_HOST(p_first_file, p_result_file); l_in_file := Text_IO.Fopen(p_second_file, 'r'); l_out_file := Text_IO.Fopen(p_result_file, 'a'); Text_IO.put_line(l_out_file,''); Text_IO.put_line(l_out_file, p_title2); Text_IO.put_line(l_out_file,''); LOOP BEGIN Text_IO.get_line(l_in_File, l_buff); EXCEPTION WHEN NO_DATA_FOUND THEN Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN Text_IO.Fclose(l_in_File); prc_msg('$$$ Fehler in prc_file_merge_HOST: '||sqlerrm); EXIT; END ; Text_IO.put_line(l_out_file, l_buff); END LOOP; Text_IO.Fclose(l_out_file); g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_file_merge_HOST; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_FLOG.pcd ================================================ PROCEDURE prc_flog (p_log VARCHAR2, p_1 VARCHAR2 DEFAULT NULL, p_2 VARCHAR2 DEFAULT NULL, p_3 VARCHAR2 DEFAULT NULL, p_4 VARCHAR2 DEFAULT NULL, p_5 VARCHAR2 DEFAULT NULL, p_msg2 VARCHAR2 DEFAULT '.', p_TYPE VARCHAR2 DEFAULT 'INFO') IS l_out_file Text_IO.File_Type; l_out_file_C client_Text_IO.File_Type; l_msg VARCHAR2(8000); c_l_type CONSTANT VARCHAR2(9):= 'EXCEPTION'; l_type VARCHAR2(9); -- F.Matz: 15.01.2017 / 02.05.2017 BEGIN l_msg:= p_log; l_msg:= replace(l_msg, '{1}', p_1); l_msg:= replace(l_msg, '{2}', p_2); l_msg:= replace(l_msg, '{3}', p_3); l_msg:= replace(l_msg, '{4}', p_4); l_msg:= replace(l_msg, '{5}', p_5); l_msg:= l_msg||' '||p_msg2; l_type:= p_TYPE; l_type:= rpad(l_type, length(c_l_type)); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN l_out_file := Text_IO.Fopen( :PARAMETER.P_USER_HOME ||:PARAMETER.P_FILE_SEPARATOR|| 'Migration-'||replace(substr(webutil_clientinfo.get_date_time,1,8),'.','-')|| --:PARAMETER.P_PNO|| '.log', 'a'); Text_IO.put_line(l_out_file, replace(replace(webutil_clientinfo.get_date_time,' ','-'),':','-')||'['|| -- TO_CHAR(SYSDATE,'DD.MM.YYYY-HH24:MI:SS')||'-'|| webutil_clientinfo.get_user_name||']'|| --:PARAMETER.P_MODULE_SHORT|| '['||substr(l_type,1,5)||']'|| '['||g.p||']::'|| l_msg); Text_IO.Fclose (l_out_file); ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN l_out_file_C := client_Text_IO.Fopen( :PARAMETER.P_USER_HOME ||:PARAMETER.P_FILE_SEPARATOR|| 'Migration-'||replace(substr(webutil_clientinfo.get_date_time,1,8),'.','-')|| --:PARAMETER.P_PNO|| '.log', 'a'); client_Text_IO.put_line(l_out_file_C, replace(replace(webutil_clientinfo.get_date_time,' ','-'),':','-')||'['|| -- TO_CHAR(SYSDATE,'DD.MM.YYYY-HH24:MI:SS')||'-'|| webutil_clientinfo.get_user_name||']'|| --:PARAMETER.P_MODULE_SHORT|| '['||substr(l_type,1,5)||']'|| '['||g.p||']::'|| l_msg); client_Text_IO.Fclose (l_out_file_C); END IF; EXCEPTION WHEN OTHERS THEN prc_error('$$$ EXCEPTION in: prc_flog'||chr(10)||':: '||sqlerrm); END prc_flog; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_GET_CHK_REF_INFO.pcd ================================================ PROCEDURE prc_get_chk_ref_info(p_fn VARCHAR2) IS l_buff VARCHAR2(4096); l_in_file Text_IO.File_Type; l_in_file_C client_Text_IO.File_Type; l_cnt NUMBER(3); BEGIN l_buff:=''; IF :PARAMETER.P_HOST_CLIENT='HOST' THEN l_in_file := Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN Text_IO.get_line(l_in_File, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF INSTR(l_buff, '$$$ EXCEPTION')>0 THEN :BLK_HANDLG.STATUS_CHECK := 'ERROR'; Text_IO.Fclose(l_in_File); EXIT; Else :BLK_HANDLG.STATUS_CHECK := 'SUCCESS'; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN Text_IO.Fclose(l_in_File); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN l_in_file_C := client_Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN client_Text_IO.get_line(l_in_File_C, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF INSTR(l_buff, '$$$ EXCEPTION')>0 THEN :BLK_HANDLG.STATUS_CHECK := 'ERROR'; client_Text_IO.Fclose(l_in_File_C); EXIT; Else :BLK_HANDLG.STATUS_CHECK := 'SUCCESS'; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN client_Text_IO.Fclose(l_in_File_C); EXIT; WHEN OTHERS THEN client_Text_IO.Fclose(l_in_File_C); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; END IF; END prc_get_chk_ref_info; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_GET_CONNECT_INFO.pcd ================================================ PROCEDURE prc_Get_Connect_Info( the_username IN OUT VARCHAR2, the_password IN OUT VARCHAR2, the_connect IN OUT VARCHAR2) IS BEGIN the_username := Get_Application_Property(lower(USERNAME)); the_password := Get_Application_Property(PASSWORD); the_connect := Get_Application_Property(CONNECT_STRING); END prc_Get_Connect_Info; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_INFO.pcd ================================================ PROCEDURE prc_info(s VARCHAR2) IS al_button PLS_INTEGER; al_id Alert; -- F.Matz: 15.01.107 BEGIN al_id:= FIND_ALERT('INFO'); SET_ALERT_PROPERTY(al_id, ALERT_MESSAGE_TEXT, s ); al_button := SHOW_ALERT( al_id ); END prc_info; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_MIGRATION.pcd ================================================ PROCEDURE prc_MIGRATION IS l_fname_blank VARCHAR2(128); PROCEDURE prc_clear_results IS BEGIN -- clear final results -- IF webutil_file.file_exists(:PARAMETER.P_MIGR_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME) THEN IF webutil_file.delete_file(:PARAMETER.P_MIGR_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME) THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_UNIX_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME) THEN IF webutil_file.delete_file(:PARAMETER.P_UNIX_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME) THEN NULL; END IF; END IF; -- delete all logs -- IF webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log') THEN IF webutil_file.delete_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log') THEN IF webutil_file.delete_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log') THEN NULL; END IF; END IF; IF webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one-all.log') THEN IF webutil_file.delete_file(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one-all.log') THEN NULL; END IF; END IF; END prc_clear_results; PROCEDURE prc_clear_results_HOST IS l_cmd VARCHAR2(2048); BEGIN HOST( 'IF EXIST '||:PARAMETER.P_MIGR_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME|| ' DEL '||:PARAMETER.P_MIGR_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME, NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_UNIX_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME|| ' DEL '||:PARAMETER.P_UNIX_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME, NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_LOG_DIR ||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log'|| ' DEL '||:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log', NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_LOG_DIR ||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log'||' DEL '||:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log', NO_SCREEN); HOST( 'IF EXIST '||:PARAMETER.P_MIGR_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one-all.log'||' DEL '||:PARAMETER.P_MIGR_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one-all.log', NO_SCREEN); END prc_clear_results_HOST; BEGIN l_fname_blank:= substr(:BLK_HANDLG.FNAME, 1, length(:BLK_HANDLG.FNAME)-4); IF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT IN ('FMB', 'PLL', 'MMB') AND :BLK_HANDLG.STATUS_CHECK<>'ERROR' THEN -- for re-enter loop:: configure parameters for one fmb e.g. -- pkg_Config.prc_set_Config_INI_Source(:BLK_HANDLG.FNAME); IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN prc_clear_results; ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN prc_clear_results_HOST; END IF; -- running 2 scripts for one -- pkg_FAM_RUN_Script.prc_run_FAM_script_mig('mig_main_one.p2s'); IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN prc_copy_file( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'mig_main_one.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log'); ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN prc_copy_file_HOST( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'mig_main_one.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log'); END IF; SYNCHRONIZE; pkg_FAM_RUN_Script.prc_run_FAM_script_win2unix('mig_Win2Unix_one.p2s'); IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN prc_copy_file( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'mig_Win2Unix_one.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log'); SYNCHRONIZE; -- merge files -- prc_file_merge( :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one-all.log', '--- BEGINN - Windows => Unix Migration --------------------------------' ); prc_Set_Migrate_Result(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one-all.log'); SYNCHRONIZE; IF NOT webutil_file.file_exists(:PARAMETER.P_UNIX_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME) -- OR -- NOT webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log') OR -- NOT webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log') THEN :BLK_HANDLG.STATUS_MIGRATE := 'ERROR'; ELSE :BLK_HANDLG.STATUS_MIGRATE := 'SUCCESS'; END IF; ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN prc_copy_file_HOST( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'mig_Win2Unix_one.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log'); SYNCHRONIZE; -- merge files -- prc_file_merge_HOST( :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one-all.log', '--- BEGINN - Windows => Unix Migration --------------------------------' ); prc_Set_Migrate_Result(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one-all.log'); SYNCHRONIZE; IF NOT fnc_File_Exists_HOST(:PARAMETER.P_UNIX_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME) -- OR -- NOT webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log') OR -- NOT webutil_file.file_exists(:PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_Win2Unix_one.log') THEN :BLK_HANDLG.STATUS_MIGRATE := 'ERROR'; ELSE :BLK_HANDLG.STATUS_MIGRATE := 'SUCCESS'; END IF; END IF; -- 28.02.2017 / 02.05.2017 -- ELSIF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT = 'RDF' AND :BLK_HANDLG.STATUS_CHECK<>'ERROR' THEN IF :PARAMETER.P_REPORTS_RUN='YES' THEN pkg_Config.prc_set_Config_INI_Source(:BLK_HANDLG.FNAME); pkg_FAM_RUN_Script.prc_run_FAM_script_mig('mig_rdfconvert.p2s'); IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN prc_copy_file( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'mig_rdfconvert.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log'); SYNCHRONIZE; IF NOT webutil_file.file_exists(:PARAMETER.P_UNIX_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME) THEN :BLK_HANDLG.STATUS_MIGRATE := 'ERROR'; ELSE :BLK_HANDLG.STATUS_MIGRATE := 'SUCCESS'; END IF; ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN prc_copy_file_HOST( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'mig_rdfconvert.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-mig_main_one.log'); SYNCHRONIZE; IF NOT fnc_File_Exists_HOST(:PARAMETER.P_UNIX_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME) THEN :BLK_HANDLG.STATUS_MIGRATE := 'ERROR'; ELSE :BLK_HANDLG.STATUS_MIGRATE := 'SUCCESS'; END IF; END IF; END IF; END IF; END prc_MIGRATION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_MSG.pcd ================================================ /** * Erstellt: F.Matz - Okt.2016 * Geaendert: 26.10.2016 , 29.06.2017 - F.Matz * */ PROCEDURE prc_msg (p_msg VARCHAR2, p_1 VARCHAR2 DEFAULT NULL, p_2 VARCHAR2 DEFAULT NULL, p_3 VARCHAR2 DEFAULT NULL, p_4 VARCHAR2 DEFAULT NULL, p_5 VARCHAR2 DEFAULT NULL, p_msg2 VARCHAR2 DEFAULT NULL, p_title VARCHAR2 DEFAULT NULL, p_type VARCHAR2 DEFAULT 'MESSG' ) IS C_MAX_ALERT_LEN CONSTANT NUMBER(3):= 200; l_alert Alert; l_b PLS_INTEGER; l_msg VARCHAR2(2048); l_msg_t VARCHAR2(2048); l_msgtab BOOLEAN; l_type VARCHAR2(10); l_exception_alert EXCEPTION; l_exception_msgno EXCEPTION; l_errorno VARCHAR2(5); l_errorcode VARCHAR2(10); --------------------------------------------------------- PROCEDURE prc_lmsg (p_str VARCHAR2) IS l_b PLS_INTEGER; BEGIN Set_Alert_property(l_alert, alert_message_text, p_str); l_b := Show_Alert(l_alert); END prc_lmsg; --------------------------------------------------------- BEGIN l_errorno := NULL; l_errorcode := NULL; l_alert:= Find_Alert(p_type); IF Id_Null(l_alert) THEN Message('$$$ Das Alert: '||p_type||' existiert nicht! $$$'); RAISE l_exception_alert; END IF; -- flying messages -- -- set -- l_msg := p_msg; l_type := p_type; l_msgtab := FALSE; l_msg:= replace(l_msg, '{1}', p_1); l_msg:= replace(l_msg, '{2}', p_2); l_msg:= replace(l_msg, '{3}', p_3); l_msg:= replace(l_msg, '{4}', p_4); l_msg:= replace(l_msg, '{5}', p_5); IF p_title IS NOT NULL THEN Set_Alert_property(l_alert, title, p_title); END IF; -- Textlange behandeln -- l_msg_t:= l_msg; LOOP IF length(l_msg)>C_MAX_ALERT_LEN THEN l_msg_t:= substr(l_msg,1,C_MAX_ALERT_LEN); l_msg:= substr(l_msg, C_MAX_ALERT_LEN+1,length(l_msg)-C_MAX_ALERT_LEN-1); ELSE l_msg_t:= l_msg; l_msg:=NULL; END IF; Set_Alert_property(l_alert, alert_message_text, l_msg_t); l_b := Show_Alert(l_alert); EXIT WHEN l_msg IS NULL; END LOOP; IF p_TYPE IN ('ERROR', 'EXCEPTION') THEN g.STATE:= l_TYPE; IF l_errorno IS NOT NULL THEN -- save Global ! -- g.ERROR_NO := l_errorno; g.ERROR_CODE := l_errorcode; END IF; END IF; EXCEPTION WHEN l_exception_alert THEN message('$$$ EXCEPTION: prc_msg(l_exception_alert) - Alert nicht gefunden! $$$'); WHEN l_exception_msgno THEN message('$$$ EXCEPTION: prc_msg(l_exception_msg) - Message Problem! $$$'); WHEN OTHERS THEN prc_lmsg('$$$ EXCEPTION in prc_msg bei: '||l_msg||chr(10)||sqlerrm); END prc_msg; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_SET_COMPILE_RESULT.pcd ================================================ PROCEDURE prc_Set_Compile_result(p_fn VARCHAR2) IS l_fname_blank VARCHAR2(128); BEGIN -- l_buff:=''; l_fname_blank:= substr(p_fn, 1, length(p_fn)-4); -- check if *.fmx / *.plx / *.mmx exists -- IF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN IF :BLK_HANDLG.FEXTENT='FMB' AND NOT webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmx') THEN :BLK_HANDLG.STATUS_COMPILE := 'ERROR'; ELSIF :BLK_HANDLG.FEXTENT='PLL' AND NOT webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx') THEN :BLK_HANDLG.STATUS_COMPILE := 'ERROR'; ELSIF :BLK_HANDLG.FEXTENT='MMB' AND NOT webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx') THEN :BLK_HANDLG.STATUS_COMPILE := 'ERROR'; ELSIF :BLK_HANDLG.FEXTENT='RDF' AND NOT webutil_file.file_exists(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.rep') THEN :BLK_HANDLG.STATUS_COMPILE := 'ERROR'; ELSE :BLK_HANDLG.STATUS_COMPILE := 'SUCCESS'; -- RETURN; -- <<< SENSE <<< END IF; ELSIF :PARAMETER.P_HOST_CLIENT='HOST' THEN IF :BLK_HANDLG.FEXTENT='FMB' AND NOT fnc_File_Exists_HOST(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.fmx') THEN :BLK_HANDLG.STATUS_COMPILE := 'ERROR'; ELSIF :BLK_HANDLG.FEXTENT='PLL' AND NOT fnc_File_Exists_HOST(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.plx') THEN :BLK_HANDLG.STATUS_COMPILE := 'ERROR'; ELSIF :BLK_HANDLG.FEXTENT='MMB' AND NOT fnc_File_Exists_HOST(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.mmx') THEN :BLK_HANDLG.STATUS_COMPILE := 'ERROR'; ELSIF :BLK_HANDLG.FEXTENT='RDF' AND NOT fnc_File_Exists_HOST(:PARAMETER.P_COMP_DIR||:PARAMETER.P_FILE_SEPARATOR||l_fname_blank||'.rep') THEN :BLK_HANDLG.STATUS_COMPILE := 'ERROR'; ELSE :BLK_HANDLG.STATUS_COMPILE := 'SUCCESS'; -- RETURN; -- <<< SENSE <<< END IF; END IF; END prc_Set_Compile_result; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_SET_INFOS.pcd ================================================ PROCEDURE prc_set_infos IS BEGIN :CTL_INFO.FORMS_VERSION := GET_APPLICATION_PROPERTY(VERSION); -- IF SUBSTR(V_VERSION,1,10) ='12.2.1.0.0' THEN :CTL_INFO.FORMSAPI_VERSION := substr(:PARAMETER.P_FORMSAPI_VERSION, 1,instr(:PARAMETER.P_FORMSAPI_VERSION,'(')-1)||' - '|| substr(:PARAMETER.P_FORMSAPI_VERSION, instr(:PARAMETER.P_FORMSAPI_VERSION,'(')+1, 3); :CTL_INFO.FORMSAPI_LICENSE := :PARAMETER.P_FORMSAPI_LICENSE; :CTL_INFO.MODUL_VARIANTE := :PARAMETER.P_MODULE_VARIANTE; :CTL_INFO.MODUL_VERSION := :PARAMETER.P_MODULE_VERSION; :CTL_INFO.MODUL_HERSTELLER := 'Cologne Data GmbH'; END prc_set_infos; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_SET_MIGRATE_RESULT.pcd ================================================ PROCEDURE prc_Set_Migrate_Result(p_fname VARCHAR2) IS l_buff VARCHAR2(4096); l_cnt NUMBER(3); PROCEDURE get_result_HOST IS l_in_file Text_IO.File_Type; BEGIN l_buff:=''; l_in_file := Text_IO.Fopen(p_fname, 'r'); l_cnt:=1; LOOP BEGIN Text_IO.get_line(l_in_File, l_buff); IF substr(l_buff, 10, length('[Error]'))='[Error]' THEN :BLK_HANDLG.STATUS_MIGRATE:= 'ERROR'; Text_IO.Fclose(l_in_File); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN Text_IO.Fclose(l_in_File); prc_msg('$$$ Fehler in prc_Set_Migrate_Result: '||sqlerrm); EXIT; EXIT; END ; END LOOP; END get_result_HOST; PROCEDURE get_result IS l_in_file_C client_Text_IO.File_Type; BEGIN l_buff:=''; l_in_file_C := client_Text_IO.Fopen(p_fname, 'r'); l_cnt:=1; LOOP BEGIN client_Text_IO.get_line(l_in_File_C, l_buff); IF substr(l_buff, 10, length('[Error]'))='[Error]' THEN :BLK_HANDLG.STATUS_MIGRATE:= 'ERROR'; client_Text_IO.Fclose(l_in_File_C); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN client_Text_IO.Fclose(l_in_File_C); EXIT; WHEN OTHERS THEN client_Text_IO.Fclose(l_in_File_C); prc_msg('$$$ Fehler in prc_Set_Migrate_Result: '||sqlerrm); EXIT; EXIT; END ; END LOOP; END get_result; BEGIN g.msg_push('prc_Set_Migrate_Result'); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN get_result_HOST; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN get_result; END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_Set_Migrate_Result; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_SET_STATISTIK.pcd ================================================ PROCEDURE prc_set_statistik IS l_result VARCHAr2(32); PROCEDURE get_src_info(p_fn VARCHAR2,p_type VARCHAR2) IS l_buff VARCHAR2(4096); l_in_file Text_IO.File_Type; l_in_file_C client_Text_IO.File_Type; l_cnt NUMBER(3); BEGIN l_buff:=''; IF :PARAMETER.P_HOST_CLIENT='HOST' THEN l_in_file := Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN Text_IO.get_line(l_in_File, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF l_cnt=11 THEN :BLK_HANDLG.DFILE := replace(substr(l_buff, 52,16) , '-', '.'); prc_cng_month_time; if p_type <> 'RDF' then :BLK_HANDLG.FORMS_OBJ_VNO := substr(l_buff, 96,10); else :BLK_HANDLG.FORMS_OBJ_VNO := 'undefined'; end if; l_result:= substr(l_buff, 86,7); -- 20.02.2017 -- IF instr(l_result,'WARNING',1,1) > 0 THEN l_result:='SUCCESS'; -- :BLK_HANDLG.STATUS_CHECK:='SUCCESS'; -- prc_info('Switched=>SUCCESS'); END IF; Text_IO.Fclose(l_in_File); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN Text_IO.Fclose(l_in_File); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN l_in_file_C := client_Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN client_Text_IO.get_line(l_in_File_C, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF l_cnt=11 THEN :BLK_HANDLG.DFILE := replace(substr(l_buff, 52,16) , '-', '.'); prc_cng_month_time; if p_type <> 'RDF' then :BLK_HANDLG.FORMS_OBJ_VNO := substr(l_buff, 96,10); else :BLK_HANDLG.FORMS_OBJ_VNO := 'undefined'; end if; -- :BLK_HANDLG.STATUS_CHECK := substr(l_buff, 86,7); l_result:= substr(l_buff, 86,7); -- 20.02.2017 -- -- IF instr(:BLK_HANDLG.STATUS_CHECK,'WARNING',1,1) > 0 THEN IF instr(l_result,'WARNING',1,1) > 0 THEN l_result:='SUCCESS'; -- :BLK_HANDLG.STATUS_CHECK:='SUCCESS'; -- prc_info('Switched=>SUCCESS'); END IF; client_Text_IO.Fclose(l_in_File_C); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN client_Text_IO.Fclose(l_in_File_C); EXIT; WHEN OTHERS THEN client_Text_IO.Fclose(l_in_File_C); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; END IF; END get_src_info; PROCEDURE get_chk_ref_info(p_fn VARCHAR2) IS l_buff VARCHAR2(4096); l_in_file Text_IO.File_Type; l_in_file_C client_Text_IO.File_Type; l_cnt NUMBER(3); BEGIN l_buff:=''; IF :PARAMETER.P_HOST_CLIENT='HOST' THEN l_in_file := Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN Text_IO.get_line(l_in_File, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF INSTR(l_buff, '$$$ EXCEPTION')>0 THEN :BLK_HANDLG.STATUS_CHECK := 'ERROR'; Text_IO.Fclose(l_in_File); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN :BLK_HANDLG.STATUS_CHECK := 'SUCCESS'; Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN Text_IO.Fclose(l_in_File); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN l_in_file_C := client_Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN client_Text_IO.get_line(l_in_File_C, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF INSTR(l_buff, '$$$ EXCEPTION')>0 THEN :BLK_HANDLG.STATUS_CHECK := 'ERROR'; client_Text_IO.Fclose(l_in_File_C); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN :BLK_HANDLG.STATUS_CHECK := 'SUCCESS'; client_Text_IO.Fclose(l_in_File_C); EXIT; WHEN OTHERS THEN client_Text_IO.Fclose(l_in_File_C); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; END IF; END get_chk_ref_info; BEGIN -- prc_info('START-Check'); go_block('BLK_HANDLG'); first_record; LOOP -- extract data from file to BLK_HANDLG -- IF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT IN ( 'FMB', 'PLL', 'MMB')THEN pkg_FAM_run_Script.prc_run_batch_version_cmd (:BLK_HANDLG.FNAME); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN get_src_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :BLK_HANDLG.FEXTENT); prc_copy_file_HOST( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log'); pkg_FAM_run_Script.prc_run_FAM_check_script(:BLK_HANDLG.FNAME); get_chk_ref_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.log' ); prc_copy_file_HOST( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-ref.log'); -- merge files -- prc_file_merge_HOST( :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-ref.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-all.log', '--- BEGINN - CHECK - REFERENCES --------------------------------' ); ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN get_src_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :BLK_HANDLG.FEXTENT); prc_copy_file( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log'); pkg_FAM_run_Script.prc_run_FAM_check_script(:BLK_HANDLG.FNAME); get_chk_ref_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.log' ); prc_copy_file( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-ref.log'); -- merge files -- prc_file_merge( :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-ref.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-all.log', '--- BEGINN - CHECK - REFERENCES --------------------------------' ); END IF; ELSIF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT= 'RDF' THEN pkg_FAM_run_Script.prc_run_batch_version_cmd (:BLK_HANDLG.FNAME); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN get_src_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt',:BLK_HANDLG.FEXTENT); prc_copy_file_HOST( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log'); ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN get_src_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt',:BLK_HANDLG.FEXTENT); prc_copy_file( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log'); END IF; -- go over ! -- :BLK_HANDLG.STATUS_CHECK:= 'SUCCESS'; END IF; IF :SYSTEM.LAST_RECORD='TRUE' THEN EXIT; END IF; SYNCHRONIZE; next_record; END LOOP; first_record; -- re-query -- END prc_set_statistik; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_SET_STATISTIK_SINGLE.pcd ================================================ PROCEDURE PRC_SET_STATISTIK_SINGLE IS l_result VARCHAR2(32); PROCEDURE get_src_info(p_fn VARCHAR2, p_type VARCHAR2) IS l_buff VARCHAR2(4096); l_in_file Text_IO.File_Type; l_in_file_C client_Text_IO.File_Type; l_cnt NUMBER(3); BEGIN l_buff:=''; IF :PARAMETER.P_HOST_CLIENT='HOST' THEN l_in_file := Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN Text_IO.get_line(l_in_File, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF l_cnt=11 THEN :BLK_HANDLG.DFILE := replace(substr(l_buff, 52,16) , '-', '.'); prc_cng_month_time; if p_type <> 'RDF' then :BLK_HANDLG.FORMS_OBJ_VNO := substr(l_buff, 96,10); else :BLK_HANDLG.FORMS_OBJ_VNO := 'undefined'; end if; l_result:= substr(l_buff, 86,7); -- 20.02.2017 -- -- IF instr(:BLK_HANDLG.STATUS_CHECK,'WARNING',1,1) > 0 THEN IF instr(l_result, 'WARNING',1,1) > 0 THEN l_result:= 'SUCCESS'; END IF; Text_IO.Fclose(l_in_File); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN Text_IO.Fclose(l_in_File); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN l_in_file_C := client_Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN client_Text_IO.get_line(l_in_File_C, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF l_cnt=11 THEN :BLK_HANDLG.DFILE := replace(substr(l_buff, 52,16) , '-', '.'); prc_cng_month_time; if p_type <> 'RDF' then :BLK_HANDLG.FORMS_OBJ_VNO := substr(l_buff, 96,10); else :BLK_HANDLG.FORMS_OBJ_VNO := 'undefined'; end if; -- :BLK_HANDLG.STATUS_CHECK := substr(l_buff, 86,7); l_result:= substr(l_buff, 86,7); -- 20.02.2017 -- -- IF instr(:BLK_HANDLG.STATUS_CHECK,'WARNING',1,1) > 0 THEN IF instr(l_result, 'WARNING',1,1) > 0 THEN l_result:= 'SUCCESS'; -- :BLK_HANDLG.STATUS_CHECK:='SUCCESS'; -- prc_info('Switched=>SUCCESS'); END IF; client_Text_IO.Fclose(l_in_File_C); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN client_Text_IO.Fclose(l_in_File_C); EXIT; WHEN OTHERS THEN client_Text_IO.Fclose(l_in_File_C); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; END IF; END get_src_info; PROCEDURE get_chk_ref_info(p_fn VARCHAR2) IS l_buff VARCHAR2(4096); l_in_file Text_IO.File_Type; l_in_file_C client_Text_IO.File_Type; l_cnt NUMBER(3); BEGIN l_buff:=''; IF :PARAMETER.P_HOST_CLIENT='HOST' THEN l_in_file := Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN Text_IO.get_line(l_in_File, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF INSTR(l_buff, '$$$ EXCEPTION')>0 THEN :BLK_HANDLG.STATUS_CHECK := 'ERROR'; Text_IO.Fclose(l_in_File); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN :BLK_HANDLG.STATUS_CHECK := 'SUCCESS'; Text_IO.Fclose(l_in_File); EXIT; WHEN OTHERS THEN Text_IO.Fclose(l_in_File); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN l_in_file_C := client_Text_IO.Fopen(p_fn, 'r'); l_cnt:=1; LOOP BEGIN client_Text_IO.get_line(l_in_File_C, l_buff); --l_buff_all:= l_buff_all||replace(l_in_buff,' ',' ')||'/'; IF INSTR(l_buff, '$$$ EXCEPTION')>0 THEN :BLK_HANDLG.STATUS_CHECK := 'ERROR'; client_Text_IO.Fclose(l_in_File_C); EXIT; END IF; l_cnt:= l_cnt+1; EXCEPTION WHEN NO_DATA_FOUND THEN :BLK_HANDLG.STATUS_CHECK := 'SUCCESS'; client_Text_IO.Fclose(l_in_File_C); EXIT; WHEN OTHERS THEN client_Text_IO.Fclose(l_in_File_C); prc_msg('$$$ Fehler in get_src_info: '||sqlerrm); EXIT; EXIT; END ; END LOOP; END IF; END get_chk_ref_info; BEGIN -- extract data from file to BLK_HANDLG -- IF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT IN ( 'FMB', 'PLL', 'MMB')THEN pkg_FAM_run_Script.prc_run_batch_version_cmd (:BLK_HANDLG.FNAME); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN get_src_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :BLK_HANDLG.FEXTENT); prc_copy_file_HOST( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log'); pkg_FAM_run_Script.prc_run_FAM_check_script(:BLK_HANDLG.FNAME); get_chk_ref_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.log' ); prc_copy_file_HOST( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-ref.log'); -- merge files -- prc_file_merge_HOST( :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-ref.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-all.log', '--- BEGINN - CHECK - REFERENCES --------------------------------' ); ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN get_src_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :BLK_HANDLG.FEXTENT); prc_copy_file( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log'); pkg_FAM_run_Script.prc_run_FAM_check_script(:BLK_HANDLG.FNAME); get_chk_ref_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.log' ); prc_copy_file( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check-ref.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-ref.log'); -- merge files -- prc_file_merge( :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-ref.log', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check-all.log', '--- BEGINN - CHECK - REFERENCES --------------------------------' ); END IF; ELSIF :BLK_HANDLG.FNAME IS NOT NULL AND :BLK_HANDLG.CB='Y' AND :BLK_HANDLG.FEXTENT= 'RDF' THEN pkg_FAM_run_Script.prc_run_batch_version_cmd (:BLK_HANDLG.FNAME); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN get_src_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt',:BLK_HANDLG.FEXTENT); prc_copy_file_HOST( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log'); ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN get_src_info( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt',:BLK_HANDLG.FEXTENT); prc_copy_file( :PARAMETER.P_SCRIPT_DIR||:PARAMETER.P_FILE_SEPARATOR||'check.txt', :PARAMETER.P_LOG_DIR||:PARAMETER.P_FILE_SEPARATOR||:BLK_HANDLG.FNAME||'-check.log'); END IF; -- go over ! -- :BLK_HANDLG.STATUS_CHECK:= 'SUCCESS'; END IF; SYNCHRONIZE; END prc_set_statistik_SINGLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_SET_USERHOME.pcd ================================================ PROCEDURE prc_set_UserHome IS -- F.Matz: 15.01.107 BEGIN g.p:= 'pkg_config.prc_set_UserHome'; IF :PARAMETER.P_USER_HOME IS NULL THEN :PARAMETER.P_USER_HOME:= webutil_clientinfo.get_system_property('user.home'); END IF; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_set_UserHome; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_SHOW_DURATION.pcd ================================================ PROCEDURE prc_show_duration IS -- F.Matz -- FUNCTION secs (p_beg VARCHAR2, p_end VARCHAR2) RETURN INTERVAL DAY TO SECOND IS BEGIN RETURN ( to_timestamp(p_end, 'DD.MM.YYYY HH24:MI:SS') - to_timestamp(p_beg, 'DD.MM.YYYY HH24:MI:SS') ); END secs; BEGIN :PARAMETER.P_END_TIME := fnc_get_timer_value; clear_message; --to_char(:system.current_datetime,'DD.MM.YYYY HH24:MI:SS') message( substr(secs(:PARAMETER.P_START_TIME, :PARAMETER.P_END_TIME), 5, 8) ); -- message('Runtime ' || to_char(round(((to_number(:parameter.p__end) - to_number(:parameter.p__start)) / 1000 / 60),2)) || ' min '); END prc_show_duration; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_SHOW_INIT.pcd ================================================ PROCEDURE prc_show_init(p_step VARCHAR2 DEFAULT 'INIT', p_txt VARCHAR2 DEFAULT NULL, p_result VARCHAR2 DEFAULT NULL) IS -- F.Matz : 18.05.2017 PROCEDURE prc_init IS BEGIN g.rstate:= 'OPENED'; g.rcnt:= 0; g.result:='OK'; show_view('CNV_INIT'); END prc_init; PROCEDURE prc_show1 IS BEGIN g.rstate:= 'STEP1'; g.rcnt:= 1; :CTL_INIT.STEP1:=p_txt; :CTL_INIT.RES1:=p_result; END prc_show1; PROCEDURE prc_show2 IS BEGIN g.rstate:= 'STEP2'; g.rcnt:= 2; :CTL_INIT.STEP2:=p_txt; :CTL_INIT.RES2:=p_result; END prc_show2; PROCEDURE prc_show3 IS BEGIN g.rstate:= 'STEP3'; g.rcnt:= 3; :CTL_INIT.STEP3:=p_txt; :CTL_INIT.RES3:=p_result; END prc_show3; PROCEDURE prc_show4 IS BEGIN g.rstate:= 'STEP4'; g.rcnt:= 4; :CTL_INIT.STEP4:=p_txt; :CTL_INIT.RES4:=p_result; END prc_show4; PROCEDURE prc_close IS BEGIN g.rstate:= 'CLOSED'; g.rcnt:= 5; hide_view('CNV_INIT'); go_item('CTL_BASIC.BT_CHECK'); END prc_close; BEGIN g.msg_push('prc_show_init'); IF :PARAMETER.P_SHOW_INIT='YES' THEN CASE WHEN g.rstate='INIT' AND p_step='INIT' THEN prc_init; WHEN g.rstate='OPENED' AND p_step='STEP1' THEN prc_show1; WHEN g.rstate='STEP1' AND p_step='STEP2' THEN prc_show2; WHEN g.rstate='STEP2' AND p_step='STEP3' THEN prc_show3; WHEN g.rstate='STEP3' AND p_step='STEP4' THEN prc_show4; WHEN g.rstate='STEP4' AND p_step='CLOSE' AND g.result='OK' AND g.state='OK' THEN prc_close; ELSE prc_ABORT; -- <<< SENSE <<< END CASE; END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_show_init; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_VIEW_FILE.pcd ================================================ PROCEDURE prc_view_file (p_file VARCHAR2) IS -- F.Matz: 11.02.2017, 09.05.2017, 18.06.2017 : IF HOST THEN transfer from AS => CLIENT; END IF; -- m_init_n VARCHAR2(2048) := 'CMD /C notepad.exe "${p_file}" '; m_init_n VARCHAR2(2048) := ' notepad.exe "${p_file}" '; m_run_notepad VARCHAR2(4096); m_bare_filename VARCHAR2(64); -------------------------------------------------------------------- PROCEDURE prc_run_view_notepad(p_file VARCHAR2) IS BEGIN m_run_notepad:= m_init_n; m_run_notepad:= replace( m_run_notepad, '${p_file}', p_file ); SYNCHRONIZE; -- -notabbar -nosession -- client_host('CMD /C call ' || m_run_notepad); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN -- HOST( 'CMD /C call ' || m_run_notepad ); client_host( 'CMD /C call ' || m_run_notepad ); ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN WEBUTIL_HOST.BLOCKING( 'CMD /C call ' || m_run_notepad ); END IF; END prc_run_view_notepad; -------------------------------------------------------------------- PROCEDURE prc_run_view_notepad_HOST IS BEGIN m_run_notepad:= m_init_n; m_run_notepad:= replace( m_run_notepad, '${p_file}', :PARAMETER.P_USER_HOME||'\'||m_bare_filename ); SYNCHRONIZE; -- -notabbar -nosession -- client_host('CMD /C call ' || m_run_notepad); -- HOST( 'CMD /C call ' || m_run_notepad ); WEBUTIL_HOST.BLOCKING( 'CMD /C call ' || m_run_notepad ); END prc_run_view_notepad_HOST; -------------------------------------------------------------------- FUNCTION fnc_trans_AS2CLIENT RETURN BOOLEAN IS l_success BOOLEAN; BEGIN -- THIS CODE ASSUMES THAT CLIENT IS WINDOWS BASED -- CHANGE THE serverFile PATH FROM C:\TEMP TO THE LOCATION SET IN WEBUTIL.CFG -- -- 09.05.2017 : IF transfer.appsrv.accessControl=FALSE(webutil.cfg) THEN -- transfer.appsrv.read.(webutil.cfg NOT USED -- END IF; -- e.g in webutil.cfg :: -- .... -- transfer.appsrv.enabled=TRUE -- transfer.appsrv.workAreaRoot= -- transfer.appsrv.accessControl=FALSE -- #List transfer.appsrv.read. directories -- transfer.appsrv.read.1=c:\temp -- #List transfer.appsrv.write. directories -- transfer.appsrv.write.1=c:\temp l_success := webutil_file_transfer.AS_to_Client_with_progress( clientFile => :PARAMETER.P_USER_HOME||'\'||m_bare_filename ,serverFile => p_file ,progressTitle => 'Download from Application Server in progress.' ,progressSubTitle => 'Please wait..' ); IF l_success THEN -- prc_info('File downloaded successfully from the Application Server'); RETURN(TRUE); ELSE prc_ERROR('$$$ File download from Application Server failed. $$$'); RETURN(FALSE); END IF; EXCEPTION WHEN others THEN prc_ERROR('File download failed: '||sqlerrm); RETURN(FALSE); END fnc_trans_AS2CLIENT; BEGIN IF :PARAMETER.P_HOST_CLIENT='HOST' THEN IF fnc_File_Exists_HOST(p_file) THEN -- 09.05.2017 - transfer HOST => CLIENT -- -- set for transfer & view -- m_bare_filename := substr(p_file, instr(p_file,'\',-1)+1); IF fnc_trans_AS2CLIENT THEN prc_run_view_notepad_HOST(); END IF; ELSE prc_info('Ausgabe Datei existiert nicht !'); END IF; ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN IF webutil_file.file_exists(p_file) THEN prc_run_view_notepad(p_file); ELSE prc_info('Ausgabe Datei existiert nicht !'); END IF; END IF; END prc_view_file; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/PRC_WRITE_SCRIPT.pcd ================================================ PROCEDURE prc_write_script(p_scriptname VARCHAR2, p_script VARCHAR2) IS l_out_file Text_IO.File_Type; l_out_file_C client_Text_IO.File_Type; BEGIN g.msg_push('prc_write_script'); IF :PARAMETER.P_HOST_CLIENT='HOST' THEN l_out_file := Text_IO.Fopen(p_scriptname, 'w'); BEGIN Text_IO.put(l_out_file, p_script); EXCEPTION WHEN OTHERS THEN prc_error('$$$ Fehler prc_write_script (ablk_prc_write_script) '||sqlerrm); END ablk_prc_write_script; Text_IO.Fclose(l_out_File); ELSIF :PARAMETER.P_HOST_CLIENT='CLIENT' THEN l_out_file_C := client_Text_IO.Fopen(p_scriptname, 'w'); BEGIN client_Text_IO.put(l_out_file_C, p_script); EXCEPTION WHEN OTHERS THEN prc_error('$$$ Fehler prc_write_script (ablk_prc_write_script) '||sqlerrm); END ablk_prc_write_script; client_Text_IO.Fclose(l_out_File_C); END IF; g.msg_free; EXCEPTION WHEN OTHERS THEN prc_EXCEPTION; END prc_write_script; ------------------------------------------------------------------------------------------------- ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/WEBUTIL/WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN if :system.cursor_block = 'WEBUTIL' then next_block; end if; WebUtil_Core.ShowBeans(false); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/WEBUTIL/WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/WEBUTIL/WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/WEBUTIL/WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/WEBUTIL/WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/WEBUTIL/WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/WEBUTIL/WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/WEBUTIL/WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0009/FORMSAPI_WIZARD_2905/metadata.json ================================================ { "alerts": [ "INFO", "MESSG", "DEBUG", "ERROR", "EXCEPTION", "WEBUTIL_ERROR" ], "blocks": [ { "name": "CTL_MAIN", "items": [ "CMD_INFO", "CMD_SUPPORT", "CMD_EXIT", "CMD_SAVE", "CMD_CONFIG", "CMD_DUMMY" ] }, { "name": "CTL_BASIC", "items": [ "BT_ALL", "BT_CONFIGURE", "BT_CHECK", "BT_MIGRATE", "BT_COMPILE" ] }, { "name": "CTL_INFO", "items": [ "DUMMY", "FORMS_VERSION", "FORMSAPI_VERSION", "FORMSAPI_LICENSE", "MODUL_VARIANTE", "MODUL_VERSION", "MODUL_HERSTELLER" ] }, { "name": "CTL_INIT", "items": [ "STEP1", "RES1", "STEP2", "RES2", "STEP3", "RES3", "STEP4", "RES4", "BT_CLOSE" ] }, { "name": "BLK_HANDLG", "items": [ "DMY", "PNO", "BT_SELECT", "CB", "RNO", "FNAME", "FSIZE", "DFILE", "FORMS_OBJ_VNO", "STATUS_CHECK", "BT_CHECK_SINGLE", "BT_VIEW_CHECK", "STATUS_MIGRATE", "BT_MIGRATE_SINGLE", "BT_VIEW_MIGRATE", "STATUS_COMPILE", "BT_COMPILE_SINGLE", "BT_VIEW_COMPILE", "FSTATUS", "CBOX_FAM_ACTION", "STATUS", "FEXTENT", "FAM_VERSION", "FMESSAGE", "REC_STATUS", "REC_USER", "REC_DCREATED" ] }, { "name": "WEBUTIL", "items": [ "DUMMY", "WEBUTIL_CLIENTINFO_FUNCTIONS", "WEBUTIL_FILE_FUNCTIONS", "WEBUTIL_HOST_FUNCTIONS", "WEBUTIL_SESSION_FUNCTIONS", "WEBUTIL_FILETRANSFER_FUNCTIONS", "WEBUTIL_C_API_FUNCTIONS", "WEBUTIL_BROWSER_FUNCTIONS" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/BLK/BLK__PB_WEB_FFI__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN DECLARE StringBuffer varchar2(255) := 'An initial value that will be overwritten'; StringLength pls_integer := length(StringBuffer); rc pls_integer; f_handle Webutil_c_api.FUNCTIONHANDLE; args Webutil_c_api.parameterlist; param1 Webutil_c_api.ParameterHandle; param2 Webutil_c_api.ParameterHandle; loc VARCHAR2(512); BEGIN -- loc := webutil_clientinfo.get_system_property('user.home') || '\' || -- WEBUTIL_CORE.ReadFromPropertyBundle('install.syslib.location.client.0') || ';'; -- prc_show(loc); prc_show('Before Calling the C program the value of the string is:"'||chr(10)|| StringBuffer||'" with a length of '||to_char(StringLength)); f_handle := WEBUTIL_C_API.register_function('FFIdll32.dll', 'PopulateString'); --prc_show('-- After register_function() ---'); args := WEBUTIL_C_API.create_parameter_list; param1 := WEBUTIL_C_API.add_parameter(args,WEBUTIL_C_API.C_CHAR_PTR ,WEBUTIL_C_API.PARAM_INOUT ,StringBuffer, 255); --prc_show('-- After add_parameter param1 ---'); param2 := WEBUTIL_C_API.add_parameter(args,WEBUTIL_C_API.C_INT_PTR ,WEBUTIL_C_API.PARAM_INOUT ,StringLength); --prc_show('-- After add_parameter param2 ---'); rc := WEBUTIL_C_API.Invoke_Int( 'FFIdll32.dll', 'PopulateString', args); --prc_show('-- After Invoke_Int() --- : '||to_char(rc)); --- SUCCESS !!! --- ----------------------------------------------------------------------------------------------------- prc_show('The New value for String is: "'||chr(10)|| WEBUTIL_C_API.Get_Parameter_String(args, param1)|| '" with a length of ' || to_char(WEBUTIL_C_API.Get_Parameter_Number(args, param2))); --prc_show('The New value for String is: "'||WEBUTIL_C_API.Get_Parameter_String(args, -- param2)||'" with a length of ' ||to_char(WEBUTIL_C_API.Get_Parameter_Number(args, param2))); --prc_show('RC was : '||to_char(rc)); WEBUTIL_C_API.Destroy_Parameter_List(args); WEBUTIL_C_API.Deregister_Function(f_handle); END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/BLK/BLK__URL__WHEN-MOUSE-CLICK.tgg ================================================ BEGIN BEGIN web.show_document('http://www.oracle.com/technetwork/developer-tools/forms/howto-ffi-090477.html'); END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/CHK_MYFFI_SAMPLE5/ON-LOGON.tgg ================================================ BEGIN null; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/FNC_BOOL.fun ================================================ FUNCTION fnc_BOOL(p_bool BOOLEAN) RETURN VARCHAR2 IS BEGIN IF p_bool THEN RETURN('TRUE'); ELSE RETURN('FALSE'); END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/PRC_SHOW.pcd ================================================ PROCEDURE prc_show(s VARCHAR2) IS al_button PLS_INTEGER; al_id Alert; -- F.Matz: 15.01.107 BEGIN al_id:= FIND_ALERT('INFO'); SET_ALERT_PROPERTY(al_id, ALERT_MESSAGE_TEXT, s ); al_button := SHOW_ALERT( al_id ); END prc_show; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/WEBUTIL/WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN if :system.cursor_block = 'WEBUTIL' then next_block; end if; WebUtil_Core.ShowBeans(false); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/WEBUTIL/WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/WEBUTIL/WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/WEBUTIL/WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/WEBUTIL/WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/WEBUTIL/WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/WEBUTIL/WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/WEBUTIL/WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0010/CHK_MYFFI_SAMPLE5/metadata.json ================================================ { "alerts": [ "INFO", "WEBUTIL_ERROR" ], "blocks": [ { "name": "BLK", "items": [ "PB_WEB_FFI", "URL" ] }, { "name": "WEBUTIL", "items": [ "DUMMY", "WEBUTIL_CLIENTINFO_FUNCTIONS", "WEBUTIL_FILE_FUNCTIONS", "WEBUTIL_HOST_FUNCTIONS", "WEBUTIL_SESSION_FUNCTIONS", "WEBUTIL_FILETRANSFER_FUNCTIONS", "WEBUTIL_C_API_FUNCTIONS", "WEBUTIL_BROWSER_FUNCTIONS" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/ABOUT/ABOUT__ABOUT_BUTTON__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin show_webutil_information; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/BROWSER/BROWSER__APPLET_PARAMS__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin get_applet_parameters; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/BROWSER/BROWSER__BROWSER_MESSAGE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin set_browser_message (:browser_mess_text); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/BROWSER/BROWSER__SEPARATE_FRAME__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin separate_frame_options; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/BUILTINS/BUILTINS__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin get_client_filename; If :builtins.file_name IS NOT NULL Then Go_Item('builtins.read_image'); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/BUILTINS/BUILTINS__GET_TOOL_ENV__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin client_getenv; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/BUILTINS/BUILTINS__READ_IMAGE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin If :builtins.file_name IS NULL then message ('Please enter image filename.'); GO_ITEM('builtins.filename'); SYNCHRONIZE; RAISE FORM_TRIGGER_FAILURE; End if; client_readimage; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/BUILTINS/BUILTINS__TEXT_IO_BUTTON__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin client_textio; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CLIENTINFO/CLIENTINFO__ACTION__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin get_clientinfo; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CLIENT_GETENV.pcd ================================================ PROCEDURE client_getenv IS BEGIN client_tool_env.getvar('NLS_LANG',:builtins.tool_env); SYNCHRONIZE; If :builtins.tool_env IS NULL Then :builtins.tool_env := 'NLS_LANG is not set.'; End if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CLIENT_READIMAGE.pcd ================================================ PROCEDURE client_readimage IS BEGIN client_image.read_image_file(:builtins.file_name, 'GIF', 'builtins.image'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CLIENT_TEXTIO.pcd ================================================ PROCEDURE client_textio IS l_out_file client_Text_IO.File_Type; BEGIN l_out_file := client_Text_IO.Fopen(:global.user_home ||'\helloworld.txt', 'w'); client_text_io.put_line(l_out_file, 'At '||TO_CHAR(SYSDATE,'HH24:MI')||' ' ||webutil_clientinfo.get_user_name||' wrote:'); client_text_io.put_line(l_out_file, :builtins.text_io_item); client_text_io.fclose (l_out_file); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__ACKNOWLEDGE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN show_window ('window1'); hide_window('w_hello'); go_block('clientinfo'); SYNCHRONIZE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT10__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT1__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT2__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT3__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT4__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT5__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT6__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT7__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT8__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/CTL/CTL__EXIT9__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/C_API/C_API__CALL_C_API__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- IMPORTANT -- Be sure to review the following My Oracle Support Note -- Doc ID: 285331.1 - "Exception When Calling PASCAL style Function Via WebUTIL_C_API" declare StringBuffer varchar2(255) := 'Text to overwrite'; StringLength pls_integer := length(StringBuffer); rc pls_integer; f_handle WEBUTIL_C_API.FUNCTIONHANDLE; args Webutil_c_api.parameterlist; param1 Webutil_c_api.ParameterHandle; param2 Webutil_c_api.ParameterHandle; begin f_handle := WEBUTIL_C_API.register_function('ffisamp.dll','PopulateString'); args := WEBUTIL_C_API.create_parameter_list; param1 := WEBUTIL_C_API.add_parameter(args,WEBUTIL_C_API.C_CHAR_PTR ,WEBUTIL_C_API.PARAM_INOUT ,StringBuffer, 255); param2 := WEBUTIL_C_API.add_parameter(args,WEBUTIL_C_API.C_INT_PTR ,WEBUTIL_C_API.PARAM_INOUT ,StringLength); rc := WEBUTIL_C_API.Invoke_Int( 'ffisamp.dll','PopulateString',args); message('The New value for String is: '||WEBUTIL_C_API.Get_Parameter_String(args,param1)); message('New Length '||to_char(WEBUTIL_C_API.Get_Parameter_Number(args,param2))); message('RC was '||to_char(RC)); WEBUTIL_C_API.Destroy_Parameter_List(args); WEBUTIL_C_API.Deregister_Function(f_handle); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/C_API/C_API__LOCKSTATION__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN -- IMPORTANT -- Be sure to review the following My Oracle Support Note -- Doc ID: 285331.1 - "Exception When Calling PASCAL style Function Via WebUTIL_C_API" declare rc pls_integer; f_handle WEBUTIL_C_API.FUNCTIONHANDLE; args Webutil_c_api.parameterlist; winSysDir varchar2(255) := Client_Win_API_ENVIRONMENT.Get_Windows_Directory || '\system32\'; --- IMPORTANT --- ----------------- -- -- WEBUTIL_C_API CURRENTLY ONLY SUPPORTS CALLING C STYLE LIBRARIES, THEREFORE SOME WINDOWS LIBRARIES CANNOT BE CALLED. -- ADDITIONALLY, IT IS NOT RECOMMENDED THAT YOU ATTEMPT TO CALL WINDOWS FUNCTIONS WHICH REQUIRE ARGS. -- -- USE EXTREME CAUTION WHEN CALLING WINDOWS APIS. -- BE SURE TO THOROUGHLY TEST BEFORE MOVING TO PRODUCTION -- LOOK CLOSELY AT BOTH STABILITY AND MEMORY USAGE AS SOME CALLS -- MAY RESULT IN THE APPEARANCE OF A MEMORY LEAK. ------------------------------------------------------------------------------------------ -- This call to USER32.DLL will reference the LOCKWORKSTATION function. -- If the current OS user does not have a password configured, the workstation may not lock. ------------------------------------------------------------------------------------------ -- The Windows LockWorkStation function requires no args to be passed in. -- WebUtil expects something to be passed in. So an empty paramlist will be created. begin If webutil_clientinfo.get_operating_system LIKE 'Win%' Then f_handle := WEBUTIL_C_API.register_function(winSysDir||'user32.dll','LockWorkStation'); args := WEBUTIL_C_API.create_parameter_list; /* If the function succeeds, the return value is nonzero. Because the function executes asynchronously, a nonzero return value indicates that the operation has been initiated. It does not indicate whether the workstation has been successfully locked. If the function fails, the return value is zero. http://msdn.microsoft.com/en-us/library/aa376875(v=VS.85).aspx */ rc := WEBUTIL_C_API.Invoke_Int(winSysDir||'user32.dll','LockWorkStation',args); End if; WEBUTIL_C_API.Destroy_Parameter_List(args); WEBUTIL_C_API.Deregister_Function(f_handle); SYNCHRONIZE; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/DOWNLOAD/DOWNLOAD__DOWNLOAD_AS__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin download_as; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/DOWNLOAD/DOWNLOAD__DOWNLOAD_DB__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin download_db; exception when others then message('File download failed: '||sqlerrm); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/DOWNLOAD/DOWNLOAD__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare l_filename varchar2(200); begin l_filename := webutil_file.file_save_dialog (directory_name => :global.user_home ,file_name => 'downloaded_from_as.txt' ,file_filter => null ,title => 'Select client side filename where App Server file will be saved' ); :download.file_name := l_filename; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/DOWNLOAD_AS.pcd ================================================ PROCEDURE DOWNLOAD_AS IS l_success boolean; l_bare_filename varchar2(50); BEGIN -- THIS CODE ASSUMES THAT CLIENT IS WINDOWS BASED -- CHANGE THE serverFile PATH FROM C:\TEMP TO THE LOCATION SET IN WEBUTIL.CFG l_bare_filename := substr(:upload.file_name,instr(:upload.file_name,'\',-1)+1); l_success := webutil_file_transfer.AS_to_Client_with_progress (clientFile => :download.file_name ,serverFile => 'c:\kassandra\temp\'||l_bare_filename ,progressTitle => 'Download from Application Server in progress' ,progressSubTitle => 'Please wait' ); if l_success then message('File downloaded successfully from the Application Server'); else message('File download from Application Server failed'); end if; exception when others then message('File download failed: '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/DOWNLOAD_DB.pcd ================================================ PROCEDURE DOWNLOAD_DB IS l_success boolean; BEGIN l_success := webutil_file_transfer.DB_To_Client_with_progress (clientFile => :download.file_name ,tableName => 'wu_fileupdown_demo' ,columnName => 'BLOB' ,whereClause => 'ID = 1' ,progressTitle => 'Download from Database in progress' ,progressSubTitle=> 'Please wait' ); if l_success then message('File downloaded successfully from the Database'); else message('File download from Database failed'); end if; exception when others then message('File download failed: '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/FILES/FILES__COPY_FILE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('COPY_FILE'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/FILES/FILES__DELETE_FILE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('DELETE_FILE'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/FILES/FILES__FILE_INFO__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('FILE_INFO'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/FILES/FILES__FILE_OPEN__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('FILE_OPEN'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/FILES/FILES__FILE_SAVE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('FILE_SAVE'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/FILES/FILES__LIST_DIRS__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('LIST_DIRS'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/FILES/FILES__LIST_FILES__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin files_wbp('LIST_FILES'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/FILES_WBP.pcd ================================================ PROCEDURE FILES_WBP (P_ACTION IN VARCHAR2) IS l_file_list webutil_file.file_list; l_temp_text varchar2(8000); l_filename varchar2(80) := :global.user_home ||'\helloworld.txt'; l_copy_name varchar2(80) := :global.user_home ||'\copy of helloworld.txt'; l_success boolean; BEGIN l_file_list.delete; if p_action = 'LIST_DIRS' then l_file_list := webutil_file.directory_root_list; elsif p_action = 'LIST_FILES' then l_file_list := webutil_file.directory_list(:global.user_home,true); elsif p_action = 'FILE_INFO' then l_file_list(1) := 'Exists: '||webutil_util.booltostr(webutil_file.file_exists(l_filename)); l_file_list(2) := 'Readable: '||webutil_util.booltostr(webutil_file.file_is_readable(l_filename)); l_file_list(3) := 'Writeable: '||webutil_util.booltostr(webutil_file.file_is_writable(l_filename)); l_file_list(4) := 'Hidden: '||webutil_util.booltostr(webutil_file.file_is_hidden(l_filename)); l_file_list(5) := 'Directory: '||webutil_util.booltostr(webutil_file.file_is_directory(l_filename)); l_file_list(6) := 'Size: '||to_char(webutil_file.file_size(l_filename))||' bytes'; elsif p_action = 'COPY_FILE' then l_success := webutil_file.copy_file(l_filename,l_copy_name); if l_success then message('Copy of file successfull'); else message('Copy failed'); end if; l_file_list := webutil_file.directory_list(:global.user_home,true); elsif p_action = 'DELETE_FILE' then l_success := webutil_file.delete_file(l_copy_name); if l_success then message('Delete of file successfull'); else message('Delete failed'); end if; l_file_list := webutil_file.directory_list(:global.user_home,true); elsif p_action = 'FILE_OPEN' then l_filename := webutil_file.file_open_dialog; l_file_list(1) := 'Selected file: '||l_filename; elsif p_action = 'FILE_SAVE' then l_copy_name := webutil_file.file_save_dialog; --l_success := webutil_file.copy_file(l_filename,l_copy_name); l_file_list(1) := 'File Saved as: '||l_copy_name; else message('Invalid Event passed to FILES_WBP'); end if; -- write file list to text box l_temp_text := ''; for i in 1 .. l_file_list.count loop l_temp_text := l_temp_text || l_file_list(i) || chr(10); end loop; :files.result_box := l_temp_text; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/GET_APPLET_PARAMETERS.pcd ================================================ PROCEDURE get_applet_parameters IS BEGIN :applet_param_box := ' = '||webutil_browser.getappletparameter('lookAndFeel'); :applet_param_box := :applet_param_box || chr(10)|| ' = '||webutil_browser.getappletparameter('colorScheme'); :applet_param_box := :applet_param_box || chr(10)|| ' = '||webutil_browser.getappletparameter('separateFrame'); :applet_param_box := :applet_param_box || chr(10)|| 'Applet width and height = '||webutil_browser.getappletsize(); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/GET_CLIENTINFO.pcd ================================================ PROCEDURE GET_CLIENTINFO IS BEGIN :CLIENTINFO.USER_NAME := webutil_clientinfo.get_user_name; :CLIENTINFO.IP_ADDRESS := webutil_clientinfo.get_ip_address; :CLIENTINFO.HOST_NAME := webutil_clientinfo.get_host_name; :CLIENTINFO.OPERATING_SYSTEM := webutil_clientinfo.get_operating_system; :CLIENTINFO.JAVA_VERSION := webutil_clientinfo.get_java_version; :CLIENTINFO.PATH_SEPERATOR := webutil_clientinfo.get_path_separator; :CLIENTINFO.FILE_SEPERATOR := webutil_clientinfo.get_file_separator; :CLIENTINFO.LANGUAGE := webutil_clientinfo.get_language; :CLIENTINFO.TIME_ZONE := webutil_clientinfo.get_time_zone; :CLIENTINFO.DATE_TIME := webutil_clientinfo.get_date_time; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/GET_CLIENT_FILENAME.pcd ================================================ PROCEDURE get_client_filename IS l_filename varchar2(200); BEGIN l_filename := client_get_file_name(directory_name => :global.user_home ,file_name => null ,file_filter => 'GIF Files (*.gif)|*.gif|All Files (*.*)|*.*' ,message => null ,dialog_type => null ,select_file => null ); :builtins.file_name := l_filename; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/HOST/HOST__HOST_CALLBACK.tgg ================================================ BEGIN MESSAGE ('Host command called back into Forms'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/HOST/HOST__RUN_HOST__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN DECLARE fname VARCHAR2(255) := null; pid WEBUTIL_HOST.PROCESS_ID; BEGIN IF :HOST_ASK_FILENAME = 'true' THEN fname := CLIENT_GET_FILE_NAME(null,null,null,null,OPEN_FILE,TRUE); END IF; IF :BLOCKING_RADIO = 'BLOCKING' THEN CLIENT_HOST('CMD /C NOTEPAD '||fname); ELSIF :BLOCKING_RADIO = 'NON_BLOCKING' THEN WEBUTIL_HOST.NONBLOCKING('CMD /C NOTEPAD '||fname); ELSIF :BLOCKING_RADIO = 'NON_BLOCKING_CALLBACK' THEN pid := WEBUTIL_HOST.NONBLOCKING_WITH_CALLBACK('CMD /C NOTEPAD '||fname,'HOST_CALLBACK'); END IF; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/OLE/OLE__SAVEFILE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin :ole.filename := client_get_file_name('C:\temp','','|Word Documents(*.doc)|*.doc|','Select output document...',SAVE_FILE,true); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/OLE/OLE__WRITE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin If :OLE.OLETEXT is NULL then Message ('Please enter some text.'); Message ('Please enter some text.'); CLEAR_MESSAGE; GO_ITEM ('OLE.OLETEXT'); RAISE FORM_TRIGGER_FAILURE; Else ole_write; message('Done.'); End if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/OLE_WRITE.pcd ================================================ PROCEDURE OLE_WRITE IS app CLIENT_OLE2.OBJ_TYPE; docs CLIENT_OLE2.OBJ_TYPE; doc CLIENT_OLE2.OBJ_TYPE; selection CLIENT_OLE2.OBJ_TYPE; args CLIENT_OLE2.LIST_TYPE; BEGIN -- create a new document app := CLIENT_OLE2.CREATE_OBJ('Word.Application'); if :ole.silent = 'Y' then CLIENT_OLE2.SET_PROPERTY(app,'Visible',0); else CLIENT_OLE2.SET_PROPERTY(app,'Visible',1); end if; docs := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Documents'); doc := CLIENT_OLE2.INVOKE_OBJ(docs, 'add'); selection := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Selection'); -- insert data into new document from long item CLIENT_OLE2.SET_PROPERTY(selection, 'Text', :ole.oletext); -- save document as example.tmp args := CLIENT_OLE2.CREATE_ARGLIST; CLIENT_OLE2.ADD_ARG(args, :ole.filename); CLIENT_OLE2.INVOKE(doc, 'SaveAs', args); CLIENT_OLE2.DESTROY_ARGLIST(args); -- close example.tmp args := CLIENT_OLE2.CREATE_ARGLIST; CLIENT_OLE2.ADD_ARG(args, 0); CLIENT_OLE2.INVOKE(doc, 'Close', args); CLIENT_OLE2.DESTROY_ARGLIST(args); CLIENT_OLE2.RELEASE_OBJ(selection); CLIENT_OLE2.RELEASE_OBJ(doc); CLIENT_OLE2.RELEASE_OBJ(docs); -- exit MSWord CLIENT_OLE2.INVOKE(app,'Quit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/SEPARATE_FRAME_OPTIONS.pcd ================================================ PROCEDURE separate_frame_options IS BEGIN if WebUtil_SeparateFrame.IsSeparateFrame then WebUtil_SeparateFrame.SetTitle('WebUtil Demo Form'); end if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/SET_BROWSER_MESSAGE.pcd ================================================ PROCEDURE set_browser_message ( my_message varchar2) IS BEGIN If my_message IS NULL then WebUtil_Browser.BrowserMessage('Welcome ' ||webutil_clientinfo.get_user_name ||', your computer is called '||webutil_clientinfo.get_host_name ||', with IP address ' ||webutil_clientinfo.get_ip_address ||', running ' ||webutil_clientinfo.get_operating_system ); Else WebUtil_Browser.BrowserMessage (my_message); End if; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/UPLOAD/UPLOAD__CREATE_TABLE__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN /* THE FOLLOWING IS THE SQL FOUND IN "wu_fileupload_db_demo.sql". IF THE TRIGGER BELOW EXECUTES SUCCESSFULLY, THE SAME TABLE WILL BE CREATED AS SEEN IN THE SCRIPT THERE IS NO NEED TO RUN THE SCRIPT IF THIS TRIGGER HAS BEEN EXECUTED SUCCESSFULLY drop table wu_fileupdown_demo; create table wu_fileupdown_demo (blob blob, id number(2)); insert into wu_fileupdown_demo values (NULL,1); commit; */ BEGIN Forms_DDL('drop table wu_fileupdown_demo'); Forms_DDL('create table wu_fileupdown_demo (blob blob, id number(2))'); IF NOT Form_Success THEN -- Failure will most likely occur if the current user does not have permission to create tables Message ('Table Creation Failed'); ELSE Forms_DDL('insert into wu_fileupdown_demo values (NULL,1)'); Message ('Table "wu_fileupdown_demo" created.'); Message ('Table "wu_fileupdown_demo" created.'); -- Since the table was created successfully, we can now enable the appropriate buttons -- Also, we will remove the Create button since it is no longer needed SET_ITEM_PROPERTY ('upload.upload_db',enabled, property_true); SET_ITEM_PROPERTY ('download.download_db',enabled, property_true); GO_ITEM('upload.file_name'); SYNCHRONIZE; SET_ITEM_PROPERTY ('upload.create_table',enabled, property_false); SET_ITEM_PROPERTY ('upload.create_table',visible, property_false); END IF; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/UPLOAD/UPLOAD__GET_FILE_NAME__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN declare l_filename varchar2(200); begin l_filename := client_get_file_name(directory_name => :global.user_home ,file_name => null ,file_filter => null ,message => null ,dialog_type => null ,select_file => null ); :upload.file_name := l_filename; SYNCHRONIZE; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/UPLOAD/UPLOAD__UPLOAD_AS__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin upload_as; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/UPLOAD/UPLOAD__UPLOAD_DB__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN begin upload_db; exception when others then message('File upload failed: '||sqlerrm); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/UPLOAD_AS.pcd ================================================ PROCEDURE UPLOAD_AS IS l_success boolean; l_bare_filename varchar2(50); BEGIN -- THIS CODE ASSUMES THAT CLIENT IS WINDOWS BASED -- CHANGE THE serverFile PATH FROM C:\TEMP TO THE LOCATION SET IN WEBUTIL.CFG l_bare_filename := substr(:upload.file_name,instr(:upload.file_name,'\',-1)+1); l_success := webutil_file_transfer.Client_To_AS_with_progress (clientFile => :upload.file_name ,serverFile => 'c:\kassandra\temp\'||l_bare_filename ,progressTitle => 'Upload to Application Server in progress' ,progressSubTitle => 'Please wait' ,asynchronous => false ,callbackTrigger => null ); if l_success then message('File uploaded successfully to the Application Server'); -- Added to make demo more user friendly. -- If file is successfully uploaded, move to "Download" tab. go_item('download.file_name'); else message('File upload to Application Server failed'); end if; exception when others then message('File upload failed: '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/UPLOAD_DB.pcd ================================================ PROCEDURE UPLOAD_DB IS l_success boolean; BEGIN l_success := webutil_file_transfer.Client_To_DB_with_progress (clientFile => :upload.file_name ,tableName => 'wu_fileupdown_demo' ,columnName => 'BLOB' ,whereClause => 'ID = 1' ,progressTitle => 'Upload to Database in progress' ,progressSubTitle=> 'Please wait' ,asynchronous => false ,callbackTrigger => null ); if l_success then -- -- Force commit to save file in db. -- This is not in the original Demo -- which causes the Demo to fail if -- you exit and return later to download. :System.Message_Level := '15'; commit; :System.Message_Level := '0'; message('File uploaded successfully into the Database'); -- Added to make demo more user friendly. -- If file is successfully uploaded, move to "Download" tab. go_item('download.file_name'); else message('File upload to Database failed'); end if; exception when others then message('File upload failed: '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__DUMMY__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN if :system.cursor_block = 'WEBUTIL' then next_block; end if; WebUtil_Core.ShowBeans(false); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_BROWSER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_CLIENTINFO_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_C_API_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_FILETRANSFER_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_FILE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_HOST_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_OLE_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL/WEBUTIL__WEBUTIL_SESSION_FUNCTIONS__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN begin WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL_DEMO/KEY-EXIT.tgg ================================================ BEGIN DECLARE al_id Alert; al_button NUMBER; begin al_id := Find_Alert('EXIT_ALERT'); al_button := Show_Alert(al_id); -- 88 constant for button 1 -- 89 constant for button 2 -- 90 constant for button 3 If al_button = 88 Then -- OK was pressed --WEBUTIL_SESSION.ENABLE_REDIRECT_ON_TIMEOUT('http://www.oracle.com/technetwork/developer-tools/forms/overview/'); --SYNCHRONIZE; EXIT_FORM; Elsif al_button = 89 Then -- EXIT was pressed -- message ('Good-bye'); EXIT_FORM; Elsif al_button = 90 Then -- CANCEL was pressed, don't exit RAISE FORM_TRIGGER_FAILURE; End if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL_DEMO/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN declare fake_timer TIMER; istable varchar2(2); begin -- -- Purpose of the fake timer is the we cannot call webutil in this trigger since the -- beans have not yet been instantiated. If we put the code in a when-timer-expired-trigger -- it means that this timer will not start running until Forms has focus (and so the webutil -- beans will be instantiated and so call canbe made. -- fake_timer:= CREATE_TIMER('webutil',150,NO_REPEAT); show_window ('w_hello'); hide_window ('window1'); -- Test to see if WebUtil Demo table exists (wu_test_table) -- This is used on the File Upload tab SELECT DECODE(count(*),0,'F','T') INTO istable FROM user_tables WHERE table_name = upper('wu_fileupdown_demo'); If istable = 'F' Then SET_ITEM_PROPERTY ('upload.upload_db',enabled, property_false); SET_ITEM_PROPERTY ('download.download_db',enabled, property_false); SET_ITEM_PROPERTY ('upload.create_table',visible, property_true); SET_ITEM_PROPERTY ('upload.create_table',enabled, property_true); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL_DEMO/WHEN-TAB-PAGE-CHANGED.tgg ================================================ BEGIN begin if not WebUtil_SeparateFrame.IsSeparateFrame then set_item_property('browser.separate_frame',enabled,property_false); end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL_DEMO/WHEN-TIMER-EXPIRED.tgg ================================================ BEGIN :global.user_home := webutil_clientinfo.get_system_property('user.home'); :OLE.FILENAME := :global.user_home||'\temp.doc'; SET_ITEM_PROPERTY('builtins.text_io_item',PROMPT_TEXT,'Write to '||:global.user_home||'\helloworld.txt'); SET_ITEM_PROPERTY('files.userdothome',PROMPT_TEXT,:global.user_home); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/WEBUTIL_DEMO/WHEN-WINDOW-CLOSED.tgg ================================================ BEGIN do_key('exit'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0011/WEBUTIL_DEMO/metadata.json ================================================ { "alerts": [ "EXIT_ALERT", "WEBUTIL_ERROR" ], "blocks": [ { "name": "CLIENTINFO", "items": [ "ACTION", "DATE_TIME", "TIME_ZONE", "LANGUAGE", "FILE_SEPERATOR", "PATH_SEPERATOR", "JAVA_VERSION", "OPERATING_SYSTEM", "IP_ADDRESS", "USER_NAME", "HOST_NAME" ] }, { "name": "BUILTINS", "items": [ "IMAGE", "FILE_NAME", "GET_FILE_NAME", "READ_IMAGE", "GET_TOOL_ENV", "TOOL_ENV", "TEXT_IO_BUTTON", "TEXT_IO_ITEM" ] }, { "name": "FILES", "items": [ "LIST_DIRS", "LIST_FILES", "FILE_INFO", "COPY_FILE", "DELETE_FILE", "FILE_OPEN", "FILE_SAVE", "RESULT_BOX", "USERDOTHOME" ] }, { "name": "OLE", "items": [ "OLETEXT", "SILENT", "FILENAME", "SAVEFILE", "WRITE" ] }, { "name": "UPLOAD", "items": [ "FILE_NAME", "GET_FILE_NAME", "UPLOAD_DB", "UPLOAD_AS", "CREATE_TABLE" ] }, { "name": "DOWNLOAD", "items": [ "FILE_NAME", "GET_FILE_NAME", "DOWNLOAD_DB", "DOWNLOAD_AS" ] }, { "name": "BROWSER", "items": [ "BROWSER_MESS_TEXT", "BROWSER_MESSAGE", "SEPARATE_FRAME", "APPLET_PARAMS", "APPLET_PARAM_BOX" ] }, { "name": "HOST", "items": [ "RUN_HOST", "HOST_ASK_FILENAME", "BLOCKING_RADIO" ] }, { "name": "C_API", "items": [ "CALL_C_API", "LOCKSTATION" ] }, { "name": "ABOUT", "items": [ "ABOUT_BUTTON" ] }, { "name": "CTL", "items": [ "ACKNOWLEDGE", "TERMSOFUSE", "EXIT1", "EXIT2", "EXIT3", "EXIT4", "EXIT5", "EXIT6", "EXIT7", "EXIT8", "EXIT9", "EXIT10" ] }, { "name": "WEBUTIL", "items": [ "DUMMY", "WEBUTIL_CLIENTINFO_FUNCTIONS", "WEBUTIL_FILE_FUNCTIONS", "WEBUTIL_HOST_FUNCTIONS", "WEBUTIL_SESSION_FUNCTIONS", "WEBUTIL_FILETRANSFER_FUNCTIONS", "WEBUTIL_OLE_FUNCTIONS", "WEBUTIL_C_API_FUNCTIONS", "WEBUTIL_BROWSER_FUNCTIONS" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0012/PDFVIEWER/PDFVIEWER/ON-LOGON.tgg ================================================ BEGIN null; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0012/PDFVIEWER/PDFVIEWER/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN declare hBean ITEM:= FIND_ITEM('BL.BEAN'); timer_id Timer ; begin fbean.register_bean(hBean, 1, 'com.sun.pdfview.PDFViewer'); fbean.invoke( hBean, 1, 'doOpenUrl', 'http://forms12c.com/customer_bvi_eng.pdf'); --fbean.invoke( hBean, 1, 'doOpenUrl', 'c:\\temp\\Musterreport.pdf'); fbean.invoke( hBean, 1, 'doThumbs', 'false'); timer_id := Create_Timer( 'pageTimer', 10, NO_REPEAT ) ; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0012/PDFVIEWER/PDFVIEWER/WHEN-TIMER-EXPIRED.tgg ================================================ BEGIN declare hBean ITEM:= FIND_ITEM('BL.BEAN'); begin fbean.invoke( hBean, 1, 'forceGotoPage', '0'); end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0012/PDFVIEWER/metadata.json ================================================ { "alerts": [], "blocks": [ { "name": "BL", "items": [ "BEAN" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/BL1/BL1__B__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN -- Get new value -- :BL1.VB := Get_Custom_Property( 'BL1.B', 1, 'GETVALUE') ; :GLOBAL.Blue := :BL1.VB ; :GLOBAL.Color := 'r' || :GLOBAL.Red || 'g' || :GLOBAL.Green || 'b' || :GLOBAL.Blue ; Set_Item_Property( 'BL1.COLOR', BACKGROUND_COLOR, :GLOBAL.Color ) ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/BL1/BL1__G__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN -- Get new value -- :BL1.VG := Get_Custom_Property( 'BL1.G', 1, 'GETVALUE') ; :GLOBAL.Green := :BL1.VG ; :GLOBAL.Color := 'r' || :GLOBAL.Red || 'g' || :GLOBAL.Green || 'b' || :GLOBAL.Blue ; Set_Item_Property( 'BL1.COLOR', BACKGROUND_COLOR, :GLOBAL.Color ) ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/BL1/BL1__R__WHEN-CUSTOM-ITEM-EVENT.tgg ================================================ BEGIN -- Get new value -- :BL1.VR := Get_Custom_Property( 'BL1.R', 1, 'GETVALUE') ; :GLOBAL.Red := :BL1.VR ; :GLOBAL.Color := 'r' || :GLOBAL.Red || 'g' || :GLOBAL.Green || 'b' || :GLOBAL.Blue ; Set_Item_Property( 'BL1.COLOR', BACKGROUND_COLOR, :GLOBAL.Color ) ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/BL1/BL1__VB__POST-TEXT-ITEM.tgg ================================================ BEGIN PKG_SLIDER.Set_Value ( 'BL1.B', 1, :BL1.VB ) ; :GLOBAL.Blue := Ltrim( To_Char( :BL1.B ) ) ; :GLOBAL.Color := 'r' || :GLOBAL.Red || 'g' || :GLOBAL.Green || 'b' || :GLOBAL.Blue ; Set_Item_Property( 'BL1.COLOR', BACKGROUND_COLOR, :GLOBAL.Color ) ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/BL1/BL1__VG__POST-TEXT-ITEM.tgg ================================================ BEGIN PKG_SLIDER.Set_Value ( 'BL1.G', 1, :BL1.VG ) ; :GLOBAL.Green := Ltrim( To_Char( :BL1.G ) ) ; :GLOBAL.Color := 'r' || :GLOBAL.Red || 'g' || :GLOBAL.Green || 'b' || :GLOBAL.Blue ; Set_Item_Property( 'BL1.COLOR', BACKGROUND_COLOR, :GLOBAL.Color ) ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/BL1/BL1__VR__POST-TEXT-ITEM.tgg ================================================ BEGIN PKG_SLIDER.Set_Value ( 'BL1.R', 1, :BL1.VR ) ; :GLOBAL.Red := Ltrim( To_Char( :BL1.R ) ) ; :GLOBAL.Color := 'r' || :GLOBAL.Red || 'g' || :GLOBAL.Green || 'b' || :GLOBAL.Blue ; Set_Item_Property( 'BL1.COLOR', BACKGROUND_COLOR, :GLOBAL.Color ) ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/COLOR_SLIDER/ON-LOGON.tgg ================================================ BEGIN Null ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/COLOR_SLIDER/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN -- MDI Title -- Set_Window_Property ( FORMS_MDI_WINDOW, TITLE, 'Oracle Forms 12c - Javabean' ) ; -- ColorScheme used ? -- --PKG_SLIDER.GC$CurScheme := PKG_SLIDER.GC$Blaf ; :GLOBAL.Red := '0' ; :GLOBAL.Green := '0' ; :GLOBAL.Blue := '0' ; :GLOBAL.Color := 'r' || :GLOBAL.Red || 'g' || :GLOBAL.Green || 'b' || :GLOBAL.Blue ; Set_Item_Property( 'BL1.COLOR', BACKGROUND_COLOR, :GLOBAL.Color ) ; -- Init the slider properties -- PKG_SLIDER.Init_Slider ( 'BL1.R', 1, 'V,0,255,32,16' ) ; PKG_SLIDER.Set_Value ( 'BL1.R', 1, 0 ) ; PKG_SLIDER.Init_Slider ( 'BL1.G', 1, 'V,0,255,32,16' ) ; PKG_SLIDER.Set_Value ( 'BL1.G', 1, 0 ) ; PKG_SLIDER.Init_Slider ( 'BL1.B', 1, 'V,0,255,32,16' ) ; PKG_SLIDER.Set_Value ( 'BL1.B', 1, 0 ) ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/PKG_SLIDER.pkb ================================================ PACKAGE BODY PKG_SLIDER IS PROCEDURE Init_Slider ( PC$Name IN VARCHAR2, PN$Num IN PLS_INTEGER, PC$Bounds IN VARCHAR2 ) Is LC$CVBColor Varchar2(20) := Get_Canvas_Property( Get_Item_Property( PC$Name, ITEM_CANVAS ), BACKGROUND_COLOR ) ; LC$CVFColor Varchar2(20) := Get_Canvas_Property( Get_Item_Property( PC$Name, ITEM_CANVAS ), FOREGROUND_COLOR ) ; LC$BGColor Varchar2(20) := Get_Item_Property(PC$Name, BACKGROUND_COLOR) ; LC$FGColor Varchar2(20) := Get_Item_Property(PC$Name, FOREGROUND_COLOR) ; LC$Color Varchar2(15) ; Begin -- BackGround color -- If LC$BGColor is not null Then LC$Color := Translate( LC$BGColor, '0123456789gbr','0123456789,,' ) ; Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ; Elsif LC$CVBColor is not null Then LC$Color := Translate( LC$CVBColor, '0123456789gbr','0123456789,,' ) ; Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ; Else LC$Color := PKG_SLIDER.GC$CurScheme ; Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ; End if ; -- ForeGround color -- If LC$FGColor is not null Then LC$Color := Translate( LC$FGColor, '0123456789gbr','0123456789,,' ) ; Set_Custom_Property( PC$Name, PN$Num, 'SETFGCOLOR', LC$Color ) ; Elsif LC$CVFColor is not null Then LC$Color := Translate( LC$CVFColor, '0123456789gbr','0123456789,,' ) ; Set_Custom_Property( PC$Name, PN$Num, 'SETBGCOLOR', LC$Color ) ; End if ; -- Bounds -- Set_Custom_Property( PC$Name, PN$Num, 'SETBOUNDS', PC$Bounds ) ; End ; ------------------------------------------- -- Set the current value of the Slider -- ------------------------------------------- PROCEDURE Set_Value ( PC$Name IN VARCHAR2, PN$Num IN PLS_INTEGER, PN$Value IN NUMBER ) IS BEGIN -- Initial value -- Set_Custom_Property( PC$Name, PN$Num, 'SETVALUE', To_Char(PN$Value) ) ; End Set_Value; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/PKG_SLIDER.pks ================================================ PACKAGE PKG_SLIDER IS -- Colorscheme RGB values -- GC$Teal Varchar2(15) := '115,142,140' ; GC$Titanium Varchar2(15) := '99,101,99' ; GC$Red Varchar2(15) := '156,130,123' ; GC$Khaki Varchar2(15) := '140,142,123' ; GC$Blue Varchar2(15) := '90,117,148' ; GC$Olive Varchar2(15) := '107,113,99' ; GC$Purple Varchar2(15) := '123,113,140' ; GC$Blaf Varchar2(15) := '247,247,231' ; -- Current colorscheme -- GC$CurScheme Varchar2(15) := '' ; PROCEDURE Init_Slider ( PC$Name IN VARCHAR2, PN$Num IN PLS_INTEGER, PC$Bounds IN VARCHAR2 ) ; PROCEDURE Set_Value ( PC$Name IN VARCHAR2, PN$Num IN PLS_INTEGER, PN$Value IN NUMBER ) ; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0013/COLOR_SLIDER/metadata.json ================================================ { "alerts": [], "blocks": [ { "name": "BL1", "items": [ "R", "G", "B", "COLOR", "VR", "VG", "VB" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/ACCORDION/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN GO_BLOCK('DEPARTMENTS'); EXECUTE_QUERY; GO_BLOCK('EMPLOYEES'); EXECUTE_QUERY; PK_TREE.PR_FILL_TREE; DECLARE lAccordionList PK_ACCORDION.tAccordionList; rAccordion PK_ACCORDION.tAccordion; BEGIN rAccordion.vcCanvas:='CV'; rAccordion.vcButton:='B.B'; rAccordion.vcExpandedImage:=PK_ACCORDION.VCC_DEFAULT_EXPANDED_IMAGE; rAccordion.vcCollapsedImage:=PK_ACCORDION.VCC_DEFAULT_COLLAPSED_IMAGE; rAccordion.bOpened:=TRUE; lAccordionList(1):=rAccordion; rAccordion.vcCanvas:='CV2'; rAccordion.vcButton:='B.B2'; rAccordion.vcExpandedImage:=PK_ACCORDION.VCC_DEFAULT_EXPANDED_IMAGE; rAccordion.vcCollapsedImage:=PK_ACCORDION.VCC_DEFAULT_COLLAPSED_IMAGE; rAccordion.bOpened:=FALSE; lAccordionList(2):=rAccordion; rAccordion.vcCanvas:='CV3'; rAccordion.vcButton:='B.B3'; rAccordion.vcExpandedImage:=PK_ACCORDION.VCC_DEFAULT_EXPANDED_IMAGE; rAccordion.vcCollapsedImage:=PK_ACCORDION.VCC_DEFAULT_COLLAPSED_IMAGE; rAccordion.bOpened:=FALSE; lAccordionList(3):=rAccordion; rAccordion.vcCanvas:='CV4'; rAccordion.vcButton:='B.B4'; rAccordion.vcExpandedImage:=PK_ACCORDION.VCC_DEFAULT_EXPANDED_IMAGE; rAccordion.vcCollapsedImage:=PK_ACCORDION.VCC_DEFAULT_COLLAPSED_IMAGE; rAccordion.bOpened:=FALSE; lAccordionList(4):=rAccordion; PK_ACCORDION.PR_INIT_ACCORDION('MAIN', lAccordionList); END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/B/B__B2__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN PR_INIT_BY_DEPT; GO_ITEM('B.B2'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/B/B__B3__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN PR_INIT_BY_SAL; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/B/B__B4__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN PR_INIT_BY_OTHERS; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/B/B__B__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN PR_INIT_BY_TREE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/BL_TREE/BL_TREE__IT_TREE__WHEN-TREE-NODE-EXPANDED.tgg ================================================ BEGIN PK_TREE.PR_WTNE(:SYSTEM.TRIGGER_NODE); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/BL_TREE/BL_TREE__IT_TREE__WHEN-TREE-NODE-SELECTED.tgg ================================================ BEGIN PK_TREE.PR_WTNS(:SYSTEM.TRIGGER_NODE); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/DEPARTMENTS/DEPARTMENTS__WHEN-NEW-RECORD-INSTANCE.tgg ================================================ BEGIN PR_INIT_BY_DEPT; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/OTHRS/OTHRS__EMAIL__WHEN-CHECKBOX-CHANGED.tgg ================================================ BEGIN PR_INIT_BY_OTHERS; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0014/ACCORDION/PK_ACCORDION.pkb ================================================ PACKAGE BODY PK_ACCORDION IS TYPE tList IS TABLE OF tAccordionList INDEX BY VARCHAR2(30); lList tList; -- -------------------------------------------------------------------------------------- PROCEDURE PR_INIT_ACCORDION(i_vcAccordionGroup IN VARCHAR2, i_lAccordionList IN tAccordionList) IS vcPrior VARCHAR2(4000); vcNext VARCHAR2(4000); BEGIN lList(i_vcAccordionGroup):=i_lAccordionList; FOR i IN 1..i_lAccordionList.COUNT LOOP -- prior Accordion-entry IF i>1 THEN vcPrior:=i_lAccordionList(i-1).vcButton; ELSE vcPrior:='.'; END IF; -- following Accordion-entries IF i1 THEN vcPrior:=i_lAccordionList(i-1).vcButton; ELSE vcPrior:='.'; END IF; -- following Accordion-entries IF iHTML Ipsum Presents

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.

Header Level 2

  1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  2. Aliquam tincidunt mauris eu risus.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.

Header Level 3

  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Aliquam tincidunt mauris eu risus.

#header h1 a {
  display: block;
  width: 300px;
  height: 80px;
}
' ); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0015/MODERNIZE/MODERNIZE/WHEN-WINDOW-CLOSED.tgg ================================================ BEGIN exit_form; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0015/MODERNIZE/RecordGroups/LOV9.sql ================================================ select 'A' key,'Item A' value from dual union all select 'B','Item B' from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0015/MODERNIZE/metadata.json ================================================ { "alerts": [ "CLICKED", "BTN_CLICKED" ], "blocks": [ { "name": "CONTROL", "items": [ "ERROR_STACK", "TEXT_FIELD_1", "TEXT_FIELD_2", "DATE_FIELD", "DATE_TIME_FIELD", "TEXT_FIELD_BACK_COLOR", "TEXT_FIELD_ENABLE", "CHECK_BOX_1", "CHECK_BOX_2", "CHECK_BOX_BACK_COLOR", "RADIO_BUTTON_1", "RADIO_BACK_COLOR", "SHOW_ERROR", "SHOW_WARNING", "SHOW_INFO", "HTML_FIELD" ] } ], "lovs": [ "LOV9" ] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/C/C__CBOX__KEY-NEXT-ITEM.tgg ================================================ BEGIN declare BEGIN synchronize; if get_view_property('CBX',VISIBLE) = 'TRUE' and length(:label) > 0 and upper (:label) <> upper (:cbox) then go_item('label'); set_item_property('c.cbox',enabled,property_false); else pkg_CBOX.prc_kni; end if; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/C/C__CBOX__POST-CHANGE.tgg ================================================ BEGIN declare mytimer timer; begin if :parameter.par1 is not null then if get_view_property('CBX',VISIBLE) = 'TRUE' and not abs(length(:cbox) - length(:dummy))= 1 then :cbox := :parameter.par1; :parameter.par1 := null; mytimer := create_timer('xxx',1,NO_REPEAT); else :parameter.par1 := null; end if; end if; end; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/C/C__CBOX__WHEN-LIST-CHANGED.tgg ================================================ BEGIN declare pre_dummy varchar2(30) := :dummy; BEGIN pkg_CBOX.prc_wlc('C.CBOX'); if get_view_property('CBX',VISIBLE) = 'TRUE' and length(:label) > 0 and upper (:label) <> upper (:cbox) then :dummy := :cbox; if nvl(pre_dummy,' ') <> :dummy then :parameter.par1 := :dummy; else :parameter.par1 := null; end if; end if; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/C/C__DUMMY__KEY-NEXT-ITEM.tgg ================================================ BEGIN go_item('C.CBOX'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/C/C__DUMMY__KEY-PREV-ITEM.tgg ================================================ BEGIN go_item('C.CBOX'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/CBX/CBX__LABEL__KEY-NEXT-ITEM.tgg ================================================ BEGIN BEGIN set_item_property('c.cbox',enabled,property_true); pkg_CBOX.prc_kni; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/CBX/CBX__LABEL__KEY-PREV-ITEM.tgg ================================================ BEGIN set_item_property('c.cbox',enabled,property_true); :cbox := null; go_item('C.CBOX'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/CBX/CBX__LABEL__WHEN-MOUSE-CLICK.tgg ================================================ BEGIN BEGIN set_item_property('c.cbox',enabled,property_true); pkg_Cbox.prc_labelclick; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/CBX/CBX__ON-ERROR.tgg ================================================ BEGIN BEGIN -- ignore -- NULL; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/CHK_CBOX3/WHEN-NEW-BLOCK-INSTANCE.tgg ================================================ BEGIN /* * Quasi AutoComplete ComboBox with native PL/SQL. * 29.01.2018 - Friedhold.Matz@yahoo.com * */ BEGIN set_window_property('WINDOW1', TITLE, 'Autocomplete Combo Box - PoC [chk_cbox3 v03.01.20180129]'); pkg_CBOX.populate_auto_cbox('CBOX','select name,name from europecities order by 1'); END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/CHK_CBOX3/WHEN-TIMER-EXPIRED.tgg ================================================ BEGIN go_item('label'); set_item_property('c.cbox',enabled,property_false); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/PKG_CBOX.pkb ================================================ PACKAGE BODY pkg_cbox IS /* * Author: Friedhold Matz : http://friedhold-matz.blogspot.com/ * Created: 05.08.2007 * Modified: 16.09.2007 * Modified: 29.01.2018 * */ -- Module variables -- m_CBOX VARCHAR2(100); m_nxtitem VARCHAR2(100); -------------------------------------------------------------------------------- PROCEDURE prc_show(p_s VARCHAR2) IS al_button PLS_INTEGER; al_id Alert; BEGIN al_id:= FIND_ALERT('INFO'); SET_ALERT_PROPERTY(al_id, ALERT_MESSAGE_TEXT, p_s ); al_button := SHOW_ALERT( al_id ); END prc_show; -------------------------------------------------------------------------------- PROCEDURE populate_auto_cbox (p_list_item varchar2, p_sql_stat varchar2)IS rgid recordgroup; rcnt number; rgname constant varchar2(30):= get_item_property(p_list_item,item_name); l_x number(10); l_y number(10); BEGIN -- fix setting : 29.01.2018 - CBOX . -- m_CBOX := 'C.CBOX'; m_nxtitem:= 'C.DUMMY'; rgid:=find_group(rgname); IF id_null(rgid) THEN rgid:= create_group_from_query (rgname, p_sql_stat); end if; rcnt:=populate_group(rgid); IF rcnt=0 THEN populate_list(p_list_item,rgid); --copy(get_list_element_value(list_item,1),list_item); END IF; --delete_group(rgid); hide_view('CBX'); EXCEPTION WHEN others THEN prc_show('$$$ Module pkg_Cbox.populate_auto_cbox: '||sqlerrm); END populate_auto_cbox; -------------------------------------------------------------------------------- PROCEDURE prc_wlc(p_cbox varchar2) IS list_id ITEM; list_count NUMBER; current_value VARCHAR2(250); l_found BOOLEAN := FALSE; rgid2 RECORDGROUP; gcid2 GROUPCOLUMN; BEGIN -- set active CBOX -- IF pkg_CBOX.m_cbox IS NULL then IF p_cbox<>:SYSTEM.cursor_item THEN prc_show('$$$ Error in pkg_cbox.prc_wlc: Definition of CBOX.'||sqlerrm); END IF; pkg_CBOX.m_cbox:= :SYSTEM.cursor_item; END IF; --prc_show(pkg_CBOX.g_cbox); IF length(name_in(pkg_CBOX.m_cbox))>1 THEN go_item('LABEL'); -- prc_show(name_in(pkg_CBOX.m_cbox)); END IF; IF name_in(pkg_CBOX.m_cbox) IS NULL THEN hide_view('CBX'); RETURN; END IF; list_id:=FIND_ITEM(pkg_CBOX.m_cbox); list_count := GET_LIST_ELEMENT_COUNT(list_id); go_block('CBX'); clear_block; FOR i IN 1..list_count LOOP current_value := GET_LIST_ELEMENT_VALUE(list_id, i); IF UPPER(:CBOX)= UPPER(substr(current_value,1,length(name_in(pkg_CBOX.m_cbox)))) then l_found:= TRUE; :CBX.LABEL:= current_value; next_record; END IF; END LOOP; go_item(pkg_CBOX.m_cbox); -- fill IF l_found THEN go_item('CBX.LABEL'); show_view('CBX'); go_record(1); :CBOX_SAVE:=:CBOX; IF name_in(pkg_CBOX.m_cbox)=:CBX.LABEL THEN go_item(pkg_CBOX.m_nxtitem); hide_view('CBX'); copy(Name_IN(pkg_CBOX.m_cbox), pkg_CBOX.m_nxtitem); END IF; ELSE -- 29.01.2018 - F.Matz -- -- not defined value: wait-finish(|) -- --prc_show('Value not found.'); RETURN; END IF; go_item(pkg_CBOX.m_cbox); EXCEPTION WHEN OTHERS THEN prc_show('$$$ Module pkg_Cbox.prc_wlc: '|| sqlerrm); END prc_wlc; -------------------------------------------------------------------------------- PROCEDURE prc_kni IS BEGIN IF :CBX.LABEL IS NOT NULL THEN copy(:CBX.LABEL, pkg_CBOX.m_cbox); copy(Name_IN(pkg_CBOX.m_cbox), pkg_CBOX.m_nxtitem); END IF; go_item(pkg_CBOX.m_nxtitem); hide_view('CBX'); -- copy into next_item -- copy(Name_IN(pkg_CBOX.m_cbox), pkg_CBOX.m_nxtitem); END prc_kni; -------------------------------------------------------------------------------- PROCEDURE prc_labelclick IS BEGIN :CBOX:= :CBX.LABEL; go_item(pkg_CBOX.m_CBOX); hide_view('CBX'); -- copy into nex_item -- copy(Name_IN(pkg_CBOX.m_cbox), pkg_CBOX.m_nxtitem); END prc_labelclick; -------------------------------------------------------------------------------- BEGIN NULL; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/PKG_CBOX.pks ================================================ PACKAGE pkg_cbox IS PROCEDURE prc_show(p_s varchar2); PROCEDURE populate_auto_cbox (p_list_item varchar2, p_sql_stat varchar2); PROCEDURE prc_wlc(p_cbox varchar2); PROCEDURE prc_kni; PROCEDURE prc_labelclick; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0016/CHK_CBOX3/metadata.json ================================================ { "alerts": [ "INFO" ], "blocks": [ { "name": "C", "items": [ "CBOX", "DUMMY" ] }, { "name": "CBX", "items": [ "LABEL", "ELEMENT", "CBOX_SAVE" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__ANSWER__WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN BEGIN pkg_item.prc_Enter; END W_N_I_INSTANCE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__ANSWER__WHEN-VALIDATE-ITEM.tgg ================================================ BEGIN BEGIN pkg_item.prc_Leave; END W_V_ITEM; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__BT_COMMIT__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN DECLARE l_res VARCHAR2(256); BEGIN SYNCHRONIZE; l_res:= pkg_Item.fnc_final_check; IF l_res='OK' THEN prc_info(' User account is completed. '); ELSE prc_info(' User account is not completed. '||chr(10)||l_res); END IF; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__CLOSE__WHEN-MOUSE-CLICK.tgg ================================================ BEGIN BEGIN DO_KEY('EXIT'); END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__EMAIL2__WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN BEGIN pkg_item.prc_Enter; END W_N_I_INSTANCE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__EMAIL2__WHEN-VALIDATE-ITEM.tgg ================================================ BEGIN BEGIN pkg_item.prc_Leave; END W_V_ITEM; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__EMAIL__WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN BEGIN pkg_item.prc_Enter; END W_N_I_INSTANCE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__EMAIL__WHEN-VALIDATE-ITEM.tgg ================================================ BEGIN BEGIN pkg_item.prc_Leave; END W_V_ITEM; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__FULLNAME__WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN BEGIN pkg_item.prc_Enter; END W_N_I_INSTANCE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__FULLNAME__WHEN-VALIDATE-ITEM.tgg ================================================ BEGIN BEGIN pkg_item.prc_Leave; END W_V_ITEM; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__PASSWORD_RETRY__WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN BEGIN pkg_item.prc_Enter; END W_N_I_INSTANCE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__PASSWORD_RETRY__WHEN-VALIDATE-ITEM.tgg ================================================ BEGIN BEGIN pkg_item.prc_Leave; END W_V_ITEM; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__PASSWORD__WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN BEGIN pkg_item.prc_Enter; END W_N_I_INSTANCE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__PASSWORD__WHEN-VALIDATE-ITEM.tgg ================================================ BEGIN BEGIN pkg_item.prc_Leave; END W_V_ITEM; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__QUERY__WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN BEGIN pkg_item.prc_Enter; END W_N_I_INSTANCE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__QUERY__WHEN-VALIDATE-ITEM.tgg ================================================ BEGIN BEGIN pkg_item.prc_Leave; END W_V_ITEM; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__START_DEMO__WHEN-MOUSE-CLICK.tgg ================================================ BEGIN BEGIN prc_chk_item_sequence; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__USERNAME__WHEN-NEW-ITEM-INSTANCE.tgg ================================================ BEGIN BEGIN pkg_item.prc_Enter; END W_N_I_INSTANCE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/BLK_ACCOUNT/BLK_ACCOUNT__USERNAME__WHEN-VALIDATE-ITEM.tgg ================================================ BEGIN BEGIN pkg_item.prc_Leave; END W_V_ITEM; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/FNC_MSG_QUERY.fun ================================================ FUNCTION fnc_msg_query(p_msg VARCHAR2) RETURN VARCHAR2 IS l_button PLS_INTEGER; l_id Alert; l_res VARCHAR2(32); BEGIN l_id:= FIND_ALERT('QUERY'); SET_ALERT_PROPERTY(l_id, ALERT_MESSAGE_TEXT, p_msg ); l_button := SHOW_ALERT( l_id ); IF l_button = ALERT_BUTTON1 THEN l_res := 'YES'; ELSIF l_button = ALERT_BUTTON2 THEN l_res := 'NO'; ELSE l_res := 'CANCEL'; END IF; RETURN(l_res); END fnc_msg_query; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/FNC_VALIDATE.fun ================================================ FUNCTION fnc_validate (p_item VARCHAR2) RETURN VARCHAR2 IS -- Friedhold Matz - 2018-FEB l_vres VARCHAR2(256); BEGIN IF p_item='EMAIL' THEN IF regexp_like(:BLK_ACCOUNT.EMAIL, '([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})') THEN RETURN('OK'); ELSE RETURN('$$$ Error: '|| pkg_Item.item_name('EMAIL').msg ||' $$$'); END IF; ELSIF p_item='EMAIL2' THEN IF LOWER(:BLK_ACCOUNT.EMAIL)=LOWER(:BLK_ACCOUNT.EMAIL2) THEN RETURN('$$$ Error: eMail2 is the same as eMail ! $$$'); END IF; IF regexp_like(:BLK_ACCOUNT.EMAIL2, '([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})') THEN RETURN('OK'); ELSE RETURN('$$$ Error: '|| pkg_Item.item_name('EMAIL2').msg ||' $$$'); END IF; ELSIF p_item='PASSWORD' THEN IF :BLK_ACCOUNT.PASSWORD<>pkg_Item.item_name('PASSWORD').text THEN l_vres:=v#r#fy_pw$001(:BLK_ACCOUNT.USERNAME,:BLK_ACCOUNT.PASSWORD); IF l_vres='OK' THEN RETURN('OK'); ELSE RETURN(l_vres); END IF; ELSE RETURN('$$$ Error: Username and Password are not completed ! $$$'); END IF; ELSIF p_item='PASSWORD_RETRY' THEN IF :PASSWORD<>:PASSWORD_RETRY THEN RETURN('$$$ Error: Passwords are not identical ! $$$'); END IF; END IF; RETURN('OK'); EXCEPTION WHEN OTHERS THEN RETURN('$$$ EXCEPTION in fnc_validate) - item: '||p_item||' : '||sqlerrm); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/PKG_ITEM.pkb ================================================ PACKAGE BODY pkg_Item IS -- Friedhold Matz - 2018-FEB ----------------------------------------------------------------------------------- -- private procs / funcs -- ----------------------------------------------------------------------------------- PROCEDURE prc_enable_item (p_item VARCHAR2) IS BEGIN -- display items only ! -- Set_Item_Property(p_item , VISIBLE, PROPERTY_TRUE); -- Set_Item_Property(p_item , ENABLED, PROPERTY_TRUE); END prc_enable_item; ----------------------------------------------------------------------------------- PROCEDURE sleep (p_x NUMBER) IS x NUMBER; BEGIN --FOR i IN 1..p_x LOOP -- x:= POWER(2, 100); -- SYNCHRONIZE; --END LOOP; -- FHOFFMANN Changed because the server calculates to slow. dbms_lock.sleep(1); synchronize; END sleep; ----------------------------------------------------------------------------------- FUNCTION fnc_get_txtnnullc (p_bit VARCHAR2, p_txt VARCHAR2)RETURN VARCHAR2 IS BEGIN IF pkg_Item.item_name(p_bit).notnull='YES' THEN RETURN(p_txt||' *'); ELSE RETURN(p_txt); END IF; END fnc_get_txtnnullc; ----------------------------------------------------------------------------------- FUNCTION fnc_sign_msg (p_txt VARCHAR2) RETURN VARCHAR2 IS BEGIN CASE p_txt WHEN 'LIGHT' THEN RETURN('VA_TXT_LIGHT_MSG'); WHEN 'MEDIUM' THEN RETURN('VA_TXT_MEDIUM_MSG'); WHEN 'STRONG' THEN RETURN('VA_TXT_STRONG_MSG'); ELSE RETURN('VA_TXT_ERROR_MSG'); END CASE; END fnc_sign_msg; ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -- global procs / funcs -- ----------------------------------------------------------------------------------- PROCEDURE prc_Enter IS l_blk VARCHAR2(32); l_fit VARCHAR2(32); l_bit VARCHAR2(32); BEGIN l_fit:= :SYSTEM.CURSOR_ITEM; -- get blank item name -- l_bit:= substr(l_fit, instr(l_fit,'.')+1, length(l_fit)-instr(l_fit,'.')); l_blk:= pkg_Item.item_name(l_bit).block; -- clear item -- COPY(NULL, l_fit); -- clear msg -- COPY(NULL, l_blk||'.'||'MSG_'||l_bit); -- activate underline -- Set_Item_Property(l_blk||'.'||'UNDER_'||l_bit, VISUAL_ATTRIBUTE, 'VA_UL_ACTIVE'); -- activate label -- prc_enable_item(l_blk||'.'||'LABEL_'||l_bit); Set_Item_Property(l_blk||'.'||'LABEL_'||l_bit, VISUAL_ATTRIBUTE, 'VA_TXT_LABEL_ACTIVE'); -- deactivate msg -- Set_Item_Property(l_blk||'.'||'MSG_'||l_bit , VISIBLE, PROPERTY_FALSE); -- activate input property -- Set_Item_Property(l_fit , VISUAL_ATTRIBUTE, 'VA_TEXT'); -- IF pkg_Item.item_name(l_bit).type='SECURE' THEN -- hide text -- Set_item_Property(l_blk||'.'||l_bit, ECHO, PROPERTY_FALSE); END IF; EXCEPTION WHEN OTHERS THEN prc_info('$$$ EXCEPTION in pkg_Item.prc_Enter: '||sqlerrm); END prc_Enter; ----------------------------------------------------------------------------------- PROCEDURE prc_Leave IS l_blk VARCHAR2(32); l_fit VARCHAR2(32); l_bit VARCHAR2(32); l_it_value VARCHAR2(64); l_vres VARCHAR2(512); BEGIN l_fit := :SYSTEM.CURSOR_ITEM; l_it_value := NAME_IN(l_fit); l_bit := substr(l_fit, instr(l_fit,'.')+1, length(l_fit)-instr(l_fit,'.')); l_blk := pkg_Item.item_name(l_bit).block; IF l_it_value IS NULL OR l_it_value=pkg_Item.item_name(l_bit).text THEN COPY(pkg_Item.item_name(l_bit).text, l_fit); COPY(pkg_Item.item_name(l_bit).label, l_blk||'.'||'LABEL_'||l_fit); -- underline to empty -- Set_Item_Property(l_blk||'.'||'UNDER_'||l_bit , VISUAL_ATTRIBUTE, 'VA_UL_EMPTY'); -- deactivate label -- Set_Item_Property(l_blk||'.'||'LABEL_'||l_bit , VISIBLE, PROPERTY_FALSE); -- IF pkg_Item.item_name(l_bit).type='SECURE' THEN -- hide text -- Set_item_Property(l_blk||'.'||l_bit, ECHO, PROPERTY_TRUE); END IF; -- activate insert property -- Set_Item_Property(l_fit , VISUAL_ATTRIBUTE, 'VA_TEXT_INSERT'); ELSE l_vres:= fnc_validate(l_bit); IF substr(l_vres,1,3)<>'$$$' THEN IF l_vres NOT IN ('OK', 'LIGHT', 'MEDIUM', 'STRONG') THEN Set_Item_Property(l_blk||'.'||'LABEL_'||l_bit , VISUAL_ATTRIBUTE, 'VA_TXT_LABEL_ERROR'); -- underline to error full -- prc_enable_item(l_blk||'.'||'UNDER_'||l_bit); Set_Item_Property(l_blk||'.'||'UNDER_'||l_bit, VISUAL_ATTRIBUTE, 'VA_UL_ERROR'); COPY(l_vres, l_blk||'.'||'MSG_'||l_bit); -- Set_Item_Property(pkg_Item.item_name(l_bit).block||'.'||'MSG_'||l_bit , VISUAL_ATTRIBUTE, fnc_sign_msg(l_vres)); prc_enable_item(l_blk||'.'||'MSG_'||l_bit); ELSE Set_Item_Property(l_blk||'.'||'LABEL_'||l_bit , VISUAL_ATTRIBUTE, 'VA_TXT_LABEL_OK'); prc_enable_item(l_blk||'.'||'UNDER_'||l_bit); Set_Item_Property(l_blk||'.'||'UNDER_'||l_bit , VISUAL_ATTRIBUTE, 'VA_UL_FULL'); IF l_vres<>'OK' THEN prc_enable_item(l_blk||'.'||'MSG_'||l_bit); Set_Item_Property(l_blk||'.'||'MSG_'||l_bit , VISUAL_ATTRIBUTE, fnc_sign_msg(l_vres)); COPY(l_vres, l_blk||'.'||'MSG_'||l_bit); END IF; END IF; ELSE prc_enable_item(l_blk||'.'||'LABEL_'||l_bit); Set_Item_Property(l_blk||'.'||'LABEL_'||l_bit , VISUAL_ATTRIBUTE, 'VA_TXT_LABEL_ERROR'); -- underline to error full -- prc_enable_item(l_blk||'.'||'UNDER_'||l_bit); Set_Item_Property(l_blk||'.'||'UNDER_'||l_bit, VISUAL_ATTRIBUTE, 'VA_UL_ERROR'); -- error msg -- COPY(l_vres, l_blk||'.'||'MSG_'||l_bit); prc_enable_item(l_blk||'.'||'MSG_'||l_bit); Set_Item_Property(l_blk||'.'||'MSG_'||l_bit , VISUAL_ATTRIBUTE, 'VA_TXT_ERROR_MSG'); END IF; END IF; EXCEPTION WHEN OTHERS THEN prc_info('$$$ EXCEPTION in pkg_Item.prc_Leave: '||sqlerrm); END prc_Leave; ----------------------------------------------------------------------------------- FUNCTION fnc_final_check RETURN VARCHAR2 IS l_value VARCHAR2(64); BEGIN FOR i IN 1.. pkg_Item.item_ix.count LOOP l_value:= NAME_IN(pkg_Item.item_ix(i).name); IF (l_value IS NULL AND pkg_Item.item_ix(i).notnull='YES') OR -- item label text ? -- (l_value=pkg_Item.item_ix(i).text AND pkg_Item.item_ix(i).notnull='YES') OR -- item error message ? -- substr(NAME_IN(pkg_Item.item_name(pkg_Item.item_ix(i).name).block||'.'|| 'MSG_'||pkg_Item.item_ix(i).name),1,3)='$$$' THEN RETURN('Item: '|| pkg_Item.item_ix(i).name); END IF; END LOOP; RETURN('OK'); EXCEPTION WHEN OTHERS THEN prc_info('$$$ EXCEPTION in pkg_Item.fnc_final_check: '||sqlerrm); END fnc_final_check; ----------------------------------------------------------------------------------- PROCEDURE prc_chk_item (p_block VARCHAR2, p_item VARCHAR2, p_value VARCHAR2, p_result VARCHAR2 DEFAULT NULL ) IS l_res VARCHAR2(16); BEGIN go_item(p_block||'.'||p_item); IF p_value='GO' THEN RETURN; ELSIF p_value='PRESS' THEN Execute_Trigger('WHEN-BUTTON-PRESSED'); sleep(100); ELSE -- setter & getter item values -- Execute_Trigger('WHEN-NEW-ITEM-INSTANCE'); Copy(p_value, p_block||'.'||p_item); Execute_Trigger('WHEN-VALIDATE-ITEM'); sleep(150); -- check expected/real result -- l_res:='OK'; IF (substr(NAME_IN(pkg_Item.item_name(p_item).block||'.'||'MSG_'||p_item) ,1,3)='$$$') THEN l_res:='NOK'; END IF; IF (l_res='NOK' AND p_result='OK') OR ( (Name_In('MSG_'||p_item) IS NULL OR l_res='OK') AND p_result='NOK' ) THEN prc_info('$$$ Error in automatic test sequence :: '||chr(10)|| 'Item: '||p_item||chr(10)|| 'Value:'||p_value||chr(10)|| 'Result expected: '||p_result||chr(10)|| 'Result real: '||l_res||chr(10)||' $$$'); RETURN; END IF; -- compare values : setter=getter ? -- IF Name_In(pkg_Item.item_name(p_item).block||'.'||p_item)<>p_value THEN prc_info('$$$ Error in automatic test sequence :: '||chr(10)|| 'Item: '||p_item||chr(10)|| 'Value expected: '||p_value||chr(10)|| 'Value real: '||Name_In(pkg_Item.item_name(p_item).block||'.'||p_item)||chr(10)||' $$$'); END IF; END IF; EXCEPTION WHEN OTHERS THEN prc_info('$$$ Exception in pkg_Item.prc_chk_Item: '||sqlerrm); END prc_chk_item; ----------------------------------------------------------------------------------- -- !!! Used prc_Set_Items - defined from USER external procedure !!! -- ----------------------------------------------------------------------------------- PROCEDURE prc_rec (p_ix PLS_INTEGER, p_block VARCHAR2, p_name VARCHAR2, p_label VARCHAR2, p_text VARCHAR2, p_messg VARCHAR2 DEFAULT NULL, p_notnull VARCHAR2 DEFAULT 'YES', p_type VARCHAR2 DEFAULT 'NORMAL') IS l_label VARCHAR2(64); l_text VARCHAR2(64); BEGIN IF p_notnull='YES' THEN l_label:= p_label||' *'; l_text := p_text||' *'; ELSE l_label:= p_label; l_text := p_text; END IF; -- 1. set name sorted tab -- pkg_Item.item_name(p_name).id := p_ix; pkg_Item.item_name(p_name).block := p_block; pkg_Item.item_name(p_name).name := p_name; pkg_Item.item_name(p_name).label := l_label; pkg_Item.item_name(p_name).text := l_text; pkg_Item.item_name(p_name).msg := p_messg; pkg_Item.item_name(p_name).notnull := p_notnull; pkg_Item.item_name(p_name).type := p_type; -- 2. set ix sorted tab -- pkg_Item.item_ix(p_ix).id := p_ix; pkg_Item.item_ix(p_ix).block := p_block; pkg_Item.item_ix(p_ix).name := p_name; pkg_Item.item_ix(p_ix).label := l_label; pkg_Item.item_ix(p_ix).text := l_text; pkg_Item.item_ix(p_ix).msg := p_messg; pkg_Item.item_ix(p_ix).notnull := p_notnull; pkg_Item.item_ix(p_ix).type := p_type; EXCEPTION WHEN OTHERS THEN prc_info('$$$ Exception in pkg_Item.prc_init(rec): '||sqlerrm); END prc_rec; PROCEDURE prc_init_Items IS l_name VARCHAR2(32); BEGIN -- USER DEFINED - external !!! -- prc_Set_Items; FOR i IN 1.. pkg_Item.item_ix.count LOOP l_name:= pkg_Item.item_ix(i).name; COPY(pkg_Item.item_ix(i).text, l_name); COPY(pkg_Item.item_ix(i).label, 'LABEL_'||l_name); -- specials -- IF pkg_Item.item_ix(i).type='SECURE' THEN -- shows text -- Set_item_Property(pkg_Item.item_ix(i).block||'.'||l_name, ECHO, PROPERTY_TRUE); END IF; Set_item_Property(pkg_Item.item_ix(i).block||'.UNDER_'||l_name, VISUAL_ATTRIBUTE, 'VA_UL_EMPTY'); END LOOP; EXCEPTION WHEN OTHERS THEN prc_info('$$$ EXCEPTION pkg_Item.prc_init: '||sqlerrm); END prc_init_Items; ----------------------------------------------------------------------------------- END pkg_Item; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/PKG_ITEM.pks ================================================ PACKAGE pkg_Item IS -- Friedhold Matz - 2018-FEB gLastItem VARCHAR2(128); C_BlockName CONSTANT VARCHAR2(32):= 'BLK_ACCOUNT'; TYPE rec_def_t IS RECORD (id NUMBER(4), block VARCHAR2(32), name VARCHAR2(32), label VARCHAR2(64), text VARCHAR2(64), msg VARCHAR2(64), notnull VARCHAR2(8), type VARCHAR2(32) ); TYPE rec_item_name_t IS TABLE OF rec_def_t INDEX BY VARCHAR2(32); -- order by code TYPE rec_item_ix_t IS TABLE OF rec_def_t INDEX BY PLS_INTEGER; -- order by index item_name rec_item_name_t; item_ix rec_item_name_t; -- WHEN-NEW-INSTANCE-ITEM trigger -- PROCEDURE prc_Enter; -- WHEN-VALIDATE-ITEM trigger -- PROCEDURE prc_Leave; -- e.g. KEX-EXIT trigger -- FUNCTION fnc_final_check RETURN VARCHAR2; -- automated checks a item -- PROCEDURE prc_chk_item (p_block VARCHAR2, p_item VARCHAR2, p_value VARCHAR2, p_result VARCHAR2 DEFAULT NULL); PROCEDURE prc_rec (p_ix PLS_INTEGER, p_block VARCHAR2, p_name VARCHAR2, p_label VARCHAR2, p_text VARCHAR2, p_messg VARCHAR2 DEFAULT NULL, p_notnull VARCHAR2 DEFAULT 'YES', p_type VARCHAR2 DEFAULT 'NORMAL'); PROCEDURE prc_init_Items; END pkg_Item; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/POC_ACCOUNT/KEY-EXIT.tgg ================================================ BEGIN -- Friedhold Matz - 2018-FEB DECLARE l_res VARCHAR2(256); BEGIN l_res:= pkg_Item.fnc_final_check; IF l_res<>'OK' THEN IF fnc_msg_query(' User uccount is not completed ! '||chr(10)|| l_res ||chr(10)|| 'Do you want to exit ?')='YES' THEN EXIT_FORM(NO_VALIDATE); ELSE Raise Form_trigger_Failure; END IF; END IF; -- permanent storage function here ... -- prc_info('User account is completed .'); EXIT_FORM; END KEY_EXIT; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/POC_ACCOUNT/ON-ERROR.tgg ================================================ BEGIN BEGIN IF ERROR_CODE IN (42100) THEN NULL; ELSE prc_info('ERR::'||ERROR_CODE||'/'||ERROR_TEXT); END IF; END ON_ERROR; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/POC_ACCOUNT/ON-MESSAGE.tgg ================================================ BEGIN BEGIN prc_info('ON-MESSAGE::'||MESSAGE_CODE); END ON_MESSAGE; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/POC_ACCOUNT/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN /* * Created by Friedhold.Matz@yahoo.com - Jan-2018 * This PoC Demo demonstrates the Oracle Forms power * of Forms Items modernizing as "Materialized Items": * * - Low Native PL/SQL Forms code * - using simple four Items for one: * o LABEL_Item * o Item * o UNDER_Item * o MSG_Item . * - D_% items: Not used, only as separators. * - demonstrate a low code automated self check of this items. * * Basic features: * - Materialized items * - Verification of Oracle password incl. special characters * - Final check procedure of all defined items * - Automatic test sequence for expected results and item values. * --------------------------------------------------------------- * * NOT's: * ------ * - no using for production (only at own risk) * - no generic solution (yet) * - no maintainability * - no guarantee. * * Hope you can accept & enjoy it. * */ BEGIN set_window_property('WIN_MAIN', TITLE, 'User Account (Layout PoC) [poc_account v'||:PARAMETER.P_VERSION||']'); pkg_Item.prc_Init_Items; go_item('DUMMY'); END W_N_F_I; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/POP_CHECK/CHECK_ALL/POP_CHECK__CHECK_ALL.sql ================================================ BEGIN BEGIN -- Yoho, that's Forms ! -- prc_chk_item_sequence; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/PRC_CHK_ITEM_SEQUENCE.pcd ================================================ PROCEDURE prc_chk_item_sequence IS -- Friedhold Matz - 2018-FEB -- -- Automated self check sequence definition . -- BEGIN -- block item value expected result( DEFAULT:OK | NOK ) pkg_Item.prc_chk_item('BLK_ACCOUNT', 'USERNAME', 'Tester' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'FULLNAME', 'Friedhold Matz' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'EMAIL', 'fx@xx.' ,'NOK'); --'OK' ); -- <<< 'OK' => FALSE ! pkg_Item.prc_chk_item('BLK_ACCOUNT', 'EMAIL', 'fx@xx.com' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'EMAIL2', 'fx@xx.com' ,'NOK'); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'EMAIL2', 'fy@xx.com' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'QUERY', 'What''s the name of your cat ?' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'ANSWER', 'Susi' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD', '13aaaPPP+#-' ,'NOK'); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD', '1333aaPPP+#-' ,'NOK'); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD', 'testeraaPPP+#-123456' ,'NOK'); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD', 'aaPPPtester+#-123456' ,'NOK'); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD', '123aaaPPP+#-1TESTER' ,'NOK'); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD', '123aaaPPP+#-' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD', '123aaaPPP+#-123456' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD', '123aaaPPP+#-1234567890' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD_RETRY', '123aaaPPP+#-1234567891' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD_RETRY', '123aaaPPP+#-1234567890' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'BT_COMMIT', 'PRESS' ); -- clear (reset) items -- pkg_Item.prc_chk_item('BLK_ACCOUNT', 'USERNAME', '' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'FULLNAME', '' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'EMAIL', '' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'EMAIL2', '' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'QUERY', '' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'ANSWER', '' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD', '' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'PASSWORD_RETRY', '' ); pkg_Item.prc_chk_item('BLK_ACCOUNT', 'BT_COMMIT', 'GO' ); END prc_chk_item_sequence; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/PRC_INFO.pcd ================================================ PROCEDURE prc_info(s VARCHAR2) IS al_button PLS_INTEGER; al_id Alert; BEGIN -- ${open} -- al_id:= FIND_ALERT('INFO'); SET_ALERT_PROPERTY(al_id, ALERT_MESSAGE_TEXT, s ); al_button := SHOW_ALERT( al_id ); END prc_info; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/PRC_SET_ITEMS.pcd ================================================ PROCEDURE prc_Set_Items IS -- Friedhold Matz - 2018-FEB -- -- item value definitions -- BEGIN -- place your item definitions here . ! -- pkg_Item.prc_rec(1 , 'BLK_ACCOUNT', 'USERNAME', 'User name', 'Enter your user name', 'Must begin with .. followed .. #_$'); pkg_Item.prc_rec(2 , 'BLK_ACCOUNT', 'FULLNAME', 'Full name', 'Enter your full name', 'Must begin with .. followed .. #_$'); pkg_Item.prc_rec(3 , 'BLK_ACCOUNT', 'EMAIL', 'Email address', 'Enter your first email address', 'Not a valid email format !'); pkg_Item.prc_rec(4 , 'BLK_ACCOUNT', 'EMAIL2', 'Second email address', 'Enter your second email address', 'Not a valid email format !', 'NO'); pkg_Item.prc_rec(5 , 'BLK_ACCOUNT', 'QUERY', 'Users query', 'Enter your query (e.g. "Name of my Cat")', 'Must begin with .. followed .. #_$'); pkg_Item.prc_rec(6 , 'BLK_ACCOUNT', 'ANSWER', 'Users answer', 'Enter the answer of your query', '.. ', 'YES', 'SECURE'); pkg_Item.prc_rec(7 , 'BLK_ACCOUNT', 'PASSWORD', 'Password (3 lowers,3 uppers,3 numbers,3 specials)', 'Enter the password (min. 12 characters)', '.. Error message comes from intern ..', 'YES', 'SECURE'); pkg_Item.prc_rec(8 , 'BLK_ACCOUNT', 'PASSWORD_RETRY', 'Retry password', 'Re-enter the password', '.. Error message comes from intern ..', 'YES', 'SECURE'); EXCEPTION WHEN OTHERS THEN prc_info(' EXCEPTION prc_Set_Items: '||sqlerrm); END prc_Set_Items; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/V#R#FY_PW$001.fun ================================================ FUNCTION v#r#fy_pw$001 ( p_username varchar2, p_password varchar2 ) RETURN VARCHAR2 IS /* * This password check enabled some special characters using with "my :-} password.§$" * and get the password strength in Oracle Forms for the Oracle DB password setting. * That's a maximal password variant; remember that you can use ANY characters * in Oracle DB enclosed in double quotes e.g. " . - # ~ 12 .." * OUTPUT: substr(v#r#fy_pw$001,1,3)<>'$$$' => {LIGHT|MEDIUM|STRONG} :: 'OK' * substr(v#r#fy_pw$001,1,3)= '$$$' => '$$$ Error .. $$$' . * * Friedhold Matz - 2018-FEB * **/ -- password strength definition -- C_MINPWLEN CONSTANT NUMBER(3) :=12; C_MINDIGIT CONSTANT NUMBER(3) :=3; C_MINCHARLOW CONSTANT NUMBER(3) :=3; C_MINCHARUPP CONSTANT NUMBER(3) :=3; C_MINSPECIAL CONSTANT NUMBER(3) :=3; C_MEDIUM CONSTANT NUMBER(2) :=17; C_STRONG CONSTANT NUMBER(2) :=20; l_lenpw NUMBER(2); l_restype VARCHAR2(32); l_cnt_charlow NUMBER(3) :=0; l_cnt_charupp NUMBER(3) :=0; l_cnt_digit NUMBER(3) :=0; l_cnt_special NUMBER(3) :=0; l_cnt_NO NUMBER(3) :=0; l_1un CHAR(1); l_lenun NUMBER(2); l_char CHAR(1); BEGIN -- Check for the minimum length of the password -- l_lenpw := length(p_password); IF l_lenpw < C_MINPWLEN THEN RETURN('$$$ Error: Password length less than '||C_MINPWLEN||' characters. $$$'); END IF; -- Check if the password is same as the username or username(1-100) IF LOWER(password) = LOWER(p_username) THEN RETURN('$$$ Error: Password same as or similar to user $$$'); END IF; l_lenun := length(p_username); l_1un := substr(p_username,1,1); ------------------------------------------------------------------------------ --- Friedhold Matz : 14.10.2013 / 14.12.2017 / 09.02.2018 --- ------------------------------------------------------------------------------ FOR i IN 1..l_lenpw LOOP l_char := substr(p_password, i ,1); IF l_char BETWEEN 'a' AND 'z' THEN l_cnt_charlow:= l_cnt_charlow+1; ELSIF l_char BETWEEN 'A' and 'Z' THEN l_cnt_charupp:= l_cnt_charupp+1; ELSIF l_char BETWEEN '0' AND '9' THEN l_cnt_digit:= l_cnt_digit+1; ELSIF l_char IN( '#', '_', '$', '!', '"', '§', '%', '&', '/', '(', ')', '=', '?', '\', '{', '>', '<', '`', '°', '[', ']', '}', '~', '+', '*', '#', '-', ';', ',', ':', '.', ':', ' ', '´', ' ', '|', '''', '^' ) THEN l_cnt_special:= l_cnt_special+1; ELSE l_cnt_NO := l_cnt_NO+1; END IF; IF LOWER(l_char)=LOWER(l_1un) THEN IF LOWER(p_username)=LOWER(substr(p_password,i,l_lenun)) THEN RETURN('$$$ Error: Username is included in Password ! $$$'); END IF; END IF; END LOOP; IF l_cnt_charlow0 THEN RETURN('$$$ Error: Password contains invalid characters. $$$'); END IF; ------------------------------------------------------------------------------ --- Everything is fine, get the strength now. --- l_restype:='LIGHT'; IF l_lenpw BETWEEN C_MEDIUM AND C_STRONG THEN l_restype:='MEDIUM'; ELSIF l_lenpw > C_STRONG THEN l_restype:='STRONG'; END IF; RETURN (l_restype); EXCEPTION WHEN OTHERS THEN RETURN ('$$$ : '||l_lenpw||' / '||sqlerrm); END v#r#fy_pw$001; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0017/POC_ACCOUNT/metadata.json ================================================ { "alerts": [ "INFO", "QUERY" ], "blocks": [ { "name": "BLK_ACCOUNT", "items": [ "DUMMY", "LABEL_USERNAME", "USERNAME", "UNDER_USERNAME", "MSG_USERNAME", "D_", "LABEL_FULLNAME", "FULLNAME", "UNDER_FULLNAME", "MSG_FULLNAME", "D__", "LABEL_EMAIL", "EMAIL", "UNDER_EMAIL", "MSG_EMAIL", "D___", "LABEL_EMAIL2", "EMAIL2", "UNDER_EMAIL2", "MSG_EMAIL2", "D____", "LABEL_QUERY", "QUERY", "UNDER_QUERY", "MSG_QUERY", "D_____", "LABEL_ANSWER", "ANSWER", "UNDER_ANSWER", "MSG_ANSWER", "D______", "LABEL_PASSWORD", "PASSWORD", "UNDER_PASSWORD", "MSG_PASSWORD", "D_______", "LABEL_PASSWORD_RETRY", "PASSWORD_RETRY", "UNDER_PASSWORD_RETRY", "MSG_PASSWORD_RETRY", "D________", "BT_COMMIT", "CLOSE", "START_DEMO" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0018/TEST/TEST/TEST__BUTTON1__WHEN-BUTTON-PRESSED.tgg ================================================ BEGIN go_item('TEST'); do_key('EDIT_TEXTITEM'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0018/TEST/TEST/WHEN-NEW-FORM-INSTANCE.tgg ================================================ BEGIN execute_query; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/Doag-Forms-extracted/demo0018/TEST/metadata.json ================================================ { "alerts": [], "blocks": [ { "name": "TEST", "items": [ "TEST", "BUTTON1" ] } ], "lovs": [] } ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/README.md ================================================ These files were copied from https://github.com/antlr/grammars-v4/tree/086ca965a5fcff502e338879e50a0013b072683d/sql/plsql ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/administer_key_management.sql ================================================ ADMINISTER KEY MANAGEMENT MOVE KEYS TO NEW KEYSTORE '$ORACLE_BASE/admin/orcl/wallet' IDENTIFIED BY "pass" FROM FORCE KEYSTORE IDENTIFIED BY "pass" WITH IDENTIFIER IN (SELECT KEY_ID FROM V$ENCRYPTION_KEYS WHERE ROWNUM < 2); ADMINISTER KEY MANAGEMENT SWITCHOVER TO LIBRARY 'updated_fully_qualified_file_name_of_library' FOR ALL CONTAINERS; ADMINISTER KEY MANAGEMENT CREATE KEYSTORE '/etc/ORACLE/WALLETS/orcl' IDENTIFIED BY "pass"; ADMINISTER KEY MANAGEMENT CREATE AUTO_LOGIN KEYSTORE FROM KEYSTORE '/etc/ORACLE/WALLETS/orcl' IDENTIFIED BY "pass"; ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "pass"; ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "pass" CONTAINER = CURRENT; ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "user_id:password"; ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY EXTERNAL STORE; ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY "pass"; ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE; ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY "user_id:password"; ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY EXTERNAL STORE; ADMINISTER KEY MANAGEMENT BACKUP KEYSTORE USING 'hr.emp_keystore' IDENTIFIED BY "password" TO '/etc/ORACLE/KEYSTORE/DB1/'; ADMINISTER KEY MANAGEMENT ALTER KEYSTORE PASSWORD IDENTIFIED BY "old_password" SET "new_password" WITH BACKUP USING 'pwd_change'; ADMINISTER KEY MANAGEMENT MERGE KEYSTORE '/etc/ORACLE/KEYSTORE/DB1' AND KEYSTORE '/etc/ORACLE/KEYSTORE/DB2' IDENTIFIED BY "old-pass" INTO NEW KEYSTORE '/etc/ORACLE/KEYSTORE/DB3' IDENTIFIED BY "new-pass"; ADMINISTER KEY MANAGEMENT MERGE KEYSTORE '/etc/ORACLE/KEYSTORE/DB1' INTO EXISTING KEYSTORE '/etc/ORACLE/KEYSTORE/DB2' IDENTIFIED BY "pass" WITH BACKUP; ADMINISTER KEY MANAGEMENT SET KEY USING ALGORITHM 'SEED128' IDENTIFIED BY "pass" WITH BACKUP; ADMINISTER KEY MANAGEMENT CREATE KEY USING TAG 'mykey1' IDENTIFIED BY "pass" WITH BACKUP; ADMINISTER KEY MANAGEMENT USE KEY 'ARgEtzPxpE/Nv8WdPu8LJJUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' IDENTIFIED BY "pass" WITH BACKUP; ADMINISTER KEY MANAGEMENT SET TAG 'mykey2' FOR 'ARgEtzPxpE/Nv8WdPu8LJJUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' FORCE KEYSTORE IDENTIFIED BY "pass" WITH BACKUP; ADMINISTER KEY MANAGEMENT EXPORT KEYS WITH SECRET "my_secret" TO '/etc/TDE/export.exp' IDENTIFIED BY "password" WITH IDENTIFIER IN 'AdoxnJ0uH08cv7xkz83ovwsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'AW5z3CoyKE/yv3cNT5CWCXUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; ADMINISTER KEY MANAGEMENT EXPORT KEYS WITH SECRET "my_secret" TO '/etc/TDE/export.exp' IDENTIFIED BY "pass" WITH IDENTIFIER IN (SELECT KEY_ID FROM V$ENCRYPTION_KEYS WHERE TAG IN ('mytag1', 'mytag2')); ADMINISTER KEY MANAGEMENT EXPORT KEYS WITH SECRET "my_secret" TO '/etc/TDE/export.exp' IDENTIFIED BY "pass"; ADMINISTER KEY MANAGEMENT IMPORT KEYS WITH SECRET "my_secret" FROM '/etc/TDE/export.exp' IDENTIFIED BY "pass" WITH BACKUP; ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY IDENTIFIED BY "software_keystore_password" REVERSE MIGRATE USING "user_id:password"; ADMINISTER KEY MANAGEMENT ADD SECRET 'secret1' FOR CLIENT 'client1' USING TAG 'My first secret' IDENTIFIED BY "pass" WITH BACKUP; ADMINISTER KEY MANAGEMENT ADD SECRET 'secret2' FOR CLIENT 'client2' USING TAG 'My second secret' IDENTIFIED BY "user_id:password"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/aggregate_functions.sql ================================================ select collect(emp.ldap_login order by emp.last_name, emp.first_name) from employee emp where emp.dept = 'HR'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_analytic_view.sql ================================================ ALTER ANALYTIC VIEW sales_av RENAME TO mysales_av; ALTER ANALYTIC VIEW TKHCSGL308_UNITS_AVIEW_CACHE ADD CACHE MEASURE GROUP (sales, units, cost) LEVELS (TIME.FISCAL.FISCAL_QUARTER, WAREHOUSE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_attribute_dimension.sql ================================================ ALTER ATTRIBUTE DIMENSION product_attr_dim RENAME TO my_product_attr_dim; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_audit_policy.sql ================================================ ALTER AUDIT POLICY hr_audit_policy ADD ONLY TOPLEVEL; ALTER AUDIT POLICY hr_audit_policy DROP ONLY TOPLEVEL; ALTER AUDIT POLICY dml_pol ADD PRIVILEGES CREATE ANY TABLE, DROP ANY TABLE; ALTER AUDIT POLICY java_pol ADD ACTIONS CREATE JAVA, ALTER JAVA, DROP JAVA; ALTER AUDIT POLICY table_pol ADD ROLES dba; ALTER AUDIT POLICY security_pol ADD PRIVILEGES CREATE ANY LIBRARY, DROP ANY LIBRARY ACTIONS DELETE on hr.employees, INSERT on hr.employees, UPDATE on hr.employees, ALL on hr.departments ROLES dba, connect; ALTER AUDIT POLICY table_pol DROP PRIVILEGES CREATE ANY TABLE; ALTER AUDIT POLICY dml_pol DROP ACTIONS INSERT on hr.employees, UPDATE on hr.employees; ALTER AUDIT POLICY java_pol DROP ROLES java_deploy; ALTER AUDIT POLICY hr_admin_pol DROP PRIVILEGES CREATE ANY TABLE ACTIONS LOCK TABLE ROLES audit_viewer; ALTER AUDIT POLICY dp_actions_pol ADD ACTIONS COMPONENT = datapump EXPORT DROP ACTIONS COMPONENT = datapump IMPORT; ALTER AUDIT POLICY order_updates_pol CONDITION DROP; ALTER AUDIT POLICY emp_updates_pol CONDITION 'UID = 102' EVALUATE PER STATEMENT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_database.sql ================================================ ALTER DATABASE testdb DATAFILE '+dgroup_01/testdb/datafile/system.261.1' ONLINE; ALTER DATABASE OPEN READ ONLY; ALTER DATABASE RECOVER TABLESPACE tbs_03 PARALLEL; ALTER DATABASE ADD LOGFILE GROUP 3 ('diska:log3.log' , 'diskb:log3.log') SIZE 50K; ALTER DATABASE ADD LOGFILE THREAD 5 GROUP 4 ('diska:log4.log', 'diskb:log4:log'); ALTER DATABASE ADD LOGFILE MEMBER 'diskc:log3.log' TO GROUP 3; ALTER DATABASE DROP LOGFILE MEMBER 'diskb:log3.log'; ALTER DATABASE DROP LOGFILE GROUP 3; ALTER DATABASE RENAME FILE 'diskc:log3.log' TO 'diskb:log3.log'; ALTER DATABASE SET DEFAULT BIGFILE TABLESPACE; ALTER DATABASE DEFAULT TEMPORARY TABLESPACE tbs_05; ALTER DATABASE TEMPFILE 'temp02.dbf' OFFLINE; ALTER DATABASE RENAME FILE 'temp02.dbf' TO 'temp03.dbf'; ALTER DATABASE RENAME GLOBAL_NAME TO demo.world.oracle.com; ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE 'tracking_file' REUSE; ALTER DATABASE DISABLE BLOCK CHANGE TRACKING; ALTER DATABASE DATAFILE 'diskb:tbs_f5.dat' RESIZE 10 M; ALTER DATABASE CLEAR LOGFILE 'diskc:log3.log'; ALTER DATABASE RECOVER AUTOMATIC DATABASE; ALTER DATABASE RECOVER LOGFILE 'diskc:log3.log'; --TODO: fix grammar --ALTER DATABASE -- RECOVER STANDBY DATAFILE '/finance/stbs_21.f' -- UNTIL CONTROLFILE; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_dimension.sql ================================================ ALTER DIMENSION customers_dim DROP ATTRIBUTE country; ALTER DIMENSION customers_dim ADD LEVEL zone IS customers.cust_postal_code ADD ATTRIBUTE zone DETERMINES (cust_city); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_diskgroup.sql ================================================ ALTER DISKGROUP hmdg ADD FILEGROUP fgtem TEMPLATE SET 'datafile.redundancy'='unprotected'; ALTER DISKGROUP hmdg ADD FILEGROUP fgdb DATABASE NONE FROM TEMPLATE fgtem; ALTER DISKGROUP hmdg ADD FILEGROUP fgtem2 TEMPLATE FROM TEMPLATE fgtem; ALTER DISKGROUP dgroup_01 ADD DISK '/devices/disks/d100'; ALTER DISKGROUP dgroup_01 DROP DISK dgroup_01_0000; ALTER DISKGROUP dgroup_01 UNDROP DISKS; ALTER DISKGROUP dgroup_01 RESIZE ALL SIZE 36G; ALTER DISKGROUP dgroup_01 REBALANCE POWER 11 WAIT; ALTER DISKGROUP dgroup_01 CHECK ALL REPAIR; ALTER DISKGROUP dgroup_01 ADD TEMPLATE template_01 ATTRIBUTES (UNPROTECTED COARSE); ALTER DISKGROUP dgroup_01 MODIFY TEMPLATE template_01 ATTRIBUTES (FINE); ALTER DISKGROUP dgroup_01 DROP TEMPLATE template_01; ALTER DISKGROUP dgroup_01 ADD DIRECTORY '+dgroup_01/alias_dir'; ALTER DISKGROUP dgroup_01 ADD ALIAS '+dgroup_01/alias_dir/datafile.dbf' FOR '+dgroup_01.261.1'; ALTER DISKGROUP dgroup_01 SCRUB REPAIR WAIT; ALTER DISKGROUP dgroup_01 DISMOUNT FORCE; ALTER DISKGROUP dgroup_01 MOUNT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_flashback_archive.sql ================================================ ALTER FLASHBACK ARCHIVE test_archive1 MODIFY RETENTION 1 MONTH; ALTER TABLE oe.customers FLASHBACK ARCHIVE; ALTER TABLE oe.orders FLASHBACK ARCHIVE test_archive2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_function.sql ================================================ ALTER FUNCTION my_schema.my_fun EDITIONABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_hierarchy.sql ================================================ ALTER HIERARCHY product_hier RENAME TO myproduct_hier; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_inmemory_join_group.sql ================================================ ALTER INMEMORY JOIN GROUP prod_id1 ADD(product_descriptions(product_id)); ALTER INMEMORY JOIN GROUP prod_id1 REMOVE(product_descriptions(product_id)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_java.sql ================================================ ALTER JAVA CLASS "Agent" RESOLVER (("/usr/bin/bfile_dir/*" pm)(* public)) RESOLVE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_library.sql ================================================ ALTER LIBRARY hr.my_ext_lib COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_lockdown_profile.sql ================================================ ALTER LOCKDOWN PROFILE hr_prof DISABLE FEATURE = ('NETWORK_ACCESS'); ALTER LOCKDOWN PROFILE hr_prof DISABLE FEATURE = ('LOB_FILE_ACCESS', 'TRACE_VIEW_ACCESS'); ALTER LOCKDOWN PROFILE hr_prof DISABLE FEATURE ALL EXCEPT = ('COMMON_USER_LOCAL_SCHEMA_ACCESS', 'LOCAL_USER_COMMON_SCHEMA_ACCESS'); ALTER LOCKDOWN PROFILE hr_prof DISABLE FEATURE ALL; ALTER LOCKDOWN PROFILE hr_prof ENABLE FEATURE = ('UTL_HTTP', 'UTL_SMTP', 'OS_ACCESS'); ALTER LOCKDOWN PROFILE hr_prof ENABLE FEATURE ALL EXCEPT = ('AQ_PROTOCOLS', 'CTX_PROTOCOLS'); ALTER LOCKDOWN PROFILE hr_prof ENABLE FEATURE ALL; ALTER LOCKDOWN PROFILE hr_prof DISABLE OPTION = ('DATABASE QUEUING'); ALTER LOCKDOWN PROFILE hr_prof DISABLE OPTION = ('PARTITIONING'); ALTER LOCKDOWN PROFILE hr_prof ENABLE OPTION = ('DATABASE QUEUING'); ALTER LOCKDOWN PROFILE hr_prof ENABLE OPTION ALL; ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER DATABASE'); ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SUSPEND', 'RESUME'); ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER PLUGGABLE DATABASE') CLAUSE ALL EXCEPT = ('DEFAULT TABLESPACE', 'DEFAULT TEMPORARY TABLESPACE'); ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SESSION') CLAUSE = ('SET') OPTION = ('COMMIT_WAIT', 'CURSOR_SHARING'); ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SET') OPTION = ('PDB_FILE_NAME_CONVERT') VALUE = ('cdb1_pdb0', 'cdb1_pdb1'); ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SET') OPTION = ('CPU_COUNT') MINVALUE = '8'; ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SET') OPTION = ('CPU_COUNT') MAXVALUE = '2'; ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SET') OPTION = ('CPU_COUNT') MINVALUE = '2' MAXVALUE = '6'; ALTER LOCKDOWN PROFILE hr_prof ENABLE STATEMENT ALL EXCEPT = ('ALTER DATABASE'); ALTER LOCKDOWN PROFILE hr_prof ENABLE STATEMENT = ('ALTER DATABASE') CLAUSE = ('MOUNT', 'OPEN'); ALTER LOCKDOWN PROFILE hr_prof ENABLE STATEMENT = ('ALTER PLUGGABLE DATABASE') CLAUSE ALL EXCEPT = ('DEFAULT TABLESPACE', 'DEFAULT TEMPORARY TABLESPACE'); ALTER LOCKDOWN PROFILE hr_prof ENABLE STATEMENT = ('ALTER SESSION') CLAUSE = ('SET') OPTION = ('COMMIT_WAIT', 'CURSOR_SHARING'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_materialized_zonemap.sql ================================================ ALTER MATERIALIZED ZONEMAP sales_zmap PCTFREE 20 PCTUSED 50 NOCACHE; ALTER MATERIALIZED ZONEMAP sales_zmap REFRESH FAST ON COMMIT; ALTER MATERIALIZED ZONEMAP sales_zmap DISABLE PRUNING; ALTER MATERIALIZED ZONEMAP sales_zmap COMPILE; ALTER MATERIALIZED ZONEMAP sales_zmap REBUILD; ALTER MATERIALIZED ZONEMAP sales_zmap UNUSABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_mv.sql ================================================ ALTER MATERIALIZED VIEW sales_by_month_by_state REFRESH FAST; ALTER MATERIALIZED VIEW sales_by_month_by_state REFRESH NEXT SYSDATE+7; ALTER MATERIALIZED VIEW sales_by_month_by_state CONSIDER FRESH; ALTER MATERIALIZED VIEW emp_data REFRESH COMPLETE START WITH TRUNC(SYSDATE+1) + 9/24 NEXT SYSDATE+7; ALTER MATERIALIZED VIEW emp_data ENABLE QUERY REWRITE; ALTER MATERIALIZED VIEW order_data REFRESH WITH PRIMARY KEY; ALTER MATERIALIZED VIEW order_data COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_mv_log.sql ================================================ ALTER MATERIALIZED VIEW LOG ON order_items ADD ROWID; ALTER MATERIALIZED VIEW LOG ON employees ADD (commission_pct) EXCLUDING NEW VALUES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_operator.sql ================================================ ALTER OPERATOR eq_op COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_outline.sql ================================================ ALTER OUTLINE salaries REBUILD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_pmem_filestore.sql ================================================ ALTER PMEM FILESTORE cloud_db_1 RESIZE 5T; ALTER PMEM FILESTORE cloud_db_1 MOUNT MOUNTPOINT '/corp/db/cloud_db_1' BACKINGFILE '/var/pmem/foo_1'; ALTER PMEM FILESTORE cloud_db_1 DISMOUNT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_resource_cost.sql ================================================ ALTER RESOURCE COST CPU_PER_SESSION 100 CONNECT_TIME 1; ALTER RESOURCE COST LOGICAL_READS_PER_SESSION 2 CONNECT_TIME 0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_role.sql ================================================ alter role TEST_ROLE_AAA NOT IDENTIFIED; alter role TEST_ROLE_AAA IDENTIFIED BY data; alter role TEST_ROLE_AAA IDENTIFIED EXTERNALLY; ALTER ROLE TEST_ROLE_AAA IDENTIFIED USING hr.admin; alter role TEST_ROLE_AAA IDENTIFIED GLOBALLY; ALTER ROLE dw_manager IDENTIFIED GLOBALLY AS 'domain_name_of_directory_group' ; ALTER ROLE warehouse_user NOT IDENTIFIED CONTAINER = CURRENT; ALTER ROLE warehouse_user NOT IDENTIFIED CONTAINER = ALL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_rollback_segment.sql ================================================ ALTER ROLLBACK SEGMENT rbs_one ONLINE; ALTER ROLLBACK SEGMENT rbs_one SHRINK TO 100M; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_session.sql ================================================ ALTER SESSION SET QUERY_REWRITE_ENABLED = TRUE; ALTER SESSION SET NLS_SORT = XSpanish; ALTER SESSION SET NLS_LANGUAGE = FRENCH; ALTER SESSION SET NLS_CURRENCY = 'FF'; ALTER SESSION ADVISE COMMIT; ALTER SESSION ENABLE PARALLEL DML; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_synonym01.sql ================================================ alter synonym emp compile; alter public synonym emp compile; alter public synonym emp noneditionable; alter public synonym sch.emp editionable; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_table.sql ================================================ alter table hr.employees add constraint emp_fk foreign key (department_id) references hr.departments (department_id) on delete cascade; alter table hr.employees add foreign key (department_id) references hr.departments (department_id) on delete set null; alter table hr.employees add constraint emp_fk foreign key (department_id, employee_id) references hr.some_table (department_id, employee_id); alter table employees add primary key (employee_id); alter table hr.employees add constraint emp_complex_pk primary key (employee_id, department_id); alter table hr.employees add constraint emp_uq unique (employee_id, email); alter table employees add unique (employee_id); ALTER TABLE suppliers ADD CONSTRAINT check_supplier_name CHECK (supplier_name IN ('IBM', 'Microsoft', 'NVIDIA')); ALTER TABLE suppliers DROP CONSTRAINT check_supplier_id; ALTER TABLE suppliers ENABLE CONSTRAINT check_supplier_id; ALTER TABLE suppliers DISABLE CONSTRAINT check_supplier_id; ALTER TABLE customers PARALLEL; ALTER TABLE employees DEALLOCATE UNUSED; ALTER TABLE countries_demo INITRANS 4; ALTER TABLE employees PCTFREE 30 PCTUSED 60; ALTER TABLE employees ALLOCATE EXTENT (SIZE 5K INSTANCE 4); ALTER TABLE customers ADD (online_acct_pw VARCHAR2(8) ENCRYPT 'NOMAC' NO SALT ); ALTER TABLE employees ADD (resume CLOB) LOB (resume) STORE AS resume_seg (TABLESPACE example); ALTER TABLE employees ADD (resume CLOB) LOB (resume) STORE AS SECUREFILE resume_seg (TABLESPACE auto_seg_ts); ALTER TABLE employees ADD (skills number) NESTED TABLE skills STORE AS nested_skill_table; ALTER TABLE employees ENABLE VALIDATE CONSTRAINT emp_manager_fk EXCEPTIONS INTO exceptions; ALTER TABLE print_media MODIFY NESTED TABLE ad_textdocs_ntab RETURN AS VALUE; ALTER TABLE employees ENABLE NOVALIDATE PRIMARY KEY ENABLE NOVALIDATE CONSTRAINT emp_last_name_nn; ALTER TABLE locations MODIFY PRIMARY KEY DISABLE CASCADE; ALTER TABLE employees ADD CONSTRAINT check_comp CHECK (salary + (commission_pct*salary) <= 5000) DISABLE; ALTER TABLE employees ENABLE ALL TRIGGERS; ALTER TABLE employees DEALLOCATE UNUSED; ALTER TABLE customers RENAME COLUMN credit_limit TO credit_amount; ALTER TABLE t1 DROP (pk) CASCADE CONSTRAINTS; ALTER TABLE t1 DROP (pk, fk, c1); ALTER TABLE customers MODIFY (online_acct_pw DECRYPT); ALTER TABLE departments DROP PRIMARY KEY CASCADE; ALTER TABLE employees DROP UNIQUE (email); ALTER TABLE employees MODIFY LOB (resume) (CACHE); ALTER TABLE employees MODIFY LOB (resume) (NOCACHE); ALTER TABLE employees MODIFY LOB (resume) (NOCACHE); alter TABLE employee add ( constraint employee_pk UNique ( a , b ) ) ; alter table employee add ( constraint emp_fk foreign key (col1, col2) references other, constraint emp_fk2 foreign key (col1, col2) references another ); alter table employee add constraint emp_fk foreign key (col1, col2) references other; alter table employee add constraint emp_fk foreign key (col1, col2) references other on delete set null; alter table employee add constraint emp_fk foreign key (col1, col2) references other on delete cascade; ALTER TABLE TABLE_A ADD TABLE_B_ID NUMBER(5) ADD FOREIGN KEY (TABLE_B_ID) REFERENCES TABLE_B (ID); ALTER TABLE S.PRODUCTS DROP PARTITION FOR 101; ALTER TABLE S.PRODUCTS DROP PARTITION p0 UPDATE GLOBAL INDEXES; ALTER TABLE S.PRODUCTS DROP PARTITION p0 INVALIDATE GLOBAL INDEXES; ALTER TABLE S.PRODUCTS DROP PARTITION p0 UPDATE INDEXES; ALTER TABLE S.PRODUCTS DROP PARTITION p0, p1 UPDATE INDEXES; ALTER TABLE S.PRODUCTS DROP PARTITION p0 UPDATE GLOBAL INDEXES NOPARALLEL; ALTER TABLE S.PRODUCTS DROP PARTITION p0 INVALIDATE GLOBAL INDEXES NOPARALLEL; ALTER TABLE S.PRODUCTS DROP PARTITION p0 UPDATE INDEXES NOPARALLEL; ALTER TABLE B.EXCHANGE_LOG DROP PARTITION FOR (TIMESTAMP '2022-01-28 00:00:00') UPDATE GLOBAL INDEXES ; ALTER TABLE mesg_perf_stat TRUNCATE PARTITION SYS_P1221396 DROP STORAGE CASCADE UPDATE INDEXES; ALTER TABLE employees MEMOPTIMIZE FOR READ ENABLE VALIDATE CONSTRAINT emp_manager_fk EXCEPTIONS INTO exceptions; ALTER TABLE employees NO MEMOPTIMIZE FOR READ ENABLE VALIDATE CONSTRAINT emp_manager_fk EXCEPTIONS INTO exceptions; ALTER TABLE employees MEMOPTIMIZE FOR WRITE ENABLE VALIDATE CONSTRAINT emp_manager_fk EXCEPTIONS INTO exceptions; ALTER TABLE employees NO MEMOPTIMIZE FOR WRITE ENABLE VALIDATE CONSTRAINT emp_manager_fk EXCEPTIONS INTO exceptions; ALTER TABLE employees MODIFY LAST_UPDATE_DATE invisible; ALTER TABLE employees MODIFY LAST_UPDATE_DATE visible; ALTER TABLE employees ADD XMLTYPE; ALTER TABLE PTY_PD_IVSM_MAGR_INFO DROP CONSTRAINT PK_PTY_PD_IVSM_MAGR_INFO CASCADE DROP INDEX; ALTER TABLE TABLE_NAME SPLIT PARTITION TABLE_NAME_CURRENT AT (TO_DATE('20240116040241', 'YYYYMMDDHH24MISS')) INTO (PARTITION TABLE_NAME_20240116040241, PARTITION TABLE_NAME_CURRENT) UPDATE INDEXES; ALTER TABLE TABLE_NAME SPLIT PARTITION TABLE_NAME_CURRENT AT (TO_DATE('20240116040241', 'YYYYMMDDHH24MISS')) INTO (PARTITION TABLE_NAME_20240116040241, PARTITION TABLE_NAME_CURRENT) UPDATE INDEXES (COST_IX (PARTITION C_P1 TABLESPACE TBS_02, PARTITION C_P2 TABLESPACE TBS_03)); ALTER TABLE "AB01"."SMOSTAMM" ADD CONSTRAINT "CC_SMOSTAMM_KRAB" CHECK ((KRAB >= 0. ) AND (KRAB <= 100. )) ENABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_table_inmemory.sql ================================================ -- inmemory_table_clause ALTER TABLE customer INMEMORY; ALTER TABLE customer NO INMEMORY; -- inmemory_memcompress ALTER TABLE customer INMEMORY MEMCOMPRESS FOR DML; ALTER TABLE customer INMEMORY MEMCOMPRESS FOR QUERY; ALTER TABLE customer INMEMORY MEMCOMPRESS FOR QUERY LOW; ALTER TABLE customer INMEMORY MEMCOMPRESS FOR QUERY HIGH; ALTER TABLE customer INMEMORY MEMCOMPRESS FOR CAPACITY; ALTER TABLE customer INMEMORY MEMCOMPRESS FOR CAPACITY LOW; ALTER TABLE customer INMEMORY MEMCOMPRESS FOR CAPACITY HIGH; ALTER TABLE customer INMEMORY NO MEMCOMPRESS; -- inmemory_priority ALTER TABLE customer INMEMORY PRIORITY NONE; ALTER TABLE customer INMEMORY PRIORITY LOW; ALTER TABLE customer INMEMORY PRIORITY MEDIUM; ALTER TABLE customer INMEMORY PRIORITY HIGH; ALTER TABLE customer INMEMORY PRIORITY CRITICAL; -- inmemory_distribute ALTER TABLE customer INMEMORY DISTRIBUTE; ALTER TABLE customer INMEMORY DISTRIBUTE AUTO; ALTER TABLE customer INMEMORY DISTRIBUTE BY ROWID RANGE; ALTER TABLE customer INMEMORY DISTRIBUTE BY PARTITION; ALTER TABLE customer INMEMORY DISTRIBUTE BY SUBPARTITION; ALTER TABLE customer INMEMORY DISTRIBUTE FOR SERVICE DEFAULT; ALTER TABLE customer INMEMORY DISTRIBUTE FOR SERVICE ALL; ALTER TABLE customer INMEMORY DISTRIBUTE FOR SERVICE some_service; ALTER TABLE customer INMEMORY DISTRIBUTE FOR SERVICE NONE; ALTER TABLE customer INMEMORY DISTRIBUTE BY ROWID RANGE FOR SERVICE DEFAULT; -- inmemory_duplicate ALTER TABLE customer INMEMORY DUPLICATE; ALTER TABLE customer INMEMORY DUPLICATE ALL; ALTER TABLE customer INMEMORY NO DUPLICATE; -- inmemory_column_clause ALTER TABLE customer INMEMORY INMEMORY (customer_name); ALTER TABLE customer INMEMORY (customer_name, customer_id); ALTER TABLE customer INMEMORY (name) INMEMORY (customer_id); ALTER TABLE customer INMEMORY (name) NO INMEMORY (customer_id); ALTER TABLE customer INMEMORY MEMCOMPRESS FOR QUERY LOW (name) NO INMEMORY (customer_id); -- verify usage of ... as regular id CREATE TABLE vendor (SERVICE VARCHAR2(100)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_table_modify_partition_by_range.sql ================================================ ALTER TABLE table_name MODIFY PARTITION BY RANGE (date_column) INTERVAL ( NUMTODSINTERVAL (1, 'DAY') ) ( PARTITION VALUES LESS THAN (TO_DATE('2024-01-01', 'YYYY-MM-DD')) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_table_modify_partition_shrink.sql ================================================ ALTER TABLE tft_tsm.t_act_trade_detail MODIFY PARTITION SYS_P41089 SHRINK SPACE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_tablespace_set.sql ================================================ ALTER TABLESPACE SET ts1 FORCE LOGGING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_tablespaces.sql ================================================ ALTER TABLESPACE tbs_01 BEGIN BACKUP; ALTER TABLESPACE tbs_01 END BACKUP; ALTER TABLESPACE tbs_02 OFFLINE NORMAL; ALTER TABLESPACE tbs_02 RENAME DATAFILE 'diskb:tbs_f5.dbf' TO 'diska:tbs_f5.dbf'; ALTER TABLESPACE tbs_02 ONLINE; ALTER TABLESPACE tbs_03 ADD DATAFILE 'tbs_f04.dbf' SIZE 100K AUTOEXTEND ON NEXT 10K MAXSIZE 100K; ALTER TABLESPACE tbs_03 DROP DATAFILE 'tbs_f04.dbf'; ALTER TABLESPACE temp_demo ADD TEMPFILE 'temp05.dbf' SIZE 5 AUTOEXTEND ON; ALTER TABLESPACE temp_demo DROP TEMPFILE 'temp05.dbf'; ALTER TABLESPACE temp_demo SHRINK SPACE; ALTER TABLESPACE omf_ts1 ADD DATAFILE; ALTER TABLESPACE tbs_03 NOLOGGING; ALTER TABLESPACE undots1 RETENTION NOGUARANTEE; ALTER TABLESPACE undots1 RETENTION GUARANTEE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/alter_view.sql ================================================ ALTER VIEW customer_ro COMPILE; ALTER VIEW customer_ro EDITIONABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/analytic_query.sql ================================================ select time_id, product , last_value(quantity ignore nulls) over (partition by product order by time_id) quantity , last_value(quantity respect nulls) over (partition by product order by time_id) quantity from ( select times.time_id, product, quantity from inventory partition by (product) right outer join times on (times.time_id = inventory.time_id) where times.time_id between to_date('01/04/01', 'dd/mm/yy') and to_date('06/04/01', 'dd/mm/yy')) order by 2,1; select times.time_id, product, quantity from inventory partition by (product) right outer join times on (times.time_id = inventory.time_id) where times.time_id between to_date('01/04/01', 'dd/mm/yy') and to_date('06/04/01', 'dd/mm/yy') order by 2,1; select deptno , ename , hiredate , listagg(ename, ',') within group (order by hiredate) over (partition by deptno) as employees from emp; select deptno , ename , hiredate , listagg(ename, ',' ON OVERFLOW ERROR) within group (order by hiredate) over (partition by deptno) as employees from emp; select deptno , ename , hiredate , listagg(ename, ',' ON OVERFLOW TRUNCATE) within group (order by hiredate) over (partition by deptno) as employees from emp; select deptno , ename , hiredate , listagg(UNIQUE ename, ',' ON OVERFLOW TRUNCATE) within group (order by hiredate) over (partition by deptno) as employees , listagg(UNIQUE edepartment, ',' ON OVERFLOW TRUNCATE) within group (order by hiredate) over (partition by deptno) as edepartments from emp; select deptno , ename , hiredate , listagg(UNIQUE ename, (',') || TO_CHAR(13) ON OVERFLOW TRUNCATE) within group (order by hiredate) over (partition by deptno) as employees from emp; select deptno , ename , hiredate , listagg(UNIQUE ename, d ON OVERFLOW TRUNCATE) within group (order by hiredate) over (partition by deptno) as employees from emp; select metric_id ,bsln_guid ,timegroup ,obs_value as obs_value , cume_dist () over (partition by metric_id, bsln_guid, timegroup order by obs_value ) as cume_dist , count(1) over (partition by metric_id, bsln_guid, timegroup ) as n , row_number () over (partition by metric_id, bsln_guid, timegroup order by obs_value) as rrank , percentile_disc(:b7 ) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as mid_tail_value , max(obs_value) over (partition by metric_id, bsln_guid, timegroup ) as max_val , min(obs_value) over (partition by metric_id, bsln_guid, timegroup ) as min_val , avg(obs_value) over (partition by metric_id, bsln_guid, timegroup ) as avg_val , stddev(obs_value) over (partition by metric_id, bsln_guid, timegroup ) as sdev_val , percentile_cont(0.25) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_25 , percentile_cont(0.5) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_50 , percentile_cont(0.75) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_75 , percentile_cont(0.90) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_90 , percentile_cont(0.95) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_95 , percentile_cont(0.99) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_99 from timegrouped_rawdata d; select trim(both ' ' from ' a ') from dual where trim(:a) is not null; with clus_tab as ( select id, a.attribute_name aname, a.conditional_operator op, nvl(a.attribute_str_value, round(decode(a.attribute_name, n.col, a.attribute_num_value * n.scale + n.shift, a.attribute_num_value),4)) val, a.attribute_support support, a.attribute_confidence confidence from table(dbms_data_mining.get_model_details_km('km_sh_clus_sample')) t, table(t.rule.antecedent) a, km_sh_sample_norm n where a.attribute_name = n.col (+) and a.attribute_confidence > 0.55 ), clust as ( select id, cast(collect(cattr(aname, op, to_char(val), support, confidence)) as cattrs) cl_attrs from clus_tab group by id ), custclus as ( select t.cust_id, s.cluster_id, s.probability from (select cust_id , cluster_set(km_sh_clus_sample, null, 0.2 using *) pset from km_sh_sample_apply_prepared where cust_id = 101362) t, table(t.pset) s ) select a.probability prob, a.cluster_id cl_id, b.attr, b.op, b.val, b.supp, b.conf from custclus a, (select t.id, c.* from clust t, table(t.cl_attrs) c) b where a.cluster_id = b.id order by prob desc, cl_id asc, conf desc, attr asc, val asc; select row_number() over (partition by hc.id_ws order by hc.lastdate desc) rn1 , lag(ascii(hc.status)-32, 1, -1) ignore nulls over (partition by hc.id_ws order by hc.lastdate) lag_st , lead(ascii(hc.status)-32, 1, -1) ignore nulls over (partition by hc.id_ws order by hc.lastdate) lead_st , var_pop(hc.price) over (partition by hc.id_reg) pr_var , wm_concat(hc.code) over (partition by hc.id_reg) reg_codes from history_tbl hc where hc.id_ws in (select id_ws from ws_tbl where name like 'MX%'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/analyze.sql ================================================ ANALYZE TABLE orders DELETE STATISTICS; ANALYZE INDEX inv_product_ix VALIDATE STRUCTURE; ANALYZE TABLE employees VALIDATE STRUCTURE CASCADE; ANALYZE TABLE customers VALIDATE REF UPDATE; ANALYZE TABLE customers VALIDATE STRUCTURE ONLINE; ANALYZE CLUSTER personnel VALIDATE STRUCTURE CASCADE; ANALYZE TABLE orders LIST CHAINED ROWS INTO chained_rows; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/associate_statistics.sql ================================================ ASSOCIATE STATISTICS WITH PACKAGES emp_mgmt DEFAULT SELECTIVITY 10; ASSOCIATE STATISTICS WITH INDEXES salary_index DEFAULT COST (100,5,0); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/audit.sql ================================================ AUDIT ROLE; AUDIT ROLE WHENEVER SUCCESSFUL; AUDIT ROLE WHENEVER NOT SUCCESSFUL; AUDIT SELECT TABLE, UPDATE TABLE; AUDIT SELECT TABLE, UPDATE TABLE BY hr, oe; AUDIT DELETE ANY TABLE; AUDIT CREATE ANY DIRECTORY; AUDIT DIRECTORY; AUDIT READ ON DIRECTORY bfile_dir; AUDIT SELECT ON hr.employees; AUDIT SELECT ON hr.employees WHENEVER SUCCESSFUL; AUDIT SELECT ON hr.employees WHENEVER NOT SUCCESSFUL; AUDIT INSERT, UPDATE ON oe.customers; AUDIT ALL ON hr.employees_seq; AUDIT ALTER, GRANT, INSERT, UPDATE, DELETE ON DEFAULT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/bindvar01.sql ================================================ insert into p ( a1, b2, c3, d4, e5, f6, g7, h8 ) values ( :b1, :b2, :b3, :b4, :5, :6, :7, :8) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/bindvar02.sql ================================================ select * from a where a=:3 and b= : 4 and c= :5and :a = :b ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/bindvar03.sql ================================================ select count(*), max(scn) from ( select sp.bo#, sp.pmoptype, sp.scn, sp.flags from sumpartlog$ sp, sumdep$ sd where sd.sumobj# = :1 and sd.p_obj# = sp.bo# group by sp.bo#, sp.pmoptype, sp.scn, sp.flags minus select sp.bo#, sp.pmoptype, sp.scn, sp.flags from sumpartlog$ sp where sp.bo# not in ( select sk.detailobj# from sumkey$ sk where sk.sumobj# = :1 and sk.detailcolfunction in (2,3) ) and bitand(sp.flags, 2) != 2 and sp.pmoptype in (2,3,5,7) group by sp.bo#, sp.pmoptype, sp.scn, sp.flags ) where scn > : 2 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/bindvar04.sql ================================================ select * from ( select * from "rme" "rm" where "rm".a-interval:"sys_b_07" day(:"sys_b_08") to second(:"sys_b_09") ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/bindvar05.sql ================================================ select object_name, object_id, decode(status, 'INVALID', 'TRUE', 'FALSE') invalid, 'TRUE' runnable, plsql_debug from sys.dba_objects o, dba_plsql_object_settings s where o.owner = :schema and s.owner = :schema and s.name = o.object_name and s.type = 'PACKAGE' and object_type = 'PACKAGE' and subobject_name is null and object_id not in ( select purge_object from recyclebin ) and upper(object_name) in upper(:name) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/block01.sql ================================================ CREATE OR REPLACE PACKAGE TEST_PKG_LXD AS -- Package header PROCEDURE block_test; END TEST_PKG_LXD; CREATE OR REPLACE PACKAGE BODY TEST_PKG_LXD AS -- Package body -- This test case compiles and runs fine on 'Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production' PROCEDURE block_test IS BEGIN DECLARE v1 PLS_INTEGER := 1; BEGIN dbms_output.put_line('v1=' || v1); END; DECLARE BEGIN dbms_output.put_line('empty declare_spec is ok'); END; BEGIN dbms_output.put_line('no DECLARE no declare_spec is ok too'); END; -- the block below is invalid -- v2 PLS_INTEGER := 1; -- BEGIN -- dbms_output.put_line(''); -- END; END block_test; END TEST_PKG_LXD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/block02.sql ================================================ -- anonymous block with undocumented NULL option in variable declaration DECLARE i INTEGER NULL DEFAULT 0; BEGIN dbms_output.put_line(i); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/bulk_collect_fetch_clause01.sql ================================================ declare cursor cur_div is select rid, code from tmp_data_item_value_euro; lvnCount number := 0; type cCurDiv_t is table of cur_div%Rowtype; lvaCurDiv cCurDiv_t; begin open cur_div; loop fetch cur_div bulk collect into lvaCurDiv limit 100000; exit when lvaCurDiv.count = 0; forall i in lvaCurDiv.first .. lvaCurDiv.last update data_item_value set unit_code = lvaCurDiv(i).code where rowid = lvaCurDiv(i).rid; commit; end loop; close cur_div; commit; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/call.sql ================================================ CALL my_procedure(arg1 => 3, arg2 => 4) ; CALL my_procedure(3, 4) ; CALL my_procedure(3, arg2 => 4) ; CALL emp_mgmt.remove_dept(162); CALL warehouse_typ(456, 'Warehouse 456', 2236).ret_name() INTO :x; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/case_when01.sql ================================================ select ROOT,LEV,OBJ,LinK,PaTH,cycle, case when (LEV - LEaD(LEV) over (order by orD)) < 0 then 0 else 1 end is_LEaF from T ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/case_when02.sql ================================================ select STaLENESS, OSIZE, OBJ#, TYPE#, case when STaLENESS > .5 then 128 when STaLENESS > .1 then 256 else 0 end + aFLaGS aFLaGS, STaTUS, SID, SERIaL#, PaRT#, BO# , case when is_FULL_EVENTS_HisTorY = 1 then SRC.Bor_LasT_STaTUS_TIME else case GREaTEST (NVL (WP.Bor_LasT_STaT_TIME, date '1900-01-01'), NVL (SRC.Bor_LasT_STaTUS_TIME, date '1900-01-01')) when date '1900-01-01' then null when WP.Bor_LasT_STaT_TIME then WP.Bor_LasT_STaT_TIME when SRC.Bor_LasT_STaTUS_TIME then SRC.Bor_LasT_STaTUS_TIME else null end end , case GREaTEST (NVL (WP.Bor_LasT_STaT_TIME, date '1900-01-01'), NVL (SRC.Bor_LasT_STaTUS_TIME, date '1900-01-01')) when date '1900-01-01' then null when WP.Bor_LasT_STaT_TIME then WP.Bor_LasT_STaT_TIME when SRC.Bor_LasT_STaTUS_TIME then SRC.Bor_LasT_STaTUS_TIME else null end from X ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/case_when03.sql ================================================ select case (STaTUS) when 'N' then 1 when 'B' then 2 when 'a' then 3 end as STaTE from VaLUE where KID=:B2 and RID=:B1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/case_when04.sql ================================================ select case when row_number() over (partition by bo# order by staleness, osize, obj#) = 1 then 32 else 0 end + 64 aflags from f ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/case_when05.sql ================================================ select staleness , osize, obj# , type# , case when row_number() over (partition by bo# order by staleness, osize, obj#) = 1 then 64 else 0 end + case when row_number() over (partition by (select tcp0.bo# from tabcompart$ tcp0 where tcp0.obj#=st0.bo#) order by staleness, osize, obj#) = 1 then 32 else 0 end aflags , 0 status , :b3 sid , :b2 serial# , part#, bo# from st0 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/case_when06.sql ================================================ SELECT case when STaLENESS > .5 then 128 when STaLENESS > .1 then 256 else 0 end aFLaGS FROM employees ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/case_when07.sql ================================================ SELECT h1.CRTYPE , CASE 'month' WHEN 'week' THEN TO_CHAR(h1.DateFrom, 'YYYYIW') ELSE to_char(h1.DateFrom,'YYYYMM') END FROM CQ_CHANGEREQUESTS h1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/case_when08.sql ================================================ select case when doc is JSON then 'valid' else 'invalid' end from persons p; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/cast.sql ================================================ select raw_value, cast(raw_value as date, 'YYYY-MM-DD'), cast(raw_value as date, 'YYYY-MM-DD', 'NLS_DATE_LANGUAGE = RUSSIAN'), cast(raw_value as number default null on conversion error), cast(raw_value as number default 9999 on conversion error), cast(raw_value as date default null on conversion error, 'YYYY-MM-DD'), cast(raw_value as date default null on conversion error, 'YYYY-MM-DD', 'NLS_DATE_LANGUAGE = RUSSIAN') from raw_values; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/cast_multiset01.sql ================================================ select t1.department_id, t2.* from hr_info t1, table(cast(multiset( select t3.last_name, t3.department_id, t3.salary from people t3 where t3.department_id = t1.department_id) as people_tab_typ)) t2 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/cast_multiset02.sql ================================================ select title from table(select courses from department where name = 'history') where name like '%etruscan%' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/cast_multiset03.sql ================================================ select 1 , cursor(select 1 from dual) c1 , cursor(select 2, 3 from dual) as c2 from table(select 1 from dual) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/cast_multiset04.sql ================================================ select e1.last_name from employees e1 where f( cursor(select e2.hire_date from employees e2 where e1.employee_id = e2.manager_id), e1.hire_date) = 1 order by last_name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/cast_multiset05.sql ================================================ select * from table ( function_name() ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/cast_multiset06.sql ================================================ select cast(collect(cattr(aname, op, to_char(val), support, confidence)) as cattrs) cl_attrs from a ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/cast_multiset08.sql ================================================ select * from table (cast (f_int_date_varchar2() as table_int_date_varchar2)) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/cluster.sql ================================================ CREATE CLUSTER personnel (department NUMBER(4)) SIZE 512 STORAGE (initial 100K next 50K); CREATE INDEX idx_personnel ON CLUSTER personnel; CREATE CLUSTER language (cust_language VARCHAR2(3)) SIZE 512 HASHKEYS 10 STORAGE (INITIAL 100k next 50k); CREATE CLUSTER address (postal_code NUMBER, country_id CHAR(2)) HASHKEYS 20 HASH IS MOD(postal_code + country_id, 101); CREATE CLUSTER cust_orders (customer_id NUMBER(6)) SIZE 512 SINGLE TABLE HASHKEYS 100; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/collection_method_invocation.sql ================================================ DECLARE TYPE nums_list IS VARRAY(3) OF INTEGER; ns nums_list := nums_list(1, 2, 3); BEGIN DBMS_OUTPUT.PUT_LINE(ns.first); DBMS_OUTPUT.PUT_LINE(ns.prior(3)); DBMS_OUTPUT.PUT_LINE(ns.last); ns.delete; DBMS_OUTPUT.PUT_LINE(ns.count); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/columns01.sql ================================================ select a, b, a d, ddd as ddd, ddd as "dfdf", x as from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/comment_on.sql ================================================ -- column comment on column employees.employee_id is 'Primary key of employees table.'; comment on column hr.employees.employee_id is 'Multiline comment on column.'; comment on column "hr"."employees"."employee_id" is 'Primary key of employees table.'; -- add example: fix when comment on column with schema, the parser is report syntax error comment on column s.a.c1 is 'comment'; -- table comment on table employees is 'employees table. Contains 107 rows.'; comment on table hr.employees is 'employees table. Contains 107 rows.'; comment on table "hr"."employees" is 'employees table. Contains 107 rows.'; comment on table "my schema"."my table" is 'Some demo table with space in its name and a multiline comment.'; COMMENT ON MATERIALIZED VIEW "MONITOR"."SQL_ALERT_LOG_ERRORS" IS 'snapshot table for snapshot MONITOR.SQL_ALERT_LOG_ERRORS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/comments.sql ================================================ -- com1 select * /* com2 */ from dual; -- com3 Rem Copyright (c) All Rights Reserved. prompt . ## Hello world ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/commit.sql ================================================ COMMIT; COMMIT WORK; COMMIT WRITE BATCH; COMMIT COMMENT 'TEST' WRITE NOWAIT IMMEDIATE; COMMIT WORK COMMENT 'TEXT'; COMMIT FORCE '22.57.53'; COMMIT WORK FORCE '22.57.53'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/concatenation-double_asterisk.sql ================================================ CREATE OR REPLACE PACKAGE TEST_PKG_LXD AS -- Package header PROCEDURE double_asterisk_test; END TEST_PKG_LXD; CREATE OR REPLACE PACKAGE BODY TEST_PKG_LXD AS -- Package body -- This test case compiles and runs fine on 'Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production' PROCEDURE double_asterisk_test IS value number(3); BEGIN value := 2 * 2 ** 3; -- The expected output value is 16, and the actual output value is also 16 dbms_output.put_line('value=' || value); END double_asterisk_test; END TEST_PKG_LXD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/concatenation-mod.sql ================================================ CREATE OR REPLACE PACKAGE TEST_PKG_LXD AS -- Package header PROCEDURE double_mod; END TEST_PKG_LXD; CREATE OR REPLACE PACKAGE BODY TEST_PKG_LXD AS -- Package body -- This test case compiles and runs fine on 'Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production' PROCEDURE double_mod IS value number(3); BEGIN value := 17 mod 3 ** 2; -- The expected output value is 8, and the actual output value is also 8 dbms_output.put_line('value=' || value); END double_mod; END TEST_PKG_LXD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition01.sql ================================================ select department_id, last_name, salary from employees x where salary > (select avg(salary) from employees where x.department_id = department_id) order by department_id ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition02.sql ================================================ select * from employees x where salary > (select avg(salary) from x) and 1 = 1 and hiredate = sysdate and to_yminterval('01-00') < sysdate and to_yminterval('01-00') + x < sysdate ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition03.sql ================================================ select * from employees x where salary > (select avg(salary) from x) and 1 = 1 and hiredate = sysdate and to_yminterval('01-00') < sysdate and to_yminterval('01-00') + x < sysdate or a=b and d=e ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition04.sql ================================================ select * from t where ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( type = '2' ) or ( type = '3' ) ) and ( t.cde < 20 ) ) and ( t.se = 'xxx' ) ) and ( t.id = '000000000002' ) ) and ( ( t.attr_1 is null ) or ( t.attr_1 = '*' ) ) ) and ( ( t.attr_2 is null ) or ( t.attr_2 = '*' ) ) ) and ( ( t.attr_3 is null ) or ( t.attr_3 = '*' ) ) ) and ( ( t.attr_4 is null ) or ( t.attr_4 = '*' ) ) ) and ( ( t.attr_5 is null ) or ( t.attr_5 = '*' ) ) ) and ( ( t.itype is null ) or ( t.itype = '*' ) ) ) and ( ( t.inbr is null ) or ( t.inbr = '*' ) ) ) and ( ( t.stat = '01' ) or ( t.stat = '*' ) ) ) and ( ( t.orgn is null ) or ( t.orgn = '*' ) ) ) and ( t.mbr = '0000000000001' ) ) and ( t.nbr is null ) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition05.sql ================================================ select * from t where ( t.type = '2' ) or ( t.type = '3' ) and t.cde < 20 and t.se = 'xxx' and t.id = '000000000002' and ( ( t.sku_attr_1 is null ) or ( t.sku_attr_1 = '*' ) ) and ( ( t.sku_attr_2 is null ) or ( t.sku_attr_2 = '*' ) ) and ( ( t.sku_attr_3 is null ) or ( t.sku_attr_3 = '*' ) ) and ( ( t.sku_attr_4 is null ) or ( t.sku_attr_4 = '*' ) ) and ( ( t.sku_attr_5 is null ) or ( t.sku_attr_5 = '*' ) ) and ( ( t.itype is null ) or ( t.itype = '*' ) ) and ( ( t.bnbr is null ) or ( t.bnbr = '*' ) ) and ( ( t.stat = '01' ) or ( t.stat = '*' ) ) and ( ( t.orgn is null ) or ( t.orgn = '*' ) ) and ( t.mbr = '0000000000001' ) and ( t.nbr is null ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition06.sql ================================================ select * from t1, t2 where (trunc(t1.timestamp) between to_date('110226','yymmdd') and to_date('110326','yymmdd')) and t1.code(+) = 'cn' and t1.id(+)=t2.id and t1.cid=t2.cid and t1.mid = 1245714070376993504 and t1.tmst >= to_date('110226','yymmdd') -- note: this is possible too "column_spec outer_join_sign conditional_operator and shipper.alt_party_code(+) is null and t2.code(+) = 'sh' and t1.sid(+)=t2.sid and ( ( t1.scode like 'mmm' and t2.scode like 'xax' ) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition07.sql ================================================ select * from append where -- note space between '>' and '=' (length(w.numer) > = 8) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition08.sql ================================================ select * from "p" where -- note there are no parens around 231092 ( ( "p"."id" in 231092 ) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition09.sql ================================================ select sum(nvl(pl.qty,0)) from oline ol, pline pl, blocation bl where ol.id = pl.id and pl.no = pl.no and bl.id = pl.id and ( (select count(*) from la.sa where pl.id like sa.bid) > 0 or (select count(*) from la.sa where bl.id like sa.id) > 0 ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition10.sql ================================================ select department_id, last_name, salary from employees x where 1 = 1 and ( ( HI ) > ( .1 * T.ROWCNT ) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition11.sql ================================================ select distinct X from X,Y,Z where X.id = Z.id (+) and nvl(X.cid, '^') = nvl(Y.clientid (+), '^') and 0 = Lib.SKU(X.sid, nvl(Z.cid, '^')) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition12.sql ================================================ select * from v.e where cid <> rid and rid not in ( (select distinct rid from v.s ) union (select distinct rid from v.p ) ) and "timestamp" <= 1298505600000 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition14.sql ================================================ select * from dual where trim(sxhnode_key) is not null ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition15.sql ================================================ select "a3"."r_id" "r_id" from "pe" "a3", "me" "a2" where "a3"."m_id"="a2"."m_id" and "a2"."mi_t" = any ((( select "a4"."sys$"."id" from t "a4" ))) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/condition16.sql ================================================ select * from persons p where value(p) is of type(only employee_t) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/connect_by01.sql ================================================ with o as ( select 'a' obj, 'b' link from dual union all select 'a', 'c' from dual union all select 'c', 'd' from dual union all select 'd', 'c' from dual union all select 'd', 'e' from dual union all select 'e', 'e' from dual ) select connect_by_root obj root, level, obj,link, sys_connect_by_path(obj||'->'||link,','), connect_by_iscycle, connect_by_isleaf from o connect by nocycle obj=prior link start with obj='a' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/connect_by02.sql ================================================ select lpad(' ',2*(level-1)) || last_name org_chart, employee_id, manager_id, job_id from employees start with job_id = 'ad_pres' connect by prior employee_id = manager_id and level <= 2 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/connect_by03.sql ================================================ select lpad(' ',2*(level-1)) || last_name org_chart, employee_id, manager_id, job_id from employees where job_id != 'fi_mgr' start with job_id = 'ad_vp' connect by prior employee_id = manager_id ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/connect_by04.sql ================================================ select lpad(' ',2*(level-1)) || last_name org_chart, employee_id, manager_id, job_id from employees start with job_id = 'ad_vp' connect by prior employee_id = manager_id ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/connect_by05.sql ================================================ with liste as ( select substr(:liste, instr(','||:liste||',', ',', 1, rn), instr(','||:liste||',', ',', 1, rn+1) - instr(','||:liste||',', ',', 1, rn)-1) valeur from ( select rownum rn from dual connect by level<=length(:liste) - length(replace(:liste,',',''))+1)) select trim(valeur) from liste ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/context.sql ================================================ CREATE CONTEXT hr_context USING emp_mgmt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_analytic_view.sql ================================================ CREATE OR REPLACE ANALYTIC VIEW sales_av USING sales_fact DIMENSION BY (time_attr_dim -- An attribute dimension of time data KEY month_id REFERENCES month_id HIERARCHIES ( time_hier DEFAULT), product_attr_dim -- An attribute dimension of product data KEY category_id REFERENCES category_id HIERARCHIES ( product_hier DEFAULT), geography_attr_dim -- An attribute dimension of store data KEY state_province_id REFERENCES state_province_id HIERARCHIES ( geography_hier DEFAULT) ) MEASURES( sales FACT sales, -- A base measure units FACT units, -- A base measure -- Calculated measures sales_prior_period AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1)), sales_year_ago AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL year)), chg_sales_year_ago AS (LAG_DIFF(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL year)), pct_chg_sales_year_ago AS (LAG_DIFF_PERCENT(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL year)), sales_qtr_ago AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL quarter)), chg_sales_qtr_ago AS (LAG_DIFF(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL quarter)), pct_chg_sales_qtr_ago AS (LAG_DIFF_PERCENT(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL quarter)) ) DEFAULT MEASURE SALES; CREATE OR REPLACE ANALYTIC VIEW sales_av USING av.sales_fact DIMENSION BY (time_attr_dim KEY month_id REFERENCES month_id HIERARCHIES ( time_hier DEFAULT), product_attr_dim KEY category_id REFERENCES category_id HIERARCHIES ( product_hier DEFAULT), geography_attr_dim KEY state_province_id REFERENCES state_province_id HIERARCHIES ( geography_hier DEFAULT) ) MEASURES (sales FACT sales, sales_year_ago AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL year)), sales_pct_chg_year_ago AS (ROUND(LAG_DIFF_PERCENT(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL year),2)), units FACT units ) DEFAULT MEASURE SALES; CREATE OR REPLACE ANALYTIC VIEW sales_av USING av.sales_fact DIMENSION BY (time_attr_dim KEY month_id REFERENCES month_id HIERARCHIES ( time_hier DEFAULT)) MEASURES (sales FACT sales, avg_sales FACT sales AGGREGATE BY AVG, count_sales FACT sales AGGREGATE BY COUNT, max_sales FACT sales AGGREGATE BY MAX, min_sales FACT sales AGGREGATE BY MIN, stddev_sales FACT sales AGGREGATE BY STDDEV, variance_sales FACT sales AGGREGATE BY VARIANCE, units FACT units, avg_units FACT units AGGREGATE BY AVG ) DEFAULT MEASURE SALES DEFAULT AGGREGATE BY SUM; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_attribute_dimension.sql ================================================ CREATE OR REPLACE ATTRIBUTE DIMENSION time_attr_dim DIMENSION TYPE TIME USING time_dim ATTRIBUTES (year_id CLASSIFICATION caption VALUE 'YEAR_ID' CLASSIFICATION description VALUE 'YEAR ID', year_name CLASSIFICATION caption VALUE 'YEAR_NAME' CLASSIFICATION description VALUE 'Year', year_end_date CLASSIFICATION caption VALUE 'YEAR_END_DATE' CLASSIFICATION description VALUE 'Year End Date', quarter_id CLASSIFICATION caption VALUE 'QUARTER_ID' CLASSIFICATION description VALUE 'QUARTER ID', quarter_name CLASSIFICATION caption VALUE 'QUARTER_NAME' CLASSIFICATION description VALUE 'Quarter', quarter_end_date CLASSIFICATION caption VALUE 'QUARTER_END_DATE' CLASSIFICATION description VALUE 'Quarter End Date', quarter_of_year CLASSIFICATION caption VALUE 'QUARTER_OF_YEAR' CLASSIFICATION description VALUE 'Quarter of Year', month_id CLASSIFICATION caption VALUE 'MONTH_ID' CLASSIFICATION description VALUE 'MONTH ID', month_name CLASSIFICATION caption VALUE 'MONTH_NAME' CLASSIFICATION description VALUE 'Month', month_long_name CLASSIFICATION caption VALUE 'MONTH_LONG_NAME' CLASSIFICATION description VALUE 'Month Long Name', month_end_date CLASSIFICATION caption VALUE 'MONTH_END_DATE' CLASSIFICATION description VALUE 'Month End Date', month_of_quarter CLASSIFICATION caption VALUE 'MONTH_OF_QUARTER' CLASSIFICATION description VALUE 'Month of Quarter', month_of_year CLASSIFICATION caption VALUE 'MONTH_OF_YEAR' CLASSIFICATION description VALUE 'Month of Year', season CLASSIFICATION caption VALUE 'SEASON' CLASSIFICATION description VALUE 'Season', season_order CLASSIFICATION caption VALUE 'SEASON_ORDER' CLASSIFICATION description VALUE 'Season Order') LEVEL month LEVEL TYPE MONTHS CLASSIFICATION caption VALUE 'MONTH' CLASSIFICATION description VALUE 'Month' KEY month_id MEMBER NAME month_name MEMBER CAPTION month_name MEMBER DESCRIPTION month_long_name ORDER BY month_end_date DETERMINES (month_end_date, quarter_id, season, season_order, month_of_year, month_of_quarter) LEVEL quarter LEVEL TYPE QUARTERS CLASSIFICATION caption VALUE 'QUARTER' CLASSIFICATION description VALUE 'Quarter' KEY quarter_id MEMBER NAME quarter_name MEMBER CAPTION quarter_name MEMBER DESCRIPTION quarter_name ORDER BY quarter_end_date DETERMINES (quarter_end_date, quarter_of_year, year_id) LEVEL year LEVEL TYPE YEARS CLASSIFICATION caption VALUE 'YEAR' CLASSIFICATION description VALUE 'Year' KEY year_id MEMBER NAME year_name MEMBER CAPTION year_name MEMBER DESCRIPTION year_name ORDER BY year_end_date DETERMINES (year_end_date) LEVEL season LEVEL TYPE QUARTERS CLASSIFICATION caption VALUE 'SEASON' CLASSIFICATION description VALUE 'Season' KEY season MEMBER NAME season MEMBER CAPTION season MEMBER DESCRIPTION season LEVEL month_of_quarter LEVEL TYPE MONTHS CLASSIFICATION caption VALUE 'MONTH_OF_QUARTER' CLASSIFICATION description VALUE 'Month of Quarter' KEY month_of_quarter; CREATE OR REPLACE ATTRIBUTE DIMENSION product_attr_dim USING product_dim ATTRIBUTES (department_id, department_name, category_id, category_name) LEVEL DEPARTMENT KEY department_id ALTERNATE KEY department_name MEMBER NAME department_name MEMBER CAPTION department_name ORDER BY department_name LEVEL CATEGORY KEY category_id ALTERNATE KEY category_name MEMBER NAME category_name MEMBER CAPTION category_name ORDER BY category_name DETERMINES(department_id) ALL MEMBER NAME 'ALL PRODUCTS'; CREATE OR REPLACE ATTRIBUTE DIMENSION geography_attr_dim USING geography_dim ATTRIBUTES (region_id, region_name, country_id, country_name, state_province_id, state_province_name) LEVEL REGION KEY region_id ALTERNATE KEY region_name MEMBER NAME region_name MEMBER CAPTION region_name ORDER BY region_name LEVEL COUNTRY KEY country_id ALTERNATE KEY country_name MEMBER NAME country_name MEMBER CAPTION country_name ORDER BY country_name DETERMINES(region_id) LEVEL STATE_PROVINCE KEY state_province_id ALTERNATE KEY state_province_name MEMBER NAME state_province_name MEMBER CAPTION state_province_name ORDER BY state_province_name DETERMINES(country_id) ALL MEMBER NAME 'ALL CUSTOMERS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_audit_policy.sql ================================================ CREATE AUDIT POLICY table_pol PRIVILEGES CREATE ANY TABLE, DROP ANY TABLE; CREATE AUDIT POLICY dml_pol ACTIONS DELETE on hr.employees, INSERT on hr.employees, UPDATE on hr.employees, ALL on hr.departments; CREATE AUDIT POLICY security_pol ACTIONS ADMINISTER KEY MANAGEMENT; CREATE AUDIT POLICY dir_pol ACTIONS READ DIRECTORY, WRITE DIRECTORY, EXECUTE DIRECTORY; CREATE AUDIT POLICY all_actions_pol ACTIONS ALL; CREATE AUDIT POLICY dp_actions_pol ACTIONS COMPONENT = datapump IMPORT; CREATE AUDIT POLICY java_pol ROLES java_admin, java_deploy; CREATE AUDIT POLICY hr_admin_pol PRIVILEGES CREATE ANY TABLE, DROP ANY TABLE ACTIONS DELETE on hr.employees, INSERT on hr.employees, UPDATE on hr.employees, ALL on hr.departments, LOCK TABLE ROLES audit_admin, audit_viewer; CREATE AUDIT POLICY order_updates_pol ACTIONS UPDATE ON oe.orders WHEN 'SYS_CONTEXT(''USERENV'', ''IDENTIFICATION_TYPE'') = ''EXTERNAL''' EVALUATE PER SESSION; CREATE AUDIT POLICY emp_updates_pol ACTIONS DELETE on hr.employees, INSERT on hr.employees, UPDATE on hr.employees WHEN 'UID NOT IN (100, 105, 107)' EVALUATE PER STATEMENT; CREATE AUDIT POLICY local_table_pol PRIVILEGES CREATE ANY TABLE, DROP ANY TABLE CONTAINER = CURRENT; CREATE AUDIT POLICY common_role1_pol ROLES c##role1 CONTAINER = ALL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_controlfile.sql ================================================ CREATE CONTROLFILE DATABASE "demo" LOGFILE GROUP 1 '/path/oracle/dbs/t_log1.f' SIZE 500K, GROUP 2 '/path/oracle/dbs/t_log2.f' SIZE 500K RESETLOGS datafile '/path/file' FORCE LOGGING ARCHIVELOG CHARACTER SET WE8DEC ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_database.sql ================================================ CREATE DATABASE myoracle LOGFILE GROUP 1 ('diska:log1.log', 'diskb:log1.log') SIZE 50K, GROUP 2 ('diska:log2.log', 'diskb:log2.log') SIZE 50K DATAFILE 'diskc:dbone.dbf' SIZE 30M; CREATE DATABASE sample CONTROLFILE REUSE LOGFILE GROUP 1 ('diskx:log1.log', 'disky:log1.log') SIZE 50K, GROUP 2 ('diskx:log2.log', 'disky:log2.log') SIZE 50K MAXLOGFILES 5 MAXLOGHISTORY 100 MAXDATAFILES 10 MAXINSTANCES 2 ARCHIVELOG CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 DATAFILE 'disk1:df1.dbf' AUTOEXTEND ON, 'disk2:df2.dbf' AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED DEFAULT TEMPORARY TABLESPACE temp_ts UNDO TABLESPACE undo_ts ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_dimension.sql ================================================ CREATE DIMENSION customers_dim LEVEL customer IS (customers.cust_id) LEVEL city IS (customers.cust_city) LEVEL state IS (customers.cust_state_province) LEVEL country IS (countries.country_id) LEVEL subregion IS (countries.country_subregion) LEVEL region IS (countries.country_region) HIERARCHY geog_rollup ( customer CHILD OF city CHILD OF state CHILD OF country CHILD OF subregion CHILD OF region JOIN KEY (customers.country_id) REFERENCES country ) ATTRIBUTE customer DETERMINES (cust_first_name, cust_last_name, cust_gender, cust_marital_status, cust_year_of_birth, cust_income_level, cust_credit_limit) ATTRIBUTE country DETERMINES (countries.country_name) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_directory.sql ================================================ CREATE DIRECTORY mydir AS '/scratch/data/file_data'; CREATE OR REPLACE DIRECTORY bfile_dir AS '/usr/bin/bfile_dir'; CREATE OR REPLACE DIRECTORY bfile_dir SHARING = NONE AS '/usr/bin/bfile_dir'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_diskgroup.sql ================================================ CREATE DISKGROUP dgroup_01 EXTERNAL REDUNDANCY DISK '/devices/disks/c*'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_edition.sql ================================================ CREATE EDITION test_ed; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_flashback_archive.sql ================================================ CREATE FLASHBACK ARCHIVE DEFAULT test_archive1 TABLESPACE example QUOTA 1 M RETENTION 1 DAY; CREATE FLASHBACK ARCHIVE test_archive2 TABLESPACE example QUOTA 1 M RETENTION 1 DAY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_function01.sql ================================================ CREATE FUNCTION top_protected_f RETURN NUMBER SHARING = NONE ACCESSIBLE BY (TRIGGER top_trusted_f) AS BEGIN RETURN 0.5; END top_protected_f; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_function02.sql ================================================ CREATE OR REPLACE EDITIONABLE FUNCTION MY_FUNC RETURN VARCHAR2 DEFAULT COLLATION USING_NLS_COMP AGGREGATE USING MY_AGG_FUNC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_function03.sql ================================================ CREATE FUNCTION process_table(tab TABLE) RETURN TABLE PIPELINED ROW POLYMORPHIC USING process_table_pkg; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_function04.sql ================================================ ALTER SESSION SET PLSQL_CCFLAGS = 'my_debug:TRUE'; CREATE OR REPLACE FUNCTION conditional_compilation(val VARCHAR2) RETURN VARCHAR2 IS BEGIN $IF $$my_debug $THEN RETURN '--DEBUG--'; $ELSE RETURN val; $END END; / -- SELECT conditional_compilation('hello') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_function05.sql ================================================ CREATE FUNCTION get_val ( x_val IN NUMBER, y_val IN NUMBER, image IN LONG RAW ) RETURN BINARY_INTEGER AS LANGUAGE C NAME "c_get_val" LIBRARY c_utils PARAMETERS ( c_x_val int , c_y_val int , c_image BY REFERENCE byte); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_function06.sql ================================================ CREATE OR REPLACE TYPE DUMMY_TAB AS TABLE OF INTEGER; -- https://docs.oracle.com/cd/B10501_01/appdev.920/a96624/08_subs.htm#19845 CREATE OR REPLACE FUNCTION fun_pipelined (i INTEGER) RETURN dummy_tab PIPELINED PARALLEL_ENABLE AS BEGIN FOR rec1 in (SELECT i AS outrec from dual) LOOP PIPE ROW (rec1.outrec); END LOOP; RETURN; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_hierarchy.sql ================================================ CREATE OR REPLACE HIERARCHY time_hier -- Hierarchy name USING time_attr_dim -- Refers to TIME_ATTR_DIM attribute dimension (month CHILD OF -- Months in the attribute dimension quarter CHILD OF year); CREATE OR REPLACE HIERARCHY product_hier USING product_attr_dim (category CHILD OF department); CREATE OR REPLACE HIERARCHY geography_hier USING geography_attr_dim (state_province CHILD OF country CHILD OF region); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_index.sql ================================================ CREATE INDEX "NORTHWIND"."IDX_CUSTOMERS_REGION" ON "NORTHWIND"."CUSTOMERS" ("REGION") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; CREATE INDEX INDEX_SYS_LOG_YEAR ON SYS_LOG (YEAR) GLOBAL PARTITION BY RANGE (YEAR) (PARTITION p1 VALUES LESS THAN (1970), PARTITION p2 VALUES LESS THAN (2000), PARTITION p2 VALUES LESS THAN (2030), PARTITION p3 VALUES LESS THAN (MAXVALUE)); CREATE UNIQUE INDEX order_index ON t_order (order_id) IMMEDIATE INVALIDATION; CREATE UNIQUE INDEX order_index ON t_order (order_id) DEFERRED INVALIDATION; CREATE INDEX the_index IF NOT EXISTS ON t_order (order_id); CREATE INDEX part_idx ON partitioned_by_ts (part) GLOBAL PARTITION BY RANGE (part) (PARTITION t0 VALUES LESS THAN (TIMESTAMP '2020-01-01 00:00:00') ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_inmemory_join_group.sql ================================================ CREATE INMEMORY JOIN GROUP prod_id1 (inventories(product_id), order_items(product_id)); CREATE INMEMORY JOIN GROUP prod_id2 (inventories(product_id), pm.online_media(product_id)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_java.sql ================================================ CREATE JAVA CLASS USING BFILE (java_dir, 'Agent.class') ; -- requires / as a stmt delimiter -- CREATE JAVA SOURCE NAMED "Welcome" AS -- public class Welcome { -- public static String welcome() { -- return "Welcome World"; } } -- / CREATE JAVA RESOURCE NAMED "appText" USING BFILE (java_dir, 'textBundle.dat') ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_library.sql ================================================ CREATE LIBRARY ext_lib AS 'ddl_1' IN ddl_dir; CREATE OR REPLACE LIBRARY ext_lib AS 'ddl_1' IN ddl_dir CREDENTIAL ddl_cred; CREATE LIBRARY ext_lib AS '/OR/lib/ext_lib.so'; CREATE OR REPLACE LIBRARY ext_lib IS '/OR/newlib/ext_lib.so'; CREATE LIBRARY app_lib as '${ORACLE_HOME}/lib/app_lib.so' AGENT 'sales.hq.example.com'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_lockdown_profile.sql ================================================ CREATE LOCKDOWN PROFILE hr_prof INCLUDING PRIVATE_DBAAS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_materialized_zonemap.sql ================================================ CREATE MATERIALIZED ZONEMAP sales_zmap ON sales(cust_id, prod_id); CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(rowid), MIN(cust_id), MAX(cust_id), MIN(prod_id), MAX(prod_id) FROM sales GROUP BY SYS_OP_ZONE_ID(rowid); CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(s.rowid), MIN(cust_state_province), MAX(cust_state_province), MIN(cust_city), MAX(cust_city) FROM sales s LEFT OUTER JOIN customers c ON s.cust_id = c.cust_id GROUP BY SYS_OP_ZONE_ID(s.rowid); CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(s.rowid), MIN(prod_category), MAX(prod_category), MIN(prod_subcategory), MAX(prod_subcategory), MIN(country_id), MAX(country_id), MIN(cust_state_province), MAX(cust_state_province), MIN(cust_city), MAX(cust_city) FROM sales s LEFT OUTER JOIN products p ON s.prod_id = p.prod_id LEFT OUTER JOIN customers c ON s.cust_id = c.cust_id GROUP BY sys_op_zone_id(s.rowid); CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(s.rowid), MIN(prod_category), MAX(prod_category), MIN(prod_subcategory), MAX(prod_subcategory), MIN(country_id), MAX(country_id), MIN(cust_state_province), MAX(cust_state_province), MIN(cust_city), MAX(cust_city) FROM sales s, products p, customers c WHERE s.prod_id = p.prod_id(+) AND s.cust_id = c.cust_id(+) GROUP BY sys_op_zone_id(s.rowid); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_operator.sql ================================================ CREATE OPERATOR eq_op BINDING (VARCHAR2, VARCHAR2) RETURN NUMBER USING eq_f; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_outline.sql ================================================ CREATE OUTLINE salaries FOR CATEGORY special ON SELECT last_name, salary FROM employees; CREATE OR REPLACE PRIVATE OUTLINE my_salaries FROM salaries; CREATE OR REPLACE OUTLINE public_salaries FROM PRIVATE my_salaries; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_package.sql.tree ================================================ (sql_script (unit_statement (create_package CREATE PACKAGE (package_name (identifier (id_expression (regular_id EMP_BONUS)))) AS (package_obj_spec (variable_declaration (identifier (id_expression (regular_id LOCAL_PARAM))) (type_spec (datatype (native_datatype_element NUMBER))) ;)) (package_obj_spec (exception_declaration (identifier (id_expression (regular_id USER_EXCEPTION))) EXCEPTION ;)) (package_obj_spec (procedure_spec PROCEDURE (identifier (id_expression (regular_id CALC_BONUS))) ( (parameter (parameter_name (identifier (id_expression (regular_id DATE_HIRED)))) (type_spec (datatype (native_datatype_element DATE)))) ) ;)) END (package_name (identifier (id_expression (regular_id EMP_BONUS)))))) ; ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_package01.sql ================================================ CREATE PACKAGE EMP_BONUS AS LOCAL_PARAM NUMBER; USER_EXCEPTION EXCEPTION; PROCEDURE CALC_BONUS (DATE_HIRED DATE); END EMP_BONUS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_package02.sql ================================================ CREATE OR REPLACE PACKAGE calendar_data AUTHID DEFINER AS TYPE calcurtyp IS REF CURSOR RETURN d_months%ROWTYPE; PROCEDURE open_cal_cv (cal_cv IN OUT calcurtyp, year_id INT); END calendar_data; CREATE OR REPLACE PACKAGE BODY calendar_data AS PROCEDURE open_cal_cv (cal_cv IN OUT calcurtyp, year_id INT) PARALLEL_ENABLE /* although PARALLEL_ENABLE is legal for procedures, the following part of the clause will cause PLS-00655 error, if uncommented: (PARTITION cal_cv BY ANY) */ IS BEGIN OPEN cal_cv FOR SELECT * FROM d_months WHERE year_id = year_id; END open_cal_cv; END calendar_data; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_package03.sql ================================================ CREATE OR REPLACE PACKAGE pkg_prc_with_properties AS PROCEDURE access_prc_with_properties; PRAGMA DEPRECATE(prc_with_properties, 'no more supported'); PROCEDURE prc_with_properties PARALLEL_ENABLE ACCESSIBLE BY (PROCEDURE access_prc_with_properties); END pkg_prc_with_properties; / CREATE OR REPLACE PACKAGE BODY pkg_prc_with_properties AS PROCEDURE access_prc_with_properties IS BEGIN prc_with_properties(); END access_prc_with_properties; PROCEDURE prc_with_properties PARALLEL_ENABLE ACCESSIBLE BY (PROCEDURE access_prc_with_properties) IS BEGIN DBMS_OUTPUT.PUT_LINE('I have properties!'); END prc_with_properties; END pkg_prc_with_properties; / CALL pkg_prc_with_properties.access_prc_with_properties(); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_package04.sql ================================================ CREATE OR REPLACE PACKAGE initialized_package AS END initialized_package; / CREATE OR REPLACE PACKAGE BODY initialized_package AS BEGIN DBMS_OUTPUT.PUT_LINE('Initialized'); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR!'); RAISE; END initialized_package; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_package05.sql ================================================ create or replace package pkg_fun_with_streaming is type t_change is record( guid raw(16) ); type t_message is record( guid raw(16) ); type t_change_cur is ref cursor return t_change; type t_message_tab is table of t_message not null index by int; function prep_messages(p_changes t_change_cur) return t_message_tab pipelined cluster p_changes by(guid) parallel_enable(partition p_changes by hash(guid)); end; / create or replace package body pkg_fun_with_streaming is function prep_messages(p_changes t_change_cur) return t_message_tab pipelined cluster p_changes by(guid) parallel_enable(partition p_changes by hash(guid)) is l_rec t_change; l_message t_message; begin loop fetch p_changes into l_rec; if l_rec.guid is not null then pipe row(l_message); end if; end loop; end prep_messages; end pkg_fun_with_streaming; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_pmem_filestore.sql ================================================ CREATE PMEM FILESTORE cloud_db_1 MOUNTPOINT '/corp/db/cloud_db_1' BACKINGFILE '/var/pmem/foo_1.' SIZE 2T BLOCKSIZE 8K AUTOEXTEND ON NEXT 10G MAXSIZE 3T ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_procedure01.sql ================================================ CREATE OR REPLACE PROCEDURE PROC(PARAM NUMBER) IS LOCAL_PARAM NUMBER; USER_EXCEPTION EXCEPTION; BEGIN LOCAL_PARAM:=0; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_procedure01.sql.tree ================================================ (sql_script (unit_statement (create_procedure_body CREATE OR REPLACE PROCEDURE (procedure_name (identifier (id_expression (regular_id PROC)))) ( (parameter (parameter_name (identifier (id_expression (regular_id (non_reserved_keywords_pre12c PARAM))))) (type_spec (datatype (native_datatype_element NUMBER)))) ) IS (seq_of_declare_specs (declare_spec (variable_declaration (identifier (id_expression (regular_id LOCAL_PARAM))) (type_spec (datatype (native_datatype_element NUMBER))) ;)) (declare_spec (exception_declaration (identifier (id_expression (regular_id USER_EXCEPTION))) EXCEPTION ;))) (body BEGIN (seq_of_statements (statement (assignment_statement (general_element (general_element_part (id_expression (regular_id LOCAL_PARAM)))) := (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (atom (constant (numeric 0)))))))))))))) ;) END))) ; ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_procedure02.sql ================================================ CREATE OR REPLACE PROCEDURE prc_calendar_data (cal_cv IN OUT calendar_data.calcurtyp, year_id INT) PARALLEL_ENABLE /* although PARALLEL_ENABLE is legal for procedures, the following part of the clause will cause PLS-00655 error, if uncommented: (PARTITION cal_cv BY ANY) */ AS BEGIN OPEN cal_cv FOR SELECT * FROM d_months WHERE year_id = year_id; EXCEPTION WHEN OTHERS THEN raise_application_error(-20001, 'Error!'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_procedure03.sql ================================================ CREATE OR REPLACE PROCEDURE prc_hw IS BEGIN DBMS_OUTPUT.PUT_LINE('Hello World!'); END; / CREATE OR REPLACE PROCEDURE prc_pragma_inline IS BEGIN PRAGMA INLINE (prc_hw, 'YES'); DBMS_OUTPUT.PUT_LINE(''); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_profile.sql ================================================ CREATE MANDATORY PROFILE c##cdb_profile LIMIT PASSWORD_VERIFY_FUNCTION my_mandatory_function CONTAINER = ALL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_restore_point.sql ================================================ CREATE RESTORE POINT good_data; CREATE RESTORE POINT rp2 for pluggable database pdb; CREATE RESTORE POINT rp2 for pluggable database pdb preserve; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_role.sql ================================================ create role TEST_ROLE_AAA ; create role TEST_ROLE_BBB NOT IDENTIFIED ; create role TEST_ROLE_CCC IDENTIFIED BY TEST_ROLE_AAA; create role TEST_ROLE_DDD IDENTIFIED EXTERNALLY; create role TEST_ROLE_EEE IDENTIFIED GLOBALLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_rollback_segment.sql ================================================ CREATE ROLLBACK SEGMENT rbs_one TABLESPACE rbs_ts; CREATE ROLLBACK SEGMENT rbs_one TABLESPACE rbs_ts STORAGE ( INITIAL 10K NEXT 10K MAXEXTENTS UNLIMITED ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_spfile.sql ================================================ CREATE SPFILE FROM PFILE = '$ORACLE_HOME/work/t_init1.ora'; CREATE SPFILE = 's_params.ora' FROM PFILE = '$ORACLE_HOME/work/t_init1.ora'; CREATE SPFILE = 's_params.ora' FROM PFILE = '$ORACLE_HOME/work/t_init1.ora' AS COPY; CREATE SPFILE = 's_params.ora' FROM MEMORY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_synonym01.sql ================================================ create public synonym emp for hr.employees ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_synonym02.sql ================================================ create synonym hr.chicago_employees for hr.employees@chicago_db ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_synonym03.sql ================================================ create or replace public synonym depts for departments ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_table.sql ================================================ CREATE TABLE employee ( first_name VARCHAR2(128), last_name VARCHAR2(128), empID NUMBER, salary NUMBER(6) ENCRYPT ); CREATE TABLE employee ( first_name VARCHAR2(128), last_name VARCHAR2(128), empID NUMBER ENCRYPT NO SALT, salary NUMBER(6) ENCRYPT USING '3DES168' ); CREATE TABLE persons OF person ( homeaddress NOT NULL, UNIQUE (homeaddress.phone), CHECK (homeaddress.zip IS NOT NULL), CHECK (homeaddress.city <> 'San Francisco') ); CREATE TABLE purchaseorder_as_table OF XMLType XMLSCHEMA "http://xmlns.oracle.com/xdb/documentation/purchaseOrder.xsd" ELEMENT "PurchaseOrder"; CREATE TABLE purchaseorder_as_column OF XMLType XMLTYPE COLUMN xml_document ELEMENT "http://xmlns.oracle.com/xdb/documentation/purchaseOrder.xsd#PurchaseOrder"; CREATE TABLE po_binaryxml OF XMLType XMLTYPE STORE AS BINARY XML VIRTUAL COLUMNS (DATE_COL AS (XMLCast(XMLQuery('/PurchaseOrder/@orderDate' PASSING OBJECT_VALUE RETURNING CONTENT) AS DATE))) ; CREATE TABLE po_binary OF XMLType; create table junk ( me date, primary key (me) ); CREATE TABLE TEST AS WITH TESTCTE AS ( SELECT 1 ONE FROM DUAL ) SELECT 'A', 'B', 'C' FROM DUAL JOIN TESTCTE; CREATE TABLE DEMO ( ID NUMBER GENERATED BY DEFAULT AS IDENTITY, TEST VARCHAR2(100) NOT NULL ); CREATE TABLE DEMO ( ID NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY, TEST VARCHAR2(100) NOT NULL ); CREATE TABLE DEMO ( ID NUMBER GENERATED ALWAYS AS IDENTITY, TEST VARCHAR2(100) NOT NULL ); CREATE TABLE products ( id NUMBER(4) GENERATED BY DEFAULT ON NULL AS IDENTITY (START WITH 101) NOT NULL PRIMARY KEY, name VARCHAR2(255) NOT NULL, description VARCHAR2(512), weight FLOAT, PRICE NUMERIC(10,-2) ); CREATE TABLE products ( id NUMBER(4) GENERATED BY DEFAULT ON NULL AS IDENTITY (START WITH 101 INCREMENT BY 1 CYCLE CACHE 200) NOT NULL PRIMARY KEY, name VARCHAR2(255) NOT NULL, description VARCHAR2(512), weight FLOAT, PRICE NUMERIC(10,-2) ); create table "DVSADM".CMP3$58238005 nocompress tablespace "DVS_PROOF" nologging lob (VALUE) store as (tablespace "DVS_PROOF" enable storage in row nocache nologging) as select /*+ DYNAMIC_SAMPLING(0) FULL("DVSADM"."DVS_ARCHIVE") */ * from "DVSADM"."DVS_ARCHIVE" sample block( 6.734) mytab; CREATE TABLE "APPLSYS"."FND_SEC_GUIDELINES_TL" ( "CODE" VARCHAR2(20) NOT NULL ENABLE, "TITLE" VARCHAR2(100) NOT NULL ENABLE, "DESCRIPTION" VARCHAR2(2000) NOT NULL ENABLE, "INFO" CLOB NOT NULL ENABLE, "LANGUAGE" VARCHAR2(30) NOT NULL ENABLE, "SOURCE_LANG" VARCHAR2(4) NOT NULL ENABLE, "CREATED_BY" VARCHAR2(30) NOT NULL ENABLE, "CREATION_DATE" DATE NOT NULL ENABLE, "LAST_UPDATED_BY" NUMBER(15,0) NOT NULL ENABLE, "LAST_UPDATE_DATE" DATE NOT NULL ENABLE, "LAST_UPDATE_LOGIN" NUMBER(15,0)) PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255 LOGGING STORAGE( INITIAL 4096 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 4 BUFFER_POOL DEFAULT) TABLESPACE "APPS_TS_TX_DATA" LOB ("INFO") STORE AS ( TABLESPACE "APPS_TS_TX_DATA" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE STORAGE( INITIAL 4096 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 4 BUFFER_POOL DEFAULT)) ; CREATE TABLE CATEGORIES ( "CATEGORY_ID" NUMBER(9,0), "CATEGORY_NAME" VARCHAR2(15 BYTE), "DESCRIPTION" VARCHAR2(2000 BYTE), "PICTURE" VARCHAR2(255 BYTE) ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ; CREATE TABLE "t_ddl_0027"( "PID" INT, "FID" INT, "NAME" VARCHAR(50) DEFAULT 'Tom', "ADDRESS" VARCHAR(50) NOT NULL, "DEPT" VARCHAR(50), CONSTRAINT "PK_ID" PRIMARY KEY("PID"), CONSTRAINT "CK_DEPT" CHECK ("DEPT" IN('IT', 'SALES', 'MANAGER'))); CREATE TABLE "C##RCUSER"."JSON_TRANS"( "ID" NUMBER(8,0) NOT NULL ENABLE, "TRANS_MSG" CLOB, CONSTRAINT "CHECK_JSON" CHECK (trans_msg is json) ENABLE, PRIMARY KEY ("ID") USING INDEX ENABLE, SUPPLEMENTAL LOG DATA (ALL) COLUMNS); CREATE TABLE "ASEDBUSR"."ECLAIMPROCESS" ( "PKEY" NUMBER(12,0) NOT NULL ENABLE, "BOID" VARCHAR2(40 CHAR) NOT NULL ENABLE, "METABO" NUMBER(12,0) NOT NULL ENABLE, "LASTUPDATE" TIMESTAMP (9) NOT NULL ENABLE, "PROCESSID" VARCHAR2(40 CHAR) NOT NULL ENABLE, "ROWCOMMENT" VARCHAR2(15 CHAR), "CREATED" TIMESTAMP (9) NOT NULL ENABLE, "CREATEDUSER" VARCHAR2(40 CHAR) NOT NULL ENABLE, "REPLACED" TIMESTAMP (9) NOT NULL ENABLE, "REPLACEDUSER" VARCHAR2(40 CHAR), "ITSPROCSUMPKOGU" VARCHAR2(40 CHAR), "ITSPROCSUMINVOICE" VARCHAR2(40 CHAR) NOT NULL ENABLE, "IMPORTDATE" DATE NOT NULL ENABLE, "BATCHIMPORTSTATUS" VARCHAR2(40 CHAR) NOT NULL ENABLE, "ITSECLAIMPROCVERS" VARCHAR2(40 CHAR), "ITSECLAIMPROCPAT" VARCHAR2(40 CHAR), "ITSPROCVERANLASSLE" VARCHAR2(40 CHAR), "ITSPROCAUSFUEHRLE" VARCHAR2(40 CHAR), "ITSPROCRECHSTELLER" VARCHAR2(40 CHAR), "ITSPROCBEARBOE" VARCHAR2(40 CHAR), "ITSPROCBEARBUSER" VARCHAR2(40 CHAR), "ITSSUMPROCZAHLER" VARCHAR2(40 CHAR), "ITSECLAIMSCHADEN" VARCHAR2(40 CHAR), "ITSECPLSTABRTYP" VARCHAR2(40 CHAR), "ITSECLAIMLSTFALL" VARCHAR2(40 CHAR), "ITSECLAIMFDOSSIER" VARCHAR2(40 CHAR), "VERARBEITUNGCOUNT" NUMBER(12,0), "ITSPROCBATCHLAUF" VARCHAR2(40 CHAR), "VORBEHALTOVR" NUMBER(12,0) NOT NULL ENABLE, "LSTSPERRENOVR" NUMBER(12,0) NOT NULL ENABLE, "SISTIERUNGOVR" NUMBER(12,0) NOT NULL ENABLE, "RUECKWEISUNGTEXT" VARCHAR2(350 CHAR), "FEHLERTEXT" VARCHAR2(1024 CHAR), "PROVSTATUS" VARCHAR2(40 CHAR), "ECLAIMSTATUS" VARCHAR2(40 CHAR) NOT NULL ENABLE, "SBENTSCHEID" VARCHAR2(40 CHAR) NOT NULL ENABLE, "ITSSUMPROCLSTABR" VARCHAR2(40 CHAR), "RESPONSE" VARCHAR2(4000 CHAR), "MODIFIALLOWED" VARCHAR2(40 CHAR), "LSTAUFSCHUBOVR" NUMBER(12,0) NOT NULL ENABLE, "ISEXTERNALSTORED" VARCHAR2(40 CHAR) NOT NULL ENABLE, "ITSPROCGBEREICH" VARCHAR2(40 CHAR) NOT NULL ENABLE, "ITSPROCECLAIMMAND" VARCHAR2(40 CHAR), "HABEGRUENDUNG" VARCHAR2(40 CHAR), "ITSKUERZUNG" VARCHAR2(40 CHAR), "KUERZUNGPROZENT" NUMBER(9,2), "ITSSUMPROCKOGU" VARCHAR2(40 CHAR), "EKOGURUECKWCODE" VARCHAR2(40 CHAR), "EKOGUERLEDIGTCODE" VARCHAR2(40 CHAR), "SECONDOPINION" VARCHAR2(40 CHAR), "ITSTHERAPIEMETHODE" VARCHAR2(40 CHAR), "ITSPROCSUMKOGU" VARCHAR2(40 CHAR), "ITSLERBMELDUNG" VARCHAR2(40 CHAR), "PROCBEHANDORTOVR" NUMBER(12,0) NOT NULL ENABLE, "ITSAUSZAHLUNGSTYP" VARCHAR2(40 CHAR), "AUSZAHLTYPOVR" NUMBER(12,0) NOT NULL ENABLE, "VERARBEITSTATUS" VARCHAR2(40 CHAR) NOT NULL ENABLE, "FOREIGNCURRACTIV" NUMBER(12,0) NOT NULL ENABLE, "PROCRECHSTOVR" NUMBER(12,0) NOT NULL ENABLE, "ISESR" VARCHAR2(40 CHAR), "ITSKSKTARKOST" VARCHAR2(40 CHAR), "ITSPROCBEHANDORT" VARCHAR2(40 CHAR), "STATUS" VARCHAR2(40 CHAR) NOT NULL ENABLE, "ERFREVISION" NUMBER(12,0) NOT NULL ENABLE, "ITSXMLSTORE" VARCHAR2(40 CHAR), "ITSANNULXMLSTORE" VARCHAR2(40 CHAR), "VORBESCHEXPFREIG" VARCHAR2(40 CHAR), "EINFEXPFREIG" VARCHAR2(40 CHAR), "SANKTIONSTUFEFLAG" VARCHAR2(40 CHAR), "SANKTIONSTUFEOVR" NUMBER(12,0) NOT NULL ENABLE, "BESTDATNOTENKURS" DATE, "RKOPFCOMMENT" VARCHAR2(255 CHAR), "INTERNCOMMENT" VARCHAR2(4000 CHAR), "OVRINTERNCOMMENT" NUMBER(12,0) NOT NULL ENABLE, "COMMENTLERB" VARCHAR2(4000 CHAR), "COMMENTLERBOVR" VARCHAR2(4000 CHAR), "COMMENTLERBKOPF" VARCHAR2(1000 CHAR), "COMMENTLERBKOPFPOS" VARCHAR2(40 CHAR), "OVRCOMMENTLERB" NUMBER(12,0) NOT NULL ENABLE, "OVRCOMMENTLERBKOPF" NUMBER(12,0) NOT NULL ENABLE, "COMMENTVERS" VARCHAR2(4000 CHAR), "COMMENTVERSOVR" VARCHAR2(4000 CHAR), "OVRCOMMENTVERS" NUMBER(12,0) NOT NULL ENABLE, "OVRCOMMENTVERSKOPF" NUMBER(12,0) NOT NULL ENABLE, "COMMENTVERSKOPF" VARCHAR2(1000 CHAR), "COMMENTVERSKOPFPOS" VARCHAR2(40 CHAR), "USEESRREDBANKINFO" VARCHAR2(40 CHAR), "ISKOGU" VARCHAR2(40 CHAR) NOT NULL ENABLE, "ITSBEHANDLUNG" VARCHAR2(40 CHAR), "ITSSTORNOECLPROC" VARCHAR2(40 CHAR), "KOPIERT" VARCHAR2(40 CHAR) NOT NULL ENABLE, "STORNOCODE" VARCHAR2(40 CHAR), "MCDINVOICESTATUS" VARCHAR2(40 CHAR) NOT NULL ENABLE, "ITSMCDXMLSTORE" VARCHAR2(40 CHAR), "TARIFGRPMDC" VARCHAR2(35 CHAR), "SUMPOTEINSPARUNG" NUMBER(14,4) NOT NULL ENABLE, "ABSCHLUSSDAT" TIMESTAMP (9), "PROCESSDATE" DATE, "LSTABRDATE" DATE, "LSTABRSTORNODATE" DATE, "REGELVARIABLE1" VARCHAR2(255 CHAR), "TREATMENTBEGIN" DATE, "TREATMENTEND" DATE, "ITSECLAIMPROCINS" VARCHAR2(40 CHAR), "ITSABTRGERKLG" VARCHAR2(40 CHAR), "ITSPROCCOPYFROM" VARCHAR2(40 CHAR), "ARCHIVETAG" VARCHAR2(40 CHAR), "ECLSABEDRGSTATUS" VARCHAR2(40 CHAR), "RECHNUNGSTYP" VARCHAR2(40 CHAR) NOT NULL ENABLE, "MCDVISIBLEDATE" TIMESTAMP (9), "ITSSENDUNG" VARCHAR2(40 CHAR), "MDBID" VARCHAR2(255 CHAR), "LSTZAHLUNGAN" VARCHAR2(40 CHAR), "LSTFORDERUNGAN" VARCHAR2(40 CHAR), "LSTZAHLUNGANOVR" NUMBER(12,0) NOT NULL ENABLE, "LSTFORDERUNGANOVR" NUMBER(12,0) NOT NULL ENABLE, "FRISTBEGINN" DATE DEFAULT NULL NOT NULL ENABLE, "EXTPRUEFSYSSTATUS" VARCHAR2(40 CHAR) DEFAULT NULL, "EXTPRUEFSYSDATE" DATE DEFAULT NULL, SUPPLEMENTAL LOG DATA (ALL) COLUMNS ) PCTFREE 10 PCTUSED 40 INITRANS 40 MAXTRANS 255 LOGGING STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ASEDBUSR_DAT" PARTITION BY LIST ("REPLACED") (PARTITION "P_CURR" VALUES (TIMESTAMP '3000-01-01 00:00:00') SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 40 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 8388608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ASEDBUSR_DAT" , PARTITION "P_ARCH" VALUES (DEFAULT) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 40 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 8388608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ASEDBUSR_DAT" ) ENABLE ROW MOVEMENT; CREATE UNIQUE INDEX "ASEDBUSR"."PK1019008" ON "ASEDBUSR"."ECLAIMPROCESS" ("PKEY") PCTFREE 10 INITRANS 80 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ASEDBUSR_DAT"; ALTER TABLE "ASEDBUSR"."ECLAIMPROCESS" ADD CONSTRAINT "PK1019008" PRIMARY KEY ("PKEY") USING INDEX "ASEDBUSR"."PK1019008" ENABLE; CREATE TABLE "ASEDBUSR"."DOCBESTPARAMATTR" ( "PKEY" NUMBER(12,0) NOT NULL ENABLE, "BOID" VARCHAR2(40 CHAR) NOT NULL ENABLE, "METABO" NUMBER(12,0) NOT NULL ENABLE, "LASTUPDATE" TIMESTAMP (9) NOT NULL ENABLE, "PROCESSID" VARCHAR2(40 CHAR) NOT NULL ENABLE, "ROWCOMMENT" VARCHAR2(15 CHAR), "CREATED" TIMESTAMP (9) NOT NULL ENABLE, "CREATEDUSER" VARCHAR2(40 CHAR) NOT NULL ENABLE, "REPLACED" TIMESTAMP (9) NOT NULL ENABLE, "REPLACEDUSER" VARCHAR2(40 CHAR), "ARCHIVETAG" VARCHAR2(40 CHAR), "GUELTAB" DATE NOT NULL ENABLE, "GUELTBIS" DATE NOT NULL ENABLE, "ITSPARAMATTRDEF" VARCHAR2(40 CHAR) NOT NULL ENABLE, "CODEVALUE" VARCHAR2(40 CHAR), "ITSBOVALUE" VARCHAR2(40 CHAR), "CLSBOVALUE" NUMBER(12,0), "INTVALUE" NUMBER(12,0), "DECVALUE" NUMBER(18,6), "TEXTVALUE" VARCHAR2(4000 CHAR), "DATEVALUE" DATE, "ITSDOCBESTELLUNG" VARCHAR2(40 CHAR) NOT NULL ENABLE, "MDBID" VARCHAR2(255 CHAR), "BIGTEXTVALUE" CLOB, "CK_CODEVALUE" VARCHAR2(40 CHAR), CONSTRAINT "PK500332" PRIMARY KEY ("PKEY") USING INDEX PCTFREE 10 INITRANS 80 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ASEDBUSR_DAT" ENABLE, SUPPLEMENTAL LOG DATA (ALL) COLUMNS ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 40 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ASEDBUSR_DAT" LOB ("BIGTEXTVALUE") STORE AS SECUREFILE ( TABLESPACE "ASEDBUSR_DAT" ENABLE STORAGE IN ROW CHUNK 8192 NOCACHE LOGGING NOCOMPRESS KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ; CREATE TABLE t_order (SYS_ID VARCHAR2(32 CHAR) VISIBLE NOT NULL, ATTACHMENT_NAME VARCHAR2(1024 BYTE) INVISIBLE DEFAULT ''); CREATE TABLE "A"."B" ( "FIELD1" NUMBER(19,0) NOT NULL ENABLE, "FIELD2" NUMBER(19,0) NOT NULL ENABLE, PRIMARY KEY ("FIELD1") ENABLE ) ORGANIZATION INDEX NOCOMPRESS ; CREATE BLOCKCHAIN TABLE bank_ledger (bank VARCHAR2(128), deposit_date DATE, deposit_amount NUMBER) NO DROP UNTIL 31 DAYS IDLE NO DELETE LOCKED HASHING USING "SHA2_512" VERSION "v1"; CREATE BLOCKCHAIN TABLE bctab_part (trans_id number primary key, sender varchar2(50), recipient varchar2(50), trans_date DATE, amount number) NO DROP UNTIL 16 DAYS IDLE NO DELETE UNTIL 25 DAYS AFTER INSERT HASHING USING "SHA2_512" VERSION "v1" PARTITION BY RANGE(trans_date) (PARTITION p1 VALUES LESS THAN (TO_DATE('30-09-2019','dd-mm-yyyy')), PARTITION p2 VALUES LESS THAN (TO_DATE('31-12-2019','dd-mm-yyyy')), PARTITION p3 VALUES LESS THAN (TO_DATE('31-03-2020','dd-mm-yyyy')), PARTITION p4 VALUES LESS THAN (TO_DATE('30-06-2020','dd-mm-yyyy')) ); CREATE TABLE T_ORDER ( ORDER_ID NUMBER(10) GENERATED BY DEFAULT AS IDENTITY START WITH 1 MAXVALUE 100, STATUS VARCHAR2(10), COLUMN1 VARCHAR2(10) ); -- see as https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/CREATE-TABLE.html#GUID-F9CE0CC3-13AE-4744-A43C-EAC7A71AAAB6 CREATE TABLE print_media_demo ( product_id NUMBER(6) , ad_id NUMBER(6) , ad_composite BLOB , ad_sourcetext CLOB , ad_finaltext CLOB , ad_fltextn NCLOB , ad_textdocs_ntab textdoc_tab , ad_photo BLOB , ad_graphic BFILE , ad_header adheader_typ ) NESTED TABLE ad_textdocs_ntab STORE AS textdocs_nestedtab_demo LOB (ad_composite, ad_photo, ad_finaltext) STORE AS(STORAGE (INITIAL 20M)) PARTITION BY RANGE (product_id) (PARTITION p1 VALUES LESS THAN (3000) TABLESPACE tbs_01 LOB (ad_composite, ad_photo) STORE AS (TABLESPACE tbs_02 STORAGE (INITIAL 10M)) NESTED TABLE ad_textdocs_ntab STORE AS nt_p1 (TABLESPACE example), PARTITION P2 VALUES LESS THAN (MAXVALUE) LOB (ad_composite, ad_finaltext) STORE AS SECUREFILE (TABLESPACE auto_seg_ts) NESTED TABLE ad_textdocs_ntab STORE AS nt_p2 ) TABLESPACE tbs_03; CREATE TABLE T ( id number(9,0) primary key, data xmltype ); CREATE TABLE "D1 " ("c1" INTEGER, "C2" INTEGER); CREATE TABLE T ( id number(9,0) primary key, data xmltype ) USAGE QUEUE; CREATE TABLE tab (ID number(9) primary key, data xmltype, data2 xmltype) MEMOPTIMIZE FOR READ; CREATE TABLE tab (ID number(9) primary key, data xmltype, data2 xmltype) NO MEMOPTIMIZE FOR READ; CREATE TABLE tab (ID number(9) primary key, data xmltype, data2 xmltype) MEMOPTIMIZE FOR WRITE; CREATE TABLE tab (ID number(9) primary key, data xmltype, data2 xmltype) NO MEMOPTIMIZE FOR WRITE; CREATE TABLE tab IF NOT EXISTS (ID number(9) primary key); CREATE TABLE T1 ( "NAME" VARCHAR(10) NOT NULL, "ID" INT NOT NULL, "ADDRESS" VARCHAR(255), "SQ_NUMBER" NUMBER(10), "PQ_NUMBER" NUMBER(10), CONSTRAINTS UQ1 UNIQUE ("SQ_NUMBER", "PQ_NUMBER")); create TABLE PROCESSED AS ( select * FROM T_ORDER_PROCESSED f) -- WHERE -- TO_CHAR(to_date('20'||f.nr_ano,'YYYY'),'YYYY')||'/'||TRIM(TO_CHAR(f.nr_mes,'00')) = :refCompAcad); ; CREATE INDEX part_idx ON partitioned_by_index (part, val) GLOBAL PARTITION BY RANGE (part) ( PARTITION t0 VALUES LESS THAN (TIMESTAMP '2020-01-01 00:00:00') , PARTITION t1 VALUES LESS THAN (MAXVALUE) ) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_tablespace.sql ================================================ CREATE BIGFILE TABLESPACE bigtbs_01 DATAFILE 'bigtbs_f1.dbf' SIZE 20M AUTOEXTEND ON; CREATE UNDO TABLESPACE undots1 DATAFILE 'undotbs_1a.dbf' SIZE 10M AUTOEXTEND ON RETENTION GUARANTEE; CREATE TEMPORARY TABLESPACE temp_demo TEMPFILE 'temp01.dbf' SIZE 5M AUTOEXTEND ON; CREATE TEMPORARY TABLESPACE tbs_05; CREATE TEMPORARY TABLESPACE tbs_05 TABLESPACE GROUP ''; CREATE TEMPORARY TABLESPACE tbs_temp_02 TEMPFILE 'temp02.dbf' SIZE 5M AUTOEXTEND ON TABLESPACE GROUP tbs_grp_01; CREATE TABLESPACE tbs_01 DATAFILE 'tbs_f2.dbf' SIZE 40M ONLINE; CREATE TABLESPACE tbs_03 DATAFILE 'tbs_f03.dbf' SIZE 20M LOGGING; CREATE TABLESPACE tbs_02 DATAFILE 'diskb:tbs_f5.dbf' SIZE 500K REUSE AUTOEXTEND ON NEXT 500K MAXSIZE 100M; CREATE TABLESPACE tbs_02 DATAFILE 'diskb:tbs_f5.dbf' SIZE 500K REUSE AUTOEXTEND ON NEXT 500K MAXSIZE 100M; CREATE TABLESPACE tbs_04 DATAFILE 'file_1.dbf' SIZE 10M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K; CREATE TABLESPACE lmt1 DATAFILE 'lmt_file2.dbf' SIZE 100m REUSE EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M; CREATE TABLESPACE lmt2 DATAFILE 'lmt_file3.dbf' SIZE 100m REUSE EXTENT MANAGEMENT LOCAL; CREATE TABLESPACE encrypt_ts DATAFILE '$ORACLE_HOME/dbs/encrypt_df.dbf' SIZE 1M ENCRYPTION USING 'AES256' ; CREATE TABLESPACE auto_seg_ts DATAFILE 'file_2.dbf' SIZE 1M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; CREATE TABLESPACE omf_ts1; CREATE TABLESPACE omf_ts2 DATAFILE AUTOEXTEND OFF; CREATE TABLESPACE ts IF NOT EXISTS DATAFILE 'file.dbf' SIZE 100m ONLINE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_tablespace_set.sql ================================================ CREATE TABLESPACE SET ts1 IN SHARDSPACE sgr1 USING TEMPLATE ( DATAFILE SIZE 100m EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_trigger01.sql ================================================ CREATE TRIGGER my_schema.my_table_trg FOR INSERT OR UPDATE OR DELETE ON my_schema.my_table COMPOUND TRIGGER v_ts TIMESTAMP(6) := SYSTIMESTAMP; v_cnt NUMBER := 0; BEFORE EACH ROW IS col_d_value_override INT := 1; BEGIN IF updating THEN SELECT COUNT(*) INTO v_cnt FROM (SELECT :new.id FROM dual UNION SELECT :old.id FROM dual ); IF v_cnt > 1 THEN raise_application_error(-20000, 'You can''t change primary key.'); END IF; SELECT COUNT(*) INTO v_cnt FROM (SELECT :new.id, :new.col_a, :new.col_b, :new.col_c, :new.col_d FROM dual UNION SELECT :old.id, :old.col_a, :old.col_b, :old.col_c, :old.col_d FROM dual ); END IF; IF v_cnt = 2 OR inserting THEN :new.col_ts := v_ts; ELSIF updating THEN :new.col_ts := :old.col_ts; END IF; IF v_cnt = 2 OR deleting THEN INSERT INTO my_schema.h$_hub_lnk_source_l (id, col_a, col_b, col_c, col_d ) VALUES (:old.id, :old.col_a, :old.col_b, :old.col_c, :col_d_value_override ) ; END IF; END BEFORE EACH ROW; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_trigger02.sql ================================================ create or replace trigger my_trg before insert on my_schema.tgt_table references for each row declare l_id integer; l_rqsttype_id integer; l_rest_date date; v_cnt number(1); begin if :new.id is null then :new.id := gen_id('seq', 1); else l_id := gen_id('seq', 0); if :new.id > l_id then :new.id := gen_id('seq', :new.id - l_id); end if; end if; :new.date_load := sysdate; :new.mi_part := floor(to_char(sysdate, 'mi') / 10); begin select count(1) into v_cnt from my_schema.nem_tbl rt where rt.rqsttypeid = l_rqsttype_id; if (v_cnt = 0) then l_rest_date := add_months(trunc(l_rest_date, 'mm'), 1) - 1; end if; :new.date_rest := l_rest_date; exception when others then :new.date_rest := null; end; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_type.sql ================================================ CREATE TYPE address_t AS OBJECT ( hno NUMBER, street VARCHAR2(40), city VARCHAR2(20), zip VARCHAR2(5), phone VARCHAR2(10) ); CREATE TYPE person AS OBJECT ( name VARCHAR2(40), dateofbirth DATE, homeaddress address_t, manager REF person ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/create_view.sql ================================================ CREATE OR REPLACE VIEW VIEW_TEST_ROLE AS SELECT ID, NAME || '-' ALIAS_NAME FROM TEST_ROLE WHERE ID < 6 with check option; CREATE OR REPLACE FORCE VIEW VIEW_TEST_ROLE AS SELECT ID, NAME || '-' ALIAS_NAME FROM TEST_ROLE WHERE ID < 7 with check option; CREATE OR REPLACE NO FORCE VIEW VIEW_TEST_ROLE AS SELECT ID, NAME || '-' ALIAS_NAME FROM TEST_ROLE WHERE ID < 8 with check option; CREATE VIEW warehouse_view OF XMLTYPE XMLSCHEMA "http://www.example.com/xwarehouses.xsd" ELEMENT "Warehouse" WITH OBJECT ID (extract(OBJECT_VALUE, '/Warehouse/Area/text()').getnumberval()) AS SELECT XMLELEMENT("Warehouse", XMLFOREST(WarehouseID as "Building", area as "Area", docks as "Docks", docktype as "DockType", wateraccess as "WaterAccess", railaccess as "RailAccess", parking as "Parking", VClearance as "VClearance")) FROM warehouse_table; CREATE VIEW THE_VIEW IF NOT EXISTS AS SELECT ID, NAME FROM THE_TABLE WHERE ID > 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/ctas.sql ================================================ create table junk as select sysdate from dual; create table junk1 INITRANS 10 as select sysdate from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/datetime01.sql ================================================ select from_tz(cast(to_date('1999-12-01 11:00:00','yyyy-mm-dd hh:mi:ss') as timestamp), 'america/new_york') at time zone 'america/los_angeles' "west coast time" from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/datetime03.sql ================================================ select timestamp '2009-10-29 01:30:00' at time zone 'us/pacific'from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/datetime04.sql ================================================ select timestamp '2009-10-29 01:30:00' from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/datetime05.sql ================================================ select date '1900-01-01' from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/dblink.sql ================================================ CREATE PUBLIC DATABASE LINK remote USING 'remote'; CREATE DATABASE LINK local CONNECT TO hr IDENTIFIED BY p4ssword USING 'local'; CREATE DATABASE LINK remote.us.example.com CONNECT TO CURRENT_USER USING 'remote'; CREATE DATABASE LINK "LINK" CONNECT TO "DBLINK" IDENTIFIED BY VALUES ':1' USING 'local'; ALTER DATABASE LINK private_link CONNECT TO hr IDENTIFIED BY hr_new_password; ALTER PUBLIC DATABASE LINK public_link CONNECT TO scott IDENTIFIED BY scott_new_password; ALTER SHARED PUBLIC DATABASE LINK shared_pub_link CONNECT TO scott IDENTIFIED BY scott_new_password AUTHENTICATED BY hr IDENTIFIED BY hr_new_password; DROP PUBLIC DATABASE LINK remote; DROP DATABASE LINK private_link_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/dblink01.sql ================================================ select last_name, department_name from employees@remote, departments where employees.department_id = departments.department_id; SELECT * FROM scott.emp@hq.acme.com; SELECT * FROM scott.emp@hq.acme.com@dc1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/directory.sql ================================================ CREATE DIRECTORY mydir AS '/scratch/data/file_data'; CREATE OR REPLACE DIRECTORY bfile_dir AS '/usr/bin/bfile_dir'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/disassociate_statistics.sql ================================================ DISASSOCIATE STATISTICS FROM COLUMNS hr.emp_mgmt.col1 FORCE; DISASSOCIATE STATISTICS FROM PACKAGES hr.emp_mgmt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_analytic_view.sql ================================================ DROP ANALYTIC VIEW sales_av; DROP ANALYTIC VIEW sch.sales_av; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_attribute_dimension.sql ================================================ DROP ATTRIBUTE DIMENSION product_attr_dim; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_audit_policy.sql ================================================ DROP AUDIT POLICY table_pol; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_cluster.sql ================================================ DROP CLUSTER language; DROP CLUSTER sch.language; DROP CLUSTER personnel INCLUDING TABLES CASCADE CONSTRAINTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_context.sql ================================================ DROP CONTEXT hr_context; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_database.sql ================================================ DROP DATABASE ; DROP DATABASE INCLUDING BACKUPS NOPROMPT ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_directory.sql ================================================ DROP DIRECTORY bfile_dir; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_diskgroup.sql ================================================ DROP DISKGROUP dgroup_01 INCLUDING CONTENTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_edition.sql ================================================ DROP EDITION TEST_ED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_flashback_archive.sql ================================================ DROP FLASHBACK ARCHIVE test_archive2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_hierarchy.sql ================================================ DROP HIERARCHY product_hier; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_indextype.sql ================================================ DROP INDEXTYPE position_indextype FORCE; DROP INDEXTYPE position_indextype; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_inmemory_join_group.sql ================================================ DROP INMEMORY JOIN GROUP prod_id1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_java.sql ================================================ DROP JAVA CLASS "Agent"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_library.sql ================================================ DROP LIBRARY ext_lib; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_lockdown_profile.sql ================================================ DROP LOCKDOWN PROFILE hr_prof; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_materialized_view.sql ================================================ DROP MATERIALIZED VIEW mv1; DROP MATERIALIZED VIEW mv2 PRESERVE TABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_materialized_view.sql.tree ================================================ (sql_script (unit_statement (drop_materialized_view DROP MATERIALIZED VIEW (tableview_name (identifier (id_expression (regular_id mv1)))))) ; (unit_statement (drop_materialized_view DROP MATERIALIZED VIEW (tableview_name (identifier (id_expression (regular_id mv2)))) PRESERVE TABLE)) ; ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_materialized_zonemap.sql ================================================ DROP MATERIALIZED ZONEMAP sales_zmap; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_operator.sql ================================================ DROP OPERATOR eq_op; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_outline.sql ================================================ DROP OUTLINE salaries; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_pmem_filestore.sql ================================================ DROP PMEM FILESTORE cloud_db_1 EXCLUDING CONTENTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_restore_point.sql ================================================ DROP RESTORE POINT good_data; DROP RESTORE POINT rp for pluggable database pdb; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_role.sql ================================================ drop role TEST_ROLE_AAA; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_rollback_segment.sql ================================================ DROP ROLLBACK SEGMENT rbs_one; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_synonym01.sql ================================================ drop synonym emp ; drop public synonym emp ; drop public synonym emp force; drop public synonym sch.emp force; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_table.sql ================================================ DROP TABLE employee; DROP TABLE employee PURGE; DROP TABLE employee IF EXISTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_tablespace.sql ================================================ DROP TABLESPACE tbs_01 INCLUDING CONTENTS CASCADE CONSTRAINTS; DROP TABLESPACE tbs_02 INCLUDING CONTENTS AND DATAFILES; DROP TABLESPACE tbs_02 IF EXISTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_tablespace_set.sql ================================================ DROP TABLESPACE SET ts1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_user.sql ================================================ DROP USER sidney; DROP USER sidney CASCADE; DROP USER sidney IF EXISTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/drop_view.sql ================================================ DROP VIEW employee; DROP VIEW employee CASCADE CONSTRAINT; DROP VIEW employee IF EXISTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/editionable_function.sql ================================================ CREATE OR REPLACE EDITIONABLE FUNCTION "TEST"."TRIM_FUNC" (vField in varchar2) return varchar2 is vTemp varchar2(100); begin vTemp:=rtrim(ltrim(vField)); return vTemp; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/editionable_packagebody_function.sql ================================================ -- Test for EDITIONABLE package bodies. CREATE OR REPLACE EDITIONABLE PACKAGE BODY TEST AS FUNCTION TEST_FUNC RETURN NUMBER PIPELINED DETERMINISTIC AS BEGIN RETURN NULL; END TEST_FUNC; FUNCTION TEST_FUNC2 RETURN NUMBER DETERMINISTIC PIPELINED AS BEGIN RETURN NULL; END TEST_FUNC2; END TEST; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/editionable_packagespec_function.sql ================================================ -- Adding pipelined and deterministic keyword in one function spec CREATE OR REPLACE EDITIONABLE PACKAGE TEST IS FUNCTION TEST_FUNC RETURN NUMBER PIPELINED DETERMINISTIC; END TEST; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/explain01.sql ================================================ explain plan set statement_id = 'raise in tokyo' into plan_table for update employees set salary = salary * 1.10 where department_id = (select department_id from departments where location_id = 1700) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/fetch_clause01.sql ================================================ Select * fROM green_table offset 1 rows fetch FIRST 1 ROWS ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/fetch_clause02.sql ================================================ Select * fROM green_table offset 1 rows fetch NEXT 20 percent ROW ONLY ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/fetch_clause03.sql ================================================ select color, favorite FROM green_table order by color, favorite offset 1 rows fetch NEXT 20 ROW WITH TIES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/fetch_clause04.sql ================================================ SELECT (SELECT ID_ FROM TP_STUFF WHERE TEST='1' FETCH FIRST ROW ONLY) AS MWST_ID FROM ETL_MD_RAW_ADM ADM WHERE ADM.STATUS_ART_ID = 0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/fetch_statement.sql ================================================ CREATE OR REPLACE PACKAGE TEST_PKG_LXD AS -- Package header PROCEDURE fetch_statement_test; END TEST_PKG_LXD; CREATE OR REPLACE PACKAGE BODY TEST_PKG_LXD AS -- Package body -- This test case compiles and runs fine on 'Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production' PROCEDURE fetch_statement_test IS TYPE value_type IS RECORD (v PLS_INTEGER); TYPE list IS TABLE OF value_type INDEX BY PLS_INTEGER; tmp_list list; CURSOR fetch_into_cursor IS SELECT 2 FROM dual; -- The DDL of TEST_TB is 'CREATE TABLE TEST_TB(id NUMBER(3), value VARCHAR2(10))' TYPE IDList IS TABLE OF TEST_TB.ID%TYPE; TYPE ValueList IS TABLE OF TEST_TB.VALUE%TYPE; id_list IDList; value_list ValueList; CURSOR fetch_bulk_collect_cursor IS SELECT ID, VALUE FROM TEST_TB; BEGIN OPEN fetch_into_cursor; FETCH fetch_into_cursor INTO tmp_list(0).v; CLOSE fetch_into_cursor; -- The expected output value is 2, and the actual value is also 2. dbms_output.put_line('tmp_list(0).v=' || tmp_list(0).v); OPEN fetch_bulk_collect_cursor; -- Fetch 2 fields into id_list and value_list separately, each field has 2 values, the number of values is limited by tmp_list(0).v. FETCH fetch_bulk_collect_cursor BULK COLLECT INTO id_list, value_list LIMIT tmp_list(0).v; CLOSE fetch_bulk_collect_cursor; FOR i IN id_list.FIRST .. id_list.LAST LOOP -- print 2 records dbms_output.put_line('id=' || id_list(i) || ', value=' || value_list(i)); END LOOP; END fetch_statement_test; END TEST_PKG_LXD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/flashback01.sql ================================================ select value(p$) from "XDB"."XDB$SCHEMA" as of snapshot(:2) p$ where SYS_NC_OID$ = :1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/flashback_table.sql ================================================ FLASHBACK TABLE hr.employees TO TIMESTAMP TO_TIMESTAMP('29-DEC-20 01.26.29.000000000 PM'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/for_update01.sql ================================================ select employee_id from (select * from employees) for update of employee_id ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/for_update02.sql ================================================ select employee_id from (select employee_id+1 as employee_id from employees) for update ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/for_update03.sql ================================================ select employee_id from (select employee_id+1 as employee_id from employees) for update of employee_id ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/for_update04.sql ================================================ select employee_id from (select employee_id+1 as employee_id from employees) for update of employee_id nowait ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/for_update05.sql ================================================ select employee_id from (select employee_id+1 as employee_id from employees) for update of employee_id wait 10 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/for_update06.sql ================================================ select employee_id from (select employee_id+1 as employee_id from employees) for update of employee_id skip locked ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/for_update07.sql ================================================ select employee_id from (select employee_id+1 as employee_id from employees) for update of a, b.c, d skip locked ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/for_update08.sql ================================================ select su.ttype ,su.cid ,su.s_id ,sessiontimezone from sku su where (nvl(su.up,'n')='n' and su.ttype=:b0) for update of su.up order by su.d ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/forall_bulk_rowcount.sql ================================================ DECLARE TYPE num_list IS TABLE OF NUMBER; departments num_list := num_list(45, 78, 91); BEGIN FORALL j IN departments.FIRST..departments.LAST DELETE FROM employees WHERE department_id = departments(j); FOR i IN departments.FIRST..departments.LAST LOOP DBMS_OUTPUT.PUT_LINE ( 'Statement #' || i || ' deleted ' || SQL%BULK_ROWCOUNT(i) || ' rows.' ); END LOOP; DBMS_OUTPUT.PUT_LINE('Total rows deleted: ' || SQL%ROWCOUNT); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/forall_indices_of.sql ================================================ CREATE TABLE tbl (id NUMBER); DECLARE TYPE nums IS TABLE OF NUMBER; TYPE nums_list IS VARRAY(2) OF nums; ns nums_list := nums_list(nums(1, 2, 3), nums(4, 5, 6)); BEGIN FOR i IN 1..2 LOOP FORALL j IN INDICES OF ns(i) INSERT INTO tbl VALUES (ns(i)(j)); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/forall_statement_and_exception_handling.sql ================================================ -- forall syntax: https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/FORALL-statement.html#GUID-C45B8241-F9DF-4C93-8577-C840A25963DB -- forall exception handling: https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/plsql-optimization-and-tuning.html#GUID-DAF46F06-EF3F-4B1A-A518-5238B80C69FA CREATE OR REPLACE PACKAGE TEST_PKG_LXD AS -- Package header PROCEDURE forall_and_exception_after_forall; END TEST_PKG_LXD; CREATE OR REPLACE PACKAGE BODY TEST_PKG_LXD AS -- Package body -- This test case passed on 'Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production' PROCEDURE forall_and_exception_after_forall IS TYPE IdList IS TABLE OF NUMBER; ids IdList := IdList(10, 20, 30); error_message VARCHAR2(100); bad_stmt_no PLS_INTEGER; dml_errors EXCEPTION; PRAGMA EXCEPTION_INIT(dml_errors, -24381); BEGIN -- Populate table: -- The DDL of TEST_TB is 'CREATE TABLE TEST_TB(id NUMBER(3), value VARCHAR2(10))' INSERT INTO TEST_TB (id, value) VALUES (10, 'v_10'); INSERT INTO TEST_TB (id, value) VALUES (20, 'value_20'); INSERT INTO TEST_TB (id, value) VALUES (30, 'v_30'); COMMIT; -- forall_statement syntax FORALL j IN ids.FIRST..ids.LAST SAVE EXCEPTIONS -- Append 5-character string to each value: UPDATE TEST_TB SET value = value || '. add' WHERE id = ids(j); EXCEPTION WHEN dml_errors THEN -- Handling FORALL Exceptions After FORALL Statement Completes FOR i IN 1..SQL%BULK_EXCEPTIONS.COUNT LOOP error_message := SQLERRM(-(SQL%BULK_EXCEPTIONS(i).ERROR_CODE)); DBMS_OUTPUT.PUT_LINE (error_message); bad_stmt_no := SQL%BULK_EXCEPTIONS(i).ERROR_INDEX; DBMS_OUTPUT.PUT_LINE('Bad statement #: ' || bad_stmt_no); END LOOP; COMMIT; -- Commit results of successful updates WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('Unrecognized error.'); RAISE; END forall_and_exception_after_forall; END TEST_PKG_LXD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/function01.sql ================================================ select decode(decode(decode( (select count(1) from dual), a, 1, 0), 0, 1), 1, 0) from dual -- select decode(decode(decode(decode(x, 0, 1) , 0, 1), 1, 0 ), 0, 1) from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/function02.sql ================================================ select set(x) from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/function03.sql ================================================ select trim(both from con.ke) from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/function04.sql ================================================ select lnnvl( 2 > 1) from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/function05.sql ================================================ select count(*) from employees where lnnvl(commission_pct >= .2) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/function06.sql ================================================ call dbms_scheduler.auto_purge ( ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/function07.sql ================================================ create or replace function budget(job varchar2) return varchar2 SQL_MACRO is begin return q'{ select deptno, sum(sal) budget from emp where job = budget.job group by deptno }'; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/general_element_part.sql ================================================ CREATE OR REPLACE PACKAGE TEST_PKG_LXD AS -- Package header TYPE type_array IS ARRAY(5) OF PLS_INTEGER; FUNCTION return_array_test RETURN type_array; PROCEDURE get_array_test; END TEST_PKG_LXD; CREATE OR REPLACE PACKAGE BODY TEST_PKG_LXD AS -- Package body -- This test case compiles and runs fine on 'Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production' FUNCTION return_array_test RETURN type_array IS test_array type_array; BEGIN test_array := type_array(1, 2, 3, 4, 5); return test_array; END return_array_test; PROCEDURE get_array_test IS value PLS_INTEGER; BEGIN value := return_array_test()(3); -- The expected output value is 3, and the actual output value is also 3 dbms_output.put_line('value=' || value); END get_array_test; END TEST_PKG_LXD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/groupby01.sql ================================================ select :b3 as l_snap_id , :b2 as p_dbid , :b1 as p_instance_number , nvl(pid, -9) pid , nvl(serial#, -9) serial# , decode(pid, null, null, max(spid)) spid , decode(pid, null, null, max(program)) program , decode(pid, null, null, max(background)) background , sum(pga_used_mem) pga_used_mem , sum(pga_alloc_mem) pga_alloc_mem , sum(pga_freeable_mem) pga_freeable_mem , max(pga_alloc_mem) max_pga_alloc_mem , max(pga_max_mem) max_pga_max_mem , decode(pid, null, avg(pga_alloc_mem), null) avg_pga_alloc_mem , decode(pid, null, stddev(pga_alloc_mem), null) stddev_pga_alloc_mem , decode(pid, null, count(pid), null) num_processes from v$process where program != 'pseudo' group by grouping sets ( (pid, serial#), () ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/groupby02.sql ================================================ select decode(pid, null, null, max(program)) program , decode(pid, null, null, max(background)) background , sum(pga_used_mem) pga_used_mem , sum(pga_alloc_mem) pga_alloc_mem , sum(pga_freeable_mem) pga_freeable_mem , max(pga_alloc_mem) max_pga_alloc_mem , max(pga_max_mem) max_pga_max_mem , decode(pid, null, avg(pga_alloc_mem), null) avg_pga_alloc_mem , decode(pid, null, stddev(pga_alloc_mem), null) stddev_pga_alloc_mem , decode(pid, null, count(pid), null) num_processes from v$process where program != 'pseudo' group by grouping sets ( (), ((pid+1), serial#) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/groupby03.sql ================================================ select * from x group by grouping sets ( a, 1 ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/groupby04.sql ================================================ select * from x group by grouping sets ( (a),1 ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/groupby05.sql ================================================ select * from x group by grouping sets ( ((a),b), ((a),b) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/groupby06.sql ================================================ select prod_category, prod_subcategory, country_id, cust_city, count(*) from products, sales, customers where sales.prod_id = products.prod_id and sales.cust_id=customers.cust_id and sales.time_id = '01-oct-00' and customers.cust_year_of_birth between 1960 and 1970 group by grouping sets ( (prod_category, prod_subcategory, country_id, cust_city), (prod_category, prod_subcategory, country_id), (prod_category, prod_subcategory), country_id ) order by prod_category, prod_subcategory, country_id, cust_city ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/groupby07.sql ================================================ select decode((tt || tc), '56', count(distinct cn), '57', sum(nu)) as q from t where tt='500' and tc in ('6','7') and to_char(c,'mm') = '03' having sum(nu) > 0 group by tn, ui, (tt || tc) order by 1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/index.sql ================================================ create index IDX on OBJ (CODE, DOCUMENT); ALTER INDEX supplier_idx RENAME TO supplier_index_name; DROP INDEX index_name; CREATE INDEX ord_customer_ix ON orders (customer_id); CREATE INDEX ord_customer_ix_demo ON orders (customer_id, sales_rep_id) COMPRESS 1; CREATE INDEX ord_customer_ix_demo ON orders (order_mode) NOSORT NOLOGGING; CREATE INDEX idx_personnel ON CLUSTER personnel; CREATE INDEX upper_ix ON employees (UPPER(last_name)); CREATE INDEX income_ix ON employees(salary + (salary*commission_pct)); CREATE INDEX src_idx ON print_media(text_length(ad_sourcetext)); CREATE INDEX area_idx ON rect_tab x (x.area()); CREATE INDEX cust_last_name_ix ON customers (cust_last_name) GLOBAL PARTITION BY HASH (cust_last_name) PARTITIONS 4; CREATE INDEX prod_idx ON hash_products(category_id) LOCAL STORE IN (tbs_01, tbs_02); CREATE BITMAP INDEX product_bm_ix ON hash_products(list_price) TABLESPACE tbs_04; CREATE UNIQUE INDEX nested_tab_ix ON textdocs_nestedtab(NESTED_TABLE_ID, document_typ); ALTER INDEX ord_customer_ix REBUILD REVERSE; ALTER INDEX ord_customer_ix REBUILD PARALLEL; ALTER INDEX oe.cust_lname_ix INITRANS 5; ALTER INDEX upper_ix PARALLEL; ALTER INDEX upper_ix RENAME TO upper_name_ix; ALTER INDEX cost_ix MODIFY PARTITION p2 UNUSABLE; ALTER INDEX cost_ix UNUSABLE; ALTER INDEX cost_ix REBUILD PARTITION p2; ALTER INDEX cost_ix REBUILD PARTITION p3 NOLOGGING; ALTER INDEX cost_ix MODIFY PARTITION p3 STORAGE(MAXEXTENTS 30) LOGGING; ALTER INDEX cost_ix RENAME PARTITION p3 TO p3_Q3; ALTER INDEX cost_ix SPLIT PARTITION p2 AT (1500) INTO ( PARTITION p2a TABLESPACE tbs_01 LOGGING, PARTITION p2b TABLESPACE tbs_02); ALTER INDEX cost_ix DROP PARTITION p1; ALTER INDEX prod_idx MODIFY DEFAULT ATTRIBUTES INITRANS 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/insert_statement.sql ================================================ DECLARE V_RECORD EVENT%ROWTYPE; BEGIN SELECT * INTO V_RECORD FROM EVENT WHERE ROWNUM=1; INSERT INTO TMP_EVENT VALUES V_RECORD; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/interval01.sql ================================================ select (systimestamp - order_date) day(9) to second from orders where order_id = 2458 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/interval02.sql ================================================ select interval '42' day from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/interval03.sql ================================================ select interval '4 5:12:10.222' day to second(3) ,interval '4 5:12' day to minute ,interval '400 5' day(3) to hour ,interval '400' day(3) ,interval '11:12:10.2222222' hour to second(7) ,interval '11:20' hour to minute ,interval '10' hour ,interval '10:22' minute to second ,interval '10' minute ,interval '4' day ,interval '25' hour ,interval '40' minute ,interval '120' hour(3) ,interval '30.12345' second(2,4) ,interval :a day ,interval '1' year ,interval '1' month from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/interval04.sql ================================================ select interval'20' day - interval'240' hour from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join01.sql ================================================ select d.department_id as d_dept_id, e.department_id as e_dept_id, e.last_name from departments d full outer join employees e on d.department_id = e.department_id order by d.department_id, e.last_name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join02.sql ================================================ select department_id as d_e_dept_id, e.last_name from departments d full outer join employees e using (department_id) order by department_id, e.last_name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join03.sql ================================================ select d.department_id, e.last_name from m.departments d right outer join n.employees e on d.department_id = e.department_id order by d.department_id, e.last_name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join04.sql ================================================ select d.department_id, e.last_name from departments d, employees e where d.department_id = e.department_id(+) order by d.department_id, e.last_name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join05.sql ================================================ select times.time_id, product, quantity from inventory partition by (product) right outer join times on (times.time_id = inventory.time_id) where times.time_id between to_date('01/04/01', 'dd/mm/yy') and to_date('06/04/01', 'dd/mm/yy') order by 2,1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join06.sql ================================================ select * from dual d1 join dual d2 on (d1.dummy = d2.dummy) join dual d3 on(d1.dummy = d3.dummy) join dual on(d1.dummy = dual.dummy) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join07.sql ================================================ select * from t1 join t2 tt2 using(c) join t3 tt3 using(d) join t3 using(d) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join08.sql ================================================ select * from dual t1 join (select * from dual) tt2 using(dummy) join (select * from dual) using(dummy) join (select * from dual) d on(d.dummy=tt3.dummy) inner join (select * from dual) tt2 using(dummy) inner join (select * from dual) using(dummy) inner join (select * from dual) d on(d.dummy=t1.dummy) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join09.sql ================================================ select * from dual t1 left outer join (select * from dual) tt2 using(dummy) left outer join (select * from dual) using(dummy) left outer join (select * from dual) d on(d.dummy=tt3.dummy) inner join (select * from dual) tt2 using(dummy) inner join (select * from dual) using(dummy) inner join (select * from dual) d on(d.dummy=t1.dummy) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join10.sql ================================================ select * from dual t1, ( dual left outer join (select * from dual) tt2 using(dummy) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join11.sql ================================================ select * from t1, ( t2 left outer join t3 using(dummy) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join12.sql ================================================ select * from dual,( dual left outer join tt2 using(dummy) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join13.sql ================================================ select * from t1, (((( t2 left outer join t3 using(dummy) )))) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join14.sql ================================================ select * from dual t1, ( ( ( dual t2 join dual t3 using(dummy) ) left outer join dual t4 using(dummy) ) left outer join dual t5 using(dummy) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join15.sql ================================================ select * from dual t1, ( dual t2 join dual t3 using(dummy)) left outer join dual t4 using (dummy) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join16.sql ================================================ select * from dual t1, dual t2 join dual t3 using(dummy) left outer join dual t4 using(dummy) left outer join dual t5 using(dummy) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join17.sql ================================================ select * from hdr a inner join sh s inner join ca c on c.id = s.id on a.va = s.va ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join18.sql ================================================ select department_id as d_e_dept_id, e.last_name from departments full outer join employees on (a=b) left outer join employees on (a=b) right outer join employees on (a=b) join employees on (a=b) inner join employees on (a=b) cross join employees natural join employees ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join19.sql ================================================ select d1.*, d2.* from dual d1 cross join dual d2 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join20.sql ================================================ select d1.*, d2.* from dual cross join dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join21.sql ================================================ select * from sys.dual natural join sys.dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join22.sql ================================================ SELECT * FROM employees e , LATERAL(SELECT * FROM departments d WHERE e.department_id = d.department_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/join23.sql ================================================ SELECT d.department_name, v.employee_id, v.last_name FROM departments d CROSS APPLY (SELECT * FROM employees e WHERE e.department_id = d.department_id) v WHERE d.department_name IN ('Marketing', 'Operations') ORDER BY d.department_name, v.employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/json_query.sql ================================================ -- From https://www.oratable.com/querying-json-data-in-oracle/ -- 2.2a SQL/JSON query: JSON_QUERY -- to select the entire JSON document select custid , custname , json_query(metadata, '$' ) json_metadata from customer; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/json_query.sql.tree ================================================ (sql_script (unit_statement (data_manipulation_language_statements (select_statement (select_only_statement (subquery (subquery_basic_elements (query_block select (selected_list (select_list_elements (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (atom (general_element (general_element_part (id_expression (regular_id custid))))))))))))))) , (select_list_elements (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (atom (general_element (general_element_part (id_expression (regular_id custname))))))))))))))) , (select_list_elements (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (standard_function (json_function json_query ( (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (atom (general_element (general_element_part (id_expression (regular_id (non_reserved_keywords_in_12c metadata))))))))))))))) , '$' json_query_returning_clause )))))))))))) (column_alias (identifier (id_expression (regular_id json_metadata)))))) (from_clause from (table_ref_list (table_ref (table_ref_aux (table_ref_aux_internal (dml_table_expression_clause (tableview_name (identifier (id_expression (regular_id customer))))))))))))))))) ; ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/json_sql.sql ================================================ select 'A' | | 'B' from dual; SELECT JSON_OBJECT ( KEY 'deptno' IS d.department_id, KEY 'deptname' IS d.department_name ) "Department Objects" FROM departments d ORDER BY d.department_id; SELECT JSON_OBJECT(KEY 'VALUE' VALUE COL), t.* FROM T t; SELECT JSON_OBJECT(KEY 'VALUE' VALUE COL FORMAT JSON), t.* FROM T t; SELECT JSON_ARRAY ( JSON_OBJECT('percentage' VALUE .50), JSON_ARRAY(1,2,3), 100, 'California', null NULL ON NULL ) "JSON Array Example" FROM DUAL; SELECT JSON_ARRAYAGG(id ORDER BY id RETURNING VARCHAR2(100)) ID_NUMBERS FROM id_table; SELECT JSON_OBJECTAGG(KEY department_name VALUE department_id) "Department Numbers" FROM departments WHERE department_id <= 30; SELECT JSON_QUERY('{a:100, b:200, c:300}', '$') AS value FROM DUAL; SELECT JSON_SERIALIZE ('{a:[1,2,3,4]}' RETURNING VARCHAR2(3) TRUNCATE ERROR ON ERROR) from dual; SELECT JSON_VALUE('{a:100}', '$.a') AS value FROM DUAL; SELECT JSON_VALUE('{"level": 10}', '$.level' RETURNING NUMBER) FROM DUAL; SELECT 1 FROM DUAL WHERE '{"a": 1, "b": [1, 2, 3]}' IS JSON; SELECT * FROM employees WHERE (doc IS JSON); SELECT * FROM employees WHERE dept = 2 AND (doc IS JSON); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/keywordasidentifier01.sql ================================================ select timestamp, avg, cume_dist from nulls ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/keywordasidentifier02.sql ================================================ select m.model from model ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/keywordasidentifier03.sql ================================================ select ind.index_owner,ind.index_name,ind.uniqueness , ind.status,ind.index_type,ind.temporary, ind.partitioned,ind.funcidx_status , ind.join_index,ind.columns,ie.column_expression , ind.index_name sdev_link_name,'INDEX' sdev_link_type, ind.index_owner sdev_link_owner from ( select index_owner,table_owner,index_name,uniqueness, status,index_type,temporary, partitioned,funcidx_status, join_index , max(decode(position,1 ,column_name))|| max(decode(position,2 ,', '||column_name))|| max(decode(position,3 ,', '||column_name))|| max(decode(position,4 ,', '||column_name))|| max(decode(position,5 ,', '||column_name))|| max(decode(position,6 ,', '||column_name))|| max(decode(position,7 ,', '||column_name))|| max(decode(position,8 ,', '||column_name))|| max(decode(position,9 ,', '||column_name))|| max(decode(position,10,', '||column_name)) columns from ( select di.owner index_owner,dc.table_owner,dc.index_name,di.uniqueness, di.status, di.index_type, di.temporary, di.partitioned,di.funcidx_status, di.join_index , dc.column_name,dc.column_position position from all_ind_columns dc,all_indexes di where dc.table_owner = :OBJECT_OWNER and dc.table_name = :OBJECT_NAME and dc.index_name = di.index_name and dc.index_owner = di.owner ) group by index_owner,table_owner,index_name,uniqueness, status, index_type, temporary, partitioned,funcidx_status, join_index ) ind, ALL_IND_EXPRESSIONS ie where ind.index_name = ie.index_name(+) and ind.index_owner = ie.index_owner(+) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/keywordasidentifier04.sql ================================================ select bs.keep keep, bs.keep_until keep_until from v$backup_set bs union all select null keep, null keep_until from v$backup_piece bp ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/keywordasidentifier05.sql ================================================ select exception from exception ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/keywordasidentifier06.sql ================================================ SELECT * FROM PERIOD; CREATE PROCEDURE TEST AS BEGIN IF A.EXISTS() THEN NULL; END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/least_greatest.sql ================================================ SELECT LEAST(1), LEAST(1, 2), LEAST(1, 2, 3), GREATES(1), GREATEST(1, 2), GREATEST(1, 2, 3) FROM DUAL ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/lexer01.sql ================================================ select * from dual where 1 < > 2 and 1 ! = 2 and 1 ^ /*aaa */ = 2 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/lexer02.sql ================================================ select 'A' | | 'B' from dual; select a ä, b Ḅ from dual; CREATE OR REPLACE PACKAGE ACCESS_SECURITY AS -- omitted END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/lexer02.sql.tree ================================================ (sql_script (unit_statement (data_manipulation_language_statements (select_statement (select_only_statement (subquery (subquery_basic_elements (query_block select (selected_list (select_list_elements (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (concatenation (model_expression (unary_expression (atom (constant (quoted_string 'A')))))) | | (concatenation (model_expression (unary_expression (atom (constant (quoted_string 'B'))))))))))))))) (from_clause from (table_ref_list (table_ref (table_ref_aux (table_ref_aux_internal (dml_table_expression_clause (tableview_name (identifier (id_expression (regular_id dual))))))))))))))))) ; (unit_statement (data_manipulation_language_statements (select_statement (select_only_statement (subquery (subquery_basic_elements (query_block select (selected_list (select_list_elements (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (atom (general_element (general_element_part (id_expression (regular_id a)))))))))))))) (column_alias (identifier (id_expression (regular_id ä))))) , (select_list_elements (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (atom (general_element (general_element_part (id_expression (regular_id b)))))))))))))) (column_alias (identifier (id_expression (regular_id Ḅ)))))) (from_clause from (table_ref_list (table_ref (table_ref_aux (table_ref_aux_internal (dml_table_expression_clause (tableview_name (identifier (id_expression (regular_id dual))))))))))))))))) ; (unit_statement (create_package CREATE OR REPLACE PACKAGE (package_name (identifier (id_expression (regular_id ACCESS_SECURITY)))) AS END)) ; ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/lexer03.sql ================================================ select :1, :X, :1 + 1, 1 + :2 from A where A=:3 and b= : 4 and c= :5and :A = :b ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/lexer04.sql ================================================ select tbl$or$idx$part$num("sys"."wrh$_seg_stat",0,4,0,"rowid") as c1 from t1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/lexer05.sql ================================================ select tbl$or$idx$part$num("sys"."wrh:_seg_stat",0,4,0,"rowid") as c1 from t1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/like01.sql ================================================ select last_name from employees where last_name like '%a\_b%' escape '\' order by last_name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/lob-item.sql ================================================ SELECT "C1" FROM "T1" ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/lob-item.sql.tree ================================================ (sql_script (unit_statement (data_manipulation_language_statements (select_statement (select_only_statement (subquery (subquery_basic_elements (query_block SELECT (selected_list (select_list_elements (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (atom (general_element (general_element_part (id_expression "C1"))))))))))))))) (from_clause FROM (table_ref_list (table_ref (table_ref_aux (table_ref_aux_internal (dml_table_expression_clause (tableview_name (identifier (id_expression "T1")))))))))))))))) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/materialized_views.sql ================================================ CREATE MATERIALIZED VIEW foreign_customers FOR UPDATE AS SELECT * FROM sh.customers@remote cu WHERE EXISTS (SELECT * FROM sh.countries@remote co WHERE co.country_id = cu.country_id); CREATE MATERIALIZED VIEW sales_mv BUILD IMMEDIATE REFRESH FAST ON COMMIT AS SELECT t.calendar_year, p.prod_id, SUM(s.amount_sold) AS sum_sales FROM times t, products p, sales s WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id GROUP BY t.calendar_year, p.prod_id; CREATE MATERIALIZED VIEW sales_by_month_by_state TABLESPACE example PARALLEL 4 BUILD IMMEDIATE REFRESH COMPLETE ENABLE QUERY REWRITE AS SELECT t.calendar_month_desc, c.cust_state_province, SUM(s.amount_sold) AS sum_sales FROM times t, sales s, customers c WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id GROUP BY t.calendar_month_desc, c.cust_state_province; CREATE MATERIALIZED VIEW sales_sum_table ON PREBUILT TABLE WITH REDUCED PRECISION ENABLE QUERY REWRITE AS SELECT t.calendar_month_desc AS month, c.cust_state_province AS state, SUM(s.amount_sold) AS sales FROM times t, customers c, sales s WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id GROUP BY t.calendar_month_desc, c.cust_state_province; CREATE MATERIALIZED VIEW order_data REFRESH WITH ROWID AS SELECT * FROM orders; CREATE MATERIALIZED VIEW warranty_orders REFRESH FAST AS SELECT order_id, line_item_id, product_id FROM order_items o WHERE EXISTS (SELECT * FROM inventories i WHERE o.product_id = i.product_id AND i.quantity_on_hand IS NOT NULL) UNION SELECT order_id, line_item_id, product_id FROM order_items WHERE quantity > 5; CREATE MATERIALIZED VIEW my_warranty_orders AS SELECT w.order_id, w.line_item_id, o.order_date FROM warranty_orders w, orders o WHERE o.order_id = o.order_id AND o.sales_rep_id = 165; CREATE MATERIALIZED VIEW LOG ON customers PCTFREE 5 TABLESPACE example STORAGE (INITIAL 10K); CREATE MATERIALIZED VIEW LOG ON customers WITH PRIMARY KEY, ROWID; CREATE MATERIALIZED VIEW LOG ON sales WITH ROWID, SEQUENCE(amount_sold, time_id, prod_id) INCLUDING NEW VALUES; CREATE MATERIALIZED VIEW LOG ON order_items WITH (product_id); CREATE MATERIALIZED VIEW products_mv REFRESH FAST ON COMMIT AS SELECT SUM(list_price - min_price), category_id FROM product_information GROUP BY category_id; CREATE MATERIALIZED VIEW TEST AS WITH TESTCTE AS ( SELECT 1 ONE FROM DUAL ) SELECT 'A', 'B', 'C' FROM DUAL JOIN TESTCTE; -- tests for column aliases CREATE MATERIALIZED VIEW sales_mv (year, "prod") BUILD IMMEDIATE REFRESH FAST ON COMMIT AS SELECT t.calendar_year, p.prod_id, SUM(s.amount_sold) AS sum_sales FROM times t, products p, sales s WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id GROUP BY t.calendar_year, p.prod_id; CREATE MATERIALIZED VIEW sales_mv (year ENCRYPT, prod) BUILD IMMEDIATE REFRESH FAST ON COMMIT AS SELECT t.calendar_year, p.prod_id, SUM(s.amount_sold) AS sum_sales FROM times t, products p, sales s WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id GROUP BY t.calendar_year, p.prod_id; CREATE MATERIALIZED VIEW sales_mv (year ENCRYPT, prod ENCRYPT USING 'some_algorithm' IDENTIFIED BY pass 'int_algorithm' NO SALT) BUILD IMMEDIATE REFRESH FAST ON COMMIT AS SELECT t.calendar_year, p.prod_id, SUM(s.amount_sold) AS sum_sales FROM times t, products p, sales s WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id GROUP BY t.calendar_year, p.prod_id; -- tests for scoped table ref constraints CREATE MATERIALIZED VIEW sales_mv (year ENCRYPT, prod ENCRYPT, SCOPE FOR (ref_col) IS schema.table_or_alias) BUILD IMMEDIATE REFRESH FAST ON COMMIT AS SELECT t.calendar_year, p.prod_id, SUM(s.amount_sold) AS sum_sales FROM times t, products p, sales s WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id GROUP BY t.calendar_year, p.prod_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/max_001.sql ================================================ SELECT MAX (DISTINCT miles), MAX (ALL miles) FROM Flights ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/merge01.sql ================================================ merge into bonuses d using (select employee_id.* from employees) s on (employee_id = a) when matched then update set d.bonus = bonus delete where (salary > 8000) when not matched then insert (d.employee_id, d.bonus) values (s.employee_id, s.salary) where (s.salary <= 8000) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/merge02.sql ================================================ merge into bonuses d using (select employee_id.* from employees) s on (employee_id = a) when not matched then insert (d.employee_id, d.bonus) values (s.employee_id, s.salary) where (s.salary <= 8000) when matched then update set d.bonus = bonus delete where (salary > 8000) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/merge03.sql ================================================ merge /*+ dynamic_sampling(mm 4) dynamic_sampling_est_cdn(mm) dynamic_sampling(m 4) dynamic_sampling_est_cdn(m) */ into sys.mon_mods_all$ mm using ( select decode(grouping_id(tp.bo#,tsp.pobj#,m.obj#),3,tp.bo#,1,tsp.pobj#,m.obj#) obj#, sum(m.inserts) inserts, sum(m.updates) updates, sum(m.deletes) deletes, decode(sum(bitand(m.flags,1)),0,0,1) +decode(sum(bitand(m.flags,2)),0,0,2) +decode(sum(bitand(m.flags,4)),0,0,4) flags, sum(m.drop_segments) drop_segments from sys.mon_mods$ m, sys.tabcompart$ tp, sys.tabsubpart$ tsp where m.obj# = tsp.obj# and tp.obj# = tsp.pobj# group by rollup(tp.bo#,tsp.pobj#,m.obj#) having grouping_id(tp.bo#,tsp.pobj#,m.obj#) < 7 ) v on (mm.obj# = v.obj#) when matched then update set mm.inserts = mm.inserts + v.inserts, mm.updates = mm.updates + v.updates, mm.deletes = mm.deletes + v.deletes, mm.flags = mm.flags + v.flags - bitand(mm.flags,v.flags) , mm.drop_segments = mm.drop_segments + v.drop_segments when not matched then insert values (v.obj#, v.inserts, v.updates, v.deletes, sysdate, v.flags, v.drop_segments) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/merge04.sql ================================================ merge /*+ dynamic_sampling(mm 4) dynamic_sampling_est_cdn(mm) dynamic_sampling(m 4) dynamic_sampling_est_cdn(m) */ into sys.mon_mods_all$ mm using ( select decode(grouping_id(tp.bo#,tsp.pobj#,m.obj#),3,tp.bo#,1,tsp.pobj#,m.obj#) obj#, sum(m.inserts) inserts, sum(m.updates) updates, sum(m.deletes) deletes, decode(sum(bitand(m.flags,1)),0,0,1) +decode(sum(bitand(m.flags,2)),0,0,2) +decode(sum(bitand(m.flags,4)),0,0,4) flags, sum(m.drop_segments) drop_segments from sys.mon_mods$ m, sys.tabcompart$ tp, sys.tabsubpart$ tsp where m.obj# = tsp.obj# and tp.obj# = tsp.pobj# group by rollup(tp.bo#,tsp.pobj#,m.obj#) having grouping_id(tp.bo#,tsp.pobj#,m.obj#) < 7 order by 1, 2, 3 ) v on (mm.obj# = v.obj#) when matched then update set mm.inserts = mm.inserts + v.inserts, mm.updates = mm.updates + v.updates, mm.deletes = mm.deletes + v.deletes, mm.flags = mm.flags + v.flags - bitand(mm.flags,v.flags) , mm.drop_segments = mm.drop_segments + v.drop_segments when not matched then insert values (v.obj#, v.inserts, v.updates, v.deletes, sysdate, v.flags, v.drop_segments) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/merge05.sql ================================================ -- MERGE INTO with a rowtype variable as "insert values" parameter MERGE INTO salesfront.SF_FORM_REFERENCE_CHOICES_DEF target USING (select null from dual) ON (recChoicesDef.id = target.id) WHEN MATCHED THEN UPDATE SET target.source_id = recChoicesDef.source_id WHEN NOT MATCHED THEN INSERT VALUES recChoicesDef; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/model_clause01.sql ================================================ select country,prod,year,s from sales_view_ref model partition by (country) dimension by (prod, year) measures (sale s) ignore nav -- cell_reference_options unique dimension -- here starts model_rules_clause rules upsert sequential order ( s[prod='mouse pad', year=2001] = s['mouse pad', 1999] + s['mouse pad', 2000], s['standard mouse', 2002] = s['standard mouse', 2001] ) order by country, prod, year ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/model_clause02.sql ================================================ select country, year, sale, csum from (select country, year, sum(sale) sale from sales_view_ref group by country, year ) model dimension by (country, year) measures (sale, 0 csum) rules (csum[any, any]= sum(sale) over (partition by country order by year rows unbounded preceding) ) order by country, year ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/model_clause03.sql ================================================ select country,prod,year,s from sales_view_ref model partition by (country) dimension by (prod, year) measures (sale s) ignore nav unique dimension rules upsert sequential order ( s[prod='mouse pad'] = 1, s['standard mouse'] = 2 ) order by country, prod, year ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/model_clause04.sql ================================================ select country, year, sale, csum from (select country, year, salex sale from sales_view_ref group by country, year ) model dimension by (country, year) measures (sale, 0 csum) rules ( s['standard mouse'] = 2 ) order by country, year ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/model_clause05.sql ================================================ select country, year, sale, csum from (select country, year, salex sale from sales_view_ref group by country, year ) m model dimension by (country, year) measures (sale, 0 csum) rules ( s['standard mouse'] = 2 ) order by country, year ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/multiset_operators.sql ================================================ -- Example from https://github.com/utPLSQL/utPLSQL/blob/3437b689e2097b1bdae4b0daf22b09549e5eabee/source/core/ut_suite_cache_manager.pkb select c.obj.path as path from suite_items c where c.obj.tags multiset intersect :a_include_tag_list is not empty or :a_include_tag_list is empty; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/noaudit_statement.sql ================================================ NOAUDIT ROLE; NOAUDIT SELECT TABLE BY hr; NOAUDIT DELETE ANY TABLE; NOAUDIT SELECT ON hr.employees; NOAUDIT SELECT ON hr.employees WHENEVER SUCCESSFUL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/numbers01.sql ================================================ select 25 , +6.34 , 0.5 , 25e-03 , -1 -- Here are some valid floating-point number literals: , 25f , +6.34F , 0.5d , -1D , (sysdate -1d) -- here we subtract "one" in decimal format , sysdate -1m -- here we subtract "one" and "m" is column's alias , sysdate -1dm from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/nvl_001.sql ================================================ SELECT last_name, NVL(TO_CHAR(commission_pct), 'Not Applicable') "COMMISSION" FROM employees WHERE last_name LIKE 'B%' ORDER BY last_name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/object_access01.sql ================================================ select extractvalue(value(t), '/select_list_item/pos') + 1 pos, extractvalue(value(t), '/select_list_item/value') res, extractvalue(value(t), '/select_list_item/nonnulls') nonnulls, extractvalue(value(t), '/select_list_item/ndv') ndv, extractvalue(value(t), '/select_list_item/split') split, extractvalue(value(t), '/select_list_item/rsize') rsize, extractvalue(value(t), '/select_list_item/rowcnt') rowcnt, extract(value(t), '/select_list_item/hash_val').getclobval() hashval from table ( xmlsequence ( extract(:b1 , '/process_result/select_list_item') ) ) t ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/object_access_expressions.sql ================================================ SELECT (t.t_queue_type).date_calc AS date_calc_par , t.t_queue_type.date_calc AS date_calc_direct , t.t_queue_type.as_code() AS type_code , (t.t_queue_type).as_code() AS type_code_par , t.t_queue_type.sub_type.as_code() AS subtype_code , ((t.t_queue_type).sub_type).as_code() AS subtype_code_par , t.hier(1)(2)(3).gettype AS nested_invocations_and_member_access , treat(ent as my_schema.my_table).version AS member_of_treat_result FROM t_queue t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/offset_clause.sql ================================================ Select * fROM green_table offset 1 row; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/order_by01.sql ================================================ select * from dual order by 1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/order_by02.sql ================================================ select * from dual order by 1 asc ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/order_by03.sql ================================================ select * from dual order by m.year, m.title, f(a) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/order_by04.sql ================================================ select * from dual order by a nulls first, b nulls last, substr(c, 1) collate generic_m ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/order_by05.sql ================================================ select * from dual order siblings by a nulls first, b nulls last, c nulls last, d nulls last, e nulls last ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/order_by06.sql ================================================ with a as (select * from dual order by 1) select * from a ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/package_body.sql ================================================ CREATE PACKAGE BODY EMP_BONUS AS LOCAL_PARAM NUMBER; USER_EXCEPTION EXCEPTION; PROCEDURE CALC_BONUS (DATE_HIRED DATE) IS BEGIN LOCAL_PARAM:=0; END; END EMP_BONUS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/package_body.sql.tree ================================================ (sql_script (unit_statement (create_package_body CREATE PACKAGE BODY (package_name (identifier (id_expression (regular_id EMP_BONUS)))) AS (package_obj_body (variable_declaration (identifier (id_expression (regular_id LOCAL_PARAM))) (type_spec (datatype (native_datatype_element NUMBER))) ;)) (package_obj_body (exception_declaration (identifier (id_expression (regular_id USER_EXCEPTION))) EXCEPTION ;)) (package_obj_body (procedure_body PROCEDURE (identifier (id_expression (regular_id CALC_BONUS))) ( (parameter (parameter_name (identifier (id_expression (regular_id DATE_HIRED)))) (type_spec (datatype (native_datatype_element DATE)))) ) IS (body BEGIN (seq_of_statements (statement (assignment_statement (general_element (general_element_part (id_expression (regular_id LOCAL_PARAM)))) := (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (atom (constant (numeric 0)))))))))))))) ;) END) ;)) END (package_name (identifier (id_expression (regular_id EMP_BONUS)))))) ; ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/packagebody_function.sql ================================================ -- Test for ignoring the order of DETERMINISTIC and PIPELINED keywords in function bodies CREATE OR REPLACE PACKAGE BODY TEST AS FUNCTION TEST_FUNC RETURN NUMBER PIPELINED DETERMINISTIC AS BEGIN RETURN NULL; END TEST_FUNC; FUNCTION TEST_FUNC2 RETURN NUMBER DETERMINISTIC PIPELINED AS BEGIN RETURN NULL; END TEST_FUNC2; END TEST; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/packagespec_function.sql ================================================ -- Adding pipelined and deterministic keyword in one function spec CREATE OR REPLACE PACKAGE TEST IS FUNCTION TEST_FUNC RETURN NUMBER PIPELINED DETERMINISTIC; END TEST; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/partitioned_tables.sql ================================================ -- https://docs.oracle.com/cd/E18283_01/server.112/e16541/part_admin001.htm CREATE TABLE sales ( prod_id NUMBER(6) , cust_id NUMBER , time_id DATE , channel_id CHAR(1) , promo_id NUMBER(6) , quantity_sold NUMBER(3) , amount_sold NUMBER(10,2) ) PARTITION BY RANGE (time_id) ( PARTITION sales_q1_2006 VALUES LESS THAN (TO_DATE('01-APR-2006','dd-MON-yyyy')) TABLESPACE tsa , PARTITION sales_q2_2006 VALUES LESS THAN (TO_DATE('01-JUL-2006','dd-MON-yyyy')) TABLESPACE tsb , PARTITION sales_q3_2006 VALUES LESS THAN (TO_DATE('01-OCT-2006','dd-MON-yyyy')) TABLESPACE tsc , PARTITION sales_q4_2006 VALUES LESS THAN (TO_DATE('01-JAN-2007','dd-MON-yyyy')) TABLESPACE tsd ); CREATE TABLE sales ( prod_id NUMBER(6) , cust_id NUMBER , time_id DATE , channel_id CHAR(1) , promo_id NUMBER(6) , quantity_sold NUMBER(3) , amount_sold NUMBER(10,2) ) STORAGE (INITIAL 100K NEXT 50K) LOGGING PARTITION BY RANGE (time_id) ( PARTITION sales_q1_2006 VALUES LESS THAN (TO_DATE('01-APR-2006','dd-MON-yyyy')) TABLESPACE tsa STORAGE (INITIAL 20K NEXT 10K) , PARTITION sales_q2_2006 VALUES LESS THAN (TO_DATE('01-JUL-2006','dd-MON-yyyy')) TABLESPACE tsb , PARTITION sales_q3_2006 VALUES LESS THAN (TO_DATE('01-OCT-2006','dd-MON-yyyy')) TABLESPACE tsc , PARTITION sales_q4_2006 VALUES LESS THAN (TO_DATE('01-JAN-2007','dd-MON-yyyy')) TABLESPACE tsd ) ENABLE ROW MOVEMENT; CREATE TABLE interval_sales ( prod_id NUMBER(6) , cust_id NUMBER , time_id DATE , channel_id CHAR(1) , promo_id NUMBER(6) , quantity_sold NUMBER(3) , amount_sold NUMBER(10,2) ) PARTITION BY RANGE (time_id) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH')) ( PARTITION p0 VALUES LESS THAN (TO_DATE('1-1-2007', 'DD-MM-YYYY')), PARTITION p1 VALUES LESS THAN (TO_DATE('1-1-2008', 'DD-MM-YYYY')), PARTITION p2 VALUES LESS THAN (TO_DATE('1-7-2009', 'DD-MM-YYYY')), PARTITION p3 VALUES LESS THAN (TO_DATE('1-1-2010', 'DD-MM-YYYY')) ); CREATE TABLE customers_demo ( customer_id number(6), cust_first_name varchar2(20), cust_last_name varchar2(20), credit_limit number(9,2)) PARTITION BY RANGE (credit_limit) INTERVAL (1000) (PARTITION p1 VALUES LESS THAN (5001)); CREATE TABLE list_customers ( customer_id NUMBER(6) , cust_first_name VARCHAR2(20) , cust_last_name VARCHAR2(20) , cust_address CUST_ADDRESS_TYP , nls_territory VARCHAR2(30) , cust_email VARCHAR2(30)) PARTITION BY LIST (nls_territory) ( PARTITION asia VALUES ('CHINA', 'THAILAND'), PARTITION europe VALUES ('GERMANY', 'ITALY', 'SWITZERLAND'), PARTITION west VALUES ('AMERICA'), PARTITION east VALUES ('INDIA'), PARTITION rest VALUES (DEFAULT)); CREATE TABLE hash_products ( product_id NUMBER(6) PRIMARY KEY , product_name VARCHAR2(50) , product_description VARCHAR2(2000) , category_id NUMBER(2) , weight_class NUMBER(1) , warranty_period INTERVAL YEAR TO MONTH , supplier_id NUMBER(6) , product_status VARCHAR2(20) , list_price NUMBER(8,2) , min_price NUMBER(8,2) , catalog_url VARCHAR2(50) , CONSTRAINT product_status_lov_demo CHECK (product_status in ('orderable' ,'planned' ,'under development' ,'obsolete') ) ) PARTITION BY HASH (product_id) PARTITIONS 4 STORE IN (tbs_01, tbs_02, tbs_03, tbs_04); CREATE TABLE composite_sales ( prod_id NUMBER(6) , cust_id NUMBER , time_id DATE , channel_id CHAR(1) , promo_id NUMBER(6) , quantity_sold NUMBER(3) , amount_sold NUMBER(10,2) ) PARTITION BY RANGE (time_id) SUBPARTITION BY HASH (channel_id) (PARTITION SALES_Q1_1998 VALUES LESS THAN (TO_DATE('01-APR-1998','DD-MON-YYYY')), PARTITION SALES_Q2_1998 VALUES LESS THAN (TO_DATE('01-JUL-1998','DD-MON-YYYY')), PARTITION SALES_Q3_1998 VALUES LESS THAN (TO_DATE('01-OCT-1998','DD-MON-YYYY')), PARTITION SALES_Q4_1998 VALUES LESS THAN (TO_DATE('01-JAN-1999','DD-MON-YYYY')), PARTITION SALES_Q1_1999 VALUES LESS THAN (TO_DATE('01-APR-1999','DD-MON-YYYY')), PARTITION SALES_Q2_1999 VALUES LESS THAN (TO_DATE('01-JUL-1999','DD-MON-YYYY')), PARTITION SALES_Q3_1999 VALUES LESS THAN (TO_DATE('01-OCT-1999','DD-MON-YYYY')), PARTITION SALES_Q4_1999 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY')), PARTITION SALES_Q1_2000 VALUES LESS THAN (TO_DATE('01-APR-2000','DD-MON-YYYY')), PARTITION SALES_Q2_2000 VALUES LESS THAN (TO_DATE('01-JUL-2000','DD-MON-YYYY')) SUBPARTITIONS 8, PARTITION SALES_Q3_2000 VALUES LESS THAN (TO_DATE('01-OCT-2000','DD-MON-YYYY')) (SUBPARTITION ch_c, SUBPARTITION ch_i, SUBPARTITION ch_p, SUBPARTITION ch_s, SUBPARTITION ch_t), PARTITION SALES_Q4_2000 VALUES LESS THAN (MAXVALUE) SUBPARTITIONS 4) ; CREATE TABLE customers_part ( customer_id NUMBER(6), cust_first_name VARCHAR2(20), cust_last_name VARCHAR2(20), nls_territory VARCHAR2(30), credit_limit NUMBER(9,2)) PARTITION BY RANGE (credit_limit) SUBPARTITION BY LIST (nls_territory) SUBPARTITION TEMPLATE (SUBPARTITION east VALUES ('CHINA', 'JAPAN', 'INDIA', 'THAILAND'), SUBPARTITION west VALUES ('AMERICA', 'GERMANY', 'ITALY', 'SWITZERLAND'), SUBPARTITION other VALUES (DEFAULT)) (PARTITION p1 VALUES LESS THAN (1000), PARTITION p2 VALUES LESS THAN (2500), PARTITION p3 VALUES LESS THAN (MAXVALUE)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot01.sql ================================================ select * from pivot_table unpivot (yearly_total for order_mode in (store as 'direct', internet as 'online')) order by year, order_mode ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot02.sql ================================================ select * from ( select times_purchased as "puchase frequency", state_code from customers t ) pivot xml ( count(state_code) for state_code in (select state_code from preferred_states) ) order by 1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot03.sql ================================================ select * from ( select times_purchased as "purchase frequency", state_code from customers t ) pivot xml ( count(state_code) for state_code in (any) ) order by 1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot04.sql ================================================ select value from ( ( select 'a' v1, 'e' v2, 'i' v3, 'o' v4, 'u' v5 from dual ) unpivot ( value for value_type in (v1,v2,v3,v4,v5) ) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot05.sql ================================================ select * from (select customer_id, product_code, quantity from pivot_test) pivot xml (sum(quantity) as sum_quantity for (product_code) in (select distinct product_code from pivot_test)) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot06.sql ================================================ select * from (select product_code, quantity from pivot_test) pivot xml (sum(quantity) as sum_quantity for (product_code) in (select distinct product_code from pivot_test where id < 10)) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot07.sql ================================================ select * from (select customer_id, product_code, quantity from pivot_test) pivot (sum(quantity) as sum_quantity for (product_code) in ('a' as a, 'b' as b, 'c' as c)) order by customer_id ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot08.sql ================================================ select * from (select product_code, quantity from pivot_test) pivot (sum(quantity) as sum_quantity for (product_code) in ('a' as a, 'b' as b, 'c' as c)) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot09.sql ================================================ select * from (s join d using(c)) pivot ( max(c_c_p) as max_ccp , max(d_c_p) max_dcp , max(d_x_p) dxp , count(1) cnt for (i, p) in ( (1,1) as one_one, (1,2) as one_two, (1,3) as one_three, (2,1) as two_one, (2,2) as two_two, (2,3) as two_three ) ) where d_t = 'p' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot10.sql ================================================ select * from s join d using(c) pivot ( max(c_c_p) as max_ccp , max(d_c_p) max_dcp , max(d_x_p) dxp , count(1) cnt for (i, p) in ( (1,1) as one_one, (1,2) as one_two, (1,3) as one_three, (2,1) as two_one, (2,2) as two_two, (2,3) as two_three ) ) where d_t = 'p' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot11.sql ================================================ select * from s pivot ( max(c_c_p) as max_ccp , max(d_c_p) max_dcp , max(d_x_p) dxp , count(1) cnt for (i, p) in ( (1,1) as one_one, (1,2) as one_two, (1,3) as one_three, (2,1) as two_one, (2,2) as two_two, (2,3) as two_three ) ) join d using(c) where d_t = 'p' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot12.sql ================================================ select value from ( ( select 'a' v1, 'e' v2, 'i' v3, 'o' v4, 'u' v5 from dual ) unpivot include nulls ( value for value_type in (v1, v2,v3,v4,v5) -- Also can give ANY here. ) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/pivot13.sql ================================================ WITH SessionCTE AS ( SELECT terminal FROM v$session ) SELECT * FROM SessionCTE PIVOT ( COUNT(*) FOR terminal IN ('VIRTUALORACLE11' AS oracle_local, 'DRUID' AS druid, 'THOR' AS thor) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/purge_statement.sql ================================================ PURGE TABLE test; PURGE TABLE RB$$33750$TABLE$0; PURGE RECYCLEBIN; PURGE TABLESPACE ts USER U; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring01.sql ================================================ with reports_to_101 (eid, emp_last, mgr_id, reportlevel) as ( select employee_id, last_name, manager_id, 0 reportlevel from employees where employee_id = 101 union all select e.employee_id, e.last_name, e.manager_id, reportlevel+1 from reports_to_101 r, employees e where r.eid = e.manager_id ) select eid, emp_last, mgr_id, reportlevel from reports_to_101 r, auto a where r.c1 = a.c2 order by reportlevel, eid ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring02.sql ================================================ with reports_to_101 (eid, emp_last, mgr_id, reportlevel, mgr_list) as ( select employee_id, last_name, manager_id, 0 reportlevel , cast(manager_id as varchar2(2000)) from employees where employee_id = 101 union all select e.employee_id, e.last_name, e.manager_id, reportlevel+1 , cast(mgr_list || ',' || manager_id as varchar2(2000)) from reports_to_101 r, employees e where r.eid = e.manager_id ) select eid, emp_last, mgr_id, reportlevel, mgr_list from reports_to_101 order by reportlevel, eid ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring03.sql ================================================ with reports_to_101 (eid, emp_last, mgr_id, reportlevel) as ( select employee_id, last_name, manager_id, 0 reportlevel from employees where employee_id = 101 union all select e.employee_id, e.last_name, e.manager_id, reportlevel+1 from reports_to_101 r, employees e where r.eid = e.manager_id ) select eid, emp_last, mgr_id, reportlevel from reports_to_101 where reportlevel <= 1 order by reportlevel, eid ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring04.sql ================================================ with org_chart (eid, emp_last, mgr_id, reportlevel, salary, job_id) as ( select employee_id, last_name, manager_id, 0 reportlevel, salary, job_id from employees where manager_id is null union all select e.employee_id, e.last_name, e.manager_id, r.reportlevel+1 reportlevel, e.salary, e.job_id from org_chart r, employees e where r.eid = e.manager_id ) search depth first by emp_last set order1 select lpad(' ',2*reportlevel)||emp_last emp_name, eid, mgr_id, salary, job_id from org_chart order by order1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring05.sql ================================================ with x1 as (select max(y1) from klm1), x2 as (select max(y2) from klm2), x3 as (select max(y3) from klm3), x4 as (select max(y4) from klm4) select distinct -1, +1, a + b * (a * d) as aaa, t1.region_name, t2.division_name, t1.region_name as a, t2.division_name as aaaa, a.*, sum(t3.amount), sum(count(1)) + count(*) , sum(1) + (select count(1) from ddd) a from dual, fff where a is null or b is not null and ( a like 'd') and 1 = 0 and a.b is a set union select a from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring06.sql ================================================ with dept_costs as ( select department_name, sum(salary) dept_total from employees e, departments d where e.department_id = d.department_id group by department_name), avg_cost as ( select sum(dept_total)/count(*) avg from dept_costs) select * from dept_costs where dept_total > (select avvg from avg_cost) order by department_name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring08.sql ================================================ with -- qf x1 as ( select * from t1 ), x2 as ( select * from t2 join t3 on (t2.a2 = t3.a3)) select * from x1 join x2 on (x1.a1 = x2.a2) join t4 on (x1.a1 = t4.a4) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring09.sql ================================================ with rn as ( select rownum rn from dual connect by level <= (select max(cases) from t1)) select pname from t1, rn where rn <= cases order by pname ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring10.sql ================================================ with o(obj,link) as ( select 'a', 'b' from dual union all select 'a', 'c' from dual union all select 'c', 'd' from dual union all select 'd', 'c' from dual union all select 'd', 'e' from dual union all select 'e', 'e' from dual ), t(root,lev,obj,link,path) as ( select obj,1,obj,link,cast(obj||'->'||link as varchar2(4000)) from o where obj='a' -- start with union all select t.root,t.lev+1,o.obj,o.link, t.path||', '||o.obj|| '->' ||o.link from t, o where t.link=o.obj ) search depth first by obj set ord cycle obj set cycle to 1 default 0 select root,lev,obj,link,path,cycle, case when (lev - lead(lev) over (order by ord)) < 0 then 0 else 1 end is_leaf from t ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/query_factoring11.sql ================================================ with col_generator as ( select t1.batch_id, decode(t1.action, 'sent', t1.actdate) sent, decode(t2.action,'recv', t2.actdate) received from test t1, test t2 where t2.batch_id(+) = t1.batch_id) select batch_id, max(sent) sent, max(received) received from col_generator group by batch_id order by 1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/quntitative_expression.sql ================================================ SELECT 1 FROM DUAL WHERE 1 = ANY(1, 2, 3); SELECT 1 FROM DUAL WHERE 1 = ANY(1, 2, 3) AND 1 = 1; SELECT 1 FROM DUAL WHERE 1 = ANY(1, 2, 3) OR 1 = 1; SELECT 1 FROM DUAL WHERE 1 = ANY(1, 2, 3) AND 2 = ANY(2, 3); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/rename_objects.sql ================================================ -- Test for RENAME statement of unit_statement (f.e. renaming Oracle jobs) RENAME FOO TO BAR; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/revoke_statement.sql ================================================ REVOKE DROP ANY TABLE FROM hr, oe; REVOKE dw_manager FROM sh; REVOKE CREATE TABLESPACE FROM dw_manager; REVOKE dw_user FROM dw_manager; REVOKE DELETE ON orders FROM hr; REVOKE UPDATE ON emp_details_view FROM public; REVOKE INHERIT PRIVILEGES ON USER sh FROM hr; REVOKE SELECT ON hr.departments_seq FROM oe; REVOKE REFERENCES ON hr.employees FROM oe CASCADE CONSTRAINTS; REVOKE READ ON DIRECTORY bfile_dir FROM hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/round_001.sql ================================================ SELECT round( decode( a.attribute_name, n.col, a.attribute_num_value * n.scale + n.shift, a.attribute_num_value), 4 ) FROM employees ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/round_decode_001.sql ================================================ SELECT nvl( a.attribute_str_value, round( decode( a.attribute_name, n.col, a.attribute_num_value * n.scale + n.shift, a.attribute_num_value), 4 ) ) val from employees ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/row_number_001.sql ================================================ SELECT department_id, last_name, employee_id, ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY employee_id) AS emp_id FROM employees ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/sample01.sql ================================================ select * from ( select 1 as c1 from "sys"."obj$" sample block (14.285714 , 1) seed (1) "o" ) samplesub ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/select_all_some_any.sql ================================================ select * from "CW_ROLE" where role_id = some(1,5); select * from "T_ROLE" where role_id = any(1,5); select * from "T_ROLE" where role_id = all(1,5); select u.name, u.sex, u.age from sys.user u; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/select_analytic_view.sql ================================================ WITH my_av ANALYTIC VIEW AS ( USING sales_av HIERARCHIES (time_hier) ADD MEASURES ( lag_sales AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1)) ) ) SELECT time_hier.member_name time, sales, lag_sales FROM my_av HIERARCHIES (time_hier) WHERE time_hier.level_name = 'YEAR' ORDER BY time_hier.hier_order; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/select_cte.sql ================================================ -- offset, fetch and order by is acceptable in with clause subquery WITH t AS (SELECT dummy FROM dual ORDER BY dummy ASC NULLS LAST OFFSET 0 ROWS FETCH FIRST ROW ONLY) SELECT dummy FROM t ORDER BY dummy ASC NULLS LAST OFFSET 0 ROWS FETCH FIRST ROW ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/select_dense_rank.sql ================================================ -- undocumented (?) feature of first/last: you could replace mandatory "order by" clause by "partition by" clause select max(dummy) keep(dense_rank first partition by dummy) , max(dummy) keep(dense_rank last partition by dummy) from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/select_flashback_query.sql ================================================ select * from sale_op_tbl versions period for dt between CURRENT_DATE - 10 and CURRENT_DATE where id_store = 589 and id_item = 29584; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/select_hierarchical_query.sql ================================================ -- https://stackoverflow.com/questions/10043445/oracle-connect-by-clause-after-group-by-clause -- CONNECT BY comes after GROUP BY SELECT deptno, LTRIM(MAX(SYS_CONNECT_BY_PATH(ename,',')) KEEP (DENSE_RANK LAST ORDER BY curr),',') AS employees FROM (SELECT deptno, ename, ROW_NUMBER() OVER (PARTITION BY deptno ORDER BY ename) AS curr, ROW_NUMBER() OVER (PARTITION BY deptno ORDER BY ename) -1 AS prev FROM emp) GROUP BY deptno CONNECT BY prev = PRIOR curr AND deptno = PRIOR deptno START WITH curr = 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/select_package_function.sql ================================================ SELECT DBMS_LOB.SUBSTR(FIELD_1,4000,1) AS FIELD_1, 'ABC' AS FIELD_2 FROM TABLE_1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/select_time.sql ================================================ SELECT TIME '19:00:00'+INTERVAL '9' HOUR, TIME '19:00:00'-INTERVAL '9' HOUR from dual; SELECT TIME '19:00:00'+INTERVAL '9' DAY, TIME '19:00:00'-INTERVAL '9' DAY from dual; SELECT TIME '19:00:00'+INTERVAL '9' SECOND, TIME '19:00:00'-INTERVAL '9' SECOND from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/select_without_from.sql ================================================ SELECT 2*3; SELECT 2*3 WHERE 1=0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/seq_token_error.sql ================================================ select seq from employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple02.sql ================================================ select employee_id from (select employee_id+1 as employee_id from employees) for update ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple03.sql ================================================ select employee_id from (select employee_id+1 as employee_id from employees) for update of employee_id ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple04.sql ================================================ select * from ( ( select * from dual ) unpivot ( value for value_type in (dummy) ) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple05.sql ================================================ select * from ( select * from a unpivot ( value for value_type in (dummy) ) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple06.sql ================================================ select * from (( select * from dual)) a ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple07.sql ================================================ select * from dual for update of dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple08.sql ================================================ select a, b, c, d, e, 1, 2, f(a,b,c,1+1) from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple09.sql ================================================ select a||last_name, employee_id from employees start with job_id = 'ad_vp' connect by prior employee_id = manager_id ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple10.sql ================================================ select a as over from over ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple11.sql ================================================ select a.* from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple12.sql ================================================ select +1, t2.division_name as aaaa, a.*, sum(t3.amount) from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/simple13.sql ================================================ select * from (dual), (dual d), (dual) d ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/single_statement.sql ================================================ create TABLE PROCESSED AS ( select * FROM T_ORDER_PROCESSED f) -- WHERE -- TO_CHAR(to_date('20'||f.nr_ano,'YYYY'),'YYYY')||'/'||TRIM(TO_CHAR(f.nr_mes,'00')) = :refCompAcad); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/string01.sql ================================================ select 'hello' , 'oracle.dbs' , 'jackie''s raincoat' , '09-mar-98' , '' , '''' , q'!name like '%dbms_%%'!' , q'<'so,' she said, 'it's finished.'>' , q'{select * from employees where last_name = 'smith'}' , q'"name like '['"' , q'#name like #smth #' , q''name like 'smth '' , q'(name like )) )' , q'~name like ~~~ ~' , q'/name like // /' , q'\name like \\ \' , n'nchar literal' from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/timing.sql ================================================ TIMING; TIMING START; TIMING START one_word; TIMING START more_than_one_word; TIMING SHOW; TIMING STOP; -- verify that selecting a column named TIMING still work SELECT timing FROM some_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/timing.sql.tree ================================================ (sql_script (sql_plus_command (timing_command TIMING)) ; (sql_plus_command (timing_command TIMING START)) ; (sql_plus_command (timing_command TIMING START (id_expression (regular_id one_word)))) ; (sql_plus_command (timing_command TIMING START (id_expression (regular_id more_than_one_word)))) ; (sql_plus_command (timing_command TIMING SHOW)) ; (sql_plus_command (timing_command TIMING STOP)) ; (unit_statement (data_manipulation_language_statements (select_statement (select_only_statement (subquery (subquery_basic_elements (query_block SELECT (selected_list (select_list_elements (expression (logical_expression (unary_logical_expression (multiset_expression (relational_expression (compound_expression (concatenation (model_expression (unary_expression (atom (general_element (general_element_part (id_expression (regular_id (non_reserved_keywords_pre12c timing))))))))))))))))) (from_clause FROM (table_ref_list (table_ref (table_ref_aux (table_ref_aux_internal (dml_table_expression_clause (tableview_name (identifier (id_expression (regular_id some_table))))))))))))))))) ; ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_binary_double.sql ================================================ select raw_value, to_binary_double(raw_value), to_binary_double(raw_value, '9990.9999'), to_binary_double(raw_value, '9990.9999', 'NLS_DATE_LANGUAGE = RUSSIAN'), to_binary_double(raw_value default 0 on conversion error), to_binary_double(raw_value default 0 on conversion error, '9990.9999'), to_binary_double(raw_value default 0 on conversion error, '9990.9999', 'NLS_DATE_LANGUAGE = RUSSIAN') from raw_values; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_binary_float.sql ================================================ select raw_value, to_binary_float(raw_value), to_binary_float(raw_value, '9990.9999'), to_binary_float(raw_value, '9990.9999', 'NLS_DATE_LANGUAGE = RUSSIAN'), to_binary_float(raw_value default 0 on conversion error), to_binary_float(raw_value default 0 on conversion error, '9990.9999'), to_binary_float(raw_value default 0 on conversion error, '9990.9999', 'NLS_DATE_LANGUAGE = RUSSIAN') from raw_values; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_char.sql ================================================ SELECT TO_CHAR(SYSDATE), TO_CHAR(SYSDATE, 'D'), TO_CHAR(SYSDATE, 'D', 'NLS_DATE_LANGUAGE = RUSSIAN') FROM DUAL ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_char_001.sql ================================================ SELECT TO_CHAR("date", 'YYYY-MM') || '-01' as "month" FROM employes ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_char_002.sql ================================================ select TO_CHAR(commission_pct) as "commission" from employees ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_date.sql ================================================ SELECT TO_DATE('01.Jan.12') FROM DUAL; SELECT TO_DATE('01.01.2012', 'dd.mm.yyyy') FROM DUAL; SELECT TO_DATE('01' || '.01.2012', 'dd.mm.yyyy') FROM DUAL; SELECT TO_DATE('01.' || (NQUATER*3 - 2) || '.' || NRYEAR, 'DD.MM.YYYY') FROM DUAL; SELECT LAST_DAY(TO_DATE('01.' || (NQUATER*3 - 2) || '.' || NRYEAR, 'DD.MM.YYYY')) FROM DUAL; SELECT TO_CHAR(LAST_DAY(TO_DATE('01.' || (NQUATER*3 - 2) || '.' || NRYEAR, 'DD.MM.YYYY')),'DD') FROM DUAL; SELECT TO_DATE("CHAR_COLUMN") FROM EMPLOYES; SELECT TO_DATE("CHAR_COLUMN",'DD.MM.YYYY') FROM EMPLOYES; SELECT TO_DATE(E."CHAR_COLUMN",'DD.MM.YYYY') FROM EMPLOYES E; SELECT TO_DATE('01.01.2012' DEFAULT NULL ON CONVERSION ERROR) FROM DUAL; SELECT TO_DATE('01.01.2012' DEFAULT NULL ON CONVERSION ERROR, 'dd.mm.yyyy') FROM DUAL; SELECT TO_DATE('01.01.2012' DEFAULT NULL ON CONVERSION ERROR, 'dd.mm.yyyy', 'NLS_DATE_LANGUAGE = RUSSIAN') FROM DUAL; SELECT TO_DATE('01.01.2012' DEFAULT '01.01.1970' ON CONVERSION ERROR) FROM DUAL; SELECT TO_DATE('01.01.2012' DEFAULT '01.01.1970' ON CONVERSION ERROR, 'dd.mm.yyyy') FROM DUAL; SELECT TO_DATE('01.01.2012' DEFAULT '01.01.1970' ON CONVERSION ERROR, 'dd.mm.yyyy', 'NLS_DATE_LANGUAGE = RUSSIAN') FROM DUAL; SELECT TO_DATE("CHAR_COLUMN" DEFAULT NULL ON CONVERSION ERROR) FROM DUAL; SELECT TO_DATE("CHAR_COLUMN" DEFAULT NULL ON CONVERSION ERROR, 'dd.mm.yyyy') FROM DUAL; SELECT TO_DATE("CHAR_COLUMN" DEFAULT NULL ON CONVERSION ERROR, 'dd.mm.yyyy', 'NLS_DATE_LANGUAGE = RUSSIAN') FROM DUAL; SELECT TO_DATE("CHAR_COLUMN" DEFAULT '01.01.1970' ON CONVERSION ERROR) FROM DUAL; SELECT TO_DATE("CHAR_COLUMN" DEFAULT '01.01.1970' ON CONVERSION ERROR, 'dd.mm.yyyy') FROM DUAL; SELECT TO_DATE("CHAR_COLUMN" DEFAULT '01.01.1970' ON CONVERSION ERROR, 'dd.mm.yyyy', 'NLS_DATE_LANGUAGE = RUSSIAN') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_dsinterval.sql ================================================ select to_dsinterval('10 1:02:10'), to_dsinterval('1o 1:02:10' default '10 8:00:00' on conversion error), to_dsinterval(raw_value), to_dsinterval(raw_value default '10 8:00:00' on conversion error), to_dsinterval("RAW_VALUE" default '10 8:00:00' on conversion error) from raw_values; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_number.sql ================================================ select raw_value, to_number(raw_value), to_number(raw_value, '9990.9999'), to_number(raw_value, '9990.9999', 'NLS_DATE_LANGUAGE = RUSSIAN'), to_number(raw_value default 0 on conversion error), to_number(raw_value default 0 on conversion error, '9990.9999'), to_number(raw_value default 0 on conversion error, '9990.9999', 'NLS_DATE_LANGUAGE = RUSSIAN') from raw_values; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_timestamp.sql ================================================ select raw_value, to_timestamp(raw_value), to_timestamp(raw_value, 'YYYY-MM-DD'), to_timestamp(raw_value, 'YYYY-MM-DD', 'NLS_DATE_LANGUAGE = RUSSIAN'), to_timestamp(raw_value default '1970-01-01' on conversion error, 'YYYY-MM-DD'), to_timestamp(raw_value default '1970-01-01' on conversion error, 'YYYY-MM-DD', 'NLS_DATE_LANGUAGE = RUSSIAN'), to_timestamp(raw_value default null on conversion error), to_timestamp(raw_value default null on conversion error, 'YYYY-MM-DD'), to_timestamp(raw_value default null on conversion error, 'YYYY-MM-DD', 'NLS_DATE_LANGUAGE = RUSSIAN') from raw_values; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_timestamp_tz.sql ================================================ select raw_value, to_timestamp_tz(raw_value), to_timestamp_tz(raw_value, 'YYYY-MM-DD'), to_timestamp_tz(raw_value, 'YYYY-MM-DD', 'NLS_DATE_LANGUAGE = RUSSIAN'), to_timestamp_tz(raw_value default '1970-01-01' on conversion error, 'YYYY-MM-DD'), to_timestamp_tz(raw_value default '1970-01-01' on conversion error, 'YYYY-MM-DD', 'NLS_DATE_LANGUAGE = RUSSIAN'), to_timestamp_tz(raw_value default null on conversion error), to_timestamp_tz(raw_value default null on conversion error, 'YYYY-MM-DD'), to_timestamp_tz(raw_value default null on conversion error, 'YYYY-MM-DD', 'NLS_DATE_LANGUAGE = RUSSIAN') from raw_values; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/to_yminterval.sql ================================================ select to_dsinterval('10-02'), to_dsinterval('1x-02' default '00-00' on conversion error), to_dsinterval(raw_value), to_dsinterval(raw_value default '00-00' on conversion error), to_dsinterval("RAW_VALUE" default '00-00' on conversion error) from raw_values; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/truncate_cluster.sql ================================================ TRUNCATE CLUSTER personnel REUSE STORAGE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/truncate_table.sql ================================================ truncate table test; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/unified.sql ================================================ AUDIT POLICY table_pol; AUDIT POLICY dml_pol BY hr, sh; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union01.sql ================================================ select 'a' obj, 'b' link from dual union all select 'a', 'c' from dual union all select 'c', 'd' from dual union all select 'd', 'c' from dual union all select 'd', 'e' from dual union all select 'e', 'e' from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union02.sql ================================================ select distinct job_id from hr.jobs union all select distinct job_id from hr.job_history ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union03.sql ================================================ select distinct job_id from hr.jobs union all ( select distinct job_id from hr.job_history ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union04.sql ================================================ ( select distinct job_id from hr.jobs ) union all ( select distinct job_id from hr.job_history union all (((( select distinct job_id from hr.job_history union all ( select distinct job_id from hr.job_history ) ))) union all select distinct job_id from hr.job_history ) ) union all ( select distinct job_id from hr.job_history union all ( select distinct job_id from hr.job_history union all ( select distinct job_id from hr.job_history ) ) ) union all ( select distinct job_id from hr.job_history union all select distinct job_id from hr.job_history ) union all select distinct job_id from hr.job_history union all select distinct job_id from hr.job_history union all select distinct job_id from hr.job_history union all select distinct job_id from hr.job_history ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union05.sql ================================================ select * from dual union all ( select * from dual ) union all ( select * from dual ) union all ( select * from dual ) union all ( select * from dual ) union all ( select * from dual ) union all ( select * from dual ) union all ( select * from dual ) order by 1 asc, 2 asc ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union06.sql ================================================ ( select "x"."r_no", "x"."i_id", "x"."ind", "x"."item", '0' "o" from "x" where ("x"."r_no" = :a) minus select "y"."r_no", "y"."i_id", "y"."ind", "y"."item", '0' "o" from "y" where ("y"."r_no" = :a) ) union ( select "y"."r_no", "y"."i_id", "y"."ind", "y"."item", '1' "o" from "y" where ("y"."r_no" = :a) minus select "x"."r_no", "x"."i_id", "x"."ind", "x"."item", '1' "o" from "x" where ("x"."r_no" = :a) ) order by 4,3,1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union07.sql ================================================ -- -- note: this query was copied from the druid project -- http://code.alibabatech.com/wiki/display/druid/home -- select * from ( select row_.*, rownum rownum_ from ( select * from ( select results.*,row_number() over ( partition by results.object_id order by results.gmt_modified desc) rn from ( ( select sus.id id, sus.gmt_create gmt_create, sus.gmt_modified gmt_modified, sus.company_id company_id, sus.object_id object_id, sus.object_type object_type, sus.confirm_type confirm_type, sus.operator operator, sus.filter_type filter_type, sus.member_id member_id, sus.member_fuc_q member_fuc_q, sus.risk_type risk_type , 'y' is_draft from f_u_c_ sus , a_b_c_draft p , member m where 1=1 and p.company_id = m.company_id and m.login_id=? and p.sale_type in( ? ) and p.id=sus.object_id ) union ( select sus.id id, sus.gmt_create gmt_create, sus.gmt_modified gmt_modified, sus.company_id company_id, sus.object_id object_id, sus.object_type object_type, sus.confirm_type confirm_type, sus.operator operator, sus.filter_type filter_type, sus.member_id member_id, sus.member_fuc_q member_fuc_q, sus.risk_type risk_type , 'n' is_draft from f_u_c_ sus , a_b_c p ,member m where 1=1 and p.company_id = m.company_id and m.login_id=? and p.sale_type in( ? ) and p.id=sus.object_id ) ) results ) where rn = 1 order by gmt_modified desc )row_ where rownum <= ? ) where rownum_ >= ? ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union08.sql ================================================ select * from dual where exists ( select * from dual union all select * from dual ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union09.sql ================================================ select * from ( select row_.* from ( select * from ( select results.*, 1 rn from ( ( select dummy from dual where 1=1 ) union ( select dummy from dual where 1=1 ) ) results ) where rn = 1 order by dummy desc )row_ where rownum <= 1 ) where rownum >= 1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/union10.sql ================================================ select ( ( select 'y' from dual where exists ( select 1 from dual where 1 = 0 ) ) union ( select 'n' from dual where not exists ( select 1 from dual where 1 = 0 ) ) ) as yes_no from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/validate_conversion.sql ================================================ select raw_value, validate_conversion(raw_value as number), validate_conversion(raw_value as date, 'YYYY-MM-DD'), validate_conversion(raw_value as date, 'YYYY-MM-DD', 'NLS_DATE_LANGUAGE = RUSSIAN') from raw_values; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/values_clause.sql ================================================ CREATE OR REPLACE PACKAGE TEST_PKG_LXD AS -- Package header PROCEDURE values_test; END TEST_PKG_LXD; CREATE OR REPLACE PACKAGE BODY TEST_PKG_LXD AS -- Package body -- This test case compiles and runs fine on 'Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production' PROCEDURE values_test IS TYPE value_type IS RECORD (ID PLS_INTEGER, VALUE VARCHAR2(100)); TYPE list IS TABLE OF value_type INDEX BY PLS_INTEGER; tmp_list list; BEGIN tmp_list(0).ID := 1; tmp_list(0).VALUE := 'test_value'; --The DDL of TEST_TB is 'CREATE TABLE TEST_TB(id NUMBER(3), value VARCHAR2(100))' INSERT INTO TEST_TB VALUES tmp_list(0); END values_test; END TEST_PKG_LXD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/varray_type_def.sql ================================================ CREATE OR REPLACE PACKAGE TEST_PKG_LXD AS -- Package header PROCEDURE varray_def_test; END TEST_PKG_LXD; CREATE OR REPLACE PACKAGE BODY TEST_PKG_LXD AS -- Package body -- This test case passed on 'Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production' PROCEDURE varray_def_test IS -- All of these varray definition are valid TYPE type_array1 IS VARRAY(5) OF PLS_INTEGER; TYPE type_array2 IS VARYING ARRAY(5) OF PLS_INTEGER; TYPE type_array3 IS VARRAY(5) OF PLS_INTEGER; array1 type_array1; array2 type_array2; array3 type_array3; BEGIN array1 := type_array1(1); array2 := type_array2(2); array3 := type_array3(3); dbms_output.put_line('v1=' || array1(1) || ', v2=' || array2(1) || ', v3=' || array3(1)); END varray_def_test; END TEST_PKG_LXD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/views.sql ================================================ CREATE VIEW emp_view AS SELECT last_name, salary*12 annual_salary FROM employees WHERE department_id = 20; CREATE EDITIONING VIEW ed_orders_view (o_id, o_date, o_status) AS SELECT order_id, order_date, order_status FROM orders WITH READ ONLY; CREATE VIEW emp_sal (emp_id, last_name, email UNIQUE RELY DISABLE NOVALIDATE, CONSTRAINT id_pk PRIMARY KEY (emp_id) RELY DISABLE NOVALIDATE) AS SELECT employee_id, last_name, email FROM employees; CREATE VIEW clerk AS SELECT employee_id, last_name, department_id, job_id FROM employees WHERE job_id = 'PU_CLERK' or job_id = 'SH_CLERK' or job_id = 'STA_CLERK'; CREATE VIEW clerk AS SELECT employee_id, last_name, department_id, job_id FROM employees WHERE job_id = 'PU_CLERK' or job_id = 'SH_CLERK' or job_id = 'ST_CLERK' WITH CHECK OPTION; CREATE VIEW locations_view AS SELECT d.department_id, d.department_name, l.location_id, l.city FROM departments d, locations l WHERE d.location_id = l.location_id; CREATE VIEW customer_ro (name, language, credit) AS SELECT cust_last_name, nls_language, credit_limit FROM customers WITH READ ONLY; CREATE OR REPLACE VIEW oc_inventories OF inventory_typ WITH OBJECT ID (product_id) AS SELECT i.product_id, warehouse_typ(w.warehouse_id, w.warehouse_name, w.location_id), i.quantity_on_hand FROM inventories i, warehouses w WHERE i.warehouse_id=w.warehouse_id; CREATE EDITIONABLE VIEW TEST (A, B, C) AS SELECT 'A', 'B', 'C' FROM DUAL; CREATE VIEW TEST (A, B, C) AS WITH TESTCTE AS ( SELECT 1 ONE FROM DUAL ) SELECT 'A', 'B', 'C' FROM DUAL JOIN TESTCTE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/whenever_sqlerror.sql ================================================ WHENEVER SQLERROR CONTINUE; WHENEVER SQLERROR CONTINUE COMMIT; WHENEVER SQLERROR CONTINUE ROLLBACK; WHENEVER SQLERROR CONTINUE NONE; WHENEVER SQLERROR EXIT SQL.SQLCODE; WHENEVER SQLERROR EXIT SQL.SQLCODE COMMIT; WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK; WHENEVER SQLERROR EXIT 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/whenever_sqlerror.sql.tree ================================================ (sql_script (sql_plus_command (whenever_command WHENEVER SQLERROR CONTINUE)) ; (sql_plus_command (whenever_command WHENEVER SQLERROR CONTINUE COMMIT)) ; (sql_plus_command (whenever_command WHENEVER SQLERROR CONTINUE ROLLBACK)) ; (sql_plus_command (whenever_command WHENEVER SQLERROR CONTINUE NONE)) ; (sql_plus_command (whenever_command WHENEVER SQLERROR EXIT (variable_name (id_expression (regular_id (non_reserved_keywords_pre12c SQL))) . (id_expression (regular_id SQLCODE))))) ; (sql_plus_command (whenever_command WHENEVER SQLERROR EXIT (variable_name (id_expression (regular_id (non_reserved_keywords_pre12c SQL))) . (id_expression (regular_id SQLCODE))) COMMIT)) ; (sql_plus_command (whenever_command WHENEVER SQLERROR EXIT (variable_name (id_expression (regular_id (non_reserved_keywords_pre12c SQL))) . (id_expression (regular_id SQLCODE))) ROLLBACK)) ; (sql_plus_command (whenever_command WHENEVER SQLERROR EXIT (numeric 1))) ; ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/xml_function.sql ================================================ SELECT XMLAGG(XMLELEMENT(X,first_name, ',') ORDER BY FIRST_NAME).extract('//text()').getClobVal() AS "NAMES" FROM STUDENTS; SELECT XMLCOLATTVAL(first_name,first_name, first_name).extract('//text()').getClobVal() FROM STUDENTS; SELECT XMLFOREST(first_name,first_name, first_name).extract('//text()').getClobVal() FROM STUDENTS; SELECT XMLELEMENT(TEST,first_name , ',').extract('//text()').getClobVal() FROM STUDENTS; SELECT XMLPARSE(CONTENT '124 Acme Enterprises 32987457 ' WELLFORMED).extract('//text()').getClobVal() AS PO FROM DUAL; SELECT XMLPI(NAME "Order analysisComp", 'imported, reconfigured, disassembled').extract('//text()').getClobVal() AS "XMLPI" FROM DUAL; SELECT warehouse_name, EXTRACTVALUE(warehouse_spec, '/Warehouse/Area'), XMLQuery( 'for $i in /Warehouse where $i/Area > 50000 return
{ if ($i/RailAccess = "Y") then "true" else "false" }
' PASSING warehouse_spec RETURNING CONTENT).extract('//text()').getClobVal() "Big_warehouses" FROM warehouses; SELECT XMLROOT ( XMLType('143598'), VERSION '1.0', STANDALONE YES).extract('//text()').getClobVal() AS "XMLROOT" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/xmltable01.sql ================================================ -- See https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions228.htm SELECT warehouse_name warehouse, warehouse2."Water", warehouse2."Rail", warehouse2."Box" FROM warehouses, XMLTABLE(xmlnamespaces ('http://www.example.com/xml/path' AS "a"), '/Warehouse' PASSING warehouses.warehouse_spec COLUMNS "Water" varchar2(6) PATH '/Warehouse/WaterAccess', "Rail" varchar2(6) PATH '/Warehouse/RailAccess', "Box" varchar2(6) PATH '/Warehouse/BoxAccess') warehouse2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/xmltable02.sql ================================================ select xmlelement("other_attrs", xmlelement("parsing_user_id", parsing_user_id)).getClobVal() other from f ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples/xmltable03.sql ================================================ -- XMLTable and outer join methods: http://anononxml.blogspot.com/2011/06/xmltable-and-outer-join-methods.html select master_id ,details_id ,sub_details_id from demo4 s ,XMLTable('master' passing (s.xml) columns master_id varchar2 (20) path 'id' ,details XMLType path 'details/detail') mstr ,XMLTable('detail' passing (mstr.details) columns details_id varchar2 (20) path 'id' ,sub_details XMLType path 'sub_details/sub_detail')(+) dtl ,XMLTable('sub_detail' passing (dtl.sub_details) columns sub_details_id varchar2 (20) path 'id')(+) sub_dtl; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/anonymous_block.sql ================================================ DECLARE NUX NUMBER := 1; BEGIN DBMS_OUTPUT.PUT_LINE('Hello'); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('Something went wrong!'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/cursor-attributes-with-spaces.sql ================================================ DROP PACKAGE TCERS.PK_GRAMMAR_TEST; CREATE OR REPLACE PACKAGE TCERS.PK_GRAMMAR_TEST AS function test return number; END PK_GRAMMAR_TEST; / DROP PACKAGE BODY TCERS.PK_GRAMMAR_TEST; CREATE OR REPLACE PACKAGE BODY TCERS.PK_GRAMMAR_TEST AS function test return number AS src_row all_source% rowtype; n pls_integer; cursor src is select * from all_source; BEGIN open src; loop fetch src into src_row; if src% notfound then exit; end if; if src% found then null; end if; end loop; if src% isopen then close src; end if; RETURN sql% rowcount; END test; END PK_GRAMMAR_TEST; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/declare_procedure_no_args.sql ================================================ declare procedure proc; var number; begin null; end; / create or replace package pkg is procedure proc; var number; end pkg; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/delete_as_regular_id.pkb ================================================ CREATE OR REPLACE PACKAGE BODY FOO AS PROCEDURE BAR(COLL COLL_TYPE) IS BEGIN COLL.DELETE; COLL.DELETE(); COLL.DELETE(42); COLL.DELETE(42, 64); END BAR; END FOO; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/deterministic_function.pks ================================================ create or replace package deterministic_function is function fixed_value return varchar2 deterministic; end deterministic_function; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/e_in_out_parameters.pks ================================================ create or replace package e_in_out_parameters is procedure some_in_nocopy_procedure( p_string in nocopy varchar2 ); end e_in_out_parameters; / show errors; create or replace package e_in_out_parameters is procedure some_out_in_procedure( p_string out in varchar2 ); end e_in_out_parameters; / show errors; create or replace package e_in_out_parameters is procedure some_inout_procedure( p_string inout varchar2 ); end e_in_out_parameters; / show errors ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/grants.sql ================================================ -- 4 Roles for scott GRANT DEFAULT_ROLE TO scott WITH ADMIN OPTION; GRANT CONNECT TO scott; GRANT USR_DEFAULT_CONNECT TO scott WITH ADMIN OPTION; ALTER USER scott DEFAULT ROLE CONNECT; -- 3 System Privileges for scott GRANT ALTER USER TO scott; GRANT CREATE TABLE TO scott; GRANT CREATE USER TO scott; -- 6 Object Privileges for scott GRANT INSERT, SELECT ON example.green_table TO scott; GRANT ALL ON example.blue_table TO scott; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/green_run.sql ================================================ @@green_table.sql; @@green_tools.pks; @@green_tools.pkb; @@green_tools_review.sql; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/green_table.sql ================================================ drop table green_table; create table green_table ( green_col_one number(10) not null disable , green_col_two varchar2(64) ) tablespace "greenspace" ; Drop Table Green_Table; Create Table green_table ( green_col_one number(10) not null disable , green_col_two varchar2(64) ) Tablespace USERS ; insert into green_table (green_col_one, green_col_two) values (100021, 'green-varchar-21'); insert into green_table (green_col_one, green_col_two) values (100022, 'green-varchar-22'); insert into green_table (green_col_one, green_col_two) values (100023, 'green-varchar-23'); select * from green_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/green_tools.pkb ================================================ create or replace package body green_tools is procedure no_params_procedure is begin dbms_output.put_line('no_params_procedure : begin'); end no_params_procedure; function add_brackets( p_string in varchar2 ) return varchar2 as begin return '[' || p_string || ']'; end add_brackets; procedure print_green_info( p_with_brackets in boolean ) is begin for r in ( select green_col_two from green_table ) loop if p_with_brackets then dbms_output.put_line('print_green_info : with brackets : ' || add_brackets(r.green_col_two)); else dbms_output.put_line('print_green_info : no brackets : ' || r.green_col_two); end if; end loop; end print_green_info; end green_tools; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/green_tools.pks ================================================ create or replace package green_tools is procedure no_params_procedure; function add_brackets( p_string in varchar2 ) return varchar2; procedure print_green_info( p_with_brackets in boolean ); end green_tools; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/green_tools_review.sql ================================================ set serveroutput on select green_tools.add_brackets('to-be-bracketed') as with_brackets from dual; begin green_tools.print_green_info( p_with_brackets => false ); end; / begin green_tools.print_green_info( p_with_brackets => true ); end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/in_out_parameters.pks ================================================ create or replace package in_out_parameters is procedure some_procedure( p_string varchar2 ); procedure some_in_procedure( p_string in varchar2 ); procedure some_out_procedure( p_string out varchar2 ); procedure some_in_out_procedure( p_string in out varchar2 ); procedure some_in_out_nocopy_procedure( p_string in out nocopy varchar2 ); end in_out_parameters; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/key_word_as_param.pkb ================================================ create or replace package body login as function fun return varchar2 as raw_key2 raw(128); raw_userpass raw(128); raw_encrypted raw(2048); begin dbms_obfuscation_toolkit.desencrypt(input => raw_userpass, key => raw_key2, encrypted_data => raw_encrypted); end fun; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/logical_expressions.sql ================================================ DECLARE FOO NUMBER := 1; BAR NUMBER := 2; BEGIN IF FOO = 1 AND BAR IS NOT NULL THEN RAISE_APPLICATION_ERROR(-20001, 'FOO is 1 and BAR is not null'); END IF; IF FOO = 1 OR NOT BAR IS NULL THEN RAISE_APPLICATION_ERROR(-20002, 'FOO is 1 or BAR is not null'); END IF; IF FOO = 1 AND BAR IS NOT NULL AND BAR IS NOT NAN THEN RAISE_APPLICATION_ERROR(-20003, 'FOO is 1 and BAR is not null and BAR is not nan'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/package_body_null.pkb ================================================ create or replace package body pkgtest is begin null; end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/package_with_cursor.sql ================================================ create or replace package pkgtest is cursor cuData is select * from dual; procedure main; end; / create or replace package body pkgtest is procedure main is sbData varchar2(100); begin open pkgtest.cuData; fetch cuData into sbData; close cuData; if cuData%isopen then dbms_output.put_line('should work'); end if; if sql%rowcount > 0 then dbms_output.put_line('should work too'); end if; end; function GETPOS_TEMPLATE_DEF_ID return VARCHAR2 is LVS_ID VARCHAR2(4000 CHAR); BEGIN LVS_ID := TRIM(BOTH SF_FORM_EXT_CONSTANTS.GETSOMETHING FROM LVS_ID); return LVS_ID; end GETPOS_TEMPLATE_DEF_ID; end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/package_with_schema.pkb ================================================ CREATE OR REPLACE PACKAGE BODY HR.PACK AS PROCEDURE PROC1 AS BEGIN NULL; END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/package_with_schema.pks ================================================ CREATE OR REPLACE PACKAGE HR.PACK AS PROCEDURE PROC1; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/package_with_simple_init_block.pkb ================================================ -- The package init block should not be parsed as a variable declaration create package body MyPackage as begin OtherPackage.DoSomething; end MyPackage; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/pipe_row.pkb ================================================ create or replace package body pipe_row_test as function fun return t_tab pipelined as vRow t_tab_row; begin for rec in ( select Id from tbl ) loop vrow.Id := rec.Id; pipe row (vrow); end loop; end; function prodfunc(n number) return mytabletype pipelined is begin <> for i in 1 .. 5 loop pipe row (myobjectformat(n,sysdate+i,'row '||i)); end loop pipes; return; end; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/pltables.sql ================================================ declare TYPE tyrcmessage IS RECORD (id number, message varchar2(100)); TYPE tytbMessages IS TABLE OF tyrcmessage INDEX BY BINARY_INTEGER; tbmessages tytbMessages; nuidx number; begin nuidx := tbmessages.first; while nuidx is not null loop nuidx := tbmessages.next(nuidx); end loop; end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/pragma_autonomous_transaction.sql ================================================ declare pragma autonomous_transaction; begin commit; end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/pragma_exception_init.pkb ================================================ create or replace package body pragma_exception_init is some_exception exception; pragma exception_init (some_exception, -20001); end pragma_exception_init; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/pragma_exception_init.pks ================================================ create or replace package pragma_exception_init is some_exception exception; pragma exception_init (some_exception, -20001); end pragma_exception_init; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/proc_over_dblink_as_nvl_param.pkb ================================================ create or replace package body pack as procedure test(inId number) as vSum number; vPaymentsDate number; begin vSum := nvl(pack_1.getSum@dblink(inId=>inId, vPaymentsDate => pack_2.getLastDay(4, 3)), 0); end; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/procedure_with_cursor_and_limit.sql ================================================ CREATE OR REPLACE PROCEDURE SF_JOB_CLEANUP_SHOWCASES_START (FPN_ANZ_ZUM_VERARBEITEN NUMBER DEFAULT 10000, FPN_BULK_LIMIT NUMBER DEFAULT 5000) AS TYPE T_BULK_TAB IS RECORD ( SC_ID SALESFRONT.SF_SHOWCASE.ID%TYPE, JOBLIST_ID SF_JOB_CLEANUP_SHOWCASES_SCLIST.ID%TYPE ); TYPE T_BULK_COLLECT_TAB IS TABLE OF T_BULK_TAB; LNC_ID_LIST T_BULK_COLLECT_TAB; COUNTER PLS_INTEGER := 0; LVNEXISTS PLS_INTEGER := 0; LVSERRORMSG VARCHAR2(4000); CURSOR C_DEL_SC(C_MAX_ROW NUMBER) IS SELECT SC.ID SC_ID , SL.ID JOBLIST_ID FROM SF_JOB_CLEANUP_SHOWCASES_SCLIST SL INNER JOIN SALESFRONT.SF_SHOWCASE SC ON SC.ID = SL.SF_SHOWCASE_ID WHERE SL.VERARBEITEN = 1 AND VERARBEITET_AM IS NULL AND ROWNUM < C_MAX_ROW; BEGIN EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM USER_SCHEDULER_JOBS JO WHERE JOB_NAME=''SF_START_TOURENEXPORT'' AND JO.STATE = ''RUNNING''' INTO LVNEXISTS; IF LVNEXISTS = 0 THEN OPEN C_DEL_SC(FPN_ANZ_ZUM_VERARBEITEN); LOOP --IN BLÖCKEN AUS PERFORMANCE GRÜNDEN FETCH C_DEL_SC BULK COLLECT INTO LNC_ID_LIST LIMIT FPN_BULK_LIMIT; COUNTER := COUNTER + LNC_ID_LIST.COUNT; EXIT WHEN C_DEL_SC%NOTFOUND; COMMIT; END LOOP; CLOSE C_DEL_SC; END IF; EXCEPTION WHEN OTHERS THEN LVSERRORMSG := SQLERRM || ' BACKTRACE: ' || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE; ROLLBACK; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/result_cache_function.pks ================================================ create or replace package result_cache_function is function some_function( p_string in varchar2 ) return varchar2 result_cache; end result_cache_function; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/select_into.sql ================================================ DECLARE TYPE T2 IS RECORD (C NUMBER); TYPE T1 IS RECORD (B T2); A T1; TYPE T3 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER; D T3; BEGIN SELECT 1 INTO A.B.C FROM DUAL; SELECT 1 INTO D(1) FROM DUAL; SELECT 1 INTO :BLOCK.ITEM FROM DUAL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/show_errors.pks ================================================ create or replace package show_errors is procedure some_procedure; end show_errors; / show errors; create or replace package show_errors is procedure some_procedure; end show_errors; / show err ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/substr_as_regular_id.pkb ================================================ create or replace package body testPack as function blob_to_clob (blob_in in blob) return clob as begin utl_raw.cast_to_varchar2(dbms_lob.substr(a, b, c)); return null; end blob_to_clob; end testPack; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/synonym_with_database_link.sql ================================================ create or replace synonym rs_customer2Prs for SCHEMANAME.CUSTOMER2PRS@SCHEMANAME.LINKNAME; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/trigger_examples.sql ================================================ create or replace trigger trg_status_tick after insert or update or delete on status for each row declare begin if inserting then tp_ticket_util.fire('status', tp_ticket_const.cinsert, :new.id); elsif updating then tp_ticket_util.fire('status', tp_ticket_const.cupdate, :new.id); elsif deleting then tp_ticket_util.fire('status', tp_ticket_const.cdelete, :old.id); end if; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/type_body_elements.sql ================================================ create or replace type type_body_elements as object ( some_string varchar2(64), member function function_one return varchar2, member function function_two return varchar2 ); / create or replace type body type_body_elements is member function function_one return varchar2 is begin return 'the function_one result'; end function_one; member function function_two return varchar2 is begin return 'the function_two result'; end function_two; end; / create or replace TYPE CLNOBJREPORTCOLUMN force is table of varchar2(4000); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/user.sql ================================================ CREATE USER scott IDENTIFIED BY tiger DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP PROFILE SCOTT_PROFILE ACCOUNT UNLOCK; -- 1 Tablespace Quota for scott ALTER USER scott QUOTA 5000M ON USERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/examples-sql-script/with_clause_in_exists_block_in_procedure.sql ================================================ CREATE OR REPLACE PROCEDURE PROCESS_QUEUE(FPN_DATENQUELLE_ID NUMBER DEFAULT NULL) IS BEGIN DELETE FROM TP_TICKET_RAW DEL_T WHERE EXISTS ( WITH BASIS AS (SELECT * FROM TP_TICKET_RAW TT) SELECT NULL FROM BASIS BA WHERE EXISTS (SELECT NULL FROM BASIS BE WHERE BE.TABLE_NAME = BA.TABLE_NAME AND BE.TP_TICKET_ART_ID = BA.TP_TICKET_ART_ID AND BE.REF_ID = BA.REF_ID AND BA.CREATION_DATE > BE.CREATION_DATE) AND DEL_T.ID = BA.ID ); COMMIT; END PROCESS_QUEUE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/alter_operator.sql ================================================ ALTER OPERATOR eq_op COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/alter_outline.sql ================================================ ALTER OUTLINE salaries REBUILD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/drop_operator.sql ================================================ DROP OPERATOR eq_op; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/keywordasidentifier02.sql ================================================ select m.model from model ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/lexer01.sql ================================================ select * from dual where 1 < > 2 and 1 ! = 2 and 1 ^ /*aaa */ = 2 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/lexer02.sql ================================================ select 'A' | | 'B' from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/lexer03.sql ================================================ select :1, :X, :1 + 1, 1 + :2 from A where A=:3 and b= : 4 and c= :5and :A = :b ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/lexer04.sql ================================================ select tbl$or$idx$part$num("sys"."wrh$_seg_stat",0,4,0,"rowid") as c1 from t1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/lexer05.sql ================================================ select tbl$or$idx$part$num("sys"."wrh:_seg_stat",0,4,0,"rowid") as c1 from t1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/simple11.sql ================================================ select a.* from dual ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/hw-examples/truncate_table.sql ================================================ truncate table test; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/long-running/aggregate01.sql ================================================ with codes2codelocales as ( select t6.cdl_name as cod_name, t7.cdl_name as cod_cod_name, t14.cod_oid from servicedesk.itsm_codes t14 left outer join servicedesk.itsm_codes_locale t6 on (t6.cdl_cod_oid=t14.cod_oid) left outer join servicedesk.itsm_codes_locale t7 on (t7.cdl_cod_oid=t14.cod_cod_oid) ) , incident as ( select t1.*, c2cl1.cod_name as "closure code", c2cl1.cod_cod_name as "closure code parent", c2cl2.cod_name as "reason caused code", c2cl2.cod_cod_name as "reason caused code parent", t11.cdl_name "severity", t13.cdl_name "business impact", t16.cdl_name "priority", t2.rct_name "status", t12.rct_name "category", t99.rct_name "folder" from servicedesk.itsm_incidents t1 join servicedesk.itsm_codes_locale t11 on (t1.inc_sev_oid=t11.cdl_cod_oid) join servicedesk.itsm_codes_locale t13 on (t1.inc_imp_oid=t13.cdl_cod_oid) join servicedesk.itsm_codes_locale t16 on (t1.inc_pri_oid=t16.cdl_cod_oid) join servicedeskrepo.rep_codes_text t2 on (t1.inc_sta_oid=t2.rct_rcd_oid) join servicedeskrepo.rep_codes_text t12 on (t1.inc_cat_oid=t12.rct_rcd_oid) join servicedeskrepo.rep_codes_text t99 on (t1.inc_poo_oid=t99.rct_rcd_oid) left outer join codes2codelocales c2cl1 on (t1.inc_clo_oid=c2cl1.cod_oid) left outer join codes2codelocales c2cl2 on (t1.inc_cla_oid=c2cl2.cod_oid) where t1."reg_created" between sysdate-1 and sysdate ) , workgrouphistory as ( select i.inc_id , max(t101.hin_subject) keep (dense_rank first order by (t101.reg_created)) as "first" , max(t101.hin_subject) keep (dense_rank last order by (t101.reg_created)) as "last" from servicedesk.itsm_historylines_incident t101 join incident i on (t101.hin_inc_oid = i.inc_oid) -- from servicedesk.itsm_incidents i (t101.hin_inc_oid = i.inc_oid) where t101.hin_subject like 'to workgroup from%' -- and i."reg_created" between sysdate-1 and sysdate group by i.inc_id ) select incident.inc_id "id" ,incident."status" ,incident.inc_description "description" ,t4.wog_searchcode "workgroup" ,t5.per_searchcode "person" ,incident.inc_solution "solution" ,incident."closure code" ,incident."closure code parent" ,incident."reason caused code" ,incident."reason caused code parent" ,t10.cit_searchcode "ci" ,incident."severity" ,incident."category" ,incident."business impact" ,incident."priority" ,to_char(incident."reg_created", 'dd-mm-yy hh24:mi:ss') "registered" ,to_char(incident."inc_deadline", 'dd-mm-yy hh24:mi:ss') "deadline" ,to_char(incident."inc_actualfinish", 'dd-mm-yy hh24:mi:ss') "finish" ,t3.icf_incshorttext3 "message group" ,t3.icf_incshorttext4 "application" ,t3.icf_incshorttext2 "msg id" ,incident."folder" ,workgrouphistory."first" "first wg" ,workgrouphistory."last" "last wg" ,t102.hin_subject "frirst pri" from incident join servicedesk.itsm_inc_custom_fields t3 on (incident.inc_oid=t3.icf_inc_oid) join servicedesk.itsm_workgroups t4 on (incident.inc_assign_workgroup=t4.wog_oid) join workgrouphistory on (incident.inc_id = workgrouphistory.inc_id) left outer join servicedesk.itsm_persons t5 on (incident.inc_assign_person_to=t5.per_oid) left outer join servicedesk.itsm_configuration_items t10 on (incident.inc_cit_oid=t10.cit_oid) left outer join servicedesk.itsm_historylines_incident t102 on (incident.inc_oid = t102.hin_inc_oid and t102.hin_subject like 'priority set to%') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/long-running/cast_multiset07.sql ================================================ select "a3"."r_id" "r_id" from "pe" "a3", "me" "a2" where "a3"."m_id"="a2"."m_id" and "a2"."mi_t" = any ((( select "a4"."sys$"."id" from the ( select "qa"."u_pkg"."getchartable" ( "qa"."u_pkg"."glist" ( cursor ( select "qa"."u_pkg"."glist" ( cursor ( select "a6"."mi_t" "mi_t" from "me" "a6" connect by "a6"."mi_uid"=prior "a6"."mi_id" start with "a6"."mi_t"=:b1 ) ) "lst" from "sys"."dual" "a5" ) ) ) from dual ) "a4" ))) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/long-running/datetime02.sql ================================================ select dbin.db_name, dbin.instance_name, dbin.version, case when s1.startup_time = s2.startup_time then 0 else 1 end as bounce, cast(s1.end_interval_time as date) as begin_time, cast(s2.end_interval_time as date) as end_time, round((cast( (case when s2.end_interval_time > s1.end_interval_time then s2.end_interval_time else s1.end_interval_time end) as date) - cast(s1.end_interval_time as date)) * 86400) as int_secs, case when (s1.status <> 0 or s2.status <> 0) then 1 else 0 end as err_detect, round( greatest( (extract(day from s2.flush_elapsed) * 86400) + (extract(hour from s2.flush_elapsed) * 3600) + (extract(minute from s2.flush_elapsed) * 60) + extract(second from s2.flush_elapsed), (extract(day from s1.flush_elapsed) * 86400) + (extract(hour from s1.flush_elapsed) * 3600) + (extract(minute from s1.flush_elapsed) * 60) + extract(second from s1.flush_elapsed),0 ) ) as max_flush_secs from wrm$_snapshot s1 , wrm$_database_instance dbin , wrm$_snapshot s2 where s1.dbid = :dbid and s2.dbid = :dbid and s1.instance_number = :inst_num and s2.instance_number = :inst_num and s1.snap_id = :bid and s2.snap_id = :eid and dbin.dbid = s1.dbid and dbin.instance_number = s1.instance_number and dbin.startup_time = s1.startup_time ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/long-running/order_by07.sql ================================================ create or replace view testview ( id, --Test comment report_id, report_element_id, parent_id, chapterNo, sequenceNo, title_de, title_en, is_direct_restricted, is_inherited_restricted, has_note, current_status_code, report_element_discriminator, has_childs, validation_needed, -- this is required that ef6 can use this view with a primary key! constraint v_report_tree primary key (id) rely disable ) as with restr as ( select entityid reid , max(isdirectrestricted) isDirectRestricted , case when min(isdirectrestricted) = 0 then 1 else 0 end isIndirectRestricted from v_report_element_restrictions where restrictionstart < sysdate and restrictionend > sysdate group by entityid ), notes as ( SELECT report_element_id, 1 hasNote FROM report_element_note where deleted = 0 group by report_element_id ), vaidationNeeded as ( SELECT report_element_id , 1 ValidationNeeded FROM v_formatted_data_item_value_usage WHERE validationstatus = 'notvalidated' group by report_element_id ), contentText as ( select * from ( select re.id report_element_id , lang.code , CASE WHEN re.discriminator = 'DISCRIMA' THEN to_char('[' || SUBSTR(Regexp_replace(ce.text, '<.+?>'),0,30) || '...]') ELSE to_char(Regexp_replace(ce.text, '<.+?>')) end text from content_element ce inner join content c on c.id = ce.content_id inner join language lang on lang.id = ce.language_id inner join report_element re on c.id = nvl(re.text_content_id,re.title_content_id) where c.deleted = 0 and ce.deleted = 0 order by re.id, ce.content_id ) PIVOT (min(Text) AS lang_text FOR (code) IN ('EY' AS DE, 'OH' AS EN)) ) select SYS_GUID() id , re.report_id report_id , re.id report_element_id , re.parent_id parent_id , report_helper.ReportElementNo(re.id) chapterNo , re.sequence_no sequenceNo , ct.de_lang_text title_de , ct.en_lang_text title_en , cast(nvl(restr.isDirectRestricted,0) as number(1)) is_direct_restricted , cast(nvl(restr.isIndirectRestricted,0) as number(1)) is_inherited_restricted , cast(nvl(notes.hasNote,0) as number(1)) has_note , re.status_code current_status_code , re.discriminator report_element_discriminator , cast((case when exists(select 1 from report_element re2 where re2.parent_id = re.id and deleted = 0) then 1 else 0 end) as number(1)) has_childs , cast(nvl(valNeed.ValidationNeeded,0) as number(1)) validation_needed from report_element re left outer join contentText ct on ct.report_element_id = re.id left outer join restr restr on restr.reid = re.id left outer join notes notes on notes.report_element_id = re.id left outer join vaidationNeeded valNeed on valNeed.report_element_id = re.id where re.deleted = 0 start with re.parent_id is null connect by prior re.id = re.parent_id order siblings by sequenceno; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/antlr-grammars-v4/long-running/query_factoring07.sql ================================================ with timegrouped_rawdata as ( select /*+ leading(sn di md sh ot) cardinality(ot 1000) */ sh.metric_id as metric_id , ot.bsln_guid as bsln_guid , ot.timegroup as timegroup , sh.value as obs_value from dba_hist_snapshot sn , dba_hist_database_instance di , sys.wrh$_sysmetric_history sh , bsln_metric_defaults md , table(:b1 ) ot where sn.dbid = :b6 and sn.snap_id between :b5 and :b4 and di.dbid = sn.dbid and di.instance_number = sn.instance_number and di.startup_time = sn.startup_time and di.instance_name = :b3 and sh.snap_id = sn.snap_id and sh.dbid = sn.dbid and sh.instance_number = sn.instance_number and sh.group_id = 2 and sh.metric_id = md.metric_id and md.status = :b2 and ot.obs_time = trunc(sh.end_time, 'hh24') ) ( select bsln_statistics_t ( bsln_guid ,metric_id ,:b11 ,:b10 ,timegroup ,sample_count ,average ,minimum ,maximum ,sdev , pctile_25 ,pctile_50 ,pctile_75 ,pctile_90 ,pctile_95 ,pctile_99 ,est_sample_count ,est_slope ,est_intercept , case when est_slope = 0 then 0 else greatest(0,nvl(100-(25*power((1-est_mu1/est_slope), 2)*(est_sample_count-1) ),0)) end , ln( 1000) * est_slope + est_intercept , ln(10000) * est_slope + est_intercept ) from ( select metric_id ,bsln_guid ,timegroup ,est_mu as est_slope ,est_mu * ln(alpha) + x_m as est_intercept ,to_number(null) as est_fit_quality , case when count_below_x_j > 0 then (sum_below_x_j + (n-m+1)*(x_j-x_m))/count_below_x_j - x_j else to_number(null) end as est_mu1 , est_sample_count ,n as sample_count ,average ,minimum ,maximum ,sdev ,pctile_25 ,pctile_50 ,pctile_75 ,pctile_90 ,pctile_95 ,pctile_99 from ( select metric_id ,bsln_guid ,timegroup ,max(n) as n ,count(rrank) as est_sample_count , case when count(rrank) > 3 then ( sum(obs_value) + ( max(n) - max(rrank) ) * max(obs_value) - (max(n) - min(rrank) + 1) * min(obs_value) ) / (count(rrank)-1) else to_number(null) end as est_mu , (max(n) - min(rrank) + 1) / (max(n) + 1) as alpha , min(obs_value) as x_m ,max(obs_value) as x_l ,max(rrank) as l ,min(rrank) as m ,max(mid_tail_value) as x_j , sum(case when obs_value < mid_tail_value then obs_value else 0 end ) as sum_below_x_j , sum(case when cume_dist < :b7 then 1 else 0 end ) as count_below_x_j , max(max_val) as maximum ,max(min_val) as minimum ,max(avg_val) as average ,max(sdev_val) as sdev ,max(pctile_25) as pctile_25 ,max(pctile_50) as pctile_50 , max(pctile_75) as pctile_75 ,max(pctile_90) as pctile_90 ,max(pctile_95) as pctile_95 ,max(pctile_99) as pctile_99 from ( select metric_id ,bsln_guid ,timegroup ,obs_value as obs_value, cume_dist () over (partition by metric_id, bsln_guid, timegroup order by obs_value ) as cume_dist , count(1) over (partition by metric_id, bsln_guid, timegroup ) as n , row_number () over (partition by metric_id, bsln_guid, timegroup order by obs_value) as rrank , percentile_disc(:b7 ) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as mid_tail_value , max(obs_value) over (partition by metric_id, bsln_guid, timegroup ) as max_val , min(obs_value) over (partition by metric_id, bsln_guid, timegroup ) as min_val , avg(obs_value) over (partition by metric_id, bsln_guid, timegroup ) as avg_val , stddev(obs_value) over (partition by metric_id, bsln_guid, timegroup ) as sdev_val , percentile_cont(0.25) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_25 , percentile_cont(0.5) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_50 , percentile_cont(0.75) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_75 , percentile_cont(0.90) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_90 , percentile_cont(0.95) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_95 , percentile_cont(0.99) within group (order by obs_value asc) over (partition by metric_id, bsln_guid, timegroup) as pctile_99 from timegrouped_rawdata d ) x where x.cume_dist >= :b9 and x.cume_dist <= :b8 group by metric_id ,bsln_guid ,timegroup ) ) ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information.html DECLARE dg CLOB; BEGIN SELECT json_dataguide(data, DBMS_JSON.FORMAT_HIERARCHICAL) INTO dg FROM j_purchaseorder; DBMS_JSON.add_virtual_columns('J_PURCHASEORDER', 'DATA', dg, resolveNameConflicts=>TRUE, colNamePrefix=>'DATA$', mixedCaseColumns=>TRUE); END; / DESCRIBE j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information.html DECLARE dg CLOB; BEGIN dg := '{"type" : "object", "properties" : {"PO_Number" : {"type" : "number", "o:length" : 4, "o:preferred_column_name" : "PO_Number", "o:hidden" : false}, "PO_Reference" : {"type" : "string", "o:length" : 16, "o:preferred_column_name" : "PO_Reference", "o:hidden" : true}}}'; DBMS_JSON.add_virtual_columns('J_PURCHASEORDER', 'DATA', dg); END; / DESCRIBE j_purchaseorder; SELECT column_name FROM user_tab_columns WHERE table_name = 'J_PURCHASEORDER' ORDER BY 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information.html EXEC DBMS_JSON.add_virtual_columns('J_PURCHASEORDER', 'DATA'); DESCRIBE j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information.html EXEC DBMS_JSON.add_virtual_columns('J_PURCHASEORDER', 'DATA', 100); DESCRIBE j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information.html EXEC DBMS_JSON.add_virtual_columns('J_PURCHASEORDER', 'DATA', 100, TRUE); DESCRIBE j_purchaseorder; SELECT column_name FROM user_tab_columns WHERE table_name = 'J_PURCHASEORDER' ORDER BY 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/adding-and-dropping-virtual-columns-json-fields-based-data-guide-information.html EXEC DBMS_JSON.drop_virtual_columns('J_PURCHASEORDER', 'DATA'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/change-triggers-data-guide-enabled-search-index-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/change-triggers-data-guide-enabled-search-index.html EXEC DBMS_JSON.drop_virtual_columns('J_PURCHASEORDER', 'DATA'); ALTER INDEX po_search_idx REBUILD PARAMETERS ('DATAGUIDE ON CHANGE add_vc'); INSERT INTO j_purchaseorder VALUES ( SYS_GUID(), to_date('30-JUN-2015'), '{"PO_Number" : 4230, "PO_Reference" : "JDEER-20140421", "PO_LineItems" : [ {"Part_Number" : 230912362345, "Quantity" : 3.0} ]}'); DESCRIBE j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/change-triggers-data-guide-enabled-search-index-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/change-triggers-data-guide-enabled-search-index.html EXEC DBMS_JSON.drop_virtual_columns('J_PURCHASEORDER', 'DATA'); CREATE OR REPLACE PROCEDURE my_dataguide_trace(tableName VARCHAR2, jcolName VARCHAR2, path VARCHAR2, type NUMBER, tlength NUMBER) IS typename VARCHAR2(10); BEGIN IF (type = DBMS_JSON.TYPE_NULL) THEN typename := 'null'; ELSIF (type = DBMS_JSON.TYPE_BOOLEAN) THEN typename := 'boolean'; ELSIF (type = DBMS_JSON.TYPE_NUMBER) THEN typename := 'number'; ELSIF (type = DBMS_JSON.TYPE_STRING) THEN typename := 'string'; ELSIF (type = DBMS_JSON.TYPE_OBJECT) THEN typename := 'object'; ELSIF (type = DBMS_JSON.TYPE_ARRAY) THEN typename := 'array'; ELSE typename := 'unknown'; END IF; DBMS_OUTPUT.put_line('Updating ' || tableName || '(' || jcolName || '): Path = ' || path || ', Type = ' || type || ', Type Name = ' || typename || ', Type Length = ' || tlength); END; / ALTER INDEX po_search_idx REBUILD PARAMETERS ('DATAGUIDE ON CHANGE my_dataguide_trace'); INSERT INTO j_purchaseorder VALUES ( SYS_GUID(), to_date('30-MAR-2016'), '{"PO_ID" : 4230, "PO_Ref" : "JDEER-20140421", "PO_Items" : [ {"Part_No" : 98981327234, "Item_Quantity" : 13} ]}'); COMMIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/columns-clause-sql-json-function-json_table-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/columns-clause-sql-json-function-json_table.html SELECT jt.ponumb FROM j_purchaseorder, json_table(data, '$' COLUMNS (ponumb NUMBER PATH '$.PONumber.numberOnly()')) jt ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-b-tree-indexes-json_value-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-b-tree-indexes-json_value.html CREATE UNIQUE INDEX po_num_idx1 ON j_purchaseorder po (po.data.PONumber.number()); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-b-tree-indexes-json_value-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-b-tree-indexes-json_value.html CREATE INDEX po_num_idx1 ON j_purchaseorder po (po.data.PONumber.number(), 42); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-b-tree-indexes-json_value-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-b-tree-indexes-json_value.html CREATE UNIQUE INDEX po_num_idx2 ON j_purchaseorder (json_value(data, '$.PONumber.number()' ERROR ON ERROR)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-b-tree-indexes-json_value-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-b-tree-indexes-json_value.html CREATE UNIQUE INDEX po_ref_idx1 ON j_purchaseorder (json_value(data, '$.Reference' RETURNING VARCHAR2(200) ERROR ON ERROR NULL ON EMPTY)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-bitmap-indexes-json_value-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-bitmap-indexes-json_value.html CREATE BITMAP INDEX cost_ctr_idx ON j_purchaseorder (json_value(data, '$.CostCenter')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-multivalue-function-based-indexes-json_exists-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-multivalue-function-based-indexes-json_exists.html CREATE TABLE parts_tab (id NUMBER, jparts JSON); INSERT INTO parts_tab VALUES (1, '{"parts" : [{"partno" : 3, "subparts" : [510, 580, 520]}, {"partno" : 4, "subparts" : 730}]}'); INSERT INTO parts_tab VALUES (2, '{"parts" : [{"partno" : 7, "subparts" : [410, 420, 410]}, {"partno" : 4, "subparts" : [710, 730, 730]}]}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-multivalue-function-based-indexes-json_exists-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-multivalue-function-based-indexes-json_exists.html CREATE MULTIVALUE INDEX mvi ON parts_tab t (t.jparts.parts.subparts.numberOnly()); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-multivalue-function-based-indexes-json_exists-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-multivalue-function-based-indexes-json_exists.html CREATE MULTIVALUE INDEX cmvi_1 ON parts_tab (json_table(jparts, '$.parts[*]' ERROR ON ERROR NULL ON EMPTY NULL ON MISMATCH COLUMNS (partNum NUMBER(10) PATH '$.partno', NESTED PATH '$.subparts[*]' COLUMNS (subpartNum NUMBER(20) PATH '$')))); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-view-json-data-based-data-guide-information-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-view-json-data-based-data-guide-information.html DESCRIBE myview ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-view-json-data-based-data-guide-information-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-view-json-data-based-data-guide-information.html DESCRIBE view2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-view-json-data-using-json_table-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-view-json-data-using-json_table.html CREATE VIEW j_purchaseorder_detail_view AS SELECT po.id, jt.* FROM j_purchaseorder po, json_table(po.data, '$' COLUMNS ( po_number NUMBER(10) PATH '$.PONumber', reference VARCHAR2(30 CHAR) PATH '$.Reference', requestor VARCHAR2(128 CHAR) PATH '$.Requestor', userid VARCHAR2(10 CHAR) PATH '$.User', costcenter VARCHAR2(16) PATH '$.CostCenter', ship_to_name VARCHAR2(20 CHAR) PATH '$.ShippingInstructions.name', ship_to_street VARCHAR2(32 CHAR) PATH '$.ShippingInstructions.Address.street', ship_to_city VARCHAR2(32 CHAR) PATH '$.ShippingInstructions.Address.city', ship_to_county VARCHAR2(32 CHAR) PATH '$.ShippingInstructions.Address.county', ship_to_postcode VARCHAR2(10 CHAR) PATH '$.ShippingInstructions.Address.postcode', ship_to_state VARCHAR2(2 CHAR) PATH '$.ShippingInstructions.Address.state', ship_to_zip VARCHAR2(8 CHAR) PATH '$.ShippingInstructions.Address.zipCode', ship_to_country VARCHAR2(32 CHAR) PATH '$.ShippingInstructions.Address.country', ship_to_phone VARCHAR2(24 CHAR) PATH '$.ShippingInstructions.Phone[0].number', NESTED PATH '$.LineItems[*]' COLUMNS ( itemno NUMBER(38) PATH '$.ItemNumber', description VARCHAR2(256 CHAR) PATH '$.Part.Description', upc_code NUMBER PATH '$.Part.UPCCode', quantity NUMBER(12,4) PATH '$.Quantity', unitprice NUMBER(14,2) PATH '$.Part.UnitPrice'))) jt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/creating-view-json-data-using-json_table-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/creating-view-json-data-using-json_table.html CREATE MATERIALIZED VIEW j_purchaseorder_materialized_view BUILD IMMEDIATE REFRESH FAST ON STATEMENT WITH PRIMARY KEY AS SELECT po.id, jt.* FROM j_purchaseorder po, json_table(po.data, '$' COLUMNS ( po_number NUMBER(10) PATH '$.PONumber', reference VARCHAR2(30 CHAR) PATH '$.Reference', requestor VARCHAR2(128 CHAR) PATH '$.Requestor', userid VARCHAR2(10 CHAR) PATH '$.User', costcenter VARCHAR2(16) PATH '$.CostCenter', ship_to_name VARCHAR2(20 CHAR) PATH '$.ShippingInstructions.name', ship_to_street VARCHAR2(32 CHAR) PATH '$.ShippingInstructions.Address.street', ship_to_city VARCHAR2(32 CHAR) PATH '$.ShippingInstructions.Address.city', ship_to_county VARCHAR2(32 CHAR) PATH '$.ShippingInstructions.Address.county', ship_to_postcode VARCHAR2(10 CHAR) PATH '$.ShippingInstructions.Address.postcode', ship_to_state VARCHAR2(2 CHAR) PATH '$.ShippingInstructions.Address.state', ship_to_zip VARCHAR2(8 CHAR) PATH '$.ShippingInstructions.Address.zipCode', ship_to_country VARCHAR2(32 CHAR) PATH '$.ShippingInstructions.Address.country', ship_to_phone VARCHAR2(24 CHAR) PATH '$.ShippingInstructions.Phone[0].number', NESTED PATH '$.LineItems[*]' COLUMNS ( itemno NUMBER(38) PATH '$.ItemNumber', description VARCHAR2(256 CHAR) PATH '$.Part.Description', upc_code NUMBER PATH '$.Part.UPCCode', quantity NUMBER(12,4) PATH '$.Quantity', unitprice NUMBER(14,2) PATH '$.Part.UnitPrice'))) jt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/data-type-considerations-json_value-indexing-and-querying-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/data-type-considerations-json_value-indexing-and-querying.html SELECT count(*) FROM j_purchaseorder po WHERE json_value(data, '$.PONumber' RETURNING NUMBER) > 1500; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/data-type-considerations-json_value-indexing-and-querying-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/data-type-considerations-json_value-indexing-and-querying.html SELECT count(*) FROM j_purchaseorder po WHERE to_number(json_value(data, '$.PONumber')) > 1500; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/data-type-considerations-json_value-indexing-and-querying-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/data-type-considerations-json_value-indexing-and-querying.html SELECT count(*) FROM j_purchaseorder po WHERE json_value(data, '$.PONumber') > 1500; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/error-clause-sql-query-functions-and-conditions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/error-clause-sql-query-functions-and-conditions.html SELECT json_value('[{a:1},{a:2}]', '$.a'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/error-clause-sql-query-functions-and-conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/error-clause-sql-query-functions-and-conditions.html ALTER SESSION SET JSON_BEHAVIOR="ON_ERROR:ERROR" SELECT json_value('[{a:1},{a:2}]', '$.a'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/error-clause-sql-query-functions-and-conditions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/error-clause-sql-query-functions-and-conditions.html ALTER SESSION SET JSON_BEHAVIOR="ON_ERROR:NULL" ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/handling-dependent-objects-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/handling-dependent-objects.html SELECT MVIEW_NAME, COMPILE_STATE FROM USER_MVIEWS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/handling-dependent-objects-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/handling-dependent-objects.html SELECT INDEX_NAME FROM USER_INDEXES WHERE TABLE_NAME = 'J_PURCHASEORDER'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/handling-dependent-objects-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/handling-dependent-objects.html SELECT DBMS_METADATA.get_ddl('INDEX', po_num_idx1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/handling-input-values-sql-json-generation-functions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/handling-input-values-sql-json-generation-functions.html CREATE FUNCTION getX(n NUMBER) RETURN VARCHAR2 AS BEGIN RETURN '{"x":'|| n ||'}'; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/handling-input-values-sql-json-generation-functions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/handling-input-values-sql-json-generation-functions.html SELECT json_array(getX(5) FORMAT JSON); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/handling-input-values-sql-json-generation-functions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/handling-input-values-sql-json-generation-functions.html SELECT json_array(getX(5) FORMAT JSON STRICT); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/indexing-multiple-json-fields-using-composite-b-tree-index-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/indexing-multiple-json-fields-using-composite-b-tree-index.html SELECT data FROM j_purchaseorder WHERE json_value(data, '$.User') = 'ABULL' AND json_value(data, '$.CostCenter') = 'A50'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-collections-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-collections.html CREATE JSON COLLECTION TABLE employee (salary AS (json_value(DATA, '$.salary.number()')), CONSTRAINT sal_chk CHECK (salary > 0)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-collections-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-collections.html CREATE JSON COLLECTION TABLE j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-collections-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-collections.html CREATE JSON COLLECTION VIEW empview AS SELECT JSON {'_id' : employee_id, last_name, 'contactInfo' : {email, phone_number}, hire_date, salary} FROM hr.employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-data-type-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-data-type.html WITH jtab AS (SELECT JSON( '{ "name" : "Alexis Bull", "Address": { "street" : "200 Sporting Green", "city" : "South San Francisco", "state" : "CA", "zipCode" : 99236, "country" : "United States of America" } }') AS jcol) SELECT j.jcol.Address.city FROM jtab j; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-data-type-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-data-type.html SELECT data FROM customers c ORDER BY c.data.revenue; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-data-type-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-data-type.html SELECT data FROM customers c ORDER BY json_scalar(c.data.revenue); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-data-type-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-data-type.html SELECT json_value(json_scalar(current_timestamp), '$.timestamp()'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-data-type-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-data-type.html SELECT json_serialize(data PRETTY ORDERED) FROM j_purchaseorder po WHERE po.data.PONumber = 1600; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-data-type-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-data-type.html SELECT * FROM emp t WHERE t.data.dept = 'SALES' ORDER BY t.data.name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-data-type-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-data-type.html SELECT data FROM customers c ORDER BY c.data.revenue; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-data-type-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-data-type.html SELECT data FROM customers c ORDER BY json_scalar(c.data.revenue); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-query-rewrite-use-materialized-view-json_table-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-query-rewrite-use-materialized-view-json_table.html CREATE MATERIALIZED VIEW mv_for_query_rewrite BUILD IMMEDIATE REFRESH FAST ON STATEMENT WITH PRIMARY KEY AS SELECT po.id, jt.* FROM j_purchaseorder po, json_table(po.data, '$' ERROR ON ERROR NULL ON EMPTY COLUMNS ( po_number NUMBER PATH '$.PONumber', userid VARCHAR2(10) PATH '$.User', NESTED PATH '$.LineItems[*]' COLUMNS ( itemno NUMBER PATH '$.ItemNumber', description VARCHAR2(256) PATH '$.Part.Description', upc_code NUMBER PATH '$.Part.UPCCode', quantity NUMBER PATH '$.Quantity', unitprice NUMBER PATH '$.Part.UnitPrice'))) jt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-query-rewrite-use-materialized-view-json_table-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-query-rewrite-use-materialized-view-json_table.html CREATE INDEX mv_idx ON mv_for_query_rewrite(userid, upc_code, quantity); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE TABLE tab (jcol JSON VALIDATE '{"type" : "object"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE TABLE tab (jcol JSON VALIDATE '{"type" : "object"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE TABLE tab (jcol JSON CONSTRAINT jchk CHECK (jcol IS JSON VALIDATE '{"type" : "object"}')); CREATE TABLE jtab(jcol JSON DOMAIN jd); CREATE DOMAIN jd AS JSON VALIDATE '{"type" : "object"}'; SELECT * FROM USER_JSON_SCHEMA_COLUMNS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html SELECT data FROM j_purchaseorder WHERE data IS JSON VALIDATE '{"type" : "object", "properties" : {"PONumber": {"type" : "number", "minimum" : 0}}}' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE TABLE mytable ( jcol JSON VALIDATE '{"type" : "object", "properties" : {"dateOfBirth" : {"extendedType" : "date"}}}'); INSERT INTO mytable VALUES ('{"dateOfBirth" : "2018-04-11"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE TABLE mytable ( jcol JSON VALIDATE CAST '{"type" : "object", "properties" : {"dateOfBirth" : {"extendedType" : "date"}}}'); INSERT INTO mytable VALUES ('{"dateOfBirth" : "2018-04-11"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html SELECT d.jcol.dateOfBirth.type() FROM mytable d; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE TABLE tab (jcol JSON CONSTRAINT jchk CHECK (jcol IS JSON VALIDATE '{"type" : "object"}')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html ALTER TABLE employees ADD CONSTRAINT min_salary CHECK (salary >= 2000) PRECHECK; ALTER TABLE employees ADD CONSTRAINT max_bonus CHECK ((salary * commission_pct) < 6000) PRECHECK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html ALTER TABLE employees ADD CONSTRAINT max_bonus CHECK ((salary * commission_pct) < 6000); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html SELECT DBMS_JSON_SCHEMA.describe('EMPLOYEES'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE DOMAIN jd AS JSON CONSTRAINT jchkd CHECK (jd IS JSON VALIDATE '{"type" : "object"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE TABLE jtab(jcol JSON DOMAIN jd); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE DOMAIN jd AS JSON VALIDATE '{"type" : "object"}'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html SELECT DBMS_JSON_SCHEMA.validate_report('{"name" : "scott", "role" : "developer"}', '{"type" : "array"}') AS myreport; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-schema-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-schema.html CREATE TABLE tab (jcol JSON (OBJECT)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html SELECT IDX_NAME, IDX_SYNC_TYPE, IDX_MAINTENANCE_TYPE FROM CTX_USER_INDEXES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html CREATE SEARCH INDEX po_search_idx ON j_purchaseorder (data) FOR JSON; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html SELECT data FROM j_purchaseorder WHERE json_value(data, '$.User') = 'AKHOO'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html CREATE SEARCH INDEX po_search_idx ON j_purchaseorder (data) FOR JSON PARAMETERS ('MAINTENANCE AUTO'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html CREATE SEARCH INDEX po_search_idx ON j_purchaseorder (data) FOR JSON PARAMETERS ('SYNC (ON COMMIT)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html CREATE SEARCH INDEX po_search_idx ON j_purchaseorder (data) FOR JSON PARAMETERS ('SEARCH_ON TEXT INCLUDE ($.SpecialInstructions, $.LineItems.Part.Description)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html CREATE SEARCH INDEX po_search_idx ON j_purchaseorder (data) FOR JSON PARAMETERS ('SEARCH_ON TEXT INCLUDE ($.SpecialInstructions, $.LineItems.Part.Description) VALUE(NUMBER) INCLUDE ($.PONumber, $.LineItems.Part.UnitPrice) VALUE(VARCHAR2) INCLUDE ($.Reference, $.User, $.ShippingInstructions.name, $.ShippingInstructions.Address.zipCode)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html BEGIN CTX_DDL.create_path_list('json_pl', CTX_DDL.PATHLIST_JSON, CTX_DDL.PATHLIST_INCLUDE); CTX_DDL.add_path('json_pl', 'TEXT', '$.SpecialInstructions'); CTX_DDL.add_path('json_pl', 'TEXT', '$.LineItems.Part.Description'); CTX_DDL.add_path('json_pl', 'NUMBER', '$.PONumber'); CTX_DDL.add_path('json_pl', 'NUMBER', '$.LineItems.Part.UnitPrice'); CTX_DDL.add_path('json_pl', 'VARCHAR2', '$.Reference'); CTX_DDL.add_path('json_pl', 'VARCHAR2', '$.User'); CTX_DDL.add_path('json_pl', 'VARCHAR2', '$.ShippingInstructions.name'); CTX_DDL.add_path('json_pl', 'VARCHAR2', '$.ShippingInstructions.Address.zipCode'); END; / CREATE SEARCH INDEX po_search_idx ON j_purchaseorder (data) FOR JSON PARAMETERS ('PATHLIST json_pl'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html SELECT data FROM j_purchaseorder WHERE json_exists(data, '$.ShippingInstructions.Address.country'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-search-index-ad-hoc-queries-and-full-text-search.html SELECT data FROM j_purchaseorder WHERE json_exists(data, '$?(@.User == "AKHOO" && @.LineItems.Quantity > 8)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_table-generalizes-sql-json-query-functions-and-conditions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_table-generalizes-sql-json-query-functions-and-conditions.html SELECT json_value(data, '$.Requestor' RETURNING VARCHAR2(32)), json_query(data, '$.ShippingInstructions.Phone' RETURNING VARCHAR2(100)) FROM j_purchaseorder WHERE json_exists(data, '$.ShippingInstructions.Address.zipCode') AND json_value(data, '$.AllowPartialShipment' RETURNING BOOLEAN) = TRUE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_table-generalizes-sql-json-query-functions-and-conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_table-generalizes-sql-json-query-functions-and-conditions.html SELECT jt.requestor, jt.phones FROM j_purchaseorder, json_table(data, '$' COLUMNS ( requestor VARCHAR2(32 CHAR) PATH '$.Requestor', phones VARCHAR2(100 CHAR) FORMAT JSON PATH '$.ShippingInstructions.Phone', partial BOOLEAN PATH '$.AllowPartialShipment', has_zip BOOLEAN EXISTS PATH '$.ShippingInstructions.Address.zipCode')) jt WHERE jt.partial AND jt.has_zip; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operation-handlers-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operation-handlers.html SELECT json_transform('{"a":"cat"}', INSERT '$.b' = PATH '$.a.number()' IGNORE ON ERROR); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operation-handlers-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operation-handlers.html SELECT json_transform('{"a":null, "b":[ 1,2,3 ]}', APPEND '$.b' = PATH '$.x' ERROR ON EMPTY); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operation-handlers-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operation-handlers.html SELECT json_transform('{"created":"2025-04-09T22:07:06"}', SET '$.created' = SYSDATE IGNORE ON EXISTING); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operation-handlers-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operation-handlers.html SELECT json_transform('{"x":null}', RENAME '$.a' = 'b' ERROR ON MISSING); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operation-handlers-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operation-handlers.html SELECT json_transform('{"a":"notAnObject"}', MERGE '$.a' = PATH '$var' IGNORE ON MISMATCH PASSING JSON('{"b":2}') AS "var"); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operation-handlers-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operation-handlers.html SELECT json_transform('{"a":"dog"}', APPEND '$.a' = 'cat' CREATE ON MISMATCH); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operation-handlers-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operation-handlers.html SELECT json_transform('{"a":"dog"}', APPEND '$.a' = 'cat' REPLACE ON MISMATCH); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator.html SELECT json_transform('{"a":[ 1, 2, 3, 4 ], "b":[ 2, 5 ]}', MINUS '$.a' = PATH '$.b[*]') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-append-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-append.html SELECT json_transform('{"a":[1,2,3]}', APPEND '$.a' = 'hello'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-append-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-append.html SELECT json_transform('{"a":[1,2,3]}', INSERT '$.a[last+1]' = 'hello'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-append-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-append.html SELECT json_transform('{"a": [ {"b": [ 1,2 ]}, {"b": [ 3,4 ]} ]}', SET '$var' = json_array(5, 'cat'), APPEND '$.a[*].b' = PATH '$var[*]'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-append-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-append.html SELECT json_transform('{"a":[1,2,3]}', APPEND '$.b' = PATH '$.a[0,2]' CREATE ON MISSING); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-copy-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-copy.html SELECT json_transform('{"a":[], "b":[ {"x":1}, {"x":2}, {"x":3} ]}', COPY '$.a' = PATH '$.b.x', REMOVE '$.b'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-insert-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-insert.html SELECT json_transform('{}', INSERT '$.a' = 'hello') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-insert-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-insert.html SELECT json_transform('{"a":1}', INSERT '$.a' = 'hello') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-insert-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-insert.html SELECT json_transform('{"a":[1,2,3,4]}', INSERT '$.a[2]' = 'hello') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-intersect-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-intersect.html SELECT json_transform('{"a":[ 1, 2, 3 ], "b":[ 2, 3, 4 ]}', INTERSECT '$.a' = PATH '$.b[*]') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-intersect-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-intersect.html SELECT json_transform('{"a":[ 1,2 ], b:[ {c:3}, {c:4} ]}', PREPEND '$.a' = PATH '$.b[*].c') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-keep-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-keep.html SELECT json_transform('{"a":1, "b":2, "c":3, "d":4}', KEEP '$.a', '$.d') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-keep-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-keep.html SELECT json_transform('{"a":1, "b":2, "c":3, "d":4}', KEEP '$.*?(@ > 2)') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-merge-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-merge.html SELECT json_transform('{"a":{"x":1, "y":2}, "b":{"y":3, "z":4}}', MERGE '$.a' = PATH '$.b') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-nested-path-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-nested-path.html SELECT json_transform( data, NESTED PATH '$.LineItems[*]' (SET '@.LineItemTotal' = PATH '@.Part.UnitPrice * @.Quantity'), SET '$.OrderTotal' = PATH '$.LineItems[*].LineItemTotal.sum()', REMOVE '$.LineItems[*].LineItemTotal') FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-prepend-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-prepend.html SELECT json_transform('{"a":[1,2]}', INSERT '$.a' = '0') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-prepend-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-prepend.html SELECT json_transform('{"a": [ {"b": [ 1,2 ]}, {"b": [ 3,4 ]} ]}', SET '$var' = json_array(5, 'cat'), PREPEND '$.a[*].b' = PATH '$var[*]'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-prepend-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-prepend.html SELECT json_transform('{"a":[ 1,2 ], b:[ {c:3}, {c:4} ]}', PREPEND '$.a' = PATH '$.b[*].c') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-remove-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-remove.html SELECT json_transform('{"a":[0,1,2]}', REMOVE '$.a[0]') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-rename-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-rename.html SELECT json_transform('{"abc":1}', RENAME '$.abc' = 'xyz', SET '$.xyz' = 2) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-replace-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-replace.html SELECT json_transform('{"a":1}', REPLACE '$.a' = 2, REPLACE '$.b' = 3); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-set-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-set.html SELECT json_transform(JSON('{"alpha" : {"a":1, "b":2}}'), SET '$.alpha.z' = 26) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-set-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-set.html SELECT json_transform(JSON('{"a":1, "b":2}'), SET '$.alpha.z' = 26) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-set-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-set.html SELECT json_transform(JSON('{"alpha" : [ 1,2 ]}'), SET '$.alpha.z' = 26) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-set-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-set.html SELECT json_transform('{"a":1}', SET '$.b' = 2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-set-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-set.html SELECT json_transform('{"a":1}', SET '$.a' = 2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-set-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-set.html SELECT json_transform('{"a":[1,2,3]}', SET '$.a[1]' = 5); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-set-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-set.html SELECT json_transform('{"a":[1,2,3]}', SET '$.a[6]' = 5); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-sort-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-sort.html SELECT json_transform('{"a":[ 1, null, 2, "cat", true, 3.1416 ]}', SORT '$.a' DESC); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-sort-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-sort.html SELECT json_transform(data, SORT '$.LineItems' ORDER BY '$.Part.UnitPrice' DESC, '$.ItemNumber' DESC RETURNING VARCHAR2(4000)) FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-operator-union-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-operator-union.html SELECT json_transform('{"a":[ 1, 2, 3 ], "b":[ 2, 5, 3, 4 ]}', UNION '$.a' = PATH '$.b') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-right-hand-side-rhs-path-expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-right-hand-side-rhs-path-expressions.html SELECT json_transform('{"a":[ 1,2,3 ]}', SET '$.b' = PATH '$.a[*].sum()'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-right-hand-side-rhs-path-expressions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-right-hand-side-rhs-path-expressions.html SELECT json_transform('{"a":1}', SET '$var1' = 2, SET '$var2' = PATH '$.a', SET '$.b' = PATH '$var1 + $var2 + $var3' PASSING 5 AS "var3"); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-right-hand-side-rhs-path-expressions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-right-hand-side-rhs-path-expressions.html SELECT json_transform('{"salary":1000, "commission":150}', SET '$.bonus' = PATH '$.salary * $bonusFactor', SET '$.compensation' = PATH '($.salary + $.bonus) + $.commission' PASSING 0.05 AS "bonusFactor"); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-right-hand-side-rhs-path-expressions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-right-hand-side-rhs-path-expressions.html SELECT json_transform('{"items":[ {"quantity":2, "unitPrice":3}, {"quantity":2, "unitPrice":7} ]}', SET '$priceVar' = PATH '0.00', NESTED PATH '$.items[*]' (SET '$priceVar' = PATH '$priceVar + (@.unitPrice * @.quantity)'), SET '$.totalPrice' = PATH '$priceVar'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-right-hand-side-rhs-path-expressions-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-right-hand-side-rhs-path-expressions.html SELECT json_transform('{travel:[ {"name":"Jack", "approval":[ 2023, 2024 ]}, {"name":"Jill", "approval":[ 2024 ]} ]}', SET '$var' = JSON('[ 2025,2026 ]'), APPEND '$.travel.approval' = PATH '$var[*]'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/json_transform-right-hand-side-rhs-path-expressions-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json_transform-right-hand-side-rhs-path-expressions.html SELECT json_transform('{"a":[ 1,2 ], b:[ {c:3}, {c:4} ]}', PREPEND '$.a' = PATH '$.b[*].c') ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/loading-external-json-data-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/loading-external-json-data.html CREATE OR REPLACE DIRECTORY order_entry_dir AS 'folder-containing-json-file'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/loading-external-json-data-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/loading-external-json-data.html CREATE TABLE json_file_contents (data JSON) ORGANIZATION EXTERNAL (TYPE ORACLE_BIGDATA ACCESS PARAMETERS (com.oracle.bigdata.fileformat = jsondoc) LOCATION (order_entry_dir:'PurchaseOrders.json')) PARALLEL REJECT LIMIT UNLIMITED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/loading-external-json-data-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/loading-external-json-data.html DROP TABLE j_purchaseorder; CREATE TABLE j_purchaseorder (id VARCHAR2 (32) NOT NULL PRIMARY KEY, date_loaded TIMESTAMP (6) WITH TIME ZONE, data JSON); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/loading-external-json-data-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/loading-external-json-data.html INSERT INTO j_purchaseorder (id, date_loaded, data) SELECT SYS_GUID(), SYSTIMESTAMP, data FROM json_file_contents; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/loading-external-json-data-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/loading-external-json-data.html CREATE JSON COLLECTION TABLE purchaseorders; INSERT INTO purchaseorders SELECT * FROM json_file_contents; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/mismatch-clause-sql-json-query-functions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/mismatch-clause-sql-json-query-functions.html CREATE TYPE person_T AS OBJECT ( first VARCHAR2(30), last VARCHAR2(30), birthyear NUMBER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/mismatch-clause-sql-json-query-functions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/mismatch-clause-sql-json-query-functions.html SELECT json_value('{"first": "Grace", "middle": "Brewster", "last": "Hopper", "birthyear": "1906"}', '$' RETURNING person_t); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/mismatch-clause-sql-json-query-functions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/mismatch-clause-sql-json-query-functions.html SELECT json_value('{"first": "Grace", "middle": "Brewster", "last": "Hopper", "birthyear": "1906"}', '$' RETURNING person_t ERROR ON MISMATCH (EXTRA DATA)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/mismatch-clause-sql-json-query-functions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/mismatch-clause-sql-json-query-functions.html SELECT json_value('{"first": "Grace", "middle": "Brewster", "last": "Hopper", "birthyear": "1906"}', '$' RETURNING person_t ERROR ON MISMATCH (EXTRA DATA) ERROR ON MISMATCH (MISSING DATA) IGNORE ON MISMATCH (TYPE ERROR)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/multiple-data-guides-document-set-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/multiple-data-guides-document-set.html INSERT INTO j_purchaseorder VALUES ( SYS_GUID(), to_date('30-JUN-2015'), '{"PO_Number" : 4230, "PO_Reference" : "JDEER-20140421", "PO_LineItems" : [ {"Part_Number" : 230912362345, "Quantity" : 3.0} ]}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/multiple-data-guides-document-set-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/multiple-data-guides-document-set.html INSERT INTO j_purchaseorder VALUES ( SYS_GUID(), to_date('30-MAR-2016'), '{"PO_ID" : 4230, "PO_Ref" : "JDEER-20140421", "PO_Items" : [ {"Part_No" : 98981327234, "Item_Quantity" : 13} ]}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/multiple-data-guides-document-set-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/multiple-data-guides-document-set.html SELECT extract(YEAR FROM date_loaded), json_dataguide(data) FROM j_purchaseorder GROUP BY extract(YEAR FROM date_loaded) ORDER BY extract(YEAR FROM date_loaded) DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/oracle-sql-condition-json_textcontains-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/oracle-sql-condition-json_textcontains.html SELECT data FROM j_purchaseorder WHERE json_textcontains(data, '$.LineItems.Part.Description', 'Magic'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/oracle-sql-condition-json_textcontains-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/oracle-sql-condition-json_textcontains.html SELECT po.data.PONumber, SCORE(1) FROM j_purchaseorder po WHERE json_textcontains (po.data, '$.LineItems.Part.Description', 'run', 1) ORDER BY SCORE(1) DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/oracle-sql-function-json_mergepatch-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/oracle-sql-function-json_mergepatch.html UPDATE j_purchaseorder SET data = json_mergepatch(data, '{"Special Instructions":null}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/oracle-sql-function-json_mergepatch-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/oracle-sql-function-json_mergepatch.html SELECT json_mergepatch(data, '{"Special Instructions":null}' RETURNING CLOB PRETTY) FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/oracle-sql-function-json_transform-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/oracle-sql-function-json_transform.html UPDATE j_purchaseorder po SET data = json_transform(data, SET '$.costCenter' = 'Z20') WHERE po.data.User = 'ABULL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/oracle-sql-function-json_transform-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/oracle-sql-function-json_transform.html UPDATE j_purchaseorder SET data = json_transform(data, SET '$.lastUpdated' = SYSTIMESTAMP); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/oracle-sql-function-json_transform-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/oracle-sql-function-json_transform.html SELECT json_transform(data, REMOVE '$."Special Instructions"' RETURNING CLOB PRETTY) FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/overview-json-generation-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/overview-json-generation.html SELECT json_arrayagg(department_name)FROM departments; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/overview-json-generation-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/overview-json-generation.html SELECT JSON(json_objectagg(department_name VALUE department_id)) FROM departments; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/overview-json-generation-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/overview-json-generation.html SELECT json_objectagg(department_name VALUE department_id RETURNING JSON) FROM departments; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/overview-json-oracle-database-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/overview-json-oracle-database.html SELECT po.data.Requestor FROM j_purchaseorder po; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/overview-memory-json-data-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/overview-memory-json-data.html SHOW PARAMETER INMEMORY_VIRTUAL_COLUMNS ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/partitioning-json-data-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/partitioning-json-data.html CREATE JSON COLLECTION TABLE orders (po_num_vc NUMBER GENERATED ALWAYS AS (json_value (DATA, '$.PONumber.number()' ERROR ON ERROR)) MATERIALIZED) PARTITION BY RANGE (po_num_vc) (PARTITION p1 VALUES LESS THAN (1000), PARTITION p2 VALUES LESS THAN (2000)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/partitioning-json-data-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/partitioning-json-data.html SELECT DATA FROM orders p WHERE p.data.PONumber.number() = 1234; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/passing-clause-sql-functions-and-conditions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/passing-clause-sql-functions-and-conditions.html SELECT count(*) FROM j_purchaseorder WHERE json_exists(data, '$.PONumber?(@.numberOnly() > $d)' PASSING to_number(:1) AS "d"); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/passing-clause-sql-functions-and-conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/passing-clause-sql-functions-and-conditions.html SELECT count(*) FROM j_purchaseorder WHERE json_exists(data, '$.PONumber?(@ > $d)' PASSING to_number(:1) AS "d" TYPE(STRICT)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/performing-migration-check-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/performing-migration-check.html SELECT data FROM table_owner.j_purchaseorder WHERE ROWID IN (SELECT pt.ERROR_ROW_ID FROM my_precheck_table pt WHERE pt.schema_name = table_owner AND pt.table_name = j_purchaseorder AND pt.column_name = data); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/persistent-data-guide-information-part-json-search-index-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/persistent-data-guide-information-part-json-search-index.html ALTER TABLE table_name ENABLE CONSTRAINT is_json_check_constraint_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/persistent-data-guide-information-part-json-search-index-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/persistent-data-guide-information-part-json-search-index.html CREATE SEARCH INDEX po_dg_only_idx ON j_purchaseorder (data) FOR JSON PARAMETERS ('DATAGUIDE ON SEARCH_ON NONE'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/persistent-data-guide-information-part-json-search-index-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/persistent-data-guide-information-part-json-search-index.html ALTER INDEX po_search_idx REBUILD PARAMETERS ('DATAGUIDE ON'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/persistent-data-guide-information-part-json-search-index-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/persistent-data-guide-information-part-json-search-index.html EXEC DBMS_STATS.gather_index_stats(docuser, po_search_idx, NULL, 100); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/populate-json-type-column-querying-textual-json-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/populate-json-type-column-querying-textual-json.html CREATE TABLE j_purchaseorder_new PARALLEL NOLOGGING AS SELECT id id, date_loaded date_loaded, JSON(data) data FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/populate-json-type-column-querying-textual-json-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/populate-json-type-column-querying-textual-json.html INSERT /*+ PARALLEL APPEND */ INTO j_purchaseorder_new (id, date_loaded, data) SELECT id, date_loaded, JSON(data) FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/populate-json-type-column-querying-textual-json-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/populate-json-type-column-querying-textual-json.html DROP TABLE j_purchaseorder; ALTER TABLE j_purchaseorder_new RENAME TO j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/populating-json-data-memory-column-store-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/populating-json-data-memory-column-store.html SELECT COUNT(1) FROM j_purchaseorder WHERE json_exists(data, '$.ShippingInstructions?( @.Address.zipCode == 99236)'); ALTER TABLE j_purchaseorder INMEMORY; SELECT COUNT(1) FROM j_purchaseorder WHERE json_exists(data, '$.ShippingInstructions?( @.Address.zipCode == 99236)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/populating-json-data-memory-column-store-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/populating-json-data-memory-column-store.html ALTER TABLE j_purchaseorder INMEMORY TEXT (data); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/querying-data-guide-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/querying-data-guide.html WITH dg_t AS (SELECT json_dataguide(data) dg_doc FROM j_purchaseorder) SELECT jt.* FROM dg_t, json_table(dg_doc, '$[*]' COLUMNS jpath VARCHAR2(40) PATH '$."o:path"', type VARCHAR2(10) PATH '$."type"', tlength NUMBER PATH '$."o:length"') jt ORDER BY jt.jpath; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/querying-data-guide-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/querying-data-guide.html WITH dg_t AS (SELECT DBMS_JSON.get_index_dataguide('J_PURCHASEORDER', 'DATA', DBMS_JSON.FORMAT_FLAT) dg_doc ) SELECT jt.* FROM dg_t, json_table(dg_doc, '$[*]' COLUMNS jpath VARCHAR2(40) PATH '$."o:path"', type VARCHAR2(10) PATH '$."type"', tlength NUMBER PATH '$."o:length"', frequency NUMBER PATH '$."o:frequency"') jt WHERE jt.frequency > 80; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/read-only-views-based-json-generation-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/read-only-views-based-json-generation.html describe department_view; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/read-only-views-based-json-generation-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/read-only-views-based-json-generation.html CREATE VIEW department_view AS SELECT dep.department_id id, JSON {'id' : dep.department_id, 'departmentName' : dep.department_name, 'departmentAddress' : JSON {'street' : loc.street_address, 'zip' : loc.postal_code, 'city' : loc.city, 'state' : loc.state_province, 'country' : loc.country_id}, 'employees' : [ SELECT JSON {'id' : emp.employee_id, 'name' : emp.first_name || ' ' || emp.last_name, 'title' : (SELECT job_title FROM jobs job WHERE job.job_id = emp.job_id)} FROM employees emp WHERE emp.department_id = dep.department_id ]} data FROM departments dep, locations loc WHERE dep.location_id = loc.location_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/read-only-views-based-json-generation-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/read-only-views-based-json-generation.html SELECT json_serialize(data pretty) FROM department_view WHERE id = 90; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/simple-dot-notation-access-json-data-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/simple-dot-notation-access-json-data.html SELECT po.data.PONumber FROM j_purchaseorder po; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/simple-dot-notation-access-json-data-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/simple-dot-notation-access-json-data.html SELECT po.data.PONumber.number() FROM j_purchaseorder po; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/simple-dot-notation-access-json-data-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/simple-dot-notation-access-json-data.html SELECT t.data.name FROM fruit t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/simple-dot-notation-access-json-data-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/simple-dot-notation-access-json-data.html SELECT t.data.name.string() FROM fruit t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/simple-dot-notation-access-json-data-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/simple-dot-notation-access-json-data.html ALTER SESSION SET JSON_BEHAVIOR="ON_ERROR:ERROR"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/simple-dot-notation-access-json-data-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/simple-dot-notation-access-json-data.html SELECT po.data.PONumber FROM j_purchaseorder po; SELECT json_value(data, '$.PONumber') FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/simple-dot-notation-access-json-data-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/simple-dot-notation-access-json-data.html SELECT po.data.PONumber.number() FROM j_purchaseorder po; SELECT json_value(data, '$.PONumber.number()') FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/simple-dot-notation-access-json-data-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/simple-dot-notation-access-json-data.html SELECT po.data.ShippingInstructions.Phone FROM j_purchaseorder po; SELECT json_query(data, '$.ShippingInstructions.Phone') FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/simple-dot-notation-access-json-data-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/simple-dot-notation-access-json-data.html SELECT po.data.ShippingInstructions.Phone.type FROM j_purchaseorder po; SELECT json_query(data, '$.ShippingInstructions.Phone.type' WITH WRAPPER) FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/specifying-preferred-name-field-column-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/specifying-preferred-name-field-column.html BEGIN DBMS_JSON.rename_column( 'J_PURCHASEORDER', 'DATA', '$.PONumber', DBMS_JSON.TYPE_NUMBER, 'PONumber'); DBMS_JSON.rename_column( 'J_PURCHASEORDER', 'DATA', '$.ShippingInstructions.Phone', DBMS_JSON.TYPE_STRING, 'Phone'); DBMS_JSON.rename_column( 'J_PURCHASEORDER', 'DATA', '$.ShippingInstructions.Phone.type', DBMS_JSON.TYPE_STRING, 'PhoneType'); DBMS_JSON.rename_column( 'J_PURCHASEORDER', 'DATA', '$.ShippingInstructions.Phone.number', DBMS_JSON.TYPE_STRING, 'PhoneNumber'); DBMS_JSON.rename_column( 'J_PURCHASEORDER', 'DATA', '$.LineItems.ItemNumber', DBMS_JSON.TYPE_NUMBER, 'ItemNumber'); DBMS_JSON.rename_column( 'J_PURCHASEORDER', 'DATA', '$.LineItems.Part.Description', DBMS_JSON.TYPE_STRING, 'PartDescription'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-condition-json_exists-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-condition-json_exists.html SELECT json_exists('{a : null}', '$.a'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-condition-json_exists-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-condition-json_exists.html SELECT po.data FROM j_purchaseorder po WHERE json_exists(po.data, '$.LineItems.Part?(@.UPCCode == $v1)' PASSING '85391628927' AS "v1"); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-conditions-is-json-and-is-not-json-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-conditions-is-json-and-is-not-json.html CREATE TABLE j_purchaseorder (id VARCHAR2 (32) NOT NULL PRIMARY KEY, date_loaded TIMESTAMP (6) WITH TIME ZONE, data VARCHAR2 (32767) CONSTRAINT ensure_json CHECK (data is json (STRICT))); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_array-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_array.html SELECT json_object('title' VALUE job_title, 'salaryRange' VALUE json_array(min_salary, max_salary) RETURNING JSON) FROM jobs; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_array-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_array.html SELECT JSON { 'title' VALUE job_title, 'salaryRange' VALUE [ min_salary, max_salary ] } FROM jobs; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_array-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_array.html SELECT JSON [ SELECT JSON {'id' : employee_id, 'name' : last_name, 'sal' : salary} FROM employees WHERE salary > 12000 ORDER BY salary ] by_salary; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_arrayagg-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_arrayagg.html SELECT json_object('id' VALUE mgr.employee_id, 'manager' VALUE (mgr.first_name || ' '|| mgr.last_name), 'numReports' VALUE count(rpt.employee_id), 'reports' VALUE json_arrayagg(rpt.employee_id ORDER BY rpt.employee_id)) FROM employees mgr, employees rpt WHERE mgr.employee_id = rpt.manager_id GROUP BY mgr.employee_id, mgr.last_name, mgr.first_name HAVING count(rpt.employee_id) > 6; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_arrayagg-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_arrayagg.html SELECT json_object( 'region' : region_name, 'countries' : (SELECT json_arrayagg(json_object('id' : country_id, 'name' : country_name)) FROM countries c WHERE c.region_id = r.region_id)) FROM regions r; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html SELECT json_object('id' : employee_id, 'name' : first_name || ' ' || last_name, 'contactInfo' : json_object('mail' : email, 'phone' : phone_number), 'hireDate' : hire_date, 'pay' : salary RETURNING JSON) FROM hr.employees WHERE salary > 15000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html SELECT JSON { * } FROM hr.employees WHERE salary > 15000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html SELECT JSON_OBJECT('city' : city, 'province' : state_province ABSENT ON NULL) FROM hr.locations WHERE city LIKE 'S%'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html SELECT JSON {'city' : city, 'province' : state_province ABSENT ON NULL} FROM hr.locations WHERE city LIKE 'S%'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html CREATE TABLE po_ship AS SELECT json_value(data, '$.ShippingInstructions' RETURNING shipping_t) shipping FROM j_purchaseorder; DESCRIBE po_ship; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html SELECT json_object(shipping RETURNING JSON) FROM po_ship; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html SELECT JSON {shipping} FROM po_ship; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html CREATE OR REPLACE TYPE my_mailing_address_type AS OBJECT(Street VARCHAR2(80), City VARCHAR2(80), State CHAR(2), Zip VARCHAR2(10)); CREATE TABLE t1 (col1 my_mailing_address_type); INSERT INTO t1 VALUES (my_mailing_address_type('street1', 'city1', 'CA', '12345')); SELECT json_object(col1) FROM t1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html SELECT json_object(col1 WITH TYPENAME) FROM t1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html SELECT JSON { last_name, 'contactInfo' : JSON { email, phone_number }, hire_date, salary} FROM hr.employees WHERE employee_id = 101; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_object-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_object.html SELECT json_object(* RETURNING JSON) FROM hr.employees WHERE salary > 15000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_objectagg-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_objectagg.html SELECT json_objectagg(department_name VALUE department_id) FROM departments; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_query-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_query.html ALTER SESSION SET JSON_BEHAVIOR = "json_query_ret_varchar:true"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_query-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_query.html SELECT json_query(data, '$.ShippingInstructions.Phone[*].type' WITH WRAPPER) FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_table-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_table.html SELECT jt.* FROM j_purchaseorder po, json_table(po.data COLUMNS ("Special Instructions", NESTED LineItems[*] COLUMNS (ItemNumber NUMBER, Description PATH Part.Description)) ) AS "JT"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-function-json_table-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-function-json_table.html SELECT jt.* FROM j_purchaseorder po, json_table(po.data, '$' COLUMNS ( "Special Instructions" VARCHAR2(4000) PATH '$."Special Instructions"', NESTED PATH '$.LineItems[*]' COLUMNS ( ItemNumber NUMBER PATH '$.ItemNumber', Description VARCHAR(4000) PATH '$.Part.Description')) ) AS "JT"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-item-methods-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-item-methods.html SELECT json_query('[ "alpha", 42, "10.4" ]', '$[*].string()' WITH ARRAY WRAPPER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-item-methods-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-item-methods.html SELECT json_value('[ 19, "Oracle", {"a":1}, [1,2,3] ]', '$.type()'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-item-methods-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-item-methods.html SELECT json_query('[ 19, "Oracle", {"a":1}, [1,2,3] ]', '$.type()' WITH ARRAY WRAPPER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-item-methods-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-item-methods.html SELECT json_query('[ 19, "Oracle", {"a":1}, [1,2,3] ]', '$.type()'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-item-methods-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-item-methods.html CREATE TABLE tab (data JSON); INSERT INTO tab VALUES ('{a : [ 1, 2, 3.5 ]}'); SELECT t.data.a[*].sum() from tab t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-item-methods-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-item-methods.html SELECT json_value(data, '$.LineItems[*].Quantity.avg()') FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-item-methods-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-item-methods.html SELECT avg(json_value(data, '$.LineItems[*].Quantity.avg()')) FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-syntax-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-syntax.html @.z in ("a", "b", c") ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-syntax-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-syntax.html SELECT po.data FROM j_purchaseorder po WHERE json_exists(po.data, '$.LineItems.Part?(@.UPCCode == $v1)' PASSING '85391628927' AS "v1"); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-json-path-expression-syntax-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-json-path-expression-syntax.html @.locations?( @.country in ("France", "Germany") ) @.locations?( !(@.country in ("France", "Germany")) ) @.locations?( exists(@.country) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-nested-clause-instead-json_table-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-nested-clause-instead-json_table.html SELECT id, requestor, type, "number" FROM j_purchaseorder NESTED data COLUMNS (Requestor, NESTED ShippingInstructions.Phone[*] COLUMNS (type, "number")); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/sql-nested-clause-instead-json_table-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/sql-nested-clause-instead-json_table.html SELECT * FROM j_purchaseorder NESTED data.ShippingInstructions.Phone[*] COLUMNS (type, "number") ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/tables-json-columns-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/tables-json-columns.html CREATE TABLE j_purchaseorder (id VARCHAR2 (32) NOT NULL PRIMARY KEY, date_loaded TIMESTAMP (6) WITH TIME ZONE, data JSON); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/tables-json-columns-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/tables-json-columns.html CREATE TABLE j_purchaseorder (id VARCHAR2 (32) NOT NULL PRIMARY KEY, date_loaded TIMESTAMP (6) WITH TIME ZONE, data VARCHAR2 (23767) CONSTRAINT ensure_json CHECK (data is json)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/tables-json-columns-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/tables-json-columns.html INSERT INTO j_purchaseorder VALUES ( SYS_GUID(), to_date('30-DEC-2014'), '{"PONumber" : 1600, "Reference" : "ABULL-20140421", "Requestor" : "Alexis Bull", "User" : "ABULL", "CostCenter" : "A50", "ShippingInstructions" : {"name" : "Alexis Bull", "Address" : {"street" : "200 Sporting Green", "city" : "South San Francisco", "state" : "CA", "zipCode" : 99236, "country" : "United States of America"}, "Phone" : [{"type" : "Office", "number" : "909-555-7307"}, {"type" : "Mobile", "number" : "415-555-1234"}]}, "Special Instructions" : null, "AllowPartialShipment" : true, "LineItems" : [{"ItemNumber" : 1, "Part" : {"Description" : "One Magic Christmas", "UnitPrice" : 19.95, "UPCCode" : 13131092899}, "Quantity" : 9.0}, {"ItemNumber" : 2, "Part" : {"Description" : "Lethal Weapon", "UnitPrice" : 19.95, "UPCCode" : 85391628927}, "Quantity" : 5.0}]}'); INSERT INTO j_purchaseorder VALUES ( SYS_GUID(), to_date('30-DEC-2014'), '{"PONumber" : 672, "Reference" : "SBELL-20141017", "Requestor" : "Sarah Bell", "User" : "SBELL", "CostCenter" : "A50", "ShippingInstructions" : {"name" : "Sarah Bell", "Address" : {"street" : "200 Sporting Green", "city" : "South San Francisco", "state" : "CA", "zipCode" : 99236, "country" : "United States of America"}, "Phone" : "983-555-6509"}, "Special Instructions" : "Courier", "LineItems" : [{"ItemNumber" : 1, "Part" : {"Description" : "Making the Grade", "UnitPrice" : 20, "UPCCode" : 27616867759}, "Quantity" : 8.0}, {"ItemNumber" : 2, "Part" : {"Description" : "Nixon", "UnitPrice" : 19.95, "UPCCode" : 717951002396}, "Quantity" : 5}, {"ItemNumber" : 3, "Part" : {"Description" : "Eric Clapton: Best Of 1981-1999", "UnitPrice" : 19.95, "UPCCode" : 75993851120}, "Quantity" : 5.0}]}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/tables-json-columns-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/tables-json-columns.html CREATE TABLE j_purchaseorder (id VARCHAR2 (32) NOT NULL PRIMARY KEY, date_loaded TIMESTAMP (6) WITH TIME ZONE, data JSON (OBJECT)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/type-clause-sql-functions-and-conditions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/type-clause-sql-functions-and-conditions.html ALTER SESSION SET JSON_BEHAVIOR= "lax_json_value:false;lax_json_query:false;lax_json_table:false;lax_json_exists:false"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/type-clause-sql-functions-and-conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/type-clause-sql-functions-and-conditions.html SELECT json_value('{"a" : "42"}', '$.a' RETURNING NUMBER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/type-clause-sql-functions-and-conditions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/type-clause-sql-functions-and-conditions.html SELECT jt.* FROM json_table('{"a" : 314, "b" : "42"}', '$' COLUMNS (a NUMBER PATH '$.a', b NUMBER PATH '$.b')) jt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/type-clause-sql-functions-and-conditions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/type-clause-sql-functions-and-conditions.html SELECT json_query('{"a" : [ 314, "42", "alpha" ]}', '$.a?(@ == 42)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/type-clause-sql-functions-and-conditions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/type-clause-sql-functions-and-conditions.html SELECT json_exists('{"a" : {"b" : "42"}}', '$.a?(@.b in (42, 314))'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/type-clause-sql-functions-and-conditions-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/type-clause-sql-functions-and-conditions.html SELECT json_transform('{"a" : "42"}', INSERT '$.b' = PATH '$?(@.a > 0).a + 1'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/type-clause-sql-functions-and-conditions-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/type-clause-sql-functions-and-conditions.html SELECT json_transform('{"a" : "42"}', INSERT '$.b' = PATH '$?(@.a > 0).a + 1' TYPE(LAX)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/types-filter-condition-comparisons-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/types-filter-condition-comparisons.html SELECT * FROM emp t WHERE t.data.dept = 'SALES' ORDER BY t.data.name ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/use-bind-variables-json_transform-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/use-bind-variables-json_transform.html CREATE JSON COLLECTION TABLE customers; INSERT INTO customers VALUES ('{"_id" : 1234, "name" : "Jane Doe", "email" : "jane@example.com", "tags" : [ "newsletter" ], "status" : "gold", "joined" : "2024"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/use-bind-variables-json_transform-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/use-bind-variables-json_transform.html UPDATE customers c SET c.data = json_transform(c.data, APPEND '$?(@status == "gold").tags' = 'free shipping') WHERE json_exists(c.data, '$?(@joined < 2025)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/use-bind-variables-json_transform-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/use-bind-variables-json_transform.html VAR status VARCHAR2(20); VAR tag VARCHAR2(20); VAR year NUMBER; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-filters-json_exists-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-filters-json_exists.html SELECT po.data FROM j_purchaseorder po WHERE json_exists(po.data, '$.LineItems.Part.UPCCode'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-filters-json_exists-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-filters-json_exists.html SELECT po.data FROM j_purchaseorder po WHERE json_exists(po.data, '$?(@.LineItems.Part.UPCCode == 85391628927)'); SELECT po.data FROM j_purchaseorder po WHERE json_exists(po.data, '$.LineItems?(@.Part.UPCCode == 85391628927)'); SELECT po.data FROM j_purchaseorder po WHERE json_exists(po.data, '$.LineItems.Part?(@.UPCCode == 85391628927)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-filters-json_exists-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-filters-json_exists.html SELECT po.data FROM j_purchaseorder po WHERE json_exists(po.data, '$?(@.LineItems.Part.UPCCode == 85391628927 && @.LineItems.Quantity > 3)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-filters-json_exists-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-filters-json_exists.html SELECT po.data FROM j_purchaseorder po WHERE json_exists(po.data, '$.LineItems[*]?(@.Part.UPCCode == 85391628927 && @.Quantity > 3)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-filters-json_exists-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-filters-json_exists.html SELECT po.data FROM j_purchaseorder po WHERE json_exists(po.data, '$?(@.User == "ABULL" && exists(@.LineItems[*]?( @.Part.UPCCode == 85391628927 && @.Quantity > 3)))'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-geojson-geographic-data-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-geojson-geographic-data.html CREATE TABLE j_geo (id VARCHAR2 (32) NOT NULL, geo_doc VARCHAR2 (4000) CHECK (geo_doc is json)); INSERT INTO j_geo VALUES (1, '{"type" : "FeatureCollection", "features" : [{"type" : "Feature", "geometry" : {"type" : "Point", "coordinates" : [-122.236111, 37.482778]}, "properties" : {"Name" : "Redwood City"}}, {"type" : "Feature", "geometry" : {"type" : "LineString", "coordinates" : [[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]]}, "properties" : {"prop0" : "value0", "prop1" : 0.0}}, {"type" : "Feature", "geometry" : {"type" : "Polygon", "coordinates" : [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}, "properties" : {"prop0" : "value0", "prop1" : {"this" : "that"}}}]}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-geojson-geographic-data-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-geojson-geographic-data.html SELECT json_value(geo_doc, '$.features[0].geometry' RETURNING SDO_GEOMETRY ERROR ON ERROR) FROM j_geo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-geojson-geographic-data-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-geojson-geographic-data.html SELECT jt.* FROM j_geo, json_table(geo_doc, '$.features[*]' COLUMNS (sdo_val SDO_GEOMETRY PATH '$.geometry')) jt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-geojson-geographic-data-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-geojson-geographic-data.html CREATE INDEX geo_first_feature_idx ON j_geo (json_value(geo_doc, '$.features[0].geometry' RETURNING SDO_GEOMETRY)) INDEXTYPE IS MDSYS.SPATIAL_INDEX; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-geojson-geographic-data-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-geojson-geographic-data.html SELECT id, json_value(geo_doc, '$.features[0].properties.Name') "Name", SDO_GEOM.sdo_distance( json_value(geo_doc, '$.features[0].geometry' RETURNING SDO_GEOMETRY), SDO_GEOMETRY(2001, 4326, SDO_POINT_TYPE(-122.416667, 37.783333, NULL), NULL, NULL), 100, -- Tolerance in meters 'unit=KM') "Distance in kilometers" FROM j_geo WHERE sdo_within_distance( json_value(geo_doc, '$.features[0].geometry' RETURNING SDO_GEOMETRY), SDO_GEOMETRY(2001, 4326, SDO_POINT_TYPE(-122.416667, 37.783333, NULL), NULL, NULL), 'distance=100 unit=KM') = 'TRUE'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-json_table-json-arrays-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-json_table-json-arrays.html SELECT jt.* FROM j_purchaseorder, json_table(data, '$' COLUMNS (requestor VARCHAR2(32 CHAR) PATH '$.Requestor', ph_arr VARCHAR2(100 CHAR) FORMAT JSON PATH '$.ShippingInstructions.Phone') ) AS "JT"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-json_table-json-arrays-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-json_table-json-arrays.html SELECT jt.* FROM j_purchaseorder, json_table(data, '$.ShippingInstructions.Phone[*]' COLUMNS (phone_type VARCHAR2(10) PATH '$.type', phone_num VARCHAR2(20) PATH '$.number')) AS "JT"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-json_table-json-arrays-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-json_table-json-arrays.html SELECT jt.* FROM j_purchaseorder, json_table(data, '$' COLUMNS ( requestor VARCHAR2(32 CHAR) PATH '$.Requestor', phone_type VARCHAR2(50 CHAR) FORMAT JSON WITH WRAPPER PATH '$.ShippingInstructions.Phone[*].type', phone_num VARCHAR2(50 CHAR) FORMAT JSON WITH WRAPPER PATH '$.ShippingInstructions.Phone[*].number')) AS "JT"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-json_table-json-arrays-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-json_table-json-arrays.html SELECT jt.* FROM j_purchaseorder po, json_table(po.data, '$' COLUMNS (Requestor VARCHAR2(4000) PATH '$.Requestor', NESTED PATH '$.ShippingInstructions.Phone[*]' COLUMNS (type VARCHAR2(4000) PATH '$.type', "number" VARCHAR2(4000) PATH '$.number')) ) AS "JT"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-json_value-function-based-index-json_exists-queries-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-json_value-function-based-index-json_exists-queries.html SELECT count(*) FROM j_purchaseorder WHERE json_exists(data, '$.PONumber?(@ > 1500)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-json_value-function-based-index-json_exists-queries-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-json_value-function-based-index-json_exists-queries.html SELECT count(*) FROM j_purchaseorder WHERE json_exists(data, '$.PONumber?(@ > $d)' PASSING 1500 AS "d"); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-json_value-function-based-index-json_exists-queries-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-json_value-function-based-index-json_exists-queries.html SELECT count(*) FROM j_purchaseorder WHERE json_exists(data, '$.PONumber?(@.number() > $d)' PASSING 1500 AS "d"); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-json_value-function-based-index-json_exists-queries-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-json_value-function-based-index-json_exists-queries.html SELECT count(*) FROM j_purchaseorder WHERE json_exists(data, '$?(@.PONumber > 1500 && @.Reference == "ABULL-20140421")'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-json_value-function-based-index-json_table-queries-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-json_value-function-based-index-json_table-queries.html SELECT jt.* FROM j_purchaseorder po, json_table(po.data, '$' COLUMNS po_number NUMBER(5) PATH '$.PONumber', reference VARCHAR2(30 CHAR) PATH '$.Reference', requestor VARCHAR2(32 CHAR) PATH '$.Requestor', userid VARCHAR2(10 CHAR) PATH '$.User', costcenter VARCHAR2(16 CHAR) PATH '$.CostCenter') jt WHERE po_number = 1600; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-multivalue-function-based-index-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-multivalue-function-based-index.html SELECT count(*) FROM parts_tab WHERE json_exists(jparts, '$.parts.subparts?(@.numberOnly() == 730)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-multivalue-function-based-index-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-multivalue-function-based-index.html SELECT count(*) FROM parts_tab t WHERE json_exists(jparts, '$.parts.subparts?(@.number() == 730)'); SELECT count(*) FROM parts_tab t WHERE json_exists(jparts, '$.parts.subparts?(@ == 730)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-multivalue-function-based-index-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-multivalue-function-based-index.html SELECT a FROM parts_tab WHERE json_exists(jparts,'$.parts[*]?(@.partno == 4 && @.subparts == 730)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-multivalue-function-based-index-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-multivalue-function-based-index.html SELECT a FROM parts_tab WHERE json_exists(jparts,'$.parts[*]?(@.partno == 4 && @.subparts[1] == 730)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-online-redefinition-migrate-json-data-type-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-online-redefinition-migrate-json-data-type.html EXEC DBMS_REDEFINITION.can_redef_table('table_owner', 'j_purchaseorder'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-online-redefinition-migrate-json-data-type-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-online-redefinition-migrate-json-data-type.html CREATE TABLE j_purchaseorder_new (id VARCHAR2(32), date_loaded TIMESTAMP(6) WITH TIME ZONE, data JSON); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-online-redefinition-migrate-json-data-type-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-online-redefinition-migrate-json-data-type.html ALTER TABLE j_purchaseorder_new ADD (vc_user GENERATED ALWAYS AS (json_value(data, '$.User' RETURNING VARCHAR2(20)))); ALTER TABLE j_purchaseorder_new ADD (vc_costcenter GENERATED ALWAYS AS (json_value(data, '$.CostCenter' RETURNING VARCHAR2(6)))); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-online-redefinition-migrate-json-data-type-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-online-redefinition-migrate-json-data-type.html BEGIN DBMS_REDEFINITION.start_redef_table('table_owner', 'j_purchaseorder', 'j_purchaseorder_new', 'ID ID, DATE_LOADED DATE_LOADED, JSON(DATA) PO_DOCUMENT', REFRESH_DEP_MVIEWS => 'Y', ENABLE_ROLLBACK => FALSE); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-online-redefinition-migrate-json-data-type-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-online-redefinition-migrate-json-data-type.html DECLARE n_errors INTEGER; BEGIN DBMS_REDEFINITION.copy_table_dependents('table_owner', 'j_purchaseorder', 'j_purchaseorder_new', NUM_ERRORS => n_errors, IGNORE_ERRORS => FALSE); DBMS_OUTPUT.put_line(n_errors); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-online-redefinition-migrate-json-data-type-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-online-redefinition-migrate-json-data-type.html BEGIN DBMS_REDEFINITION.finish_redef_table('table_owner', 'j_purchaseorder', 'j_purchaseorder_new', DML_LOCK_TIMEOUT => 0); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-oracle-data-pump-migrate-json-data-type-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-oracle-data-pump-migrate-json-data-type.html CREATE TABLE j_purchaseorder_new (id VARCHAR2(32), date_loaded TIMESTAMP(6) WITH TIME ZONE, data JSON); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-pl-sql-object-types-json-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-pl-sql-object-types-json.html DECLARE je JSON_ELEMENT_T; jo JSON_OBJECT_T; BEGIN je := JSON_ELEMENT_T.parse('{"name":"Radio controlled plane"}'); IF (je.is_Object) THEN jo := treat(je AS JSON_OBJECT_T); jo.put('price', 149.99); END IF; DBMS_OUTPUT.put_line(je.to_string); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-pl-sql-object-types-json-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-pl-sql-object-types-json.html DECLARE jo JSON_OBJECT_T; ja JSON_ARRAY_T; keys JSON_KEY_LIST; keys_string VARCHAR2(100); BEGIN ja := new JSON_ARRAY_T; jo := JSON_OBJECT_T.parse('{"name":"Beda", "jobTitle":"codmonki", "projects":[ "json", "xml" ]}'); keys := jo.get_keys; FOR i IN 1..keys.COUNT LOOP ja.append(keys(i)); END LOOP; keys_string := ja.to_string; DBMS_OUTPUT.put_line(keys_string); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-pl-sql-object-types-json-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-pl-sql-object-types-json.html CREATE OR REPLACE FUNCTION add_totals(purchaseOrder IN VARCHAR2) RETURN VARCHAR2 IS po_obj JSON_OBJECT_T; li_arr JSON_ARRAY_T; li_item JSON_ELEMENT_T; li_obj JSON_OBJECT_T; unitPrice NUMBER; quantity NUMBER; totalPrice NUMBER := 0; totalQuantity NUMBER := 0; BEGIN po_obj := JSON_OBJECT_T.parse(purchaseOrder); li_arr := po_obj.get_Array('LineItems'); FOR i IN 0 .. li_arr.get_size - 1 LOOP li_obj := JSON_OBJECT_T(li_arr.get(i)); quantity := li_obj.get_Number('Quantity'); unitPrice := li_obj.get_Object('Part').get_Number('UnitPrice'); totalPrice := totalPrice + (quantity * unitPrice); totalQuantity := totalQuantity + quantity; END LOOP; po_obj.put('totalQuantity', totalQuantity); po_obj.put('totalPrice', totalPrice); RETURN po_obj.to_string; END; / SELECT data FROM j_purchaseorder po WHERE po.data.PONumber = 1600; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-sql-json-function-json_value-boolean-json-value-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-sql-json-function-json_value-boolean-json-value.html SELECT json_value(data, '$.AllowPartialShipment') FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-sql-json-function-json_value-boolean-json-value-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-sql-json-function-json_value-boolean-json-value.html SELECT json_value(data, '$.AllowPartialShipment' RETURNING BOOLEAN) FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/adjsn/using-sql-json-function-json_value-boolean-json-value-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/using-sql-json-function-json_value-boolean-json-value.html SELECT json_value(data, '$.AllowPartialShipment' RETURNING NUMBER ALLOW BOOLEAN TO NUMBER CONVERSION) FROM j_purchaseorder; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-FUNCTION-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-FUNCTION-statement.html ALTER FUNCTION oe.get_bal COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-LIBRARY-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-LIBRARY-statement.html ALTER LIBRARY IF EXISTS hr.my_ext_lib COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-PACKAGE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-PACKAGE-statement.html ALTER PACKAGE emp_mgmt COMPILE PACKAGE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-PACKAGE-statement-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-PACKAGE-statement.html ALTER PACKAGE hr.emp_mgmt COMPILE BODY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-PROCEDURE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-PROCEDURE-statement.html ALTER PROCEDURE IF EXISTS hr.remove_emp COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TRIGGER-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TRIGGER-statement.html ALTER TRIGGER update_job_history DISABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TRIGGER-statement-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TRIGGER-statement.html ALTER TRIGGER update_job_history ENABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html SELECT Version# FROM DBA_TYPE_VERSIONS WHERE Owner = schema AND Name = 'type_name' AND Type = 'TYPE' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html ALTER TYPE data_typ1 ADD MEMBER FUNCTION qtr(der_qtr DATE) RETURN CHAR CASCADE; CREATE OR REPLACE TYPE BODY data_typ1 IS MEMBER FUNCTION prod (invent NUMBER) RETURN NUMBER IS BEGIN RETURN (year + invent); END; MEMBER FUNCTION qtr(der_qtr DATE) RETURN CHAR IS BEGIN IF (der_qtr < TO_DATE('01-APR', 'DD-MON')) THEN RETURN 'FIRST'; ELSIF (der_qtr < TO_DATE('01-JUL', 'DD-MON')) THEN RETURN 'SECOND'; ELSIF (der_qtr < TO_DATE('01-OCT', 'DD-MON')) THEN RETURN 'THIRD'; ELSE RETURN 'FOURTH'; END IF; END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html create type Usr.My_ADT authid Definer is object(a1 number) -- Show version number of ADT: select Version#||Chr(10)||Text t from DBA_Type_Versions where Owner = 'USR' and Type_Name = 'MY_ADT' / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html type My_ADT authid Definer is object(a1 number) select Version#||Chr(10)||Text t from DBA_Type_Versions where Owner = 'USR' and Type_Name = 'MY_ADT' / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html type My_ADT authid Definer is object(a1 number) type My_ADT authid Definer is object(a1 number) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html select Version#||Chr(10)||Text t from DBA_Type_Versions where Owner = 'USR' and Type_Name = 'MY_ADT' / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html type My_ADT authid Definer is object(a1 number) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html CREATE TABLE text ( doc_id NUMBER, description textdoc_tab) NESTED TABLE description STORE AS text_store; ALTER TYPE textdoc_typ ADD ATTRIBUTE (author VARCHAR2) CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html ALTER TYPE phone_list_typ_demo MODIFY LIMIT 10 CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html ALTER TYPE phone_list_typ MODIFY ELEMENT TYPE VARCHAR(64) CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html ALTER TYPE cust_address_typ2 COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html CREATE TYPE link1 AS OBJECT (a NUMBER); / CREATE TYPE link2 AS OBJECT (a NUMBER, b link1, MEMBER FUNCTION p(c1 NUMBER) RETURN NUMBER); / CREATE TYPE BODY link2 AS MEMBER FUNCTION p(c1 NUMBER) RETURN NUMBER IS BEGIN dbms_output.put_line(c1); RETURN c1; END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html ALTER TYPE link1 ADD ATTRIBUTE (b NUMBER) INVALIDATE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html ALTER TYPE link2 COMPILE SPECIFICATION; ALTER TYPE link2 COMPILE BODY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/ALTER-TYPE-statement-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/ALTER-TYPE-statement.html ALTER TYPE link2 COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CONTINUE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CONTINUE-statement.html DECLARE x NUMBER := 0; BEGIN LOOP -- After CONTINUE statement, control resumes here DBMS_OUTPUT.PUT_LINE ('Inside loop: x = ' || TO_CHAR(x)); x := x + 1; IF x < 3 THEN CONTINUE; END IF; DBMS_OUTPUT.PUT_LINE ('Inside loop, after CONTINUE: x = ' || TO_CHAR(x)); EXIT WHEN x = 5; END LOOP; DBMS_OUTPUT.PUT_LINE (' After loop: x = ' || TO_CHAR(x)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CONTINUE-statement-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CONTINUE-statement.html DECLARE x NUMBER := 0; BEGIN LOOP -- After CONTINUE statement, control resumes here DBMS_OUTPUT.PUT_LINE ('Inside loop: x = ' || TO_CHAR(x)); x := x + 1; CONTINUE WHEN x < 3; DBMS_OUTPUT.PUT_LINE ('Inside loop, after CONTINUE: x = ' || TO_CHAR(x)); EXIT WHEN x = 5; END LOOP; DBMS_OUTPUT.PUT_LINE (' After loop: x = ' || TO_CHAR(x)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/COVERAGE-pragma-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/COVERAGE-pragma.html CREATE OR REPLACE PROCEDURE outer IS PRAGMA COVERAGE ('NOT_FEASIBLE_START'); x NUMBER := 7; PROCEDURE inner IS BEGIN IF x < 6 THEN x := 19; ELSE PRAGMA COVERAGE ('NOT_FEASIBLE'); -- 1 x := 203; END IF; END; BEGIN DBMS_OUTPUT.PUT_LINE ('X= '); PRAGMA COVERAGE ('NOT_FEASIBLE_END'); DBMS_OUTPUT.PUT_LINE (x); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-FUNCTION-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-FUNCTION-statement.html CREATE FUNCTION IF NOT EXISTS get_bal(acc_no IN NUMBER) RETURN NUMBER IS acc_bal NUMBER(11,2); BEGIN SELECT order_total INTO acc_bal FROM orders WHERE customer_id = acc_no; RETURN(acc_bal); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-FUNCTION-statement-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-FUNCTION-statement.html SELECT get_bal(165) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-FUNCTION-statement-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-FUNCTION-statement.html CREATE FUNCTION SecondMax (input NUMBER) RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SecondMaxImpl; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-FUNCTION-statement-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-FUNCTION-statement.html SELECT SecondMax(salary) "SecondMax", department_id FROM employees GROUP BY department_id HAVING SecondMax(salary) > 9000 ORDER BY "SecondMax", department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-FUNCTION-statement-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-FUNCTION-statement.html CREATE OR REPLACE FUNCTION text_length(a CLOB) RETURN NUMBER DETERMINISTIC IS BEGIN RETURN DBMS_LOB.GETLENGTH(a); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-FUNCTION-statement-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-FUNCTION-statement.html CREATE OR REPLACE FUNCTION hello_inline( "who" VARCHAR2 ) RETURN VARCHAR2 AS MLE LANGUAGE JAVASCRIPT {{ return `Hello, ${who}`; }}; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-FUNCTION-statement-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-FUNCTION-statement.html BEGIN DBMS_OUTPUT.PUT_LINE(hello_inline('Jane')); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-FUNCTION-statement-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-FUNCTION-statement.html CREATE OR REPLACE MLE MODULE hello_mod LANGUAGE JAVASCRIPT AS export function hello(who){ return `Hello, ${who}`; } / CREATE OR REPLACE FUNCTION hello( "p_who" VARCHAR2 ) RETURN VARCHAR2 AS MLE MODULE hello_mod SIGNATURE 'hello'; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-FUNCTION-statement-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-FUNCTION-statement.html BEGIN DBMS_OUTPUT.PUT_LINE(hello('Emma')); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-LIBRARY-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-LIBRARY-statement.html CREATE LIBRARY IF NOT EXISTS ext_lib AS 'ddl_1' IN ddl_dir; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-LIBRARY-statement-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-LIBRARY-statement.html CREATE OR REPLACE LIBRARY ext_lib AS 'ddl_1' IN ddl_dir CREDENTIAL ddl_cred; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-LIBRARY-statement-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-LIBRARY-statement.html CREATE LIBRARY ext_lib AS '/OR/lib/ext_lib.so'; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-LIBRARY-statement-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-LIBRARY-statement.html CREATE OR REPLACE LIBRARY ext_lib IS '/OR/newlib/ext_lib.so'; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-LIBRARY-statement-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-LIBRARY-statement.html CREATE LIBRARY app_lib as '${ORACLE_HOME}/lib/app_lib.so' AGENT 'sales.hq.example.com'; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-PACKAGE-BODY-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-PACKAGE-BODY-statement.html CREATE OR REPLACE PACKAGE BODY emp_mgmt AS tot_emps NUMBER; tot_depts NUMBER; FUNCTION hire (last_name VARCHAR2, job_id VARCHAR2, manager_id NUMBER, salary NUMBER, commission_pct NUMBER, department_id NUMBER) RETURN NUMBER IS new_empno NUMBER; BEGIN SELECT employees_seq.NEXTVAL INTO new_empno FROM DUAL; INSERT INTO employees VALUES (new_empno, 'First', 'Last','first.example@example.com', '(415)555-0100', TO_DATE('18-JUN-2002','DD-MON-YYYY'), 'IT_PROG',90000000,00, 100,110); tot_emps := tot_emps + 1; RETURN(new_empno); END; FUNCTION create_dept(department_id NUMBER, location_id NUMBER) RETURN NUMBER IS new_deptno NUMBER; BEGIN SELECT departments_seq.NEXTVAL INTO new_deptno FROM dual; INSERT INTO departments VALUES (new_deptno, 'department name', 100, 1700); tot_depts := tot_depts + 1; RETURN(new_deptno); END; PROCEDURE remove_emp (employee_id NUMBER) IS BEGIN DELETE FROM employees WHERE employees.employee_id = remove_emp.employee_id; tot_emps := tot_emps - 1; END; PROCEDURE remove_dept(department_id NUMBER) IS BEGIN DELETE FROM departments WHERE departments.department_id = remove_dept.department_id; tot_depts := tot_depts - 1; SELECT COUNT(*) INTO tot_emps FROM employees; END; PROCEDURE increase_sal(employee_id NUMBER, salary_incr NUMBER) IS curr_sal NUMBER; BEGIN SELECT salary INTO curr_sal FROM employees WHERE employees.employee_id = increase_sal.employee_id; IF curr_sal IS NULL THEN RAISE no_sal; ELSE UPDATE employees SET salary = salary + salary_incr WHERE employee_id = employee_id; END IF; END; PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER) IS curr_comm NUMBER; BEGIN SELECT commission_pct INTO curr_comm FROM employees WHERE employees.employee_id = increase_comm.employee_id; IF curr_comm IS NULL THEN RAISE no_comm; ELSE UPDATE employees SET commission_pct = commission_pct + comm_incr; END IF; END; END emp_mgmt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-PACKAGE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-PACKAGE-statement.html CREATE PACKAGE IF NOT EXISTS emp_mgmt AS FUNCTION hire (last_name VARCHAR2, job_id VARCHAR2, manager_id NUMBER, salary NUMBER, commission_pct NUMBER, department_id NUMBER) RETURN NUMBER; FUNCTION create_dept(department_id NUMBER, location_id NUMBER) RETURN NUMBER; PROCEDURE remove_emp(employee_id NUMBER); PROCEDURE remove_dept(department_id NUMBER); PROCEDURE increase_sal(employee_id NUMBER, salary_incr NUMBER); PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER); no_comm EXCEPTION; no_sal EXCEPTION; END emp_mgmt; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-PROCEDURE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-PROCEDURE-statement.html CREATE PROCEDURE IF NOT EXISTS remove_emp (employee_id NUMBER) AS tot_emps NUMBER; BEGIN DELETE FROM employees WHERE employees.employee_id = remove_emp.employee_id; tot_emps := tot_emps - 1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-PROCEDURE-statement-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-PROCEDURE-statement.html CREATE PROCEDURE find_root ( x IN REAL ) IS LANGUAGE C NAME c_find_root LIBRARY c_utils PARAMETERS ( x BY REFERENCE ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-PROCEDURE-statement-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-PROCEDURE-statement.html CREATE OR REPLACE PROCEDURE hello_inline( "who" VARCHAR2 ) AS MLE LANGUAGE JAVASCRIPT {{ console.log(`Hello, ${who}`); }}; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-PROCEDURE-statement-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-PROCEDURE-statement.html EXEC hello_inline('Angela'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-PROCEDURE-statement-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-PROCEDURE-statement.html CREATE OR REPLACE MLE MODULE hello_mod LANGUAGE JAVASCRIPT AS export function hello(who){ console.log(`Hello, ${who}`); } / CREATE OR REPLACE PROCEDURE hello( "p_who" VARCHAR2 ) AS MLE MODULE hello_mod SIGNATURE 'hello'; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-PROCEDURE-statement-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-PROCEDURE-statement.html EXEC hello('Chris'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE customer_typ_demo AS OBJECT ( customer_id NUMBER(6) , cust_first_name VARCHAR2(20) , cust_last_name VARCHAR2(20) , cust_address CUST_ADDRESS_TYP , phone_numbers PHONE_LIST_TYP , nls_language VARCHAR2(3) , nls_territory VARCHAR2(30) , credit_limit NUMBER(9,2) , cust_email VARCHAR2(30) , cust_orders ORDER_LIST_TYP ) ; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE data_typ1 AS OBJECT ( year NUMBER, MEMBER FUNCTION prod(invent NUMBER) RETURN NUMBER ); / CREATE TYPE BODY data_typ1 IS MEMBER FUNCTION prod (invent NUMBER) RETURN NUMBER IS BEGIN RETURN (year + invent); END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE demo_typ1 AS OBJECT (a1 NUMBER, a2 NUMBER); / CREATE TABLE demo_tab1 (b1 NUMBER, b2 demo_typ1); INSERT INTO demo_tab1 VALUES (1, demo_typ1(2,3)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE demo_typ2 AS OBJECT (a1 NUMBER, MEMBER FUNCTION get_square RETURN NUMBER); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TABLE demo_tab2(col demo_typ2); INSERT INTO demo_tab2 VALUES (demo_typ2(2)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE BODY demo_typ2 IS MEMBER FUNCTION get_square RETURN NUMBER IS x NUMBER; BEGIN SELECT c.col.a1*c.col.a1 INTO x FROM demo_tab2 c; RETURN (x); END; END; / SELECT t.col.get_square() FROM demo_tab2 t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE OR REPLACE TYPE department_t AS OBJECT ( deptno number(10), dname CHAR(30)); / CREATE OR REPLACE TYPE employee_t AS OBJECT( empid RAW(16), ename CHAR(31), dept REF department_t, STATIC function construct_emp (name VARCHAR2, dept REF department_t) RETURN employee_t ); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE OR REPLACE TYPE BODY employee_t IS STATIC FUNCTION construct_emp (name varchar2, dept REF department_t) RETURN employee_t IS BEGIN return employee_t(SYS_GUID(),name,dept); END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TABLE emptab OF employee_t; INSERT INTO emptab VALUES (employee_t.construct_emp('John Smith', NULL)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE corporate_customer_typ_demo UNDER customer_typ ( account_mgr_id NUMBER(6) ); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE person_t AS OBJECT (name VARCHAR2(100), ssn NUMBER) NOT FINAL; / CREATE TYPE employee_t UNDER person_t (department_id NUMBER, salary NUMBER) NOT FINAL; / CREATE TYPE part_time_emp_t UNDER employee_t (num_hrs NUMBER); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE phone_list_typ_demo AS VARRAY(5) OF VARCHAR2(25); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE plsint AS OBJECT (I PLS_INTEGER) NOT PERSISTABLE; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE tab_plsint AS TABLE OF (PLS_INTEGER) NOT PERSISTABLE; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE textdoc_typ AS OBJECT ( document_typ VARCHAR2(32) , formatted_doc BLOB ) ; / CREATE TYPE textdoc_tab AS TABLE OF textdoc_typ; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/CREATE-TYPE-statement-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/CREATE-TYPE-statement.html CREATE TYPE cust_address_typ2 AS OBJECT ( street_address VARCHAR2(40) , postal_code VARCHAR2(10) , city VARCHAR2(30) , state_province VARCHAR2(10) , country_id CHAR(2) , phone phone_list_typ_demo ); / CREATE TYPE cust_nt_address_typ AS TABLE OF cust_address_typ2; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html ALTER SESSION SET PLSQL_WARNINGS='ENABLE:(6019,6020,6021,6022)'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html CREATE PACKAGE pack1 AS PRAGMA DEPRECATE(pack1); PROCEDURE foo; PROCEDURE bar; END pack1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html CREATE PACKAGE trans_data AUTHID DEFINER AS TYPE Transrec IS RECORD ( accounttype VARCHAR2(30) , ownername VARCHAR2(30) , balance REAL ); min_balance constant real := 10.0; PRAGMA DEPRECATE(min_balance , 'Minimum balance requirement has been removed.'); insufficient_funds EXCEPTION; PRAGMA DEPRECATE (insufficient_funds , 'Exception no longer raised.'); END trans_data; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html CREATE PACKAGE pack11 AUTHID DEFINER AS $IF DBMS_DB_VERSION.VER_LE_11 $THEN PROCEDURE proc1; $ELSE PROCEDURE proc1; PRAGMA DEPRECATE(proc1); $END PROCEDURE proc2; PROCEDURE proc3; END pack11; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html TYPE type15_basetype AS OBJECT ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html CREATE PACKAGE pack5 AUTHID DEFINER AS PRAGMA DEPRECATE(pack5 , 'Package pack5 has been deprecated, use new_pack5 instead.'); PROCEDURE foo; PROCEDURE bar; END pack5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html CREATE PACKAGE pkg13 AS PRAGMA DEPRECATE ('pkg13', 'Package pkg13 is deprecated, use pkg03'); Y NUMBER; END pkg13; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html CREATE PACKAGE pkg17 IS PRAGMA DEPRECATE ("pkg17"); END pkg17; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html CREATE PACKAGE pack7 AUTHID DEFINER AS PROCEDURE foo; PRAGMA DEPRECATE (foo, 'pack7.foo is deprecated, use pack7.bar instead.'); PROCEDURE bar; END pack7; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DEPRECATE-pragma-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DEPRECATE-pragma.html CREATE PACKAGE pack2 AS PROCEDURE proc1(n1 NUMBER, n2 NUMBER, n3 NUMBER); -- Only the overloaded procedure with 2 arguments is deprecated PROCEDURE proc1(n1 NUMBER, n2 NUMBER); PRAGMA DEPRECATE(proc1); END pack2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DROP-FUNCTION-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DROP-FUNCTION-statement.html DROP FUNCTION IF EXISTS oe.SecondMax; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DROP-LIBRARY-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DROP-LIBRARY-statement.html DROP LIBRARY IF EXISTS ext_lib; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DROP-PACKAGE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DROP-PACKAGE-statement.html DROP PACKAGE emp_mgmt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DROP-PROCEDURE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DROP-PROCEDURE-statement.html DROP PROCEDURE IF EXISTS hr.remove_emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DROP-TRIGGER-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DROP-TRIGGER-statement.html DROP TRIGGER hr.salary_check; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DROP-TYPE-BODY-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DROP-TYPE-BODY-statement.html DROP TYPE BODY data_typ1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/DROP-TYPE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/DROP-TYPE-statement.html DROP TYPE IF EXISTS person_t FORCE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/EXECUTE-IMMEDIATE-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/EXECUTE-IMMEDIATE-statement.html EXECUTE IMMEDIATE 'SELECT S.NEXTVAL FROM DUAL' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/EXIT-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/EXIT-statement.html DECLARE x NUMBER := 0; BEGIN LOOP DBMS_OUTPUT.PUT_LINE ('Inside loop: x = ' || TO_CHAR(x)); x := x + 1; IF x > 3 THEN EXIT; END IF; END LOOP; -- After EXIT, control resumes here DBMS_OUTPUT.PUT_LINE(' After loop: x = ' || TO_CHAR(x)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/EXIT-statement-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/EXIT-statement.html DECLARE x NUMBER := 0; BEGIN LOOP DBMS_OUTPUT.PUT_LINE('Inside loop: x = ' || TO_CHAR(x)); x := x + 1; -- prevents infinite loop EXIT WHEN x > 3; END LOOP; -- After EXIT statement, control resumes here DBMS_OUTPUT.PUT_LINE('After loop: x = ' || TO_CHAR(x)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/FOR-LOOP-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/FOR-LOOP-statement.html DECLARE v_employees employees%ROWTYPE; CURSOR c1 is SELECT * FROM employees; BEGIN OPEN c1; -- Fetch entire row into v_employees record: FOR i IN 1..10 LOOP FETCH c1 INTO v_employees; EXIT WHEN c1%NOTFOUND; -- Process data here END LOOP; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/FOR-LOOP-statement-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/FOR-LOOP-statement.html DECLARE v_employees employees%ROWTYPE; CURSOR c1 is SELECT * FROM employees; BEGIN OPEN c1; -- Fetch entire row into v_employees record: <> FOR i IN 1..10 LOOP -- Process data here FOR j IN 1..10 LOOP FETCH c1 INTO v_employees; EXIT outer_loop WHEN c1%NOTFOUND; -- Process data here END LOOP; END LOOP outer_loop; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/FOR-LOOP-statement-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/FOR-LOOP-statement.html DECLARE v_employees employees%ROWTYPE; CURSOR c1 is SELECT * FROM employees; BEGIN OPEN c1; -- Fetch entire row into v_employees record: <> FOR i IN 1..10 LOOP -- Process data here FOR j IN 1..10 LOOP FETCH c1 INTO v_employees; CONTINUE outer_loop WHEN c1%NOTFOUND; -- Process data here END LOOP; END LOOP outer_loop; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/GOTO-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/GOTO-statement.html DECLARE p VARCHAR2(30); n PLS_INTEGER := 37; BEGIN FOR j in 2..ROUND(SQRT(n)) LOOP IF n MOD j = 0 THEN p := ' is not a prime number'; GOTO print_now; END IF; END LOOP; p := ' is a prime number'; <> DBMS_OUTPUT.PUT_LINE(TO_CHAR(n) || p); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/GOTO-statement-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/GOTO-statement.html DECLARE done BOOLEAN; BEGIN FOR i IN 1..50 LOOP IF done THEN GOTO end_loop; END IF; <> NULL; END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/GOTO-statement-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/GOTO-statement.html DECLARE v_last_name VARCHAR2(25); v_emp_id NUMBER(6) := 120; BEGIN <> SELECT last_name INTO v_last_name FROM employees WHERE employee_id = v_emp_id; BEGIN DBMS_OUTPUT.PUT_LINE (v_last_name); v_emp_id := v_emp_id + 5; IF v_emp_id < 120 THEN GOTO get_name; END IF; END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/GOTO-statement-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/GOTO-statement.html DECLARE valid BOOLEAN := TRUE; BEGIN GOTO update_row; IF valid THEN <> NULL; END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/PIPELINED-clause-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/PIPELINED-clause.html SELECT * FROM function_name() ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQLERRM-function-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQLERRM-function.html BEGIN DBMS_OUTPUT.PUT_LINE('SQLERRM(-6511): ' || TO_CHAR(SQLERRM(-6511))); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQLERRM-function-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQLERRM-function.html BEGIN DBMS_OUTPUT.PUT_LINE('SQLERRM(-50000): ' || TO_CHAR(SQLERRM(-50000))); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE FUNCTION date_string(dat DATE) RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{ TO_CHAR(dat, 'YYYY-MM-DD') }'; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html VARIABLE surname VARCHAR2(100) EXEC :surname := 'ellison' WITH e AS (SELECT emp.*, :surname lname FROM emp WHERE deptno IN (10,20)) SELECT deptno, emp_doc(first_name => ename, last_name => lname, hire_date => hiredate) doc FROM e ORDER BY ename; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE PACKAGE env AS FUNCTION current_user RETURN VARCHAR2 SQL_MACRO(SCALAR); FUNCTION current_edition_name RETURN VARCHAR2 SQL_MACRO(SCALAR); FUNCTION module RETURN VARCHAR2 SQL_MACRO(SCALAR); FUNCTION action RETURN VARCHAR2 SQL_MACRO(SCALAR); END; / CREATE PACKAGE BODY env AS FUNCTION current_user RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{SYS_CONTEXT('userenv','SESSION_USER')}'; END; FUNCTION current_edition_name RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{SYS_CONTEXT('userenv','CURRENT_EDITION_NAME')}'; END; FUNCTION module RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{SYS_CONTEXT('userenv','MODULE')}'; END; FUNCTION action RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{SYS_CONTEXT('userenv','ACTION')}'; END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html SELECT env.current_user, env.module, env.action FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE FUNCTION budget(job VARCHAR2) RETURN VARCHAR2 SQL_MACRO IS BEGIN RETURN q'{SELECT deptno, SUM(sal) budget FROM scott.emp WHERE job = budget.job GROUP BY deptno}'; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html SELECT * FROM budget('MANAGER'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE FUNCTION take (n NUMBER, t DBMS_TF.table_t) RETURN VARCHAR2 SQL_MACRO IS BEGIN RETURN 'SELECT * FROM t FETCH FIRST take.n ROWS ONLY'; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE FUNCTION name_string(first_name VARCHAR2, last_name VARCHAR2) RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{ TRIM(INITCAP(first_name) || ' ' || INITCAP(last_name)) }'; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html SELECT * FROM take(2, dept); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html VAR row_count NUMBER EXEC :row_count := 5 WITH t AS (SELECT * FROM emp NATURAL JOIN dept ORDER BY ename) SELECT ename, dname FROM take(:row_count, t); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE PACKAGE gen IS FUNCTION range(stop NUMBER) RETURN VARCHAR2 SQL_MACRO(TABLE); FUNCTION range(first NUMBER DEFAULT 0, stop NUMBER, step NUMBER DEFAULT 1) RETURN VARCHAR2 SQL_MACRO(TABLE); FUNCTION tab(tab TABLE, replication_factor NATURAL) RETURN TABLE PIPELINED ROW POLYMORPHIC USING gen; FUNCTION describe(tab IN OUT DBMS_TF.TABLE_T, replication_factor NATURAL) RETURN DBMS_TF.DESCRIBE_T; PROCEDURE fetch_rows(replication_factor NATURALN); END gen; / CREATE PACKAGE BODY gen IS FUNCTION range(stop NUMBER) RETURN VARCHAR2 SQL_MACRO(TABLE) IS BEGIN RETURN q'{SELECT ROWNUM-1 n FROM gen.tab(DUAL, stop)}'; END; FUNCTION range(first NUMBER DEFAULT 0, stop NUMBER, step NUMBER DEFAULT 1) RETURN VARCHAR2 SQL_MACRO(TABLE) IS BEGIN RETURN q'{ SELECT first+n*step n FROM gen.range(ROUND((stop-first)/NULLIF(step,0))) }'; END; FUNCTION describe(tab IN OUT DBMS_TF.TABLE_T, replication_factor NATURAL) RETURN DBMS_TF.DESCRIBE_T AS BEGIN RETURN DBMS_TF.DESCRIBE_T(row_replication => true); END; PROCEDURE fetch_rows(replication_factor NATURALN) as BEGIN DBMS_TF.ROW_REPLICATION(replication_factor); END; END gen; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html SELECT * FROM gen.range(5); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html SELECT * FROM gen.range(5, 10); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html SELECT * FROM gen.range(0, 1, step=>0.1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE FUNCTION email_string(first_name VARCHAR2, last_name VARCHAR2, host_name VARCHAR2 DEFAULT 'example.com') RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{ REPLACE(LOWER(name_string(first_name, last_name)),' ','.') || '@' || host_name }'; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html SELECT * FROM gen.range(+5,-6,-2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE FUNCTION emp_json(first_name VARCHAR2 DEFAULT NULL, last_name VARCHAR2 DEFAULT NULL, hire_date DATE DEFAULT NULL, phone_num VARCHAR2 DEFAULT NULL) RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{ JSON_OBJECT( 'name' : name_string(first_name, last_name), 'email' : email_string(first_name, last_name), 'phone' : phone_num, 'hire_date' : date_string(hire_date) ABSENT ON NULL) }'; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE FUNCTION emp_xml(first_name VARCHAR2 DEFAULT NULL, last_name VARCHAR2 DEFAULT NULL, hire_date DATE DEFAULT NULL, phone_num VARCHAR2 DEFAULT NULL) RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{ XMLELEMENT("xml", CASE WHEN first_name || last_name IS NOT NULL THEN XMLELEMENT("name", name_string(first_name, last_name)) END, CASE WHEN first_name || last_name IS NOT NULL THEN XMLELEMENT("email", email_string(first_name, last_name)) END, CASE WHEN hire_date IS NOT NULL THEN XMLELEMENT("hire_date", date_string(hire_date)) END, CASE WHEN phone_num IS NOT NULL THEN XMLELEMENT("phone", phone_num) END) }'; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html CREATE FUNCTION emp_doc(first_name VARCHAR2 DEFAULT NULL, last_name VARCHAR2 DEFAULT NULL, hire_date DATE DEFAULT NULL, phone_num VARCHAR2 DEFAULT NULL, doc_type VARCHAR2 DEFAULT 'json') RETURN VARCHAR2 SQL_MACRO(SCALAR) IS BEGIN RETURN q'{ DECODE(LOWER(doc_type), 'json', emp_json(first_name, last_name, hire_date, phone_num), 'xml', emp_xml(first_name, last_name, hire_date, phone_num)) }'; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html SELECT department_id, emp_doc(first_name => e.first_name, hire_date => e.hire_date) doc FROM hr.employees e WHERE department_id = 30 ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/SQL_MACRO-clause-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/SQL_MACRO-clause.html SELECT deptno, emp_doc(first_name => ename, hire_date => hiredate, doc_type => 'xml') doc FROM scott.emp ORDER BY ename; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html ALTER SESSION SET PLSQL_WARNINGS='ENABLE:(6009)'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE PROCEDURE p1 AUTHID DEFINER IS PRAGMA SUPPRESSES_WARNING_6009(p1); BEGIN RAISE_APPLICATION_ERROR(-20000, 'Unexpected error raised'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE OR REPLACE TYPE newid AUTHID DEFINER AS OBJECT( ID1 NUMBER, MEMBER PROCEDURE incr, MEMBER PROCEDURE log_error, PRAGMA SUPPRESSES_WARNING_6009(log_error) ); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE OR REPLACE TYPE BODY newid AS MEMBER PROCEDURE incr IS BEGIN DBMS_OUTPUT.PUT_LINE('Computing value'); EXCEPTION WHEN OTHERS THEN log_error; END; MEMBER PROCEDURE log_error IS BEGIN RAISE_APPLICATION_ERROR(-20000, 'Unexpected error'); END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE PROCEDURE p2 AUTHID DEFINER IS BEGIN DBMS_OUTPUT.PUT_LINE('In procedure p2'); EXCEPTION WHEN OTHERS THEN p1; END p2; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE FUNCTION f1(id NUMBER) RETURN NUMBER AUTHID DEFINER IS PRAGMA SUPPRESSES_WARNING_6009(f1); x NUMBER; BEGIN x := id + 1; RETURN x; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE FUNCTION f2(numval NUMBER) RETURN NUMBER AUTHID DEFINER IS i NUMBER; BEGIN i := numval + 1; RETURN i; EXCEPTION WHEN OTHERS THEN RETURN f1(i); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE PACKAGE pk1 IS PROCEDURE p1(x NUMBER); PROCEDURE p1; PRAGMA SUPPRESSES_WARNING_6009(p1); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE OR REPLACE PACKAGE BODY pk1 IS PROCEDURE p1(x NUMBER) IS BEGIN DBMS_OUTPUT.PUT_LINE('In the first overload'); END; PROCEDURE p1 IS BEGIN DBMS_OUTPUT.PUT_LINE('In the second overload'); RAISE_APPLICATION_ERROR(-20000, 'Unexpected error'); END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE OR REPLACE PROCEDURE p6 AUTHID DEFINER IS j NUMBER := 5; BEGIN j := j + 2; EXCEPTION WHEN OTHERS THEN pk1.p1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE OR REPLACE PACKAGE pk2 IS PROCEDURE p5; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/Supresses-warning-pragma-6009-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/Supresses-warning-pragma-6009.html CREATE OR REPLACE PACKAGE BODY pk2 IS PROCEDURE pn; /* Forward declaration */ PRAGMA SUPPRESSES_WARNING_6009(pn); PROCEDURE p5 IS BEGIN DBMS_OUTPUT.PUT_LINE('Computing'); EXCEPTION WHEN OTHERS THEN pn; END; PROCEDURE pn IS BEGIN RAISE_APPLICATION_ERROR(-20000, 'Unexpected error'); END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/WHILE-LOOP-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/WHILE-LOOP-statement.html DECLARE done BOOLEAN := FALSE; BEGIN WHILE done LOOP DBMS_OUTPUT.PUT_LINE ('This line does not print.'); done := TRUE; -- This assignment is not made. END LOOP; WHILE NOT done LOOP DBMS_OUTPUT.PUT_LINE ('Hello, world!'); done := TRUE; END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-collection-variables-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-collection-variables.html DECLARE TYPE triplet IS VARRAY(3) OF VARCHAR2(15); TYPE trio IS VARRAY(3) OF VARCHAR2(15); group1 triplet := triplet('Jones', 'Wong', 'Marceau'); group2 triplet; group3 trio; BEGIN group2 := group1; -- succeeds group3 := group1; -- fails END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-collection-variables-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-collection-variables.html DECLARE TYPE dnames_tab IS TABLE OF VARCHAR2(30); dept_names dnames_tab := dnames_tab( 'Shipping','Sales','Finance','Payroll'); -- Initialized to non-null value empty_set dnames_tab; -- Not initialized, therefore null PROCEDURE print_dept_names_status IS BEGIN IF dept_names IS NULL THEN DBMS_OUTPUT.PUT_LINE('dept_names is null.'); ELSE DBMS_OUTPUT.PUT_LINE('dept_names is not null.'); END IF; END print_dept_names_status; BEGIN print_dept_names_status; dept_names := empty_set; -- Assign null collection to dept_names. print_dept_names_status; dept_names := dnames_tab ( 'Shipping','Sales','Finance','Payroll'); -- Re-initialize dept_names print_dept_names_status; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-collection-variables-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-collection-variables.html DECLARE TYPE nested_typ IS TABLE OF NUMBER; nt1 nested_typ := nested_typ(1,2,3); nt2 nested_typ := nested_typ(3,2,1); nt3 nested_typ := nested_typ(2,3,1,3); nt4 nested_typ := nested_typ(1,2,4); answer nested_typ; PROCEDURE print_nested_table (nt nested_typ) IS output VARCHAR2(128); BEGIN IF nt IS NULL THEN DBMS_OUTPUT.PUT_LINE('Result: null set'); ELSIF nt.COUNT = 0 THEN DBMS_OUTPUT.PUT_LINE('Result: empty set'); ELSE FOR i IN nt.FIRST .. nt.LAST LOOP -- For first to last element output := output || nt(i) || ' '; END LOOP; DBMS_OUTPUT.PUT_LINE('Result: ' || output); END IF; END print_nested_table; BEGIN answer := nt1 MULTISET UNION nt4; print_nested_table(answer); answer := nt1 MULTISET UNION nt3; print_nested_table(answer); answer := nt1 MULTISET UNION DISTINCT nt3; print_nested_table(answer); answer := nt2 MULTISET INTERSECT nt3; print_nested_table(answer); answer := nt2 MULTISET INTERSECT DISTINCT nt3; print_nested_table(answer); answer := SET(nt3); print_nested_table(answer); answer := nt3 MULTISET EXCEPT nt2; print_nested_table(answer); answer := nt3 MULTISET EXCEPT DISTINCT nt2; print_nested_table(answer); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html CREATE PACKAGE pkg IS TYPE rec_t IS RECORD (year PLS_INTEGER := 2, name VARCHAR2 (100) ); END; / DECLARE v_rec1 pkg.rec_t := pkg.rec_t(1847,'ONE EIGHT FOUR SEVEN'); v_rec2 pkg.rec_t := pkg.rec_t(year => 1, name => 'ONE'); v_rec3 pkg.rec_t := pkg.rec_t(NULL,NULL); PROCEDURE print_rec ( pi_rec pkg.rec_t := pkg.rec_t(1847+1, 'a'||'b')) IS v_rec1 pkg.rec_t := pkg.rec_t(2847,'TWO EIGHT FOUR SEVEN'); BEGIN DBMS_OUTPUT.PUT_LINE(NVL(v_rec1.year,0) ||' ' ||NVL(v_rec1.name,'N/A')); DBMS_OUTPUT.PUT_LINE(NVL(pi_rec.year,0) ||' ' ||NVL(pi_rec.name,'N/A')); END; BEGIN print_rec(v_rec1); print_rec(v_rec2); print_rec(v_rec3); print_rec(); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html DECLARE TYPE RecordTyp IS RECORD ( last employees.last_name%TYPE, id employees.employee_id%TYPE ); rec1 RecordTyp; BEGIN SELECT last_name, employee_id INTO rec1 FROM employees WHERE job_id = 'AD_PRES'; DBMS_OUTPUT.PUT_LINE ('Employee #' || rec1.id || ' = ' || rec1.last); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html FETCH cursor INTO record_variable_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html DECLARE TYPE EmpRecTyp IS RECORD ( emp_id employees.employee_id%TYPE, salary employees.salary%TYPE ); CURSOR desc_salary RETURN EmpRecTyp IS SELECT employee_id, salary FROM employees ORDER BY salary DESC; highest_paid_emp EmpRecTyp; next_highest_paid_emp EmpRecTyp; FUNCTION nth_highest_salary (n INTEGER) RETURN EmpRecTyp IS emp_rec EmpRecTyp; BEGIN OPEN desc_salary; FOR i IN 1..n LOOP FETCH desc_salary INTO emp_rec; END LOOP; CLOSE desc_salary; RETURN emp_rec; END nth_highest_salary; BEGIN highest_paid_emp := nth_highest_salary(1); next_highest_paid_emp := nth_highest_salary(2); DBMS_OUTPUT.PUT_LINE( 'Highest Paid: #' || highest_paid_emp.emp_id || ', $' || highest_paid_emp.salary ); DBMS_OUTPUT.PUT_LINE( 'Next Highest Paid: #' || next_highest_paid_emp.emp_id || ', $' || next_highest_paid_emp.salary ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html DECLARE TYPE EmpRec IS RECORD ( last_name employees.last_name%TYPE, salary employees.salary%TYPE ); emp_info EmpRec; old_salary employees.salary%TYPE; BEGIN SELECT salary INTO old_salary FROM employees WHERE employee_id = 100; UPDATE employees SET salary = salary * 1.1 WHERE employee_id = 100 RETURNING last_name, salary INTO emp_info; DBMS_OUTPUT.PUT_LINE ( 'Salary of ' || emp_info.last_name || ' raised from ' || old_salary || ' to ' || emp_info.salary ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html DECLARE TYPE age_rec IS RECORD ( years INTEGER DEFAULT 35, months INTEGER DEFAULT 6 ); TYPE name_rec IS RECORD ( first employees.first_name%TYPE DEFAULT 'John', last employees.last_name%TYPE DEFAULT 'Doe', age age_rec ); name name_rec; PROCEDURE print_name AS BEGIN DBMS_OUTPUT.PUT(NVL(name.first, 'NULL') || ' '); DBMS_OUTPUT.PUT(NVL(name.last, 'NULL') || ', '); DBMS_OUTPUT.PUT(NVL(TO_CHAR(name.age.years), 'NULL') || ' yrs '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(name.age.months), 'NULL') || ' mos'); END; BEGIN print_name; name := NULL; print_name; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html DECLARE TYPE name_rec IS RECORD ( first employees.first_name%TYPE DEFAULT 'John', last employees.last_name%TYPE DEFAULT 'Doe' ); name1 name_rec; name2 name_rec; BEGIN name1.first := 'Jane'; name1.last := 'Smith'; DBMS_OUTPUT.PUT_LINE('name1: ' || name1.first || ' ' || name1.last); name2 := name1; DBMS_OUTPUT.PUT_LINE('name2: ' || name2.first || ' ' || name2.last); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html DECLARE TYPE name_rec IS RECORD ( first employees.first_name%TYPE DEFAULT 'John', last employees.last_name%TYPE DEFAULT 'Doe' ); CURSOR c IS SELECT first_name, last_name FROM employees; target name_rec; source c%ROWTYPE; BEGIN source.first_name := 'Jane'; source.last_name := 'Smith'; DBMS_OUTPUT.PUT_LINE ( 'source: ' || source.first_name || ' ' || source.last_name ); target := source; DBMS_OUTPUT.PUT_LINE ( 'target: ' || target.first || ' ' || target.last ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html DECLARE TYPE name_rec IS RECORD ( first employees.first_name%TYPE, last employees.last_name%TYPE ); TYPE phone_rec IS RECORD ( name name_rec, -- nested record phone employees.phone_number%TYPE ); TYPE email_rec IS RECORD ( name name_rec, -- nested record email employees.email%TYPE ); phone_contact phone_rec; email_contact email_rec; BEGIN phone_contact.name.first := 'John'; phone_contact.name.last := 'Smith'; phone_contact.phone := '1-650-555-1234'; email_contact.name := phone_contact.name; email_contact.email := ( email_contact.name.first || '.' || email_contact.name.last || '@' || 'example.com' ); DBMS_OUTPUT.PUT_LINE (email_contact.email); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-record-variables-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-record-variables.html SELECT select_list INTO record_variable_name FROM table_or_view_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-variables-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-variables.html DECLARE -- You can assign initial values here wages NUMBER; hours_worked NUMBER := 40; hourly_salary NUMBER := 22.50; bonus NUMBER := 150; country VARCHAR2(128); counter NUMBER := 0; done BOOLEAN; valid_id BOOLEAN; emp_rec1 employees%ROWTYPE; emp_rec2 employees%ROWTYPE; TYPE commissions IS TABLE OF NUMBER INDEX BY PLS_INTEGER; comm_tab commissions; BEGIN -- You can assign values here too wages := (hours_worked * hourly_salary) + bonus; country := 'France'; country := UPPER('Canada'); done := (counter > 100); valid_id := TRUE; emp_rec1.first_name := 'Antonio'; emp_rec1.last_name := 'Ortiz'; emp_rec1 := emp_rec2; comm_tab(5) := 20000 * 0.15; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-variables-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-variables.html DECLARE bonus NUMBER(8,2); BEGIN SELECT salary * 0.10 INTO bonus FROM employees WHERE employee_id = 100; DBMS_OUTPUT.PUT_LINE('bonus = ' || TO_CHAR(bonus)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-variables-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-variables.html DECLARE emp_salary NUMBER(8,2); PROCEDURE adjust_salary ( emp NUMBER, sal IN OUT NUMBER, adjustment NUMBER ) IS BEGIN sal := sal + adjustment; END; BEGIN SELECT salary INTO emp_salary FROM employees WHERE employee_id = 100; DBMS_OUTPUT.PUT_LINE ('Before invoking procedure, emp_salary: ' || emp_salary); adjust_salary (100, emp_salary, 1000); DBMS_OUTPUT.PUT_LINE ('After invoking procedure, emp_salary: ' || emp_salary); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/assigning-values-variables-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/assigning-values-variables.html DECLARE done BOOLEAN; -- Initial value is NULL by default counter NUMBER := 0; BEGIN done := FALSE; -- Assign literal value WHILE done != TRUE -- Compare to literal value LOOP counter := counter + 1; done := (counter > 500); -- Assign value of BOOLEAN expression END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/autonomous-transactions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/autonomous-transactions.html SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/autonomous-transactions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/autonomous-transactions.html CREATE OR REPLACE PACKAGE emp_actions AUTHID DEFINER AS -- package specification FUNCTION raise_salary (emp_id NUMBER, sal_raise NUMBER) RETURN NUMBER; END emp_actions; / CREATE OR REPLACE PACKAGE BODY emp_actions AS -- package body -- code for function raise_salary FUNCTION raise_salary (emp_id NUMBER, sal_raise NUMBER) RETURN NUMBER IS PRAGMA AUTONOMOUS_TRANSACTION; new_sal NUMBER(8,2); BEGIN UPDATE employees SET salary = salary + sal_raise WHERE employee_id = emp_id; COMMIT; SELECT salary INTO new_sal FROM employees WHERE employee_id = emp_id; RETURN new_sal; END raise_salary; END emp_actions; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/autonomous-transactions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/autonomous-transactions.html CREATE OR REPLACE PROCEDURE lower_salary (emp_id NUMBER, amount NUMBER) AUTHID DEFINER AS PRAGMA AUTONOMOUS_TRANSACTION; BEGIN UPDATE employees SET salary = salary - amount WHERE employee_id = emp_id; COMMIT; END lower_salary; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/autonomous-transactions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/autonomous-transactions.html DROP TABLE emp; CREATE TABLE emp AS SELECT * FROM employees; DECLARE PRAGMA AUTONOMOUS_TRANSACTION; emp_id NUMBER(6) := 200; amount NUMBER(6,2) := 200; BEGIN UPDATE employees SET salary = salary - amount WHERE employee_id = emp_id; COMMIT; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/autonomous-transactions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/autonomous-transactions.html DROP TABLE emp; CREATE TABLE emp AS SELECT * FROM employees; DROP TABLE log; CREATE TABLE log ( log_id NUMBER(6), up_date DATE, new_sal NUMBER(8,2), old_sal NUMBER(8,2) ); CREATE OR REPLACE TRIGGER log_sal BEFORE UPDATE OF salary ON emp FOR EACH ROW DECLARE PRAGMA AUTONOMOUS_TRANSACTION; BEGIN INSERT INTO log ( log_id, up_date, new_sal, old_sal ) VALUES ( :old.employee_id, SYSDATE, :new.salary, :old.salary ); COMMIT; END; / UPDATE emp SET salary = salary * 1.05 WHERE employee_id = 115; COMMIT; UPDATE emp SET salary = salary * 1.05 WHERE employee_id = 116; ROLLBACK; SELECT * FROM log WHERE log_id = 115 OR log_id = 116; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/autonomous-transactions-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/autonomous-transactions.html DROP TABLE temp; CREATE TABLE temp ( temp_id NUMBER(6), up_date DATE ); CREATE OR REPLACE TRIGGER drop_temp_table AFTER INSERT ON log DECLARE PRAGMA AUTONOMOUS_TRANSACTION; BEGIN EXECUTE IMMEDIATE 'DROP TABLE temp'; COMMIT; END; / SELECT * FROM temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/autonomous-transactions-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/autonomous-transactions.html INSERT INTO log (log_id, up_date, new_sal, old_sal) VALUES (999, SYSDATE, 5000, 4500); SELECT * FROM temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/autonomous-transactions-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/autonomous-transactions.html DROP TABLE debug_output; CREATE TABLE debug_output (message VARCHAR2(200)); CREATE OR REPLACE PACKAGE debugging AUTHID DEFINER AS FUNCTION log_msg (msg VARCHAR2) RETURN VARCHAR2; END debugging; / CREATE OR REPLACE PACKAGE BODY debugging AS FUNCTION log_msg (msg VARCHAR2) RETURN VARCHAR2 IS PRAGMA AUTONOMOUS_TRANSACTION; BEGIN INSERT INTO debug_output (message) VALUES (msg); COMMIT; RETURN msg; END; END debugging; / DECLARE my_emp_id NUMBER(6); my_last_name VARCHAR2(25); my_count NUMBER; BEGIN my_emp_id := 120; SELECT debugging.log_msg(last_name) INTO my_last_name FROM employees WHERE employee_id = my_emp_id; /* Even if you roll back in this scope, the insert into 'debug_output' remains committed, because it is part of an autonomous transaction. */ ROLLBACK; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html CREATE OR REPLACE TYPE type1 AS OBJECT (a NUMBER); / DROP TABLE tab1; CREATE TABLE tab1 (tab2 type1); INSERT INTO tab1 (tab2) VALUES (type1(10)); DROP TABLE tab2; CREATE TABLE tab2 (x NUMBER); INSERT INTO tab2 (x) VALUES (10); SELECT * FROM tab1 hr WHERE EXISTS (SELECT * FROM hr.tab2 WHERE x = hr.tab2.a); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html UPDATE ot1 o SET o = (t1(20)) WHERE o.x = 10; DECLARE n_ref REF t1; BEGIN SELECT REF(o) INTO n_ref FROM ot1 o WHERE VALUE(o) = t1(30); END; / DECLARE n t1; BEGIN SELECT VALUE(o) INTO n FROM ot1 o WHERE VALUE(o) = t1(30); END; / DECLARE n NUMBER; BEGIN SELECT o.x INTO n FROM ot1 o WHERE o.x = 30; END; / DELETE FROM ot1 o WHERE VALUE(o) = (t1(20)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html ALTER TABLE tab2 ADD (a NUMBER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html SELECT * FROM hr.tab1 p1 WHERE EXISTS (SELECT * FROM hr.tab2 p2 WHERE p2.x = p1.tab2.a); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html CREATE OR REPLACE TYPE t1 AS OBJECT (x NUMBER); / DROP TABLE tb1; CREATE TABLE tb1 (col1 t1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html BEGIN INSERT INTO tb1 VALUES ( t1(10) ); INSERT INTO tb1 VALUES ( t1(20) ); INSERT INTO tb1 VALUES ( t1(30) ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html UPDATE tb1 SET col1.x = 10 WHERE col1.x = 20; UPDATE tb1 SET tb1.col1.x = 10 WHERE tb1.col1.x = 20; UPDATE hr.tb1 SET hr.tb1.col1.x = 10 WHERE hr.tb1.col1.x = 20; DELETE FROM tb1 WHERE tb1.col1.x = 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html UPDATE hr.tb1 t SET t.col1.x = 10 WHERE t.col1.x = 20; DECLARE y NUMBER; BEGIN SELECT t.col1.x INTO y FROM tb1 t WHERE t.col1.x = 30; END; / DELETE FROM tb1 t WHERE t.col1.x = 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html CREATE OR REPLACE TYPE t1 AS OBJECT (x number); / DROP TABLE ot1; CREATE TABLE ot1 OF t1; BEGIN INSERT INTO ot1 VALUES (t1(10)); INSERT INTO ot1 VALUES (20); INSERT INTO ot1 VALUES (30); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/avoiding-inner-capture-select-and-dml-statements-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/avoiding-inner-capture-select-and-dml-statements.html UPDATE ot1 SET VALUE(ot1.x) = t1(20) WHERE VALUE(ot1.x) = t1(10); DELETE FROM ot1 WHERE VALUE(ot1) = (t1(10)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/basic-LOOP-statement-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/basic-LOOP-statement.html DECLARE s PLS_INTEGER := 0; i PLS_INTEGER := 0; j PLS_INTEGER; BEGIN <> LOOP i := i + 1; j := 0; <> LOOP j := j + 1; s := s + i * j; -- Sum several products EXIT inner_loop WHEN (j > 5); EXIT outer_loop WHEN ((i * j) > 15); END LOOP inner_loop; END LOOP outer_loop; DBMS_OUTPUT.PUT_LINE ('The sum of products equals: ' || TO_CHAR(s)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/basic-LOOP-statement-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/basic-LOOP-statement.html DECLARE i PLS_INTEGER := 0; j PLS_INTEGER := 0; BEGIN LOOP i := i + 1; DBMS_OUTPUT.PUT_LINE ('i = ' || i); LOOP j := j + 1; DBMS_OUTPUT.PUT_LINE ('j = ' || j); EXIT WHEN (j > 3); END LOOP; DBMS_OUTPUT.PUT_LINE ('Exited inner loop'); EXIT WHEN (i > 2); END LOOP; DBMS_OUTPUT.PUT_LINE ('Exited outer loop'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DELETE FROM employees_temp WHERE department_id = 10; DELETE FROM employees_temp WHERE department_id = 30; DELETE FROM employees_temp WHERE department_id = 70; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE employees_temp; CREATE TABLE employees_temp AS SELECT * FROM employees; DECLARE TYPE NumList IS VARRAY(20) OF NUMBER; depts NumList := NumList(10, 30, 70); -- department numbers BEGIN FOR i IN depts.FIRST..depts.LAST LOOP DELETE FROM employees_temp WHERE department_id = depts(i); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html SELECT cust_name "Customer", amount "Big order amount" FROM big_orders ORDER BY cust_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html SELECT cust_name "Customer", amount "Rejected order amount" FROM rejected_orders ORDER BY cust_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DELETE FROM employees_temp WHERE department_id = depts(10); DELETE FROM employees_temp WHERE department_id = depts(30); DELETE FROM employees_temp WHERE department_id = depts(70); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE emp_temp; CREATE TABLE emp_temp ( deptno NUMBER(2), job VARCHAR2(18) ); CREATE OR REPLACE PROCEDURE p AUTHID DEFINER AS TYPE NumList IS TABLE OF NUMBER; depts NumList := NumList(10, 20, 30); error_message VARCHAR2(100); BEGIN -- Populate table: INSERT INTO emp_temp (deptno, job) VALUES (10, 'Clerk'); INSERT INTO emp_temp (deptno, job) VALUES (20, 'Bookkeeper'); INSERT INTO emp_temp (deptno, job) VALUES (30, 'Analyst'); COMMIT; -- Append 9-character string to each job: FORALL j IN depts.FIRST..depts.LAST UPDATE emp_temp SET job = job || ' (Senior)' WHERE deptno = depts(j); EXCEPTION WHEN OTHERS THEN error_message := SQLERRM; DBMS_OUTPUT.PUT_LINE (error_message); COMMIT; -- Commit results of successful updates RAISE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html BEGIN p; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html SELECT * FROM emp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE employees_temp; CREATE TABLE employees_temp AS SELECT * FROM employees; DECLARE TYPE NumList IS VARRAY(20) OF NUMBER; depts NumList := NumList(10, 30, 70); -- department numbers BEGIN FORALL i IN depts.FIRST..depts.LAST DELETE FROM employees_temp WHERE department_id = depts(i); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html CREATE OR REPLACE PROCEDURE p AUTHID DEFINER AS TYPE NumList IS TABLE OF NUMBER; depts NumList := NumList(10, 20, 30); error_message VARCHAR2(100); bad_stmt_no PLS_INTEGER; bad_deptno emp_temp.deptno%TYPE; bad_job emp_temp.job%TYPE; dml_errors EXCEPTION; PRAGMA EXCEPTION_INIT(dml_errors, -24381); BEGIN -- Populate table: INSERT INTO emp_temp (deptno, job) VALUES (10, 'Clerk'); INSERT INTO emp_temp (deptno, job) VALUES (20, 'Bookkeeper'); INSERT INTO emp_temp (deptno, job) VALUES (30, 'Analyst'); COMMIT; -- Append 9-character string to each job: FORALL j IN depts.FIRST..depts.LAST SAVE EXCEPTIONS UPDATE emp_temp SET job = job || ' (Senior)' WHERE deptno = depts(j); EXCEPTION WHEN dml_errors THEN FOR i IN 1..SQL%BULK_EXCEPTIONS.COUNT LOOP error_message := SQLERRM(-(SQL%BULK_EXCEPTIONS(i).ERROR_CODE)); DBMS_OUTPUT.PUT_LINE (error_message); bad_stmt_no := SQL%BULK_EXCEPTIONS(i).ERROR_INDEX; DBMS_OUTPUT.PUT_LINE('Bad statement #: ' || bad_stmt_no); bad_deptno := depts(bad_stmt_no); DBMS_OUTPUT.PUT_LINE('Bad department #: ' || bad_deptno); SELECT job INTO bad_job FROM emp_temp WHERE deptno = bad_deptno; DBMS_OUTPUT.PUT_LINE('Bad job: ' || bad_job); END LOOP; COMMIT; -- Commit results of successful updates WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('Unrecognized error.'); RAISE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html BEGIN p; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html SELECT * FROM emp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE emp_temp; CREATE TABLE emp_temp AS SELECT * FROM employees; DECLARE TYPE NumList IS TABLE OF NUMBER; depts NumList := NumList(30, 50, 60); BEGIN FORALL j IN depts.FIRST..depts.LAST DELETE FROM emp_temp WHERE department_id = depts(j); FOR i IN depts.FIRST..depts.LAST LOOP DBMS_OUTPUT.PUT_LINE ( 'Statement #' || i || ' deleted ' || SQL%BULK_ROWCOUNT(i) || ' rows.' ); END LOOP; DBMS_OUTPUT.PUT_LINE('Total rows deleted: ' || SQL%ROWCOUNT); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE parts1; CREATE TABLE parts1 ( pnum INTEGER, pname VARCHAR2(15) ); DROP TABLE parts2; CREATE TABLE parts2 ( pnum INTEGER, pname VARCHAR2(15) ); DECLARE TYPE NumTab IS TABLE OF parts1.pnum%TYPE INDEX BY PLS_INTEGER; TYPE NameTab IS TABLE OF parts1.pname%TYPE INDEX BY PLS_INTEGER; pnums NumTab; pnames NameTab; iterations CONSTANT PLS_INTEGER := 50000; t1 INTEGER; t2 INTEGER; t3 INTEGER; BEGIN FOR j IN 1..iterations LOOP -- populate collections pnums(j) := j; pnames(j) := 'Part No. ' || TO_CHAR(j); END LOOP; t1 := DBMS_UTILITY.get_time; FOR i IN 1..iterations LOOP INSERT INTO parts1 (pnum, pname) VALUES (pnums(i), pnames(i)); END LOOP; t2 := DBMS_UTILITY.get_time; FORALL i IN 1..iterations INSERT INTO parts2 (pnum, pname) VALUES (pnums(i), pnames(i)); t3 := DBMS_UTILITY.get_time; DBMS_OUTPUT.PUT_LINE('Execution Time (secs)'); DBMS_OUTPUT.PUT_LINE('---------------------'); DBMS_OUTPUT.PUT_LINE('FOR LOOP: ' || TO_CHAR((t2 - t1)/100)); DBMS_OUTPUT.PUT_LINE('FORALL: ' || TO_CHAR((t3 - t2)/100)); COMMIT; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE emp_by_dept; CREATE TABLE emp_by_dept AS SELECT employee_id, department_id FROM employees WHERE 1 = 0; DECLARE TYPE dept_tab IS TABLE OF departments.department_id%TYPE; deptnums dept_tab; BEGIN SELECT department_id BULK COLLECT INTO deptnums FROM departments; FORALL i IN 1..deptnums.COUNT INSERT INTO emp_by_dept (employee_id, department_id) SELECT employee_id, department_id FROM employees WHERE department_id = deptnums(i) ORDER BY department_id, employee_id; FOR i IN 1..deptnums.COUNT LOOP -- Count how many rows were inserted for each department; that is, -- how many employees are in each department. DBMS_OUTPUT.PUT_LINE ( 'Dept '||deptnums(i)||': inserted '|| SQL%BULK_ROWCOUNT(i)||' records' ); END LOOP; DBMS_OUTPUT.PUT_LINE('Total records inserted: ' || SQL%ROWCOUNT); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DECLARE TYPE NumTab IS TABLE OF employees.employee_id%TYPE; TYPE NameTab IS TABLE OF employees.last_name%TYPE; enums NumTab; names NameTab; PROCEDURE print_first_n (n POSITIVE) IS BEGIN IF enums.COUNT = 0 THEN DBMS_OUTPUT.PUT_LINE ('Collections are empty.'); ELSE DBMS_OUTPUT.PUT_LINE ('First ' || n || ' employees:'); FOR i IN 1 .. n LOOP DBMS_OUTPUT.PUT_LINE ( ' Employee #' || enums(i) || ': ' || names(i)); END LOOP; END IF; END; BEGIN SELECT employee_id, last_name BULK COLLECT INTO enums, names FROM employees ORDER BY employee_id; print_first_n(3); print_first_n(6); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DECLARE CURSOR c1 IS SELECT first_name, last_name, hire_date FROM employees; TYPE NameSet IS TABLE OF c1%ROWTYPE; stock_managers NameSet; -- nested table of records BEGIN -- Assign values to nested table of records: SELECT first_name, last_name, hire_date BULK COLLECT INTO stock_managers FROM employees WHERE job_id = 'ST_MAN' ORDER BY hire_date; -- Print nested table of records: FOR i IN stock_managers.FIRST .. stock_managers.LAST LOOP DBMS_OUTPUT.PUT_LINE ( stock_managers(i).hire_date || ' ' || stock_managers(i).last_name || ', ' || stock_managers(i).first_name ); END LOOP;END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html CREATE OR REPLACE TYPE numbers_type IS TABLE OF INTEGER / CREATE OR REPLACE PROCEDURE p (i IN INTEGER) AUTHID DEFINER IS numbers1 numbers_type := numbers_type(1,2,3,4,5); BEGIN DBMS_OUTPUT.PUT_LINE('Before SELECT statement'); DBMS_OUTPUT.PUT_LINE('numbers1.COUNT() = ' || numbers1.COUNT()); FOR j IN 1..numbers1.COUNT() LOOP DBMS_OUTPUT.PUT_LINE('numbers1(' || j || ') = ' || numbers1(j)); END LOOP; --Self-selecting BULK COLLECT INTO clause: SELECT a.COLUMN_VALUE BULK COLLECT INTO numbers1 FROM TABLE(numbers1) a WHERE a.COLUMN_VALUE > p.i ORDER BY a.COLUMN_VALUE; DBMS_OUTPUT.PUT_LINE('After SELECT statement'); DBMS_OUTPUT.PUT_LINE('numbers1.COUNT() = ' || numbers1.COUNT()); END p; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html BEGIN p(2); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html BEGIN p(10); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html CREATE OR REPLACE TYPE numbers_type IS TABLE OF INTEGER / CREATE OR REPLACE PROCEDURE p (i IN INTEGER) AUTHID DEFINER IS numbers1 numbers_type := numbers_type(1,2,3,4,5); CURSOR c IS SELECT a.COLUMN_VALUE FROM TABLE(numbers1) a WHERE a.COLUMN_VALUE > p.i ORDER BY a.COLUMN_VALUE; BEGIN DBMS_OUTPUT.PUT_LINE('Before FETCH statement'); DBMS_OUTPUT.PUT_LINE('numbers1.COUNT() = ' || numbers1.COUNT()); FOR j IN 1..numbers1.COUNT() LOOP DBMS_OUTPUT.PUT_LINE('numbers1(' || j || ') = ' || numbers1(j)); END LOOP; OPEN c; FETCH c BULK COLLECT INTO numbers1; CLOSE c; DBMS_OUTPUT.PUT_LINE('After FETCH statement'); DBMS_OUTPUT.PUT_LINE('numbers1.COUNT() = ' || numbers1.COUNT()); IF numbers1.COUNT() > 0 THEN FOR j IN 1..numbers1.COUNT() LOOP DBMS_OUTPUT.PUT_LINE('numbers1(' || j || ') = ' || numbers1(j)); END LOOP; END IF; END p; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-43.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html BEGIN p(2); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-45.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html BEGIN p(10); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-47.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html CREATE OR REPLACE TYPE numbers_type IS TABLE OF INTEGER / CREATE OR REPLACE PROCEDURE p (i IN INTEGER) AUTHID DEFINER IS numbers1 numbers_type := numbers_type(1,2,3,4,5); numbers2 numbers_type := numbers_type(0,0,0,0,0); BEGIN DBMS_OUTPUT.PUT_LINE('Before SELECT statement'); DBMS_OUTPUT.PUT_LINE('numbers1.COUNT() = ' || numbers1.COUNT()); FOR j IN 1..numbers1.COUNT() LOOP DBMS_OUTPUT.PUT_LINE('numbers1(' || j || ') = ' || numbers1(j)); END LOOP; DBMS_OUTPUT.PUT_LINE('numbers2.COUNT() = ' || numbers2.COUNT()); FOR j IN 1..numbers2.COUNT() LOOP DBMS_OUTPUT.PUT_LINE('numbers2(' || j || ') = ' || numbers2(j)); END LOOP; SELECT a.COLUMN_VALUE BULK COLLECT INTO numbers2 -- numbers2 appears here FROM TABLE(numbers1) a -- numbers1 appears here WHERE a.COLUMN_VALUE > p.i ORDER BY a.COLUMN_VALUE; DBMS_OUTPUT.PUT_LINE('After SELECT statement'); DBMS_OUTPUT.PUT_LINE('numbers1.COUNT() = ' || numbers1.COUNT()); IF numbers1.COUNT() > 0 THEN FOR j IN 1..numbers1.COUNT() LOOP DBMS_OUTPUT.PUT_LINE('numbers1(' || j || ') = ' || numbers1(j)); END LOOP; END IF; DBMS_OUTPUT.PUT_LINE('numbers2.COUNT() = ' || numbers2.COUNT()); IF numbers2.COUNT() > 0 THEN FOR j IN 1..numbers2.COUNT() LOOP DBMS_OUTPUT.PUT_LINE('numbers2(' || j || ') = ' || numbers2(j)); END LOOP; END IF; END p; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-48.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html BEGIN p(2); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE employees_temp; CREATE TABLE employees_temp AS SELECT * FROM employees; DECLARE TYPE NumList IS VARRAY(10) OF NUMBER; depts NumList := NumList(5,10,20,30,50,55,57,60,70,75); BEGIN FORALL j IN 4..7 DELETE FROM employees_temp WHERE department_id = depts(j); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html BEGIN p(10); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DECLARE TYPE SalList IS TABLE OF employees.salary%TYPE; sals SalList; BEGIN SELECT salary BULK COLLECT INTO sals FROM employees WHERE ROWNUM <= 50; SELECT salary BULK COLLECT INTO sals FROM employees SAMPLE (10); SELECT salary BULK COLLECT INTO sals FROM employees FETCH FIRST 50 ROWS ONLY; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-53.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DECLARE TYPE NameList IS TABLE OF employees.last_name%TYPE; TYPE SalList IS TABLE OF employees.salary%TYPE; CURSOR c1 IS SELECT last_name, salary FROM employees WHERE salary > 10000 ORDER BY last_name; names NameList; sals SalList; TYPE RecList IS TABLE OF c1%ROWTYPE; recs RecList; v_limit PLS_INTEGER := 10; PROCEDURE print_results IS BEGIN -- Check if collections are empty: IF names IS NULL OR names.COUNT = 0 THEN DBMS_OUTPUT.PUT_LINE('No results!'); ELSE DBMS_OUTPUT.PUT_LINE('Result: '); FOR i IN names.FIRST .. names.LAST LOOP DBMS_OUTPUT.PUT_LINE(' Employee ' || names(i) || ': $' || sals(i)); END LOOP; END IF; END; BEGIN DBMS_OUTPUT.PUT_LINE ('--- Processing all results simultaneously ---'); OPEN c1; FETCH c1 BULK COLLECT INTO names, sals; CLOSE c1; print_results(); DBMS_OUTPUT.PUT_LINE ('--- Processing ' || v_limit || ' rows at a time ---'); OPEN c1; LOOP FETCH c1 BULK COLLECT INTO names, sals LIMIT v_limit; EXIT WHEN names.COUNT = 0; print_results(); END LOOP; CLOSE c1; DBMS_OUTPUT.PUT_LINE ('--- Fetching records rather than columns ---'); OPEN c1; FETCH c1 BULK COLLECT INTO recs; FOR i IN recs.FIRST .. recs.LAST LOOP -- Now all columns from result set come from one record DBMS_OUTPUT.PUT_LINE ( ' Employee ' || recs(i).last_name || ': $' || recs(i).salary ); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-55.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DECLARE CURSOR c1 IS SELECT first_name, last_name, hire_date FROM employees; TYPE NameSet IS TABLE OF c1%ROWTYPE; stock_managers NameSet; -- nested table of records TYPE cursor_var_type is REF CURSOR; cv cursor_var_type; BEGIN -- Assign values to nested table of records: OPEN cv FOR SELECT first_name, last_name, hire_date FROM employees WHERE job_id = 'ST_MAN' ORDER BY hire_date; FETCH cv BULK COLLECT INTO stock_managers; CLOSE cv; -- Print nested table of records: FOR i IN stock_managers.FIRST .. stock_managers.LAST LOOP DBMS_OUTPUT.PUT_LINE ( stock_managers(i).hire_date || ' ' || stock_managers(i).last_name || ', ' || stock_managers(i).first_name ); END LOOP;END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-57.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DECLARE TYPE numtab IS TABLE OF NUMBER INDEX BY PLS_INTEGER; CURSOR c1 IS SELECT employee_id FROM employees WHERE department_id = 80 ORDER BY employee_id; empids numtab; BEGIN OPEN c1; LOOP -- Fetch 10 rows or fewer in each iteration FETCH c1 BULK COLLECT INTO empids LIMIT 10; DBMS_OUTPUT.PUT_LINE ('------- Results from One Bulk Fetch --------'); FOR i IN 1..empids.COUNT LOOP DBMS_OUTPUT.PUT_LINE ('Employee Id: ' || empids(i)); END LOOP; EXIT WHEN c1%NOTFOUND; END LOOP; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-59.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE emp_temp; CREATE TABLE emp_temp AS SELECT * FROM employees ORDER BY employee_id; DECLARE TYPE NumList IS TABLE OF employees.employee_id%TYPE; enums NumList; TYPE NameList IS TABLE OF employees.last_name%TYPE; names NameList; BEGIN DELETE FROM emp_temp WHERE department_id = 30 RETURNING employee_id, last_name BULK COLLECT INTO enums, names; DBMS_OUTPUT.PUT_LINE ('Deleted ' || SQL%ROWCOUNT || ' rows:'); FOR i IN enums.FIRST .. enums.LAST LOOP DBMS_OUTPUT.PUT_LINE ('Employee #' || enums(i) || ': ' || names(i)); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE valid_orders; CREATE TABLE valid_orders ( cust_name VARCHAR2(32), amount NUMBER(10,2) ); DROP TABLE big_orders; CREATE TABLE big_orders AS SELECT * FROM valid_orders WHERE 1 = 0; DROP TABLE rejected_orders; CREATE TABLE rejected_orders AS SELECT * FROM valid_orders WHERE 1 = 0; DECLARE SUBTYPE cust_name IS valid_orders.cust_name%TYPE; TYPE cust_typ IS TABLE OF cust_name; cust_tab cust_typ; -- Collection of customer names SUBTYPE order_amount IS valid_orders.amount%TYPE; TYPE amount_typ IS TABLE OF NUMBER; amount_tab amount_typ; -- Collection of order amounts TYPE index_pointer_t IS TABLE OF PLS_INTEGER; /* Collections for pointers to elements of cust_tab collection (to represent two subsets of cust_tab): */ big_order_tab index_pointer_t := index_pointer_t(); rejected_order_tab index_pointer_t := index_pointer_t(); PROCEDURE populate_data_collections IS BEGIN cust_tab := cust_typ( 'Company1','Company2','Company3','Company4','Company5' ); amount_tab := amount_typ(5000.01, 0, 150.25, 4000.00, NULL); END; BEGIN populate_data_collections; DBMS_OUTPUT.PUT_LINE ('--- Original order data ---'); FOR i IN 1..cust_tab.LAST LOOP DBMS_OUTPUT.PUT_LINE ( 'Customer #' || i || ', ' || cust_tab(i) || ': $' || amount_tab(i) ); END LOOP; -- Delete invalid orders: FOR i IN 1..cust_tab.LAST LOOP IF amount_tab(i) IS NULL OR amount_tab(i) = 0 THEN cust_tab.delete(i); amount_tab.delete(i); END IF; END LOOP; -- cust_tab is now a sparse collection. DBMS_OUTPUT.PUT_LINE ('--- Order data with invalid orders deleted ---'); FOR i IN 1..cust_tab.LAST LOOP IF cust_tab.EXISTS(i) THEN DBMS_OUTPUT.PUT_LINE ( 'Customer #' || i || ', ' || cust_tab(i) || ': $' || amount_tab(i) ); END IF; END LOOP; -- Using sparse collection, populate valid_orders table: FORALL i IN INDICES OF cust_tab INSERT INTO valid_orders (cust_name, amount) VALUES (cust_tab(i), amount_tab(i)); populate_data_collections; -- Restore original order data -- cust_tab is a dense collection again. /* Populate collections of pointers to elements of cust_tab collection (which represent two subsets of cust_tab): */ FOR i IN cust_tab.FIRST .. cust_tab.LAST LOOP IF amount_tab(i) IS NULL OR amount_tab(i) = 0 THEN rejected_order_tab.EXTEND; rejected_order_tab(rejected_order_tab.LAST) := i; END IF; IF amount_tab(i) > 2000 THEN big_order_tab.EXTEND; big_order_tab(big_order_tab.LAST) := i; END IF; END LOOP; /* Using each subset in a different FORALL statement, populate rejected_orders and big_orders tables: */ FORALL i IN VALUES OF rejected_order_tab INSERT INTO rejected_orders (cust_name, amount) VALUES (cust_tab(i), amount_tab(i)); FORALL i IN VALUES OF big_order_tab INSERT INTO big_orders (cust_name, amount) VALUES (cust_tab(i), amount_tab(i)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-61.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE emp_temp; CREATE TABLE emp_temp AS SELECT * FROM employees ORDER BY employee_id; DECLARE TYPE SalList IS TABLE OF employees.salary%TYPE; old_sals SalList; new_sals SalList; TYPE NameList IS TABLE OF employees.last_name%TYPE; names NameList; BEGIN UPDATE emp_temp SET salary = salary * 1.15 WHERE salary < 2500 RETURNING OLD salary, NEW salary, last_name BULK COLLECT INTO old_sals, new_sals, names; DBMS_OUTPUT.PUT_LINE('Updated ' || SQL%ROWCOUNT || ' rows: '); FOR i IN old_sals.FIRST .. old_sals.LAST LOOP DBMS_OUTPUT.PUT_LINE(names(i) || ': Old Salary $' || old_sals(i) || ', New Salary $' || new_sals(i)); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-63.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE emp_temp; CREATE TABLE emp_temp AS SELECT * FROM employees ORDER BY employee_id, department_id; DECLARE TYPE NumList IS TABLE OF NUMBER; depts NumList := NumList(10,20,30); TYPE enum_t IS TABLE OF employees.employee_id%TYPE; e_ids enum_t; TYPE dept_t IS TABLE OF employees.department_id%TYPE; d_ids dept_t; BEGIN FORALL j IN depts.FIRST..depts.LAST DELETE FROM emp_temp WHERE department_id = depts(j) RETURNING employee_id, department_id BULK COLLECT INTO e_ids, d_ids; DBMS_OUTPUT.PUT_LINE ('Deleted ' || SQL%ROWCOUNT || ' rows:'); FOR i IN e_ids.FIRST .. e_ids.LAST LOOP DBMS_OUTPUT.PUT_LINE ( 'Employee #' || e_ids(i) || ' from dept #' || d_ids(i) ); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-65.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html DROP TABLE emp_temp; CREATE TABLE emp_temp AS SELECT * FROM employees ORDER BY employee_id, department_id; DECLARE TYPE NumList IS TABLE OF NUMBER; depts NumList := NumList(10,20,30); TYPE enum_t IS TABLE OF employees.employee_id%TYPE; e_ids enum_t; TYPE dept_t IS TABLE OF employees.department_id%TYPE; d_ids dept_t; BEGIN FOR j IN depts.FIRST..depts.LAST LOOP DELETE FROM emp_temp WHERE department_id = depts(j) RETURNING employee_id, department_id BULK COLLECT INTO e_ids, d_ids; END LOOP; DBMS_OUTPUT.PUT_LINE ('Deleted ' || SQL%ROWCOUNT || ' rows:'); FOR i IN e_ids.FIRST .. e_ids.LAST LOOP DBMS_OUTPUT.PUT_LINE ( 'Employee #' || e_ids(i) || ' from dept #' || d_ids(i) ); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-67.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html BEGIN FORALL i IN :lower..:upper DELETE FROM employees WHERE department_id = :depts(i); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/bulk-sql-and-bulk-binding-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/bulk-sql-and-bulk-binding.html SELECT cust_name "Customer", amount "Valid order amount" FROM valid_orders ORDER BY cust_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html SELECT * FROM TABLE(table_function_name(parameter_list)) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html SELECT * FROM table_function_name(parameter_list) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html SELECT * FROM TABLE(tf2(CURSOR(SELECT * FROM TABLE(tf1())))); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html CREATE OR REPLACE PACKAGE refcur_pkg AUTHID DEFINER IS TYPE refcur_t1 IS REF CURSOR RETURN employees%ROWTYPE; TYPE refcur_t2 IS REF CURSOR RETURN departments%ROWTYPE; TYPE outrec_typ IS RECORD ( var_num NUMBER(6), var_char1 VARCHAR2(30), var_char2 VARCHAR2(30) ); TYPE outrecset IS TABLE OF outrec_typ; FUNCTION g_trans (p1 refcur_t1, p2 refcur_t2) RETURN outrecset PIPELINED; END refcur_pkg; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html CREATE OR REPLACE PACKAGE BODY refcur_pkg IS FUNCTION g_trans ( p1 refcur_t1, p2 refcur_t2 ) RETURN outrecset PIPELINED IS out_rec outrec_typ; in_rec1 p1%ROWTYPE; in_rec2 p2%ROWTYPE; BEGIN LOOP FETCH p2 INTO in_rec2; EXIT WHEN p2%NOTFOUND; END LOOP; CLOSE p2; LOOP FETCH p1 INTO in_rec1; EXIT WHEN p1%NOTFOUND; -- first row out_rec.var_num := in_rec1.employee_id; out_rec.var_char1 := in_rec1.first_name; out_rec.var_char2 := in_rec1.last_name; PIPE ROW(out_rec); -- second row out_rec.var_num := in_rec2.department_id; out_rec.var_char1 := in_rec2.department_name; out_rec.var_char2 := TO_CHAR(in_rec2.location_id); PIPE ROW(out_rec); END LOOP; CLOSE p1; RETURN; END g_trans; END refcur_pkg; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html SELECT * FROM TABLE ( refcur_pkg.g_trans ( CURSOR (SELECT * FROM employees WHERE department_id = 60), CURSOR (SELECT * FROM departments WHERE department_id = 60) ) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html DROP TABLE gradereport; CREATE TABLE gradereport ( student VARCHAR2(30), subject VARCHAR2(30), weight NUMBER, grade NUMBER ); INSERT INTO gradereport (student, subject, weight, grade) VALUES ('Mark', 'Physics', 4, 4); INSERT INTO gradereport (student, subject, weight, grade) VALUES ('Mark','Chemistry', 4, 3); INSERT INTO gradereport (student, subject, weight, grade) VALUES ('Mark','Maths', 3, 3); INSERT INTO gradereport (student, subject, weight, grade) VALUES ('Mark','Economics', 3, 4); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html CREATE OR REPLACE PACKAGE pkg_gpa AUTHID DEFINER IS TYPE gpa IS TABLE OF NUMBER; FUNCTION weighted_average(input_values SYS_REFCURSOR) RETURN gpa PIPELINED; END pkg_gpa; / CREATE OR REPLACE PACKAGE BODY pkg_gpa IS FUNCTION weighted_average (input_values SYS_REFCURSOR) RETURN gpa PIPELINED IS grade NUMBER; total NUMBER := 0; total_weight NUMBER := 0; weight NUMBER := 0; BEGIN LOOP FETCH input_values INTO weight, grade; EXIT WHEN input_values%NOTFOUND; total_weight := total_weight + weight; -- Accumulate weighted average total := total + grade*weight; END LOOP; PIPE ROW (total / total_weight); RETURN; -- returns single result END weighted_average; END pkg_gpa; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html SELECT w.column_value "weighted result" FROM pkg_gpa.weighted_average ( CURSOR (SELECT weight, grade FROM gradereport) ) w; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html CREATE OR REPLACE PACKAGE pkg1 AUTHID DEFINER AS TYPE numset_t IS TABLE OF NUMBER; FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED; END pkg1; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html CREATE TYPE t IS TABLE OF NUMBER / CREATE OR REPLACE FUNCTION pipe_rows RETURN t PIPELINED AUTHID DEFINER IS n NUMBER := 0; BEGIN LOOP n := n + 1; PIPE ROW (n); END LOOP; END pipe_rows; / SELECT COLUMN_VALUE FROM TABLE(pipe_rows()) WHERE ROWNUM < 5 / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html CREATE OR REPLACE FUNCTION get_external_source_data RETURN t PIPELINED AUTHID DEFINER IS BEGIN External_Source.Init(); -- Initialize. <> BEGIN LOOP -- Pipe rows from external source. PIPE ROW (External_Source.Next_Row()); END LOOP; EXCEPTION WHEN External_Source.Done THEN -- When no more rows are available, External_Source.Clean_Up(); -- clean up. WHEN NO_DATA_NEEDED THEN -- When no more rows are needed, External_Source.Clean_Up(); -- clean up. RAISE NO_DATA_NEEDED; -- Optional, equivalent to RETURN. END b; END get_external_source_data; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html CREATE OR REPLACE PACKAGE BODY pkg1 AS FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED IS BEGIN FOR i IN 1..x LOOP PIPE ROW(i); END LOOP; RETURN; END f1; END pkg1; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html SELECT * FROM TABLE(pkg1.f1(5)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html SELECT * FROM pkg1.f1(2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/chaining-pipelined-table-functions-multiple-transformations-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/chaining-pipelined-table-functions-multiple-transformations.html CREATE OR REPLACE PACKAGE refcur_pkg AUTHID DEFINER IS TYPE refcur_t IS REF CURSOR RETURN employees%ROWTYPE; TYPE outrec_typ IS RECORD ( var_num NUMBER(6), var_char1 VARCHAR2(30), var_char2 VARCHAR2(30) ); TYPE outrecset IS TABLE OF outrec_typ; FUNCTION f_trans (p refcur_t) RETURN outrecset PIPELINED; END refcur_pkg; / CREATE OR REPLACE PACKAGE BODY refcur_pkg IS FUNCTION f_trans (p refcur_t) RETURN outrecset PIPELINED IS out_rec outrec_typ; in_rec p%ROWTYPE; BEGIN LOOP FETCH p INTO in_rec; -- input row EXIT WHEN p%NOTFOUND; out_rec.var_num := in_rec.employee_id; out_rec.var_char1 := in_rec.first_name; out_rec.var_char2 := in_rec.last_name; PIPE ROW(out_rec); -- first transformed output row out_rec.var_char1 := in_rec.email; out_rec.var_char2 := in_rec.phone_number; PIPE ROW(out_rec); -- second transformed output row END LOOP; CLOSE p; RETURN; END f_trans; END refcur_pkg; / SELECT * FROM TABLE ( refcur_pkg.f_trans ( CURSOR (SELECT * FROM employees WHERE department_id = 60) ) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-comparisons-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-comparisons.html DECLARE TYPE Foursome IS VARRAY(4) OF VARCHAR2(15); -- VARRAY type team Foursome; -- varray variable TYPE Roster IS TABLE OF VARCHAR2(15); -- nested table type names Roster := Roster('Adams', 'Patel'); -- nested table variable BEGIN IF team IS NULL THEN DBMS_OUTPUT.PUT_LINE('team IS NULL'); ELSE DBMS_OUTPUT.PUT_LINE('team IS NOT NULL'); END IF; IF names IS NOT NULL THEN DBMS_OUTPUT.PUT_LINE('names IS NOT NULL'); ELSE DBMS_OUTPUT.PUT_LINE('names IS NULL'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-comparisons-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-comparisons.html DECLARE TYPE dnames_tab IS TABLE OF VARCHAR2(30); -- element type is not record type dept_names1 dnames_tab := dnames_tab('Shipping','Sales','Finance','Payroll'); dept_names2 dnames_tab := dnames_tab('Sales','Finance','Shipping','Payroll'); dept_names3 dnames_tab := dnames_tab('Sales','Finance','Payroll'); BEGIN IF dept_names1 = dept_names2 THEN DBMS_OUTPUT.PUT_LINE('dept_names1 = dept_names2'); END IF; IF dept_names2 != dept_names3 THEN DBMS_OUTPUT.PUT_LINE('dept_names2 != dept_names3'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-comparisons-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-comparisons.html DECLARE TYPE nested_typ IS TABLE OF NUMBER; nt1 nested_typ := nested_typ(1,2,3); nt2 nested_typ := nested_typ(3,2,1); nt3 nested_typ := nested_typ(2,3,1,3); nt4 nested_typ := nested_typ(1,2,4); PROCEDURE testify ( truth BOOLEAN := NULL, quantity NUMBER := NULL ) IS BEGIN IF truth IS NOT NULL THEN DBMS_OUTPUT.PUT_LINE ( CASE truth WHEN TRUE THEN 'True' WHEN FALSE THEN 'False' END ); END IF; IF quantity IS NOT NULL THEN DBMS_OUTPUT.PUT_LINE(quantity); END IF; END; BEGIN testify(truth => (nt1 IN (nt2,nt3,nt4))); -- condition testify(truth => (nt1 SUBMULTISET OF nt3)); -- condition testify(truth => (nt1 NOT SUBMULTISET OF nt4)); -- condition testify(truth => (4 MEMBER OF nt1)); -- condition testify(truth => (nt3 IS A SET)); -- condition testify(truth => (nt3 IS NOT A SET)); -- condition testify(truth => (nt1 IS EMPTY)); -- condition testify(quantity => (CARDINALITY(nt3))); -- function testify(quantity => (CARDINALITY(SET(nt3)))); -- 2 functions END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE nt nt_type := nt_type(11, 22, 33, 44, 55, 66); BEGIN print_nt(nt); nt.DELETE(2); -- Delete second element print_nt(nt); nt(2) := 2222; -- Restore second element print_nt(nt); nt.DELETE(2, 4); -- Delete range of elements print_nt(nt); nt(3) := 3333; -- Restore third element print_nt(nt); nt.DELETE; -- Delete all elements print_nt(nt); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE aa_type_int IS TABLE OF INTEGER INDEX BY PLS_INTEGER; aa_int aa_type_int; PROCEDURE print_first_and_last IS BEGIN DBMS_OUTPUT.PUT_LINE('FIRST = ' || aa_int.FIRST); DBMS_OUTPUT.PUT_LINE('LAST = ' || aa_int.LAST); END print_first_and_last; BEGIN aa_int(1) := 3; aa_int(2) := 6; aa_int(3) := 9; aa_int(4) := 12; DBMS_OUTPUT.PUT_LINE('Before deletions:'); print_first_and_last; aa_int.DELETE(1); aa_int.DELETE(4); DBMS_OUTPUT.PUT_LINE('After deletions:'); print_first_and_last; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE aa_type_str IS TABLE OF INTEGER INDEX BY VARCHAR2(10); aa_str aa_type_str; PROCEDURE print_first_and_last IS BEGIN DBMS_OUTPUT.PUT_LINE('FIRST = ' || aa_str.FIRST); DBMS_OUTPUT.PUT_LINE('LAST = ' || aa_str.LAST); END print_first_and_last; BEGIN aa_str('Z') := 26; aa_str('A') := 1; aa_str('K') := 11; aa_str('R') := 18; DBMS_OUTPUT.PUT_LINE('Before deletions:'); print_first_and_last; aa_str.DELETE('A'); aa_str.DELETE('Z'); DBMS_OUTPUT.PUT_LINE('After deletions:'); print_first_and_last; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE team_type IS VARRAY(4) OF VARCHAR2(15); team team_type; PROCEDURE print_team (heading VARCHAR2) IS BEGIN DBMS_OUTPUT.PUT_LINE(heading); IF team IS NULL THEN DBMS_OUTPUT.PUT_LINE('Does not exist'); ELSIF team.FIRST IS NULL THEN DBMS_OUTPUT.PUT_LINE('Has no members'); ELSE FOR i IN team.FIRST..team.LAST LOOP DBMS_OUTPUT.PUT_LINE(i || '. ' || team(i)); END LOOP; END IF; DBMS_OUTPUT.PUT_LINE('---'); END; BEGIN print_team('Team Status:'); team := team_type(); -- Team is funded, but nobody is on it. print_team('Team Status:'); team := team_type('John', 'Mary'); -- Put 2 members on team. print_team('Initial Team:'); team := team_type('Arun', 'Amitha', 'Allan', 'Mae'); -- Change team. print_team('New Team:'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE team_type IS TABLE OF VARCHAR2(15); team team_type; PROCEDURE print_team (heading VARCHAR2) IS BEGIN DBMS_OUTPUT.PUT_LINE(heading); IF team IS NULL THEN DBMS_OUTPUT.PUT_LINE('Does not exist'); ELSIF team.FIRST IS NULL THEN DBMS_OUTPUT.PUT_LINE('Has no members'); ELSE FOR i IN team.FIRST..team.LAST LOOP DBMS_OUTPUT.PUT(i || '. '); IF team.EXISTS(i) THEN DBMS_OUTPUT.PUT_LINE(team(i)); ELSE DBMS_OUTPUT.PUT_LINE('(to be hired)'); END IF; END LOOP; END IF; DBMS_OUTPUT.PUT_LINE('---'); END; BEGIN print_team('Team Status:'); team := team_type(); -- Team is funded, but nobody is on it. print_team('Team Status:'); team := team_type('Arun', 'Amitha', 'Allan', 'Mae'); -- Add members. print_team('Initial Team:'); team.DELETE(2,3); -- Remove 2nd and 3rd members. print_team('Current Team:'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE NumList IS VARRAY(10) OF INTEGER; n NumList := NumList(1,3,5,7); PROCEDURE print_count_and_last IS BEGIN DBMS_OUTPUT.PUT('n.COUNT = ' || n.COUNT || ', '); DBMS_OUTPUT.PUT_LINE('n.LAST = ' || n.LAST); END print_count_and_last; BEGIN print_count_and_last; n.EXTEND(3); print_count_and_last; n.TRIM(5); print_count_and_last; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE NumList IS TABLE OF INTEGER; n NumList := NumList(1,3,5,7); PROCEDURE print_count_and_last IS BEGIN DBMS_OUTPUT.PUT('n.COUNT = ' || n.COUNT || ', '); DBMS_OUTPUT.PUT_LINE('n.LAST = ' || n.LAST); END print_count_and_last; BEGIN print_count_and_last; n.DELETE(3); -- Delete third element print_count_and_last; n.EXTEND(2); -- Add two null elements to end print_count_and_last; FOR i IN 1..8 LOOP IF n.EXISTS(i) THEN IF n(i) IS NOT NULL THEN DBMS_OUTPUT.PUT_LINE('n(' || i || ') = ' || n(i)); ELSE DBMS_OUTPUT.PUT_LINE('n(' || i || ') = NULL'); END IF; ELSE DBMS_OUTPUT.PUT_LINE('n(' || i || ') does not exist'); END IF; END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE aa_type IS TABLE OF INTEGER INDEX BY PLS_INTEGER; aa aa_type; -- associative array TYPE va_type IS VARRAY(4) OF INTEGER; va va_type := va_type(2,4); -- varray TYPE nt_type IS TABLE OF INTEGER; nt nt_type := nt_type(1,3,5); -- nested table BEGIN aa(1):=3; aa(2):=6; aa(3):=9; aa(4):= 12; DBMS_OUTPUT.PUT('aa.COUNT = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(aa.COUNT), 'NULL')); DBMS_OUTPUT.PUT('aa.LIMIT = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(aa.LIMIT), 'NULL')); DBMS_OUTPUT.PUT('va.COUNT = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(va.COUNT), 'NULL')); DBMS_OUTPUT.PUT('va.LIMIT = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(va.LIMIT), 'NULL')); DBMS_OUTPUT.PUT('nt.COUNT = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(nt.COUNT), 'NULL')); DBMS_OUTPUT.PUT('nt.LIMIT = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(nt.LIMIT), 'NULL')); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE Arr_Type IS VARRAY(10) OF NUMBER; v_Numbers Arr_Type := Arr_Type(); BEGIN v_Numbers.EXTEND(4); v_Numbers (1) := 10; v_Numbers (2) := 20; v_Numbers (3) := 30; v_Numbers (4) := 40; DBMS_OUTPUT.PUT_LINE(NVL(v_Numbers.prior (3400), -1)); DBMS_OUTPUT.PUT_LINE(NVL(v_Numbers.next (3400), -1)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE nt_type IS TABLE OF NUMBER; nt nt_type := nt_type(18, NULL, 36, 45, 54, 63); BEGIN nt.DELETE(4); DBMS_OUTPUT.PUT_LINE('nt(4) was deleted.'); FOR i IN 1..7 LOOP DBMS_OUTPUT.PUT('nt.PRIOR(' || i || ') = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(nt.PRIOR(i)), 'NULL')); DBMS_OUTPUT.PUT('nt.NEXT(' || i || ') = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(nt.NEXT(i)), 'NULL')); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE NumList IS TABLE OF NUMBER; n NumList := NumList(1, 2, NULL, NULL, 5, NULL, 7, 8, 9, NULL); idx INTEGER; BEGIN DBMS_OUTPUT.PUT_LINE('First to last:'); idx := n.FIRST; WHILE idx IS NOT NULL LOOP DBMS_OUTPUT.PUT('n(' || idx || ') = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(n(idx)), 'NULL')); idx := n.NEXT(idx); END LOOP; DBMS_OUTPUT.PUT_LINE('--------------'); DBMS_OUTPUT.PUT_LINE('Last to first:'); idx := n.LAST; WHILE idx IS NOT NULL LOOP DBMS_OUTPUT.PUT('n(' || idx || ') = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(n(idx)), 'NULL')); idx := n.PRIOR(idx); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE aa_type_str IS TABLE OF INTEGER INDEX BY VARCHAR2(10); aa_str aa_type_str; PROCEDURE print_aa_str IS i VARCHAR2(10); BEGIN i := aa_str.FIRST; IF i IS NULL THEN DBMS_OUTPUT.PUT_LINE('aa_str is empty'); ELSE WHILE i IS NOT NULL LOOP DBMS_OUTPUT.PUT('aa_str.(' || i || ') = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(aa_str(i)), 'NULL')); i := aa_str.NEXT(i); END LOOP; END IF; DBMS_OUTPUT.PUT_LINE('---'); END print_aa_str; BEGIN aa_str('M') := 13; aa_str('Z') := 26; aa_str('C') := 3; print_aa_str; aa_str.DELETE; -- Delete all elements print_aa_str; aa_str('M') := 13; -- Replace deleted element with same value aa_str('Z') := 260; -- Replace deleted element with new value aa_str('C') := 30; -- Replace deleted element with new value aa_str('W') := 23; -- Add new element aa_str('J') := 10; -- Add new element aa_str('N') := 14; -- Add new element aa_str('P') := 16; -- Add new element aa_str('W') := 23; -- Add new element aa_str('J') := 10; -- Add new element print_aa_str; aa_str.DELETE('C'); -- Delete one element print_aa_str; aa_str.DELETE('N','W'); -- Delete range of elements print_aa_str; aa_str.DELETE('Z','M'); -- Does nothing print_aa_str; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE nt nt_type := nt_type(11, 22, 33, 44, 55, 66); BEGIN print_nt(nt); nt.TRIM; -- Trim last element print_nt(nt); nt.DELETE(4); -- Delete fourth element print_nt(nt); nt.TRIM(2); -- Trim last two elements print_nt(nt); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE nt nt_type := nt_type(11, 22, 33); BEGIN print_nt(nt); nt.EXTEND(2,1); -- Append two copies of first element print_nt(nt); nt.DELETE(5); -- Delete fifth element print_nt(nt); nt.EXTEND; -- Append one null element print_nt(nt); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-methods-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-methods.html DECLARE TYPE NumList IS TABLE OF INTEGER; n NumList := NumList(1,3,5,7); BEGIN n.DELETE(2); -- Delete second element FOR i IN 1..6 LOOP IF n.EXISTS(i) THEN DBMS_OUTPUT.PUT_LINE('n(' || i || ') = ' || n(i)); ELSE DBMS_OUTPUT.PUT_LINE('n(' || i || ') does not exist'); END IF; END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-types-defined-package-specifications-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-types-defined-package-specifications.html CREATE OR REPLACE PACKAGE pkg AS TYPE NumList IS TABLE OF NUMBER; PROCEDURE print_numlist (nums NumList); END pkg; / CREATE OR REPLACE PACKAGE BODY pkg AS PROCEDURE print_numlist (nums NumList) IS BEGIN FOR i IN nums.FIRST..nums.LAST LOOP DBMS_OUTPUT.PUT_LINE(nums(i)); END LOOP; END; END pkg; / DECLARE TYPE NumList IS TABLE OF NUMBER; -- local type identical to package type n1 pkg.NumList := pkg.NumList(2,4); -- package type n2 NumList := NumList(6,8); -- local type BEGIN pkg.print_numlist(n1); -- succeeds pkg.print_numlist(n2); -- fails END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/collection-types-defined-package-specifications-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/collection-types-defined-package-specifications.html CREATE OR REPLACE TYPE NumList IS TABLE OF NUMBER; -- standalone collection type identical to package type / DECLARE n1 pkg.NumList := pkg.NumList(2,4); -- package type n2 NumList := NumList(6,8); -- standalone type BEGIN pkg.print_numlist(n1); -- succeeds pkg.print_numlist(n2); -- fails END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/column-name-precedence-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/column-name-precedence.html DROP TABLE employees2; CREATE TABLE employees2 AS SELECT LAST_NAME FROM employees; DECLARE last_name VARCHAR2(10) := 'King'; BEGIN DELETE FROM employees2 WHERE LAST_NAME = last_name; DBMS_OUTPUT.PUT_LINE('Deleted ' || SQL%ROWCOUNT || ' rows.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/column-name-precedence-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/column-name-precedence.html DROP TABLE employees2; CREATE TABLE employees2 AS SELECT LAST_NAME FROM employees; DECLARE v_last_name VARCHAR2(10) := 'King'; BEGIN DELETE FROM employees2 WHERE LAST_NAME = v_last_name; DBMS_OUTPUT.PUT_LINE('Deleted ' || SQL%ROWCOUNT || ' rows.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/column-name-precedence-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/column-name-precedence.html DROP TABLE employees2; CREATE TABLE employees2 AS SELECT LAST_NAME FROM employees; <
> DECLARE last_name VARCHAR2(10) := 'King'; BEGIN DELETE FROM employees2 WHERE last_name = main.last_name; DBMS_OUTPUT.PUT_LINE('Deleted ' || SQL%ROWCOUNT || ' rows.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/column-name-precedence-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/column-name-precedence.html DECLARE FUNCTION dept_name (department_id IN NUMBER) RETURN departments.department_name%TYPE IS department_name departments.department_name%TYPE; BEGIN SELECT department_name INTO dept_name.department_name -- ^column ^local variable FROM departments WHERE department_id = dept_name.department_id; -- ^column ^formal parameter RETURN department_name; END dept_name; BEGIN FOR item IN ( SELECT department_id FROM departments ORDER BY department_name) LOOP DBMS_OUTPUT.PUT_LINE ('Department: ' || dept_name(item.department_id)); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html ALTER SESSION SET PLSQL_WARNINGS='ENABLE:ALL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html ALTER PROCEDURE unreachable_code COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html SHOW ERRORS ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html ALTER SESSION SET PLSQL_WARNINGS='ENABLE:PERFORMANCE'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html ALTER PROCEDURE loc_var COMPILE PLSQL_WARNINGS='ENABLE:PERFORMANCE' REUSE SETTINGS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html ALTER SESSION SET PLSQL_WARNINGS='ENABLE:SEVERE', 'DISABLE:PERFORMANCE', 'ERROR:06002'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html ALTER SESSION SET PLSQL_WARNINGS='DISABLE:ALL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html ALTER SESSION SET PLSQL_WARNINGS='DISABLE:ALL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html CREATE OR REPLACE PROCEDURE unreachable_code AUTHID DEFINER AS x CONSTANT BOOLEAN := TRUE; BEGIN IF x THEN DBMS_OUTPUT.PUT_LINE('TRUE'); ELSE DBMS_OUTPUT.PUT_LINE('FALSE'); END IF; END unreachable_code; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html CALL DBMS_WARNING.set_warning_setting_string ('ENABLE:ALL', 'SESSION'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compile-time-warnings-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compile-time-warnings.html SELECT DBMS_WARNING.get_warning_setting_string() FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compiling-pl-sql-units-native-execution-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compiling-pl-sql-units-native-execution.html ALTER PROCEDURE my_proc COMPILE PLSQL_CODE_TYPE=NATIVE REUSE SETTINGS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compiling-pl-sql-units-native-execution-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compiling-pl-sql-units-native-execution.html SPOOL pre_update_invalid.log SELECT o.OWNER, o.OBJECT_NAME, o.OBJECT_TYPE FROM DBA_OBJECTS o, DBA_PLSQL_OBJECT_SETTINGS s WHERE o.OBJECT_NAME = s.NAME AND o.STATUS='INVALID'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compiling-pl-sql-units-native-execution-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compiling-pl-sql-units-native-execution.html ALTER PACKAGE SYS.DBMS_OUTPUT COMPILE BODY REUSE SETTINGS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compiling-pl-sql-units-native-execution-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compiling-pl-sql-units-native-execution.html SELECT TYPE, PLSQL_CODE_TYPE, COUNT(*) FROM DBA_PLSQL_OBJECT_SETTINGS WHERE PLSQL_CODE_TYPE IS NOT NULL AND ORIGIN_CON_ID=SYS_CONTEXT('USERENV', 'CON_ID') GROUP BY TYPE, PLSQL_CODE_TYPE ORDER BY TYPE, PLSQL_CODE_TYPE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compiling-pl-sql-units-native-execution-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compiling-pl-sql-units-native-execution.html ALTER SYSTEM ENABLE RESTRICTED SESSION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/compiling-pl-sql-units-native-execution-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/compiling-pl-sql-units-native-execution.html ALTER SYSTEM DISABLE RESTRICTED SESSION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-compilation1-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-compilation1.html BEGIN DBMS_OUTPUT.PUT_LINE('$$PLSCOPE_SETTINGS = ' || $$PLSCOPE_SETTINGS); DBMS_OUTPUT.PUT_LINE('$$PLSQL_CCFLAGS = ' || $$PLSQL_CCFLAGS); DBMS_OUTPUT.PUT_LINE('$$PLSQL_CODE_TYPE = ' || $$PLSQL_CODE_TYPE); DBMS_OUTPUT.PUT_LINE('$$PLSQL_OPTIMIZE_LEVEL = ' || $$PLSQL_OPTIMIZE_LEVEL); DBMS_OUTPUT.PUT_LINE('$$PLSQL_WARNINGS = ' || $$PLSQL_WARNINGS); DBMS_OUTPUT.PUT_LINE('$$NLS_LENGTH_SEMANTICS = ' || $$NLS_LENGTH_SEMANTICS); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-compilation1-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-compilation1.html ALTER SESSION SET PLSQL_CCFLAGS = 'name1:value1, name2:value2, ... namen:valuen' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-compilation1-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-compilation1.html ALTER SESSION SET PLSQL_CCFLAGS = 'flag:TRUE, flag:5' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-compilation1-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-compilation1.html ALTER SESSION SET PLSQL_CCFlags = 'Some_Flag:1, Some_Flag:2, PLSQL_CCFlags:99' / BEGIN DBMS_OUTPUT.PUT_LINE($$Some_Flag); DBMS_OUTPUT.PUT_LINE($$PLSQL_CCFlags); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-compilation1-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-compilation1.html ALTER SESSION SET PLSQL_CCFLAGS = 'my_debug:FALSE, my_tracing:FALSE'; CREATE OR REPLACE PACKAGE my_pkg AUTHID DEFINER AS SUBTYPE my_real IS $IF DBMS_DB_VERSION.VERSION < 10 $THEN NUMBER; $ELSE BINARY_DOUBLE; $END my_pi my_real; my_e my_real; END my_pkg; / CREATE OR REPLACE PACKAGE BODY my_pkg AS BEGIN $IF DBMS_DB_VERSION.VERSION < 10 $THEN my_pi := 3.14159265358979323846264338327950288420; my_e := 2.71828182845904523536028747135266249775; $ELSE my_pi := 3.14159265358979323846264338327950288420d; my_e := 2.71828182845904523536028747135266249775d; $END END my_pkg; / CREATE OR REPLACE PROCEDURE circle_area(radius my_pkg.my_real) AUTHID DEFINER IS my_area my_pkg.my_real; my_data_type VARCHAR2(30); BEGIN my_area := my_pkg.my_pi * (radius**2); DBMS_OUTPUT.PUT_LINE ('Radius: ' || TO_CHAR(radius) || ' Area: ' || TO_CHAR(my_area)); $IF $$my_debug $THEN SELECT DATA_TYPE INTO my_data_type FROM USER_ARGUMENTS WHERE OBJECT_NAME = 'CIRCLE_AREA' AND ARGUMENT_NAME = 'RADIUS'; DBMS_OUTPUT.PUT_LINE ('Data type of the RADIUS argument is: ' || my_data_type); $END END; / CALL DBMS_PREPROCESSOR.PRINT_POST_PROCESSED_SOURCE ('PACKAGE', 'HR', 'MY_PKG'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-compilation1-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-compilation1.html CALL DBMS_PREPROCESSOR.PRINT_POST_PROCESSED_SOURCE ( 'PACKAGE', 'HR', 'MY_PKG' ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-compilation1-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-compilation1.html CREATE PACKAGE my_pkg AUTHID DEFINERs AS SUBTYPE my_real IS BINARY_DOUBLE; my_pi my_real; my_e my_real; END my_pkg; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-compilation1-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-compilation1.html CREATE OR REPLACE PACKAGE cc_pkg AUTHID DEFINER $IF $$XFLAG $THEN ACCESSIBLE BY(p1_pkg) $END IS i NUMBER := 10; trace CONSTANT BOOLEAN := TRUE; END cc_pkg; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-compilation1-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-compilation1.html CREATE OR REPLACE PROCEDURE my_proc ( $IF $$xxx $THEN i IN PLS_INTEGER $ELSE i IN INTEGER $END ) IS BEGIN NULL; END my_proc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-selection-statements-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-selection-statements.html DECLARE PROCEDURE p ( sales NUMBER, quota NUMBER, emp_id NUMBER ) IS bonus NUMBER := 0; BEGIN IF sales > (quota + 200) THEN bonus := (sales - quota)/4; ELSE IF sales > quota THEN bonus := 50; ELSE bonus := 0; END IF; END IF; DBMS_OUTPUT.PUT_LINE('bonus = ' || bonus); UPDATE employees SET salary = salary + bonus WHERE employee_id = emp_id; END p; BEGIN p(10100, 10000, 120); p(10500, 10000, 121); p(9500, 10000, 122); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-selection-statements-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-selection-statements.html DECLARE PROCEDURE p (sales NUMBER) IS bonus NUMBER := 0; BEGIN IF sales > 50000 THEN bonus := 1500; ELSIF sales > 35000 THEN bonus := 500; ELSE bonus := 100; END IF; DBMS_OUTPUT.PUT_LINE ( 'Sales = ' || sales || ', bonus = ' || bonus || '.' ); END p; BEGIN p(55000); p(40000); p(30000); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-selection-statements-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-selection-statements.html DECLARE grade CHAR(1); BEGIN grade := 'B'; IF grade = 'A' THEN DBMS_OUTPUT.PUT_LINE('Excellent'); ELSIF grade = 'B' THEN DBMS_OUTPUT.PUT_LINE('Very Good'); ELSIF grade = 'C' THEN DBMS_OUTPUT.PUT_LINE('Good'); ELSIF grade = 'D' THEN DBMS_OUTPUT. PUT_LINE('Fair'); ELSIF grade = 'F' THEN DBMS_OUTPUT.PUT_LINE('Poor'); ELSE DBMS_OUTPUT.PUT_LINE('No such grade'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-selection-statements-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-selection-statements.html DECLARE grade CHAR(1); BEGIN grade := 'B'; CASE grade WHEN 'A' THEN DBMS_OUTPUT.PUT_LINE('Excellent'); WHEN 'B' THEN DBMS_OUTPUT.PUT_LINE('Very Good'); WHEN 'C' THEN DBMS_OUTPUT.PUT_LINE('Good'); WHEN 'D' THEN DBMS_OUTPUT.PUT_LINE('Fair'); WHEN 'F' THEN DBMS_OUTPUT.PUT_LINE('Poor'); ELSE DBMS_OUTPUT.PUT_LINE('No such grade'); END CASE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-selection-statements-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-selection-statements.html DECLARE grade NUMBER; BEGIN grade := '85'; CASE grade WHEN < 0, > 100 THEN DBMS_OUTPUT.PUT_LINE('No such grade'); WHEN > 89 THEN DBMS_OUTPUT.PUT_LINE('A'); WHEN > 79 THEN DBMS_OUTPUT.PUT_LINE('B'); WHEN > 69 THEN DBMS_OUTPUT.PUT_LINE('C'); WHEN > 59 THEN DBMS_OUTPUT.PUT_LINE('D'); ELSE DBMS_OUTPUT.PUT_LINE('F'); END CASE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-selection-statements-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-selection-statements.html DECLARE grade CHAR(1); BEGIN grade := 'B'; CASE WHEN grade = 'A' THEN DBMS_OUTPUT.PUT_LINE('Excellent'); WHEN grade = 'B' THEN DBMS_OUTPUT.PUT_LINE('Very Good'); WHEN grade = 'C' THEN DBMS_OUTPUT.PUT_LINE('Good'); WHEN grade = 'D' THEN DBMS_OUTPUT.PUT_LINE('Fair'); WHEN grade = 'F' THEN DBMS_OUTPUT.PUT_LINE('Poor'); ELSE DBMS_OUTPUT.PUT_LINE('No such grade'); END CASE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-selection-statements-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-selection-statements.html DECLARE grade CHAR(1); BEGIN grade := 'B'; CASE WHEN grade = 'A' THEN DBMS_OUTPUT.PUT_LINE('Excellent'); WHEN grade = 'B' THEN DBMS_OUTPUT.PUT_LINE('Very Good'); WHEN grade = 'C' THEN DBMS_OUTPUT.PUT_LINE('Good'); WHEN grade = 'D' THEN DBMS_OUTPUT.PUT_LINE('Fair'); WHEN grade = 'F' THEN DBMS_OUTPUT.PUT_LINE('Poor'); END CASE; EXCEPTION WHEN CASE_NOT_FOUND THEN DBMS_OUTPUT.PUT_LINE('No such grade'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-selection-statements-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-selection-statements.html DECLARE PROCEDURE p ( sales NUMBER, quota NUMBER, emp_id NUMBER ) IS bonus NUMBER := 0; updated VARCHAR2(3) := 'No'; BEGIN IF sales > (quota + 200) THEN bonus := (sales - quota)/4; UPDATE employees SET salary = salary + bonus WHERE employee_id = emp_id; updated := 'Yes'; END IF; DBMS_OUTPUT.PUT_LINE ( 'Table updated? ' || updated || ', ' || 'bonus = ' || bonus || '.' ); END p; BEGIN p(10100, 10000, 120); p(10500, 10000, 121); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/conditional-selection-statements-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/conditional-selection-statements.html DECLARE PROCEDURE p ( sales NUMBER, quota NUMBER, emp_id NUMBER ) IS bonus NUMBER := 0; BEGIN IF sales > (quota + 200) THEN bonus := (sales - quota)/4; ELSE bonus := 50; END IF; DBMS_OUTPUT.PUT_LINE('bonus = ' || bonus); UPDATE employees SET salary = salary + bonus WHERE employee_id = emp_id; END p; BEGIN p(10100, 10000, 120); p(10500, 10000, 121); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/continuing-execution-handling-exceptions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/continuing-execution-handling-exceptions.html DROP TABLE employees_temp; CREATE TABLE employees_temp AS SELECT employee_id, salary, commission_pct FROM employees; DECLARE sal_calc NUMBER(8,2); BEGIN INSERT INTO employees_temp (employee_id, salary, commission_pct) VALUES (301, 2500, 0); SELECT (salary / commission_pct) INTO sal_calc FROM employees_temp WHERE employee_id = 301; INSERT INTO employees_temp VALUES (302, sal_calc/100, .1); DBMS_OUTPUT.PUT_LINE('Row inserted.'); EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Division by zero.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/continuing-execution-handling-exceptions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/continuing-execution-handling-exceptions.html DECLARE sal_calc NUMBER(8,2); BEGIN INSERT INTO employees_temp (employee_id, salary, commission_pct) VALUES (301, 2500, 0); BEGIN SELECT (salary / commission_pct) INTO sal_calc FROM employees_temp WHERE employee_id = 301; EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Substituting 2500 for undefined number.'); sal_calc := 2500; END; INSERT INTO employees_temp VALUES (302, sal_calc/100, .1); DBMS_OUTPUT.PUT_LINE('Enclosing block: Row inserted.'); EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Enclosing block: Division by zero.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html UPDATE employees SET salary = salary * 1.05 WHERE department_id IN (10, 20, 90); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html SELECT salary FROM employees WHERE job_id = 'AD_PRES'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html DROP TABLE tab1; CREATE TABLE tab1 (c1 CLOB); INSERT INTO tab1 VALUES ('

HTML Document Fragment

Some text.', 3); CREATE OR REPLACE TRIGGER trg1 BEFORE UPDATE ON tab1 FOR EACH ROW BEGIN DBMS_OUTPUT.PUT_LINE('Old value of CLOB column: '||:OLD.c1); DBMS_OUTPUT.PUT_LINE('Proposed new value of CLOB column: '||:NEW.c1); :NEW.c1 := :NEW.c1 || TO_CLOB('


Standard footer paragraph.'); DBMS_OUTPUT.PUT_LINE('Final value of CLOB column: '||:NEW.c1); END; / SET SERVEROUTPUT ON; UPDATE tab1 SET c1 = '

Different Document Fragment

Different text.'; SELECT * FROM tab1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html CREATE TABLE new ( field1 NUMBER, field2 VARCHAR2(20) ); CREATE OR REPLACE TRIGGER Print_salary_changes BEFORE UPDATE ON new REFERENCING new AS Newest FOR EACH ROW BEGIN :Newest.Field2 := TO_CHAR (:newest.field1); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html CREATE OR REPLACE TYPE t AUTHID DEFINER AS OBJECT (n NUMBER, m NUMBER) / CREATE TABLE tbl OF t / BEGIN FOR j IN 1..5 LOOP INSERT INTO tbl VALUES (t(j, 0)); END LOOP; END; / SELECT * FROM tbl ORDER BY n; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html CREATE TABLE tbl_history ( d DATE, old_obj t, new_obj t) / CREATE OR REPLACE TRIGGER Tbl_Trg AFTER UPDATE ON tbl FOR EACH ROW BEGIN INSERT INTO tbl_history (d, old_obj, new_obj) VALUES (SYSDATE, :OLD.OBJECT_VALUE, :NEW.OBJECT_VALUE); END Tbl_Trg; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html DROP TABLE Emp_log; CREATE TABLE Emp_log ( Emp_id NUMBER, Log_date DATE, New_salary NUMBER, Action VARCHAR2(20)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html UPDATE tbl SET tbl.n = tbl.n+1 / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html BEGIN FOR j IN (SELECT d, old_obj, new_obj FROM tbl_history) LOOP DBMS_OUTPUT.PUT_LINE ( j.d || ' -- old: ' || j.old_obj.n || ' ' || j.old_obj.m || ' -- new: ' || j.new_obj.n || ' ' || j.new_obj.m ); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html CREATE OR REPLACE TRIGGER log_salary_increase AFTER UPDATE OF salary ON employees FOR EACH ROW BEGIN INSERT INTO Emp_log (Emp_id, Log_date, New_salary, Action) VALUES (:NEW.employee_id, SYSDATE, :NEW.salary, 'New Salary'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html UPDATE employees SET salary = salary + 1000.0 WHERE Department_id = 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html SELECT * FROM Emp_log; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html CREATE OR REPLACE TRIGGER print_salary_changes BEFORE DELETE OR INSERT OR UPDATE ON employees FOR EACH ROW WHEN (NEW.job_id <> 'AD_PRES') -- do not print information about President DECLARE sal_diff NUMBER; BEGIN sal_diff := :NEW.salary - :OLD.salary; DBMS_OUTPUT.PUT(:NEW.last_name || ': '); DBMS_OUTPUT.PUT('Old salary = ' || :OLD.salary || ', '); DBMS_OUTPUT.PUT('New salary = ' || :NEW.salary || ', '); DBMS_OUTPUT.PUT_LINE('Difference: ' || sal_diff); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/correlation-names-and-pseudorecords-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/correlation-names-and-pseudorecords.html SELECT last_name, department_id, salary, job_id FROM employees WHERE department_id IN (10, 20, 90) ORDER BY department_id, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-expressions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-expressions.html DECLARE TYPE emp_cur_typ IS REF CURSOR; emp_cur emp_cur_typ; dept_name departments.department_name%TYPE; emp_name employees.last_name%TYPE; CURSOR c1 IS SELECT department_name, CURSOR ( SELECT e.last_name FROM employees e WHERE e.department_id = d.department_id ORDER BY e.last_name ) employees FROM departments d WHERE department_name LIKE 'A%' ORDER BY department_name; BEGIN OPEN c1; LOOP -- Process each row of query result set FETCH c1 INTO dept_name, emp_cur; EXIT WHEN c1%NOTFOUND; DBMS_OUTPUT.PUT_LINE('Department: ' || dept_name); LOOP -- Process each row of subquery result set FETCH emp_cur INTO emp_name; EXIT WHEN emp_cur%NOTFOUND; DBMS_OUTPUT.PUT_LINE('-- Employee: ' || emp_name); END LOOP; END LOOP; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html DECLARE TYPE empcurtyp IS REF CURSOR RETURN employees%ROWTYPE; -- strong type TYPE genericcurtyp IS REF CURSOR; -- weak type cursor1 empcurtyp; -- strong cursor variable cursor2 genericcurtyp; -- weak cursor variable my_cursor SYS_REFCURSOR; -- weak cursor variable TYPE deptcurtyp IS REF CURSOR RETURN departments%ROWTYPE; -- strong type dept_cv deptcurtyp; -- strong cursor variable BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html DECLARE sal employees.salary%TYPE; sal_multiple employees.salary%TYPE; factor INTEGER := 2; cv SYS_REFCURSOR; BEGIN DBMS_OUTPUT.PUT_LINE('factor = ' || factor); OPEN cv FOR SELECT salary, salary*factor FROM employees WHERE job_id LIKE 'AD_%'; -- PL/SQL evaluates factor LOOP FETCH cv INTO sal, sal_multiple; EXIT WHEN cv%NOTFOUND; DBMS_OUTPUT.PUT_LINE('sal = ' || sal); DBMS_OUTPUT.PUT_LINE('sal_multiple = ' || sal_multiple); END LOOP; factor := factor + 1; DBMS_OUTPUT.PUT_LINE('factor = ' || factor); OPEN cv FOR SELECT salary, salary*factor FROM employees WHERE job_id LIKE 'AD_%'; -- PL/SQL evaluates factor LOOP FETCH cv INTO sal, sal_multiple; EXIT WHEN cv%NOTFOUND; DBMS_OUTPUT.PUT_LINE('sal = ' || sal); DBMS_OUTPUT.PUT_LINE('sal_multiple = ' || sal_multiple); END LOOP; CLOSE cv; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html CREATE OR REPLACE PACKAGE pkg AUTHID DEFINER AS TYPE rec IS RECORD(f1 NUMBER, f2 VARCHAR2(30)); TYPE mytab IS TABLE OF rec INDEX BY pls_integer; END; / DECLARE v1 pkg.mytab; -- collection of records v2 pkg.rec; c1 SYS_REFCURSOR; BEGIN v1(1).f1 := 1; v1(1).f2 := 'one'; OPEN c1 FOR SELECT * FROM TABLE(v1); FETCH c1 INTO v2; CLOSE c1; DBMS_OUTPUT.PUT_LINE('Values in record are ' || v2.f1 || ' and ' || v2.f2); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html CREATE OR REPLACE PACKAGE emp_data AUTHID DEFINER AS TYPE empcurtyp IS REF CURSOR RETURN employees%ROWTYPE; PROCEDURE open_emp_cv (emp_cv IN OUT empcurtyp); END emp_data; / CREATE OR REPLACE PACKAGE BODY emp_data AS PROCEDURE open_emp_cv (emp_cv IN OUT EmpCurTyp) IS BEGIN OPEN emp_cv FOR SELECT * FROM employees; END open_emp_cv; END emp_data; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html CREATE OR REPLACE PACKAGE emp_data AUTHID DEFINER AS TYPE empcurtyp IS REF CURSOR RETURN employees%ROWTYPE; PROCEDURE open_emp_cv (emp_cv IN OUT empcurtyp, choice INT); END emp_data; / CREATE OR REPLACE PACKAGE BODY emp_data AS PROCEDURE open_emp_cv (emp_cv IN OUT empcurtyp, choice INT) IS BEGIN IF choice = 1 THEN OPEN emp_cv FOR SELECT * FROM employees WHERE commission_pct IS NOT NULL; ELSIF choice = 2 THEN OPEN emp_cv FOR SELECT * FROM employees WHERE salary > 2500; ELSIF choice = 3 THEN OPEN emp_cv FOR SELECT * FROM employees WHERE department_id = 100; END IF; END; END emp_data; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html CREATE OR REPLACE PACKAGE admin_data AUTHID DEFINER AS TYPE gencurtyp IS REF CURSOR; PROCEDURE open_cv (generic_cv IN OUT gencurtyp, choice INT); END admin_data; / CREATE OR REPLACE PACKAGE BODY admin_data AS PROCEDURE open_cv (generic_cv IN OUT gencurtyp, choice INT) IS BEGIN IF choice = 1 THEN OPEN generic_cv FOR SELECT * FROM employees; ELSIF choice = 2 THEN OPEN generic_cv FOR SELECT * FROM departments; ELSIF choice = 3 THEN OPEN generic_cv FOR SELECT * FROM jobs; END IF; END; END admin_data; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html BEGIN OPEN :emp_cv FOR SELECT * FROM employees; OPEN :dept_cv FOR SELECT * FROM departments; OPEN :loc_cv FOR SELECT * FROM locations; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html BEGIN CLOSE :emp_cv; CLOSE :dept_cv; CLOSE :loc_cv; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html BEGIN OPEN :c1 FOR SELECT 1 FROM DUAL; OPEN :c2 FOR SELECT 1 FROM DUAL; OPEN :c3 FOR SELECT 1 FROM DUAL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html DECLARE TYPE EmpRecTyp IS RECORD ( employee_id NUMBER, last_name VARCHAR2(25), salary NUMBER(8,2)); TYPE EmpCurTyp IS REF CURSOR RETURN EmpRecTyp; emp_cv EmpCurTyp; BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html DECLARE cv SYS_REFCURSOR; -- cursor variable v_lastname employees.last_name%TYPE; -- variable for last_name v_jobid employees.job_id%TYPE; -- variable for job_id query_2 VARCHAR2(200) := 'SELECT * FROM employees WHERE REGEXP_LIKE (job_id, ''[ACADFIMKSA]_M[ANGR]'') ORDER BY job_id'; v_employees employees%ROWTYPE; -- record variable row of table BEGIN OPEN cv FOR SELECT last_name, job_id FROM employees WHERE REGEXP_LIKE (job_id, 'S[HT]_CLERK') ORDER BY last_name; LOOP -- Fetches 2 columns into variables FETCH cv INTO v_lastname, v_jobid; EXIT WHEN cv%NOTFOUND; DBMS_OUTPUT.PUT_LINE( RPAD(v_lastname, 25, ' ') || v_jobid ); END LOOP; DBMS_OUTPUT.PUT_LINE( '-------------------------------------' ); OPEN cv FOR query_2; LOOP -- Fetches entire row into the v_employees record FETCH cv INTO v_employees; EXIT WHEN cv%NOTFOUND; DBMS_OUTPUT.PUT_LINE( RPAD(v_employees.last_name, 25, ' ') || v_employees.job_id ); END LOOP; CLOSE cv; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html DECLARE TYPE empcurtyp IS REF CURSOR; TYPE namelist IS TABLE OF employees.last_name%TYPE; TYPE sallist IS TABLE OF employees.salary%TYPE; emp_cv empcurtyp; names namelist; sals sallist; BEGIN OPEN emp_cv FOR SELECT last_name, salary FROM employees WHERE job_id = 'SA_REP' ORDER BY salary DESC; FETCH emp_cv BULK COLLECT INTO names, sals; CLOSE emp_cv; -- loop through the names and sals collections FOR i IN names.FIRST .. names.LAST LOOP DBMS_OUTPUT.PUT_LINE ('Name = ' || names(i) || ', salary = ' || sals(i)); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursor-variables-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursor-variables.html DECLARE sal employees.salary%TYPE; sal_multiple employees.salary%TYPE; factor INTEGER := 2; cv SYS_REFCURSOR; BEGIN OPEN cv FOR SELECT salary, salary*factor FROM employees WHERE job_id LIKE 'AD_%'; -- PL/SQL evaluates factor LOOP FETCH cv INTO sal, sal_multiple; EXIT WHEN cv%NOTFOUND; DBMS_OUTPUT.PUT_LINE('factor = ' || factor); DBMS_OUTPUT.PUT_LINE('sal = ' || sal); DBMS_OUTPUT.PUT_LINE('sal_multiple = ' || sal_multiple); factor := factor + 1; -- Does not affect sal_multiple END LOOP; CLOSE cv; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DROP TABLE dept_temp; CREATE TABLE dept_temp AS SELECT * FROM departments; CREATE OR REPLACE PROCEDURE p ( dept_no NUMBER ) AUTHID CURRENT_USER AS BEGIN DELETE FROM dept_temp WHERE department_id = dept_no; IF SQL%FOUND THEN DBMS_OUTPUT.PUT_LINE ( 'Delete succeeded for department number ' || dept_no ); ELSE DBMS_OUTPUT.PUT_LINE ('No department number ' || dept_no); END IF; END; / BEGIN p(270); p(400); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c IS SELECT e.job_id, j.job_title FROM employees e, jobs j WHERE e.job_id = j.job_id AND e.manager_id = 100 ORDER BY last_name; -- Record variables for rows of cursor result set: job1 c%ROWTYPE; job2 c%ROWTYPE; job3 c%ROWTYPE; job4 c%ROWTYPE; job5 c%ROWTYPE; BEGIN OPEN c; FETCH c INTO job1; -- fetches first row FETCH c INTO job2; -- fetches second row FETCH c INTO job3; -- fetches third row FETCH c INTO job4; -- fetches fourth row FETCH c INTO job5; -- fetches fifth row CLOSE c; DBMS_OUTPUT.PUT_LINE(job1.job_title || ' (' || job1.job_id || ')'); DBMS_OUTPUT.PUT_LINE(job2.job_title || ' (' || job2.job_id || ')'); DBMS_OUTPUT.PUT_LINE(job3.job_title || ' (' || job3.job_id || ')'); DBMS_OUTPUT.PUT_LINE(job4.job_title || ' (' || job4.job_id || ')'); DBMS_OUTPUT.PUT_LINE(job5.job_title || ' (' || job5.job_id || ')'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE sal employees.salary%TYPE; sal_multiple employees.salary%TYPE; factor INTEGER := 2; CURSOR c1 IS SELECT salary, salary*factor FROM employees WHERE job_id LIKE 'AD_%'; BEGIN OPEN c1; -- PL/SQL evaluates factor LOOP FETCH c1 INTO sal, sal_multiple; EXIT WHEN c1%NOTFOUND; DBMS_OUTPUT.PUT_LINE('factor = ' || factor); DBMS_OUTPUT.PUT_LINE('sal = ' || sal); DBMS_OUTPUT.PUT_LINE('sal_multiple = ' || sal_multiple); factor := factor + 1; -- Does not affect sal_multiple END LOOP; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE sal employees.salary%TYPE; sal_multiple employees.salary%TYPE; factor INTEGER := 2; CURSOR c1 IS SELECT salary, salary*factor FROM employees WHERE job_id LIKE 'AD_%'; BEGIN DBMS_OUTPUT.PUT_LINE('factor = ' || factor); OPEN c1; -- PL/SQL evaluates factor LOOP FETCH c1 INTO sal, sal_multiple; EXIT WHEN c1%NOTFOUND; DBMS_OUTPUT.PUT_LINE('sal = ' || sal); DBMS_OUTPUT.PUT_LINE('sal_multiple = ' || sal_multiple); END LOOP; CLOSE c1; factor := factor + 1; DBMS_OUTPUT.PUT_LINE('factor = ' || factor); OPEN c1; -- PL/SQL evaluates factor LOOP FETCH c1 INTO sal, sal_multiple; EXIT WHEN c1%NOTFOUND; DBMS_OUTPUT.PUT_LINE('sal = ' || sal); DBMS_OUTPUT.PUT_LINE('sal_multiple = ' || sal_multiple); END LOOP; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c1 IS SELECT employee_id, (salary * .05) raise FROM employees WHERE job_id LIKE '%_MAN' ORDER BY employee_id; emp_rec c1%ROWTYPE; BEGIN OPEN c1; LOOP FETCH c1 INTO emp_rec; EXIT WHEN c1%NOTFOUND; DBMS_OUTPUT.PUT_LINE ( 'Raise for employee #' || emp_rec.employee_id || ' is $' || emp_rec.raise ); END LOOP; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c (job VARCHAR2, max_sal NUMBER) IS SELECT last_name, first_name, (salary - max_sal) overpayment FROM employees WHERE job_id = job AND salary > max_sal ORDER BY salary; PROCEDURE print_overpaid IS last_name_ employees.last_name%TYPE; first_name_ employees.first_name%TYPE; overpayment_ employees.salary%TYPE; BEGIN LOOP FETCH c INTO last_name_, first_name_, overpayment_; EXIT WHEN c%NOTFOUND; DBMS_OUTPUT.PUT_LINE(last_name_ || ', ' || first_name_ || ' (by ' || overpayment_ || ')'); END LOOP; END print_overpaid; BEGIN DBMS_OUTPUT.PUT_LINE('----------------------'); DBMS_OUTPUT.PUT_LINE('Overpaid Stock Clerks:'); DBMS_OUTPUT.PUT_LINE('----------------------'); OPEN c('ST_CLERK', 5000); print_overpaid; CLOSE c; DBMS_OUTPUT.PUT_LINE('-------------------------------'); DBMS_OUTPUT.PUT_LINE('Overpaid Sales Representatives:'); DBMS_OUTPUT.PUT_LINE('-------------------------------'); OPEN c('SA_REP', 10000); print_overpaid; CLOSE c; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DROP TABLE employees_temp; CREATE TABLE employees_temp AS SELECT * FROM employees; DECLARE mgr_no NUMBER(6) := 122; BEGIN DELETE FROM employees_temp WHERE manager_id = mgr_no; DBMS_OUTPUT.PUT_LINE ('Number of employees deleted: ' || TO_CHAR(SQL%ROWCOUNT)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c (location NUMBER DEFAULT 1700) IS SELECT d.department_name, e.last_name manager, l.city FROM departments d, employees e, locations l WHERE l.location_id = location AND l.location_id = d.location_id AND d.department_id = e.department_id ORDER BY d.department_id; PROCEDURE print_depts IS dept_name departments.department_name%TYPE; mgr_name employees.last_name%TYPE; city_name locations.city%TYPE; BEGIN LOOP FETCH c INTO dept_name, mgr_name, city_name; EXIT WHEN c%NOTFOUND; DBMS_OUTPUT.PUT_LINE(dept_name || ' (Manager: ' || mgr_name || ')'); END LOOP; END print_depts; BEGIN DBMS_OUTPUT.PUT_LINE('DEPARTMENTS AT HEADQUARTERS:'); DBMS_OUTPUT.PUT_LINE('--------------------------------'); OPEN c; print_depts; DBMS_OUTPUT.PUT_LINE('--------------------------------'); CLOSE c; DBMS_OUTPUT.PUT_LINE('DEPARTMENTS IN CANADA:'); DBMS_OUTPUT.PUT_LINE('--------------------------------'); OPEN c(1800); -- Toronto print_depts; CLOSE c; OPEN c(1900); -- Whitehorse print_depts; CLOSE c; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c (job VARCHAR2, max_sal NUMBER, hired DATE DEFAULT TO_DATE('31-DEC-1999', 'DD-MON-YYYY')) IS SELECT last_name, first_name, (salary - max_sal) overpayment FROM employees WHERE job_id = job AND salary > max_sal AND hire_date > hired ORDER BY salary; PROCEDURE print_overpaid IS last_name_ employees.last_name%TYPE; first_name_ employees.first_name%TYPE; overpayment_ employees.salary%TYPE; BEGIN LOOP FETCH c INTO last_name_, first_name_, overpayment_; EXIT WHEN c%NOTFOUND; DBMS_OUTPUT.PUT_LINE(last_name_ || ', ' || first_name_ || ' (by ' || overpayment_ || ')'); END LOOP; END print_overpaid; BEGIN DBMS_OUTPUT.PUT_LINE('-------------------------------'); DBMS_OUTPUT.PUT_LINE('Overpaid Sales Representatives:'); DBMS_OUTPUT.PUT_LINE('-------------------------------'); OPEN c('SA_REP', 10000); -- existing reference print_overpaid; CLOSE c; DBMS_OUTPUT.PUT_LINE('------------------------------------------------'); DBMS_OUTPUT.PUT_LINE('Overpaid Sales Representatives Hired After 2014:'); DBMS_OUTPUT.PUT_LINE('------------------------------------------------'); OPEN c('SA_REP', 10000, TO_DATE('31-DEC-2014', 'DD-MON-YYYY')); -- new reference print_overpaid; CLOSE c; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c1 IS SELECT last_name, salary FROM employees WHERE ROWNUM < 11; the_name employees.last_name%TYPE; the_salary employees.salary%TYPE; BEGIN IF NOT c1%ISOPEN THEN OPEN c1; END IF; FETCH c1 INTO the_name, the_salary; IF c1%ISOPEN THEN CLOSE c1; END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c1 IS SELECT last_name, salary FROM employees WHERE ROWNUM < 11 ORDER BY last_name; my_ename employees.last_name%TYPE; my_salary employees.salary%TYPE; BEGIN OPEN c1; LOOP FETCH c1 INTO my_ename, my_salary; IF c1%FOUND THEN -- fetch succeeded DBMS_OUTPUT.PUT_LINE('Name = ' || my_ename || ', salary = ' || my_salary); ELSE -- fetch failed EXIT; END IF; END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c1 IS SELECT last_name, salary FROM employees WHERE ROWNUM < 11 ORDER BY last_name; my_ename employees.last_name%TYPE; my_salary employees.salary%TYPE; BEGIN OPEN c1; LOOP FETCH c1 INTO my_ename, my_salary; IF c1%NOTFOUND THEN -- fetch failed EXIT; ELSE -- fetch succeeded DBMS_OUTPUT.PUT_LINE ('Name = ' || my_ename || ', salary = ' || my_salary); END IF; END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c1 IS SELECT last_name FROM employees WHERE ROWNUM < 11 ORDER BY last_name; name employees.last_name%TYPE; BEGIN OPEN c1; LOOP FETCH c1 INTO name; EXIT WHEN c1%NOTFOUND OR c1%NOTFOUND IS NULL; DBMS_OUTPUT.PUT_LINE(c1%ROWCOUNT || '. ' || name); IF c1%ROWCOUNT = 5 THEN DBMS_OUTPUT.PUT_LINE('--- Fetched 5th row ---'); END IF; END LOOP; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c1 RETURN departments%ROWTYPE; -- Declare c1 CURSOR c2 IS -- Declare and define c2 SELECT employee_id, job_id, salary FROM employees WHERE salary > 2000; CURSOR c1 RETURN departments%ROWTYPE IS -- Define c1, SELECT * FROM departments -- repeating return type WHERE department_id = 110; CURSOR c3 RETURN locations%ROWTYPE; -- Declare c3 CURSOR c3 IS -- Define c3, SELECT * FROM locations -- omitting return type WHERE country_id = 'JP'; BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html FETCH cursor_name INTO into_clause ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/cursors-overview-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/cursors-overview.html DECLARE CURSOR c1 IS SELECT last_name, job_id FROM employees WHERE REGEXP_LIKE (job_id, 'S[HT]_CLERK') ORDER BY last_name; v_lastname employees.last_name%TYPE; -- variable for last_name v_jobid employees.job_id%TYPE; -- variable for job_id CURSOR c2 IS SELECT * FROM employees WHERE REGEXP_LIKE (job_id, '[ACADFIMKSA]_M[ANGR]') ORDER BY job_id; v_employees employees%ROWTYPE; -- record variable for row of table BEGIN OPEN c1; LOOP -- Fetches 2 columns into variables FETCH c1 INTO v_lastname, v_jobid; EXIT WHEN c1%NOTFOUND; DBMS_OUTPUT.PUT_LINE( RPAD(v_lastname, 25, ' ') || v_jobid ); END LOOP; CLOSE c1; DBMS_OUTPUT.PUT_LINE( '-------------------------------------' ); OPEN c2; LOOP -- Fetches entire row into the v_employees record FETCH c2 INTO v_employees; EXIT WHEN c2%NOTFOUND; DBMS_OUTPUT.PUT_LINE( RPAD(v_employees.last_name, 25, ' ') || v_employees.job_id ); END LOOP; CLOSE c2; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dbms_sql-package-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dbms_sql-package.html CREATE OR REPLACE PROCEDURE p AUTHID DEFINER AS c1 SYS_REFCURSOR; c2 SYS_REFCURSOR; BEGIN OPEN c1 FOR SELECT first_name, last_name FROM employees WHERE employee_id = 176; DBMS_SQL.RETURN_RESULT (c1); -- Now p cannot access the result. OPEN c2 FOR SELECT city, state_province FROM locations WHERE country_id = 'AU'; DBMS_SQL.RETURN_RESULT (c2); -- Now p cannot access the result. END; / BEGIN p; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dbms_sql-package-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dbms_sql-package.html CREATE OR REPLACE PROCEDURE get_employee_info (id IN VARCHAR2) AUTHID DEFINER AS rc SYS_REFCURSOR; BEGIN -- Return employee info OPEN rc FOR SELECT first_name, last_name, email, phone_number FROM employees WHERE employee_id = id; DBMS_SQL.RETURN_RESULT(rc); -- Return employee job history OPEN RC FOR SELECT job_title, start_date, end_date FROM job_history jh, jobs j WHERE jh.employee_id = id AND jh.job_id = j.job_id ORDER BY start_date DESC; DBMS_SQL.RETURN_RESULT(rc); END; / <

> DECLARE c INTEGER; rc SYS_REFCURSOR; n NUMBER; first_name VARCHAR2(20); last_name VARCHAR2(25); email VARCHAR2(25); phone_number VARCHAR2(20); job_title VARCHAR2(35); start_date DATE; end_date DATE; BEGIN c := DBMS_SQL.OPEN_CURSOR(true); DBMS_SQL.PARSE(c, 'BEGIN get_employee_info(:id); END;', DBMS_SQL.NATIVE); DBMS_SQL.BIND_VARIABLE(c, ':id', 176); n := DBMS_SQL.EXECUTE(c); -- Get employee info dbms_sql.get_next_result(c, rc); FETCH rc INTO first_name, last_name, email, phone_number; DBMS_OUTPUT.PUT_LINE('Employee: '||first_name || ' ' || last_name); DBMS_OUTPUT.PUT_LINE('Email: ' ||email); DBMS_OUTPUT.PUT_LINE('Phone: ' ||phone_number); -- Get employee job history DBMS_OUTPUT.PUT_LINE('Titles:'); DBMS_SQL.GET_NEXT_RESULT(c, rc); LOOP FETCH rc INTO job_title, start_date, end_date; EXIT WHEN rc%NOTFOUND; DBMS_OUTPUT.PUT_LINE ('- '||job_title||' ('||start_date||' - ' ||end_date||')'); END LOOP; DBMS_SQL.CLOSE_CURSOR(c); END main; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dbms_sql-package-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dbms_sql-package.html CREATE OR REPLACE TYPE vc_array IS TABLE OF VARCHAR2(200); / CREATE OR REPLACE TYPE numlist IS TABLE OF NUMBER; / CREATE OR REPLACE PROCEDURE do_query_1 ( placeholder vc_array, bindvars vc_array, sql_stmt VARCHAR2 ) AUTHID DEFINER IS TYPE curtype IS REF CURSOR; src_cur curtype; curid NUMBER; bindnames vc_array; empnos numlist; depts numlist; ret NUMBER; isopen BOOLEAN; BEGIN -- Open SQL cursor number: curid := DBMS_SQL.OPEN_CURSOR; -- Parse SQL cursor number: DBMS_SQL.PARSE(curid, sql_stmt, DBMS_SQL.NATIVE); bindnames := placeholder; -- Bind variables: FOR i IN 1 .. bindnames.COUNT LOOP DBMS_SQL.BIND_VARIABLE(curid, bindnames(i), bindvars(i)); END LOOP; -- Run SQL cursor number: ret := DBMS_SQL.EXECUTE(curid); -- Switch from DBMS_SQL to native dynamic SQL: src_cur := DBMS_SQL.TO_REFCURSOR(curid); FETCH src_cur BULK COLLECT INTO empnos, depts; -- This would cause an error because curid was converted to a REF CURSOR: -- isopen := DBMS_SQL.IS_OPEN(curid); CLOSE src_cur; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dbms_sql-package-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dbms_sql-package.html CREATE OR REPLACE PROCEDURE do_query_2 ( sql_stmt VARCHAR2 ) AUTHID DEFINER IS TYPE curtype IS REF CURSOR; src_cur curtype; curid NUMBER; desctab DBMS_SQL.DESC_TAB; colcnt NUMBER; namevar VARCHAR2(50); numvar NUMBER; datevar DATE; empno NUMBER := 100; BEGIN -- sql_stmt := SELECT ... FROM employees WHERE employee_id = :b1'; -- Open REF CURSOR variable: OPEN src_cur FOR sql_stmt USING empno; -- Switch from native dynamic SQL to DBMS_SQL package: curid := DBMS_SQL.TO_CURSOR_NUMBER(src_cur); DBMS_SQL.DESCRIBE_COLUMNS(curid, colcnt, desctab); -- Define columns: FOR i IN 1 .. colcnt LOOP IF desctab(i).col_type = 2 THEN DBMS_SQL.DEFINE_COLUMN(curid, i, numvar); ELSIF desctab(i).col_type = 12 THEN DBMS_SQL.DEFINE_COLUMN(curid, i, datevar); -- statements ELSE DBMS_SQL.DEFINE_COLUMN(curid, i, namevar, 50); END IF; END LOOP; -- Fetch rows with DBMS_SQL package: WHILE DBMS_SQL.FETCH_ROWS(curid) > 0 LOOP FOR i IN 1 .. colcnt LOOP IF (desctab(i).col_type = 1) THEN DBMS_SQL.COLUMN_VALUE(curid, i, namevar); ELSIF (desctab(i).col_type = 2) THEN DBMS_SQL.COLUMN_VALUE(curid, i, numvar); ELSIF (desctab(i).col_type = 12) THEN DBMS_SQL.COLUMN_VALUE(curid, i, datevar); -- statements END IF; END LOOP; END LOOP; DBMS_SQL.CLOSE_CURSOR(curid); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/declarations-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/declarations.html DECLARE acct_id INTEGER(4) NOT NULL := 9999; a NATURALN := 9999; b POSITIVEN := 9999; c SIMPLE_INTEGER := 9999; BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/declarations-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/declarations.html DECLARE null_string VARCHAR2(80) := TO_CHAR(''); address VARCHAR2(80); zip_code VARCHAR2(80) := SUBSTR(address, 25, 0); name VARCHAR2(80); valid BOOLEAN := (name != ''); BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/declarations-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/declarations.html DECLARE name VARCHAR(25) NOT NULL := 'Smith'; surname name%TYPE := 'Jones'; BEGIN DBMS_OUTPUT.PUT_LINE('name=' || name); DBMS_OUTPUT.PUT_LINE('surname=' || surname); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/declarations-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/declarations.html DECLARE part_number NUMBER(6); part_name VARCHAR2(20); in_stock BOOLEAN; part_price NUMBER(6,2); part_description VARCHAR2(50); BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/declarations-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/declarations.html DECLARE credit_limit CONSTANT REAL := 5000.00; max_days_in_year CONSTANT INTEGER := 366; urban_legend CONSTANT BOOLEAN := FALSE; BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/declarations-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/declarations.html DECLARE hours_worked INTEGER := 40; employee_count INTEGER := 0; pi CONSTANT REAL := 3.14159; radius REAL := 1; area REAL := (pi * radius**2); BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/declarations-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/declarations.html DECLARE counter INTEGER; -- initial value is NULL by default BEGIN counter := counter + 1; -- NULL + 1 is still NULL IF counter IS NULL THEN DBMS_OUTPUT.PUT_LINE('counter is NULL.'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/declarations-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/declarations.html DECLARE surname employees.last_name%TYPE; BEGIN DBMS_OUTPUT.PUT_LINE('surname=' || surname); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/description-static-sql-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/description-static-sql.html DROP TABLE employees_temp; CREATE TABLE employees_temp AS SELECT employee_id, first_name, last_name FROM employees; DECLARE emp_id employees_temp.employee_id%TYPE := 299; emp_first_name employees_temp.first_name%TYPE := 'Bob'; emp_last_name employees_temp.last_name%TYPE := 'Henry'; BEGIN INSERT INTO employees_temp (employee_id, first_name, last_name) VALUES (emp_id, emp_first_name, emp_last_name); UPDATE employees_temp SET first_name = 'Robert' WHERE employee_id = emp_id; DELETE FROM employees_temp WHERE employee_id = emp_id RETURNING first_name, last_name INTO emp_first_name, emp_last_name; COMMIT; DBMS_OUTPUT.PUT_LINE (emp_first_name || ' ' || emp_last_name); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/description-static-sql-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/description-static-sql.html DROP TABLE employees_temp; CREATE TABLE employees_temp AS SELECT employee_id, first_name, last_name FROM employees; DROP TABLE employees_temp2; CREATE TABLE employees_temp2 AS SELECT employee_id, first_name, last_name FROM employees; DECLARE seq_value NUMBER; BEGIN -- Generate initial sequence number seq_value := employees_seq.NEXTVAL; -- Print initial sequence number: DBMS_OUTPUT.PUT_LINE ( 'Initial sequence value: ' || TO_CHAR(seq_value) ); -- Use NEXTVAL to create unique number when inserting data: INSERT INTO employees_temp (employee_id, first_name, last_name) VALUES (employees_seq.NEXTVAL, 'Lynette', 'Smith'); -- Use CURRVAL to store same value somewhere else: INSERT INTO employees_temp2 VALUES (employees_seq.CURRVAL, 'Morgan', 'Smith'); /* Because NEXTVAL values might be referenced by different users and applications, and some NEXTVAL values might not be stored in database, there might be gaps in sequence. */ -- Use CURRVAL to specify record to delete: seq_value := employees_seq.CURRVAL; DELETE FROM employees_temp2 WHERE employee_id = seq_value; -- Update employee_id with NEXTVAL for specified record: UPDATE employees_temp SET employee_id = employees_seq.NEXTVAL WHERE first_name = 'Lynette' AND last_name = 'Smith'; -- Display final value of CURRVAL: seq_value := employees_seq.CURRVAL; DBMS_OUTPUT.PUT_LINE ( 'Ending sequence value: ' || TO_CHAR(seq_value) ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER t BEFORE INSERT OR UPDATE OF salary, department_id OR DELETE ON employees BEGIN CASE WHEN INSERTING THEN DBMS_OUTPUT.PUT_LINE('Inserting'); WHEN UPDATING('salary') THEN DBMS_OUTPUT.PUT_LINE('Updating salary'); WHEN UPDATING('department_id') THEN DBMS_OUTPUT.PUT_LINE('Updating department ID'); WHEN DELETING THEN DBMS_OUTPUT.PUT_LINE('Deleting'); END CASE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE VIEW order_info AS SELECT c.customer_id, c.cust_last_name, c.cust_first_name, o.order_id, o.order_date, o.order_status FROM customers c, orders o WHERE c.customer_id = o.customer_id; CREATE OR REPLACE TRIGGER order_info_insert INSTEAD OF INSERT ON order_info DECLARE duplicate_info EXCEPTION; PRAGMA EXCEPTION_INIT (duplicate_info, -00001); BEGIN INSERT INTO customers (customer_id, cust_last_name, cust_first_name) VALUES ( :new.customer_id, :new.cust_last_name, :new.cust_first_name); INSERT INTO orders (order_id, order_date, customer_id) VALUES ( :new.order_id, :new.order_date, :new.customer_id); EXCEPTION WHEN duplicate_info THEN RAISE_APPLICATION_ERROR ( num=> -20107, msg=> 'Duplicate customer or order ID'); END order_info_insert; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT COUNT(*) FROM orders WHERE customer_id = 999; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TYPE nte AUTHID DEFINER IS OBJECT ( emp_id NUMBER(6), lastname VARCHAR2(25), job VARCHAR2(10), sal NUMBER(8,2) ); / CREATE OR REPLACE TYPE emp_list_ IS TABLE OF nte; / CREATE OR REPLACE VIEW dept_view AS SELECT d.department_id, d.department_name, CAST (MULTISET (SELECT e.employee_id, e.last_name, e.job_id, e.salary FROM employees e WHERE e.department_id = d.department_id ) AS emp_list_ ) emplist FROM departments d; CREATE OR REPLACE TRIGGER dept_emplist_tr INSTEAD OF INSERT ON NESTED TABLE emplist OF dept_view REFERENCING NEW AS Employee PARENT AS Department FOR EACH ROW BEGIN -- Insert on nested table translates to insert on base table: INSERT INTO employees ( employee_id, last_name, email, hire_date, job_id, salary, department_id ) VALUES ( :Employee.emp_id, -- employee_id :Employee.lastname, -- last_name :Employee.lastname || '@example.com', -- email SYSDATE, -- hire_date :Employee.job, -- job_id :Employee.sal, -- salary :Department.department_id -- department_id ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT emplist FROM dept_view WHERE department_id=10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT employee_id, last_name, job_id, salary FROM employees WHERE department_id = 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html INSERT INTO TABLE ( SELECT d.emplist FROM dept_view d WHERE department_id = 10 ) VALUES (1001, 'Glenn', 'AC_MGR', 10000); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT emplist FROM dept_view WHERE department_id=10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT COUNT(*) FROM order_info WHERE customer_id = 999; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT employee_id, last_name, job_id, salary FROM employees WHERE department_id = 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html INSERT INTO Target SELECT c1, c2, c3 FROM Source WHERE Source.c1 > 0 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE TABLE employee_salaries ( employee_id NUMBER NOT NULL, change_date DATE NOT NULL, salary NUMBER(8,2) NOT NULL, CONSTRAINT pk_employee_salaries PRIMARY KEY (employee_id, change_date), CONSTRAINT fk_employee_salaries FOREIGN KEY (employee_id) REFERENCES employees (employee_id) ON DELETE CASCADE) / CREATE OR REPLACE TRIGGER maintain_employee_salaries FOR UPDATE OF salary ON employees COMPOUND TRIGGER -- Declarative Part: -- Choose small threshhold value to show how example works: threshhold CONSTANT SIMPLE_INTEGER := 7; TYPE salaries_t IS TABLE OF employee_salaries%ROWTYPE INDEX BY SIMPLE_INTEGER; salaries salaries_t; idx SIMPLE_INTEGER := 0; PROCEDURE flush_array IS n CONSTANT SIMPLE_INTEGER := salaries.count(); BEGIN FORALL j IN 1..n INSERT INTO employee_salaries VALUES salaries(j); salaries.delete(); idx := 0; DBMS_OUTPUT.PUT_LINE('Flushed ' || n || ' rows'); END flush_array; -- AFTER EACH ROW Section: AFTER EACH ROW IS BEGIN idx := idx + 1; salaries(idx).employee_id := :NEW.employee_id; salaries(idx).change_date := SYSTIMESTAMP; salaries(idx).salary := :NEW.salary; IF idx >= threshhold THEN flush_array(); END IF; END AFTER EACH ROW; -- AFTER STATEMENT Section: AFTER STATEMENT IS BEGIN flush_array(); END AFTER STATEMENT; END maintain_employee_salaries; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html UPDATE employees SET salary = salary * 1.1 WHERE department_id = 50 / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html BEGIN DBMS_SESSION.SLEEP(2); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html UPDATE employees SET salary = salary * 1.05 WHERE department_id = 50 / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT employee_id, count(*) c FROM employee_salaries GROUP BY employee_id / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER Check_Employee_Salary_Raise FOR UPDATE OF Salary ON Employees COMPOUND TRIGGER Ten_Percent CONSTANT NUMBER := 0.1; TYPE Salaries_t IS TABLE OF Employees.Salary%TYPE; Avg_Salaries Salaries_t; TYPE Department_IDs_t IS TABLE OF Employees.Department_ID%TYPE; Department_IDs Department_IDs_t; -- Declare collection type and variable: TYPE Department_Salaries_t IS TABLE OF Employees.Salary%TYPE INDEX BY VARCHAR2(80); Department_Avg_Salaries Department_Salaries_t; BEFORE STATEMENT IS BEGIN SELECT AVG(e.Salary), NVL(e.Department_ID, -1) BULK COLLECT INTO Avg_Salaries, Department_IDs FROM Employees e GROUP BY e.Department_ID; FOR j IN 1..Department_IDs.COUNT() LOOP Department_Avg_Salaries(Department_IDs(j)) := Avg_Salaries(j); END LOOP; END BEFORE STATEMENT; AFTER EACH ROW IS BEGIN IF :NEW.Salary - :Old.Salary > Ten_Percent*Department_Avg_Salaries(:NEW.Department_ID) THEN Raise_Application_Error(-20000, 'Raise too big'); END IF; END AFTER EACH ROW; END Check_Employee_Salary_Raise; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE TABLE emp ( Empno NUMBER NOT NULL, Ename VARCHAR2(10), Job VARCHAR2(9), Mgr NUMBER(4), Hiredate DATE, Sal NUMBER(7,2), Comm NUMBER(7,2), Deptno NUMBER(2) NOT NULL); CREATE TABLE dept ( Deptno NUMBER(2) NOT NULL, Dname VARCHAR2(14), Loc VARCHAR2(13), Mgr_no NUMBER, Dept_type NUMBER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER emp_dept_check BEFORE INSERT OR UPDATE OF Deptno ON emp FOR EACH ROW WHEN (NEW.Deptno IS NOT NULL) -- Before row is inserted or DEPTNO is updated in emp table, -- fire this trigger to verify that new foreign key value (DEPTNO) -- is present in dept table. DECLARE Dummy INTEGER; -- Use for cursor fetch Invalid_department EXCEPTION; Valid_department EXCEPTION; Mutating_table EXCEPTION; PRAGMA EXCEPTION_INIT (Invalid_department, -4093); PRAGMA EXCEPTION_INIT (Valid_department, -4092); PRAGMA EXCEPTION_INIT (Mutating_table, -4091); -- Cursor used to verify parent key value exists. -- If present, lock parent key's row so it cannot be deleted -- by another transaction until this transaction is -- committed or rolled back. CURSOR Dummy_cursor (Dn NUMBER) IS SELECT Deptno FROM dept WHERE Deptno = Dn FOR UPDATE OF Deptno; BEGIN OPEN Dummy_cursor (:NEW.Deptno); FETCH Dummy_cursor INTO Dummy; -- Verify parent key. -- If not found, raise user-specified error code and message. -- If found, close cursor before allowing triggering statement to complete: IF Dummy_cursor%NOTFOUND THEN RAISE Invalid_department; ELSE RAISE Valid_department; END IF; CLOSE Dummy_cursor; EXCEPTION WHEN Invalid_department THEN CLOSE Dummy_cursor; Raise_application_error(-20000, 'Invalid Department' || ' Number' || TO_CHAR(:NEW.deptno)); WHEN Valid_department THEN CLOSE Dummy_cursor; WHEN Mutating_table THEN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER dept_restrict BEFORE DELETE OR UPDATE OF Deptno ON dept FOR EACH ROW -- Before row is deleted from dept or primary key (DEPTNO) of dept is updated, -- check for dependent foreign key values in emp; -- if any are found, roll back. DECLARE Dummy INTEGER; -- Use for cursor fetch employees_present EXCEPTION; employees_not_present EXCEPTION; PRAGMA EXCEPTION_INIT (employees_present, -4094); PRAGMA EXCEPTION_INIT (employees_not_present, -4095); -- Cursor used to check for dependent foreign key values. CURSOR Dummy_cursor (Dn NUMBER) IS SELECT Deptno FROM emp WHERE Deptno = Dn; BEGIN OPEN Dummy_cursor (:OLD.Deptno); FETCH Dummy_cursor INTO Dummy; -- If dependent foreign key is found, raise user-specified -- error code and message. If not found, close cursor -- before allowing triggering statement to complete. IF Dummy_cursor%FOUND THEN RAISE employees_present; -- Dependent rows exist ELSE RAISE employees_not_present; -- No dependent rows exist END IF; CLOSE Dummy_cursor; EXCEPTION WHEN employees_present THEN CLOSE Dummy_cursor; Raise_application_error(-20001, 'Employees Present in' || ' Department ' || TO_CHAR(:OLD.DEPTNO)); WHEN employees_not_present THEN CLOSE Dummy_cursor; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER dept_set_null AFTER DELETE OR UPDATE OF Deptno ON dept FOR EACH ROW -- Before row is deleted from dept or primary key (DEPTNO) of dept is updated, -- set all corresponding dependent foreign key values in emp to NULL: BEGIN IF UPDATING AND :OLD.Deptno != :NEW.Deptno OR DELETING THEN UPDATE emp SET emp.Deptno = NULL WHERE emp.Deptno = :OLD.Deptno; END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER dept_del_cascade AFTER DELETE ON dept FOR EACH ROW -- Before row is deleted from dept, -- delete all rows from emp table whose DEPTNO is same as -- DEPTNO being deleted from dept table: BEGIN DELETE FROM emp WHERE emp.Deptno = :OLD.Deptno; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE SEQUENCE Update_sequence INCREMENT BY 1 MAXVALUE 5000 CYCLE; CREATE OR REPLACE PACKAGE Integritypackage AUTHID DEFINER AS Updateseq NUMBER; END Integritypackage; / CREATE OR REPLACE PACKAGE BODY Integritypackage AS END Integritypackage; / ALTER TABLE emp ADD Update_id NUMBER; CREATE OR REPLACE TRIGGER dept_cascade1 BEFORE UPDATE OF Deptno ON dept DECLARE -- Before updating dept table (this is a statement trigger), -- generate sequence number -- & assign it to public variable UPDATESEQ of -- user-defined package named INTEGRITYPACKAGE: BEGIN Integritypackage.Updateseq := Update_sequence.NEXTVAL; END; / CREATE OR REPLACE TRIGGER dept_cascade2 AFTER DELETE OR UPDATE OF Deptno ON dept FOR EACH ROW -- For each department number in dept that is updated, -- cascade update to dependent foreign keys in emp table. -- Cascade update only if child row was not updated by this trigger: BEGIN IF UPDATING THEN UPDATE emp SET Deptno = :NEW.Deptno, Update_id = Integritypackage.Updateseq --from 1st WHERE emp.Deptno = :OLD.Deptno AND Update_id IS NULL; /* Only NULL if not updated by 3rd trigger fired by same triggering statement */ END IF; IF DELETING THEN -- After row is deleted from dept, -- delete all rows from emp table whose DEPTNO is same as -- DEPTNO being deleted from dept table: DELETE FROM emp WHERE emp.Deptno = :OLD.Deptno; END IF; END; / CREATE OR REPLACE TRIGGER dept_cascade3 AFTER UPDATE OF Deptno ON dept BEGIN UPDATE emp SET Update_id = NULL WHERE Update_id = Integritypackage.Updateseq; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-39.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE TABLE Salgrade ( Grade NUMBER, Losal NUMBER, Hisal NUMBER, Job_classification VARCHAR2(9)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html INSERT INTO order_info VALUES (999, 'Smith', 'John', 2500, TO_DATE('13-MAR-2001', 'DD-MON-YYYY'), 0); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER salary_check BEFORE INSERT OR UPDATE OF Sal, Job ON Emp FOR EACH ROW DECLARE Minsal NUMBER; Maxsal NUMBER; Salary_out_of_range EXCEPTION; PRAGMA EXCEPTION_INIT (Salary_out_of_range, -4096); BEGIN /* Retrieve minimum & maximum salary for employee's new job classification from SALGRADE table into MINSAL and MAXSAL: */ SELECT Losal, Hisal INTO Minsal, Maxsal FROM Salgrade WHERE Job_classification = :NEW.Job; /* If employee's new salary is less than or greater than job classification's limits, raise exception. Exception message is returned and pending INSERT or UPDATE statement that fired the trigger is rolled back: */ IF (:NEW.Sal < Minsal OR :NEW.Sal > Maxsal) THEN RAISE Salary_out_of_range; END IF; EXCEPTION WHEN Salary_out_of_range THEN Raise_application_error ( -20300, 'Salary '|| TO_CHAR(:NEW.Sal) ||' out of range for ' || 'job classification ' ||:NEW.Job ||' for employee ' || :NEW.Ename ); WHEN NO_DATA_FOUND THEN Raise_application_error(-20322, 'Invalid Job Classification'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER Employee_permit_changes BEFORE INSERT OR DELETE OR UPDATE ON employees DECLARE Dummy INTEGER; Not_on_weekends EXCEPTION; Nonworking_hours EXCEPTION; PRAGMA EXCEPTION_INIT (Not_on_weekends, -4097); PRAGMA EXCEPTION_INIT (Nonworking_hours, -4099); BEGIN -- Check for weekends: IF (TO_CHAR(Sysdate, 'DAY') = 'SAT' OR TO_CHAR(Sysdate, 'DAY') = 'SUN') THEN RAISE Not_on_weekends; END IF; -- Check for work hours (8am to 6pm): IF (TO_CHAR(Sysdate, 'HH24') < 8 OR TO_CHAR(Sysdate, 'HH24') > 18) THEN RAISE Nonworking_hours; END IF; EXCEPTION WHEN Not_on_weekends THEN Raise_application_error(-20324,'Might not change ' ||'employee table during the weekend'); WHEN Nonworking_hours THEN Raise_application_error(-20326,'Might not change ' ||'emp table during Nonworking hours'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html ALTER TABLE Emp ADD( Uppername VARCHAR2(20), Soundexname VARCHAR2(20)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-43.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER Derived BEFORE INSERT OR UPDATE OF Ename ON Emp /* Before updating the ENAME field, derive the values for the UPPERNAME and SOUNDEXNAME fields. Restrict users from updating these fields directly: */ FOR EACH ROW BEGIN :NEW.Uppername := UPPER(:NEW.Ename); :NEW.Soundexname := SOUNDEX(:NEW.Ename); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-44.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TYPE Book_t AS OBJECT ( Booknum NUMBER, Title VARCHAR2(20), Author VARCHAR2(20), Available CHAR(1) ); / CREATE OR REPLACE TYPE Book_list_t AS TABLE OF Book_t; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-45.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html DROP TABLE Book_table; CREATE TABLE Book_table ( Booknum NUMBER, Section VARCHAR2(20), Title VARCHAR2(20), Author VARCHAR2(20), Available CHAR(1) ); INSERT INTO Book_table ( Booknum, Section, Title, Author, Available ) VALUES ( 121001, 'Classic', 'Iliad', 'Homer', 'Y' ); INSERT INTO Book_table ( Booknum, Section, Title, Author, Available ) VALUES ( 121002, 'Novel', 'Gone with the Wind', 'Mitchell M', 'N' ); SELECT * FROM Book_table ORDER BY Booknum; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-47.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html DROP TABLE Library_table; CREATE TABLE Library_table (Section VARCHAR2(20)); INSERT INTO Library_table (Section) VALUES ('Novel'); INSERT INTO Library_table (Section) VALUES ('Classic'); SELECT * FROM Library_table ORDER BY Section; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-49.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE VIEW Library_view AS SELECT i.Section, CAST ( MULTISET ( SELECT b.Booknum, b.Title, b.Author, b.Available FROM Book_table b WHERE b.Section = i.Section ) AS Book_list_t ) BOOKLIST FROM Library_table i; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html CREATE OR REPLACE TRIGGER Library_trigger INSTEAD OF INSERT ON Library_view FOR EACH ROW DECLARE Bookvar Book_t; i INTEGER; BEGIN INSERT INTO Library_table VALUES (:NEW.Section); FOR i IN 1..:NEW.Booklist.COUNT LOOP Bookvar := :NEW.Booklist(i); INSERT INTO Book_table ( Booknum, Section, Title, Author, Available ) VALUES ( Bookvar.booknum, :NEW.Section, Bookvar.Title, Bookvar.Author, bookvar.Available ); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-51.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html INSERT INTO Library_view (Section, Booklist) VALUES ( 'History', book_list_t (book_t (121330, 'Alexander', 'Mirth', 'Y')) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT * FROM Library_view ORDER BY Section; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-54.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT * FROM Book_table ORDER BY Booknum; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-56.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT * FROM Library_table ORDER BY Section; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT COUNT(*) FROM order_info WHERE customer_id = 999; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/dml-triggers-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/dml-triggers.html SELECT COUNT(*) FROM customers WHERE customer_id = 999; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-handling-triggers-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-handling-triggers.html CREATE OR REPLACE TRIGGER employees_tr AFTER INSERT ON employees FOR EACH ROW BEGIN -- When remote database is unavailable, compilation fails here: INSERT INTO employees@remote ( employee_id, first_name, last_name, email, hire_date, job_id ) VALUES ( 99, 'Jane', 'Doe', 'jane.doe@example.com', SYSDATE, 'ST_MAN' ); EXCEPTION WHEN OTHERS THEN INSERT INTO emp_log (Emp_id, Log_date, New_salary, Action) VALUES (99, SYSDATE, NULL, 'Could not insert'); RAISE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-handling-triggers-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-handling-triggers.html CREATE OR REPLACE PROCEDURE insert_row_proc AUTHID CURRENT_USER AS no_remote_db EXCEPTION; -- declare exception PRAGMA EXCEPTION_INIT (no_remote_db, -20000); -- assign error code to exception BEGIN INSERT INTO employees@remote ( employee_id, first_name, last_name, email, hire_date, job_id ) VALUES ( 99, 'Jane', 'Doe', 'jane.doe@example.com', SYSDATE, 'ST_MAN' ); EXCEPTION WHEN OTHERS THEN INSERT INTO emp_log (Emp_id, Log_date, New_salary, Action) VALUES (99, SYSDATE, NULL, 'Could not insert row.'); RAISE_APPLICATION_ERROR (-20000, 'Remote database is unavailable.'); END; / CREATE OR REPLACE TRIGGER employees_tr AFTER INSERT ON employees FOR EACH ROW BEGIN insert_row_proc; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-propagation-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-propagation.html CREATE OR REPLACE PROCEDURE p AUTHID DEFINER AS BEGIN DECLARE past_due EXCEPTION; PRAGMA EXCEPTION_INIT (past_due, -4910); due_date DATE := trunc(SYSDATE) - 1; todays_date DATE := trunc(SYSDATE); BEGIN IF due_date < todays_date THEN RAISE past_due; END IF; END; EXCEPTION WHEN OTHERS THEN ROLLBACK; RAISE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-propagation-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-propagation.html BEGIN DECLARE past_due EXCEPTION; due_date DATE := trunc(SYSDATE) - 1; todays_date DATE := trunc(SYSDATE); BEGIN IF due_date < todays_date THEN RAISE past_due; END IF; END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-propagation-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-propagation.html CREATE OR REPLACE PROCEDURE print_reciprocal (n NUMBER) AUTHID DEFINER IS BEGIN BEGIN DBMS_OUTPUT.PUT_LINE(1/n); EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Error in inner block:'); DBMS_OUTPUT.PUT_LINE(1/n || ' is undefined.'); END; EXCEPTION WHEN ZERO_DIVIDE THEN -- handles exception raised in exception handler DBMS_OUTPUT.PUT('Error in outer block: '); DBMS_OUTPUT.PUT_LINE('1/0 is undefined.'); END; / BEGIN print_reciprocal(0); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-propagation-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-propagation.html CREATE OR REPLACE PROCEDURE descending_reciprocals (n INTEGER) AUTHID DEFINER IS i INTEGER; i_is_one EXCEPTION; BEGIN i := n; LOOP IF i = 1 THEN RAISE i_is_one; ELSE DBMS_OUTPUT.PUT_LINE('Reciprocal of ' || i || ' is ' || 1/i); END IF; i := i - 1; END LOOP; EXCEPTION WHEN i_is_one THEN DBMS_OUTPUT.PUT_LINE('1 is its own reciprocal.'); DBMS_OUTPUT.PUT_LINE('Reciprocal of ' || TO_CHAR(i-1) || ' is ' || TO_CHAR(1/(i-1))); WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Error:'); DBMS_OUTPUT.PUT_LINE(1/n || ' is undefined'); END; / BEGIN descending_reciprocals(3); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-propagation-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-propagation.html CREATE OR REPLACE PROCEDURE descending_reciprocals (n INTEGER) AUTHID DEFINER IS i INTEGER; i_is_one EXCEPTION; BEGIN BEGIN i := n; LOOP IF i = 1 THEN RAISE i_is_one; ELSE DBMS_OUTPUT.PUT_LINE('Reciprocal of ' || i || ' is ' || 1/i); END IF; i := i - 1; END LOOP; EXCEPTION WHEN i_is_one THEN DBMS_OUTPUT.PUT_LINE('1 is its own reciprocal.'); DBMS_OUTPUT.PUT_LINE('Reciprocal of ' || TO_CHAR(i-1) || ' is ' || TO_CHAR(1/(i-1))); WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Error:'); DBMS_OUTPUT.PUT_LINE(1/n || ' is undefined'); END; EXCEPTION WHEN ZERO_DIVIDE THEN -- handles exception raised in exception handler DBMS_OUTPUT.PUT_LINE('Error:'); DBMS_OUTPUT.PUT_LINE('1/0 is undefined'); END; / BEGIN descending_reciprocals(3); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-propagation-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-propagation.html DECLARE credit_limit CONSTANT NUMBER(3) := 5000; -- Maximum value is 999 BEGIN NULL; EXCEPTION WHEN VALUE_ERROR THEN DBMS_OUTPUT.PUT_LINE('Exception raised in declaration.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-propagation-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-propagation.html BEGIN DECLARE credit_limit CONSTANT NUMBER(3) := 5000; BEGIN NULL; END; EXCEPTION WHEN VALUE_ERROR THEN DBMS_OUTPUT.PUT_LINE('Exception raised in declaration.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-propagation-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-propagation.html CREATE OR REPLACE PROCEDURE print_reciprocal (n NUMBER) AUTHID DEFINER IS BEGIN DBMS_OUTPUT.PUT_LINE(1/n); -- handled EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Error:'); DBMS_OUTPUT.PUT_LINE(1/n || ' is undefined'); -- not handled END; / BEGIN -- invoking block print_reciprocal(0); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/exception-propagation-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/exception-propagation.html CREATE OR REPLACE PROCEDURE print_reciprocal (n NUMBER) AUTHID DEFINER IS BEGIN DBMS_OUTPUT.PUT_LINE(1/n); EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Error:'); DBMS_OUTPUT.PUT_LINE(1/n || ' is undefined'); END; / BEGIN -- invoking block print_reciprocal(0); EXCEPTION WHEN ZERO_DIVIDE THEN -- handles exception raised in exception handler DBMS_OUTPUT.PUT_LINE('1/0 is undefined.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE x VARCHAR2(4) := 'suit'; y VARCHAR2(4) := 'case'; BEGIN DBMS_OUTPUT.PUT_LINE (x || y); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE salary NUMBER := 60000; commission NUMBER := 0.10; BEGIN -- Division has higher precedence than addition: DBMS_OUTPUT.PUT_LINE('5 + 12 / 4 = ' || TO_CHAR(5 + 12 / 4)); DBMS_OUTPUT.PUT_LINE('12 / 4 + 5 = ' || TO_CHAR(12 / 4 + 5)); -- Parentheses override default operator precedence: DBMS_OUTPUT.PUT_LINE('8 + 6 / 2 = ' || TO_CHAR(8 + 6 / 2)); DBMS_OUTPUT.PUT_LINE('(8 + 6) / 2 = ' || TO_CHAR((8 + 6) / 2)); -- Most deeply nested operation is evaluated first: DBMS_OUTPUT.PUT_LINE('100 + (20 / 5 + (7 - 3)) = ' || TO_CHAR(100 + (20 / 5 + (7 - 3)))); -- Parentheses, even when unnecessary, improve readability: DBMS_OUTPUT.PUT_LINE('(salary * 0.05) + (commission * 0.25) = ' || TO_CHAR((salary * 0.05) + (commission * 0.25)) ); DBMS_OUTPUT.PUT_LINE('salary * 0.05 + commission * 0.25 = ' || TO_CHAR(salary * 0.05 + commission * 0.25) ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html CREATE OR REPLACE PROCEDURE print_boolean ( b_name VARCHAR2, b_value BOOLEAN ) AUTHID DEFINER IS BEGIN IF b_value IS NULL THEN DBMS_OUTPUT.PUT_LINE (b_name || ' = NULL'); ELSIF b_value = TRUE THEN DBMS_OUTPUT.PUT_LINE (b_name || ' = TRUE'); ELSE DBMS_OUTPUT.PUT_LINE (b_name || ' = FALSE'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE PROCEDURE print_x_and_y ( x BOOLEAN, y BOOLEAN ) IS BEGIN print_boolean ('x', x); print_boolean ('y', y); print_boolean ('x AND y', x AND y); END print_x_and_y; BEGIN print_x_and_y (FALSE, FALSE); print_x_and_y (TRUE, FALSE); print_x_and_y (FALSE, TRUE); print_x_and_y (TRUE, TRUE); print_x_and_y (TRUE, NULL); print_x_and_y (FALSE, NULL); print_x_and_y (NULL, TRUE); print_x_and_y (NULL, FALSE); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE PROCEDURE print_x_or_y ( x BOOLEAN, y BOOLEAN ) IS BEGIN print_boolean ('x', x); print_boolean ('y', y); print_boolean ('x OR y', x OR y); END print_x_or_y; BEGIN print_x_or_y (FALSE, FALSE); print_x_or_y (TRUE, FALSE); print_x_or_y (FALSE, TRUE); print_x_or_y (TRUE, TRUE); print_x_or_y (TRUE, NULL); print_x_or_y (FALSE, NULL); print_x_or_y (NULL, TRUE); print_x_or_y (NULL, FALSE); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE PROCEDURE print_not_x ( x BOOLEAN ) IS BEGIN print_boolean ('x', x); print_boolean ('NOT x', NOT x); END print_not_x; BEGIN print_not_x (TRUE); print_not_x (FALSE); print_not_x (NULL); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE x NUMBER := 5; y NUMBER := NULL; BEGIN IF x != y THEN -- yields NULL, not TRUE DBMS_OUTPUT.PUT_LINE('x != y'); -- not run ELSIF x = y THEN -- also yields NULL DBMS_OUTPUT.PUT_LINE('x = y'); ELSE DBMS_OUTPUT.PUT_LINE ('Can''t tell if x and y are equal or not.'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html BEGIN DBMS_OUTPUT.PUT_LINE ('apple' || NULL || NULL || 'sauce'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE a NUMBER := NULL; b NUMBER := NULL; BEGIN IF a = b THEN -- yields NULL, not TRUE DBMS_OUTPUT.PUT_LINE('a = b'); -- not run ELSIF a != b THEN -- yields NULL, not TRUE DBMS_OUTPUT.PUT_LINE('a != b'); -- not run ELSE DBMS_OUTPUT.PUT_LINE('Can''t tell if two NULLs are equal'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE x INTEGER := 2; Y INTEGER := 5; high INTEGER; BEGIN IF (x > y) -- If x or y is NULL, then (x > y) is NULL THEN high := x; -- run if (x > y) is TRUE ELSE high := y; -- run if (x > y) is FALSE or NULL END IF; IF NOT (x > y) -- If x or y is NULL, then NOT (x > y) is NULL THEN high := y; -- run if NOT (x > y) is TRUE ELSE high := x; -- run if NOT (x > y) is FALSE or NULL END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE x BOOLEAN := FALSE; y BOOLEAN := FALSE; BEGIN print_boolean ('NOT x AND y', NOT x AND y); print_boolean ('NOT (x AND y)', NOT (x AND y)); print_boolean ('(NOT x) AND y', (NOT x) AND y); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE on_hand INTEGER := 0; on_order INTEGER := 100; BEGIN -- Does not cause divide-by-zero error; -- evaluation stops after first expression IF (on_hand = 0) OR ((on_order / on_hand) < 5) THEN DBMS_OUTPUT.PUT_LINE('On hand quantity is zero.'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html BEGIN print_boolean ('(2 + 2 = 4)', 2 + 2 = 4); print_boolean ('(2 + 2 <> 4)', 2 + 2 <> 4); print_boolean ('(2 + 2 != 4)', 2 + 2 != 4); print_boolean ('(2 + 2 ~= 4)', 2 + 2 ~= 4); print_boolean ('(2 + 2 ^= 4)', 2 + 2 ^= 4); print_boolean ('(1 < 2)', 1 < 2); print_boolean ('(1 > 2)', 1 > 2); print_boolean ('(1 <= 2)', 1 <= 2); print_boolean ('(1 >= 1)', 1 >= 1); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE PROCEDURE compare ( value VARCHAR2, pattern VARCHAR2 ) IS BEGIN IF value LIKE pattern THEN DBMS_OUTPUT.PUT_LINE ('TRUE'); ELSE DBMS_OUTPUT.PUT_LINE ('FALSE'); END IF; END; BEGIN compare('Johnson', 'J%s_n'); compare('Johnson', 'J%S_N'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE PROCEDURE half_off (sale_sign VARCHAR2) IS BEGIN IF sale_sign LIKE '50\% off!' ESCAPE '\' THEN DBMS_OUTPUT.PUT_LINE ('TRUE'); ELSE DBMS_OUTPUT.PUT_LINE ('FALSE'); END IF; END; BEGIN half_off('Going out of business!'); half_off('50% off!'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-39.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html BEGIN print_boolean ('2 BETWEEN 1 AND 3', 2 BETWEEN 1 AND 3); print_boolean ('2 BETWEEN 2 AND 3', 2 BETWEEN 2 AND 3); print_boolean ('2 BETWEEN 1 AND 2', 2 BETWEEN 1 AND 2); print_boolean ('2 BETWEEN 3 AND 4', 2 BETWEEN 3 AND 4); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE a INTEGER := 1+2**2; b INTEGER := (1+2)**2; BEGIN DBMS_OUTPUT.PUT_LINE('a = ' || TO_CHAR(a)); DBMS_OUTPUT.PUT_LINE('b = ' || TO_CHAR(b)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE letter VARCHAR2(1) := 'm'; BEGIN print_boolean ( 'letter IN (''a'', ''b'', ''c'')', letter IN ('a', 'b', 'c') ); print_boolean ( 'letter IN (''z'', ''m'', ''y'', ''p'')', letter IN ('z', 'm', 'y', 'p') ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-43.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE a INTEGER; -- Initialized to NULL by default b INTEGER := 10; c INTEGER := 100; BEGIN print_boolean ('100 IN (a, b, c)', 100 IN (a, b, c)); print_boolean ('100 NOT IN (a, b, c)', 100 NOT IN (a, b, c)); print_boolean ('100 IN (a, b)', 100 IN (a, b)); print_boolean ('100 NOT IN (a, b)', 100 NOT IN (a, b)); print_boolean ('a IN (a, b)', a IN (a, b)); print_boolean ('a NOT IN (a, b)', a NOT IN (a, b)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-46.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE done BOOLEAN; BEGIN -- These WHILE loops are equivalent done := FALSE; WHILE done = FALSE LOOP done := TRUE; END LOOP; done := FALSE; WHILE NOT (done = TRUE) LOOP done := TRUE; END LOOP; done := FALSE; WHILE NOT done LOOP done := TRUE; END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-48.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE grade CHAR(1) := 'B'; appraisal VARCHAR2(20); BEGIN appraisal := CASE grade WHEN 'A' THEN 'Excellent' WHEN 'B' THEN 'Very Good' WHEN 'C' THEN 'Good' WHEN 'D' THEN 'Fair' WHEN 'F' THEN 'Poor' ELSE 'No such grade' END; DBMS_OUTPUT.PUT_LINE ('Grade ' || grade || ' is ' || appraisal); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE grade CHAR(1); -- NULL by default appraisal VARCHAR2(20); BEGIN appraisal := CASE grade WHEN NULL THEN 'No grade assigned' WHEN 'A' THEN 'Excellent' WHEN 'B' THEN 'Very Good' WHEN 'C' THEN 'Good' WHEN 'D' THEN 'Fair' WHEN 'F' THEN 'Poor' ELSE 'No such grade' END; DBMS_OUTPUT.PUT_LINE ('Grade ' || grade || ' is ' || appraisal); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE salary NUMBER := 7000; salary_level VARCHAR2(20); BEGIN salary_level := CASE salary WHEN 1000, 2000 THEN 'low' WHEN 3000, 4000, 5000 THEN 'normal' WHEN 6000, 7000, 8000 THEN 'high' ELSE 'executive pay' END; DBMS_OUTPUT.PUT_LINE('Salary level is: ' || salary_level); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-54.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE data_val NUMBER := 30; status VARCHAR2(20); BEGIN status := CASE data_val/2 WHEN < 0, > 50 THEN 'outlier' WHEN BETWEEN 10 AND 30 THEN 'good' ELSE 'bad' END; DBMS_OUTPUT.PUT_LINE('The data status is: ' || status); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-57.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE grade CHAR(1) := 'B'; appraisal VARCHAR2(120); id NUMBER := 8429862; attendance NUMBER := 150; min_days CONSTANT NUMBER := 200; FUNCTION attends_this_school (id NUMBER) RETURN BOOLEAN IS BEGIN RETURN TRUE; END; BEGIN appraisal := CASE WHEN attends_this_school(id) = FALSE THEN 'Student not enrolled' WHEN grade = 'F' OR attendance < min_days THEN 'Poor (poor performance or bad attendance)' WHEN grade = 'A' THEN 'Excellent' WHEN grade = 'B' THEN 'Very Good' WHEN grade = 'C' THEN 'Good' WHEN grade = 'D' THEN 'Fair' ELSE 'No such grade' END; DBMS_OUTPUT.PUT_LINE ('Result for student ' || id || ' is ' || appraisal); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-59.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE grade CHAR(1); -- NULL by default appraisal VARCHAR2(20); BEGIN appraisal := CASE WHEN grade IS NULL THEN 'No grade assigned' WHEN grade = 'A' THEN 'Excellent' WHEN grade = 'B' THEN 'Very Good' WHEN grade = 'C' THEN 'Good' WHEN grade = 'D' THEN 'Fair' WHEN grade = 'F' THEN 'Poor' ELSE 'No such grade' END; DBMS_OUTPUT.PUT_LINE ('Grade ' || grade || ' is ' || appraisal); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE a INTEGER := ((1+2)*(3+4))/7; BEGIN DBMS_OUTPUT.PUT_LINE('a = ' || TO_CHAR(a)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-62.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html CREATE PACKAGE my_debug IS debug CONSTANT BOOLEAN := TRUE; trace CONSTANT BOOLEAN := TRUE; END my_debug; / CREATE PROCEDURE my_proc1 AUTHID DEFINER IS BEGIN $IF my_debug.debug $THEN DBMS_OUTPUT.put_line('Debugging ON'); $ELSE DBMS_OUTPUT.put_line('Debugging OFF'); $END END my_proc1; / CREATE PROCEDURE my_proc2 AUTHID DEFINER IS BEGIN $IF my_debug.trace $THEN DBMS_OUTPUT.put_line('Tracing ON'); $ELSE DBMS_OUTPUT.put_line('Tracing OFF'); $END END my_proc2; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/expressions-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/expressions.html DECLARE a INTEGER := 2**2*3**2; b INTEGER := (2**2)*(3**2); BEGIN DBMS_OUTPUT.PUT_LINE('a = ' || TO_CHAR(a)); DBMS_OUTPUT.PUT_LINE('b = ' || TO_CHAR(b)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/external-subprograms-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/external-subprograms.html CREATE OR REPLACE PROCEDURE raise_salary ( empid NUMBER, pct NUMBER ) AS LANGUAGE JAVA NAME 'Adjuster.raiseSalary (int, float)'; -- call specification / BEGIN raise_salary(120, 10); -- invoke Adjuster.raiseSalary by PL/SQL name END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/external-subprograms-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/external-subprograms.html CREATE PROCEDURE java_sleep ( milli_seconds IN NUMBER ) AS LANGUAGE JAVA NAME 'java.lang.Thread.sleep(long)'; / CREATE OR REPLACE PROCEDURE sleep ( milli_seconds IN NUMBER ) AUTHID DEFINER IS BEGIN DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.get_time()); java_sleep (milli_seconds); DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.get_time()); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/external-subprograms-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/external-subprograms.html CREATE OR REPLACE FUNCTION js_raise_sal( p_empno NUMBER, p_percent NUMBER ) RETURN NUMBER AS MLE MODULE js_adjuster SIGNATURE 'raiseSal'; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/external-subprograms-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/external-subprograms.html SET SERVEROUTPUT ON; DECLARE l_new_sal NUMBER; l_old_sal NUMBER; l_empNo NUMBER := 100; BEGIN SELECT salary INTO l_old_sal FROM hr.employees WHERE employee_id = l_empNo; DBMS_OUTPUT.PUT_LINE('Current salary for employee ' || l_empNo || ' amounts to ' || l_old_sal); l_new_sal := js_raise_sal( p_empno => l_empNo, p_percent => 10 ); DBMS_OUTPUT.PUT_LINE('New salary for employee ' || l_empNo || ' increased to ' || l_new_sal); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/forward-declaration-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/forward-declaration.html DECLARE -- Declare proc1 (forward declaration): PROCEDURE proc1(number1 NUMBER); -- Declare and define proc2: PROCEDURE proc2(number2 NUMBER) IS BEGIN proc1(number2); END; -- Define proc 1: PROCEDURE proc1(number1 NUMBER) IS BEGIN proc2 (number1); END; BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/inserting-records-tables-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/inserting-records-tables.html DROP TABLE schedule; CREATE TABLE schedule ( week NUMBER, Mon VARCHAR2(10), Tue VARCHAR2(10), Wed VARCHAR2(10), Thu VARCHAR2(10), Fri VARCHAR2(10), Sat VARCHAR2(10), Sun VARCHAR2(10) ); DECLARE default_week schedule%ROWTYPE; i NUMBER; BEGIN default_week.Mon := '0800-1700'; default_week.Tue := '0800-1700'; default_week.Wed := '0800-1700'; default_week.Thu := '0800-1700'; default_week.Fri := '0800-1700'; default_week.Sat := 'Day Off'; default_week.Sun := 'Day Off'; FOR i IN 1..6 LOOP default_week.week := i; INSERT INTO schedule VALUES default_week; END LOOP; END; / COLUMN week FORMAT 99 COLUMN Mon FORMAT A9 COLUMN Tue FORMAT A9 COLUMN Wed FORMAT A9 COLUMN Thu FORMAT A9 COLUMN Fri FORMAT A9 COLUMN Sat FORMAT A9 COLUMN Sun FORMAT A9 SELECT * FROM schedule; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/invokers-rights-and-definers-rights-authid-property-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/invokers-rights-and-definers-rights-authid-property.html GRANT INHERIT PRIVILEGES ON current_user TO PUBLIC GRANT INHERIT PRIVILEGES ON current_user TO unit_owner GRANT INHERIT ANY PRIVILEGES TO unit_owner ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/invokers-rights-and-definers-rights-authid-property-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/invokers-rights-and-definers-rights-authid-property.html GRANT read, execute TO FUNCTION scott.func, PACKAGE sys.pkg ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/invokers-rights-and-definers-rights-authid-property-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/invokers-rights-and-definers-rights-authid-property.html CREATE OR REPLACE PROCEDURE hr_remote_db_link AS v_employee_id VARCHAR(50); BEGIN EXECUTE IMMEDIATE 'SELECT employee_id FROM employees@dblink' into v_employee_id; DBMS_OUTPUT.PUT_LINE('employee_id: ' || v_employee_id); END ; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html SELECT TYPE_NAME FROM ALL_TYPES WHERE PREDEFINED='YES'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html DECLARE "HELLO" varchar2(10) := 'hello'; -- HELLO is not a reserved word "BEGIN" varchar2(10) := 'begin'; -- BEGIN is a reserved word BEGIN DBMS_Output.Put_Line(Hello); -- Double quotation marks are optional DBMS_Output.Put_Line(BEGIN); -- Double quotation marks are required end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html DECLARE "HELLO" varchar2(10) := 'hello'; -- HELLO is not a reserved word "BEGIN" varchar2(10) := 'begin'; -- BEGIN is a reserved word BEGIN DBMS_Output.Put_Line(Hello); -- Identifier is case-insensitive DBMS_Output.Put_Line("Begin"); -- Identifier is case-sensitive END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html BEGIN DBMS_OUTPUT.PUT_LINE('This string breaks here.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html BEGIN DBMS_OUTPUT.PUT_LINE('This string ' || 'contains no line-break character.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html DECLARE howmany NUMBER; num_tables NUMBER; BEGIN -- Begin processing SELECT COUNT(*) INTO howmany FROM USER_OBJECTS WHERE OBJECT_TYPE = 'TABLE'; -- Check number of tables num_tables := howmany; -- Compute another value END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html DECLARE some_condition BOOLEAN; pi NUMBER := 3.1415926; radius NUMBER := 15; area NUMBER; BEGIN /* Perform some simple tests and assignments */ IF 2 + 2 = 4 THEN some_condition := TRUE; /* We expect this THEN to always be performed */ END IF; /* This line computes the area of a circle using pi, which is the ratio between the circumference and diameter. After the area is computed, the result is displayed. */ area := pi * radius**2; DBMS_OUTPUT.PUT_LINE('The area is: ' || TO_CHAR(area)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html DECLARE x NUMBER := 10; y NUMBER := 5; max NUMBER; BEGIN IF x>y THEN max:=x;ELSE max:=y;END IF; -- correct but hard to read -- Easier to read: IF x > y THEN max:=x; ELSE max:=y; END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html DECLARE "HELLO" varchar2(10) := 'hello'; BEGIN DBMS_Output.Put_Line(Hello); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html DECLARE "HELLO" varchar2(10) := 'hello'; BEGIN DBMS_Output.Put_Line("Hello"); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/lexical-units-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/lexical-units.html DECLARE "BEGIN" varchar2(15) := 'UPPERCASE'; "Begin" varchar2(15) := 'Initial Capital'; "begin" varchar2(15) := 'lowercase'; BEGIN DBMS_Output.Put_Line("BEGIN"); DBMS_Output.Put_Line("Begin"); DBMS_Output.Put_Line("begin"); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR i IN 1..3 LOOP IF i < 3 THEN DBMS_OUTPUT.PUT_LINE (TO_CHAR(i)); ELSE i := 2; END IF; END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html DECLARE i PLS_INTEGER; BEGIN FOR i IN 1..3, REVERSE i+1..i+10, 51..55 LOOP DBMS_OUTPUT.PUT_LINE(i); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR i IN 1..3 LOOP DBMS_OUTPUT.PUT_LINE (i); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR i IN REVERSE 1..3 LOOP DBMS_OUTPUT.PUT_LINE (i); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR n NUMBER(5,1) IN 1.0 .. 3.0 BY 0.5 LOOP DBMS_OUTPUT.PUT_LINE(n); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR i IN 5..15 BY 5 LOOP DBMS_OUTPUT.PUT_LINE (i); END LOOP; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR i IN 1..3 LOOP DBMS_OUTPUT.PUT_LINE ('Inside loop, i is ' || TO_CHAR(i)); END LOOP; DBMS_OUTPUT.PUT_LINE ('Outside loop, i is ' || TO_CHAR(i)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR i IN 1 LOOP DBMS_OUTPUT.PUT_LINE(i); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR i IN 1, REPEAT i*2 WHILE i < 100 LOOP DBMS_OUTPUT.PUT_LINE(i); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html OPEN c FOR SELECT id, data FROM T; CLOSE c; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html DECLARE cursor_str VARCHAR2(500) := 'SELECT last_name, employee_id FROM hr.employees ORDER BY last_name'; TYPE rec_t IS RECORD (last_name VARCHAR2(25), employee_id NUMBER); BEGIN FOR r rec_t IN VALUES OF (EXECUTE IMMEDIATE cursor_str) WHEN r.employee_id < 103 LOOP DBMS_OUTPUT.PUT_LINE(r.last_name || ', ' || r.employee_id); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR power IN 1, REPEAT power*2 WHILE power <= 64 LOOP DBMS_OUTPUT.PUT_LINE(power); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-39.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN FOR power IN 2, REPEAT power*2 WHILE power <= 64 WHEN MOD(power, 32)= 0 LOOP DBMS_OUTPUT.PUT_LINE(power); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html DECLARE i NUMBER := 5; BEGIN FOR i IN 1..3 LOOP DBMS_OUTPUT.PUT_LINE ('Inside loop, i is ' || TO_CHAR(i)); END LOOP; DBMS_OUTPUT.PUT_LINE ('Outside loop, i is ' || TO_CHAR(i)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html <
> -- Label block. DECLARE i NUMBER := 5; BEGIN FOR i IN 1..3 LOOP DBMS_OUTPUT.PUT_LINE ( 'local: ' || TO_CHAR(i) || ', global: ' || TO_CHAR(main.i) -- Qualify reference with block label. ); END LOOP; END main; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/loop-statements-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/loop-statements.html BEGIN <> FOR i IN 1..3 LOOP <> FOR i IN 1..3 LOOP IF outer_loop.i = 2 THEN DBMS_OUTPUT.PUT_LINE ('outer: ' || TO_CHAR(outer_loop.i) || ' inner: ' || TO_CHAR(inner_loop.i)); END IF; END LOOP inner_loop; END LOOP outer_loop; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/main-features-pl-sql-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/main-features-pl-sql.html BEGIN FOR someone IN ( SELECT * FROM employees WHERE employee_id < 120 ORDER BY employee_id ) LOOP DBMS_OUTPUT.PUT_LINE('First name = ' || someone.first_name || ', Last name = ' || someone.last_name); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/minimizing-cpu-overhead-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/minimizing-cpu-overhead.html DECLARE starting_time TIMESTAMP WITH TIME ZONE; ending_time TIMESTAMP WITH TIME ZONE; BEGIN -- Invokes SQRT for every row of employees table: SELECT SYSTIMESTAMP INTO starting_time FROM DUAL; FOR item IN ( SELECT DISTINCT(SQRT(department_id)) col_alias FROM employees ORDER BY col_alias ) LOOP DBMS_OUTPUT.PUT_LINE('Square root of dept. ID = ' || item.col_alias); END LOOP; SELECT SYSTIMESTAMP INTO ending_time FROM DUAL; DBMS_OUTPUT.PUT_LINE('Time = ' || TO_CHAR(ending_time - starting_time)); -- Invokes SQRT for every distinct department_id of employees table: SELECT SYSTIMESTAMP INTO starting_time FROM DUAL; FOR item IN ( SELECT SQRT(department_id) col_alias FROM (SELECT DISTINCT department_id FROM employees) ORDER BY col_alias ) LOOP IF item.col_alias IS NOT NULL THEN DBMS_OUTPUT.PUT_LINE('Square root of dept. ID = ' || item.col_alias); END IF; END LOOP; SELECT SYSTIMESTAMP INTO ending_time FROM DUAL; DBMS_OUTPUT.PUT_LINE('Time = ' || TO_CHAR(ending_time - starting_time)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/minimizing-cpu-overhead-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/minimizing-cpu-overhead.html DECLARE TYPE EmpTabTyp IS TABLE OF employees%ROWTYPE; emp_tab EmpTabTyp := EmpTabTyp(NULL); -- initialize t1 NUMBER; t2 NUMBER; t3 NUMBER; PROCEDURE get_time (t OUT NUMBER) IS BEGIN t := DBMS_UTILITY.get_time; END; PROCEDURE do_nothing1 (tab IN OUT EmpTabTyp) IS BEGIN NULL; END; PROCEDURE do_nothing2 (tab IN OUT NOCOPY EmpTabTyp) IS BEGIN NULL; END; BEGIN SELECT * INTO emp_tab(1) FROM employees WHERE employee_id = 100; emp_tab.EXTEND(49999, 1); -- Copy element 1 into 2..50000 get_time(t1); do_nothing1(emp_tab); -- Pass IN OUT parameter get_time(t2); do_nothing2(emp_tab); -- Pass IN OUT NOCOPY parameter get_time(t3); DBMS_OUTPUT.PUT_LINE ('Call Duration (secs)'); DBMS_OUTPUT.PUT_LINE ('--------------------'); DBMS_OUTPUT.PUT_LINE ('Just IN OUT: ' || TO_CHAR((t2 - t1)/100.0)); DBMS_OUTPUT.PUT_LINE ('With NOCOPY: ' || TO_CHAR((t3 - t2))/100.0); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/multidimensional-collections-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/multidimensional-collections.html DECLARE TYPE t1 IS VARRAY(10) OF INTEGER; -- varray of integer va t1 := t1(2,3,5); TYPE nt1 IS VARRAY(10) OF t1; -- varray of varray of integer nva nt1 := nt1(va, t1(55,6,73), t1(2,4), va); i INTEGER; va1 t1; BEGIN i := nva(2)(3); DBMS_OUTPUT.PUT_LINE('i = ' || i); nva.EXTEND; nva(5) := t1(56, 32); -- replace inner varray elements nva(4) := t1(45,43,67,43345); -- replace an inner integer element nva(4)(4) := 1; -- replace 43345 with 1 nva(4).EXTEND; -- add element to 4th varray element nva(4)(5) := 89; -- store integer 89 there END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/multidimensional-collections-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/multidimensional-collections.html DECLARE TYPE tb1 IS TABLE OF VARCHAR2(20); -- nested table of strings vtb1 tb1 := tb1('one', 'three'); TYPE ntb1 IS TABLE OF tb1; -- nested table of nested tables of strings vntb1 ntb1 := ntb1(vtb1); TYPE tv1 IS VARRAY(10) OF INTEGER; -- varray of integers TYPE ntb2 IS TABLE OF tv1; -- nested table of varrays of integers vntb2 ntb2 := ntb2(tv1(3,5), tv1(5,7,3)); BEGIN vntb1.EXTEND; vntb1(2) := vntb1(1); vntb1.DELETE(1); -- delete first element of vntb1 vntb1(2).DELETE(1); -- delete first string from second table in nested table END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/multidimensional-collections-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/multidimensional-collections.html DECLARE TYPE tb1 IS TABLE OF INTEGER INDEX BY PLS_INTEGER; -- associative arrays v4 tb1; v5 tb1; TYPE aa1 IS TABLE OF tb1 INDEX BY PLS_INTEGER; -- associative array of v2 aa1; -- associative arrays TYPE va1 IS VARRAY(10) OF VARCHAR2(20); -- varray of strings v1 va1 := va1('hello', 'world'); TYPE ntb2 IS TABLE OF va1 INDEX BY PLS_INTEGER; -- associative array of varrays v3 ntb2; BEGIN v4(1) := 34; -- populate associative array v4(2) := 46456; v4(456) := 343; v2(23) := v4; -- populate associative array of associative arrays v3(34) := va1(33, 456, 656, 343); -- populate associative array varrays v2(35) := v5; -- assign empty associative array to v2(35) v2(35)(2) := 78; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html CREATE OR REPLACE PROCEDURE create_dept ( deptid IN OUT NUMBER, dname IN VARCHAR2, mgrid IN NUMBER, locid IN NUMBER ) AUTHID DEFINER AS BEGIN deptid := departments_seq.NEXTVAL; INSERT INTO departments ( department_id, department_name, manager_id, location_id ) VALUES (deptid, dname, mgrid, locid); END; / DECLARE plsql_block VARCHAR2(500); new_deptid NUMBER(4); new_dname VARCHAR2(30) := 'Advertising'; new_mgrid NUMBER(6) := 200; new_locid NUMBER(4) := 1700; BEGIN -- Dynamic PL/SQL block invokes subprogram: plsql_block := 'BEGIN create_dept(:a, :b, :c, :d); END;'; /* Specify bind variables in USING clause. Specify mode for first parameter. Modes of other parameters are correct by default. */ EXECUTE IMMEDIATE plsql_block USING IN OUT new_deptid, new_dname, new_mgrid, new_locid; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html CREATE OR REPLACE PROCEDURE p (x BOOLEAN) AUTHID DEFINER AS BEGIN IF x THEN DBMS_OUTPUT.PUT_LINE('x is true'); END IF; END; / DECLARE dyn_stmt VARCHAR2(200); b BOOLEAN := TRUE; BEGIN dyn_stmt := 'BEGIN p(:x); END;'; EXECUTE IMMEDIATE dyn_stmt USING b; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html CREATE TABLE employees_temp AS SELECT * FROM EMPLOYEES; DECLARE a_null CHAR(1); -- Set to NULL automatically at run time BEGIN EXECUTE IMMEDIATE 'UPDATE employees_temp SET commission_pct = :x' USING a_null; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html DECLARE TYPE EmpCurTyp IS REF CURSOR; v_emp_cursor EmpCurTyp; emp_record employees%ROWTYPE; v_stmt_str VARCHAR2(200); v_e_job employees.job_id%TYPE; BEGIN -- Dynamic SQL statement with placeholder: v_stmt_str := 'SELECT * FROM employees WHERE job_id = :j'; -- Open cursor & specify bind variable in USING clause: OPEN v_emp_cursor FOR v_stmt_str USING 'MANAGER'; -- Fetch rows from result set one at a time: LOOP FETCH v_emp_cursor INTO emp_record; EXIT WHEN v_emp_cursor%NOTFOUND; END LOOP; -- Close cursor: CLOSE v_emp_cursor; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html CREATE OR REPLACE PACKAGE pkg AUTHID DEFINER AS TYPE rec IS RECORD(f1 NUMBER, f2 VARCHAR2(30)); TYPE mytab IS TABLE OF rec INDEX BY pls_integer; END; / DECLARE v1 pkg.mytab; -- collection of records v2 pkg.rec; c1 SYS_REFCURSOR; BEGIN OPEN c1 FOR 'SELECT * FROM TABLE(:1)' USING v1; FETCH c1 INTO v2; CLOSE c1; DBMS_OUTPUT.PUT_LINE('Values in record are ' || v2.f1 || ' and ' || v2.f2); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html EXECUTE IMMEDIATE sql_stmt USING a, b, c, d; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html INSERT INTO payroll VALUES (a, b, c, d) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html EXECUTE IMMEDIATE sql_stmt USING a, a, b, a; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html INSERT INTO payroll VALUES (a, a, b, a) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html CREATE PROCEDURE calc_stats ( w NUMBER, x NUMBER, y NUMBER, z NUMBER ) IS BEGIN DBMS_OUTPUT.PUT_LINE(w + x + y + z); END; / DECLARE a NUMBER := 4; b NUMBER := 7; plsql_block VARCHAR2(100); BEGIN plsql_block := 'BEGIN calc_stats(:x, :x, :y, :x); END;'; EXECUTE IMMEDIATE plsql_block USING a, b; -- calc_stats(a, a, b, a) END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html CREATE OR REPLACE PACKAGE pkg AUTHID DEFINER AS TYPE rec IS RECORD (n1 NUMBER, n2 NUMBER); PROCEDURE p (x OUT rec, y NUMBER, z NUMBER); END pkg; / CREATE OR REPLACE PACKAGE BODY pkg AS PROCEDURE p (x OUT rec, y NUMBER, z NUMBER) AS BEGIN x.n1 := y; x.n2 := z; END p; END pkg; / DECLARE r pkg.rec; dyn_str VARCHAR2(3000); BEGIN dyn_str := 'BEGIN pkg.p(:x, 6, 8); END;'; EXECUTE IMMEDIATE dyn_str USING OUT r; DBMS_OUTPUT.PUT_LINE('r.n1 = ' || r.n1); DBMS_OUTPUT.PUT_LINE('r.n2 = ' || r.n2); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html CREATE OR REPLACE PACKAGE pkg AUTHID DEFINER AS TYPE number_names IS TABLE OF VARCHAR2(5) INDEX BY PLS_INTEGER; PROCEDURE print_number_names (x number_names); END pkg; / CREATE OR REPLACE PACKAGE BODY pkg AS PROCEDURE print_number_names (x number_names) IS BEGIN FOR i IN x.FIRST .. x.LAST LOOP DBMS_OUTPUT.PUT_LINE(x(i)); END LOOP; END; END pkg; / DECLARE digit_names pkg.number_names; dyn_stmt VARCHAR2(3000); BEGIN digit_names(0) := 'zero'; digit_names(1) := 'one'; digit_names(2) := 'two'; digit_names(3) := 'three'; digit_names(4) := 'four'; digit_names(5) := 'five'; digit_names(6) := 'six'; digit_names(7) := 'seven'; digit_names(8) := 'eight'; digit_names(9) := 'nine'; dyn_stmt := 'BEGIN pkg.print_number_names(:x); END;'; EXECUTE IMMEDIATE dyn_stmt USING digit_names; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html CREATE OR REPLACE PACKAGE pkg AUTHID DEFINER AS TYPE names IS TABLE OF VARCHAR2(10); PROCEDURE print_names (x names); END pkg; / CREATE OR REPLACE PACKAGE BODY pkg AS PROCEDURE print_names (x names) IS BEGIN FOR i IN x.FIRST .. x.LAST LOOP DBMS_OUTPUT.PUT_LINE(x(i)); END LOOP; END; END pkg; / DECLARE fruits pkg.names; dyn_stmt VARCHAR2(3000); BEGIN fruits := pkg.names('apple', 'banana', 'cherry'); dyn_stmt := 'BEGIN pkg.print_names(:x); END;'; EXECUTE IMMEDIATE dyn_stmt USING fruits; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/native-dynamic-sql-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/native-dynamic-sql.html CREATE OR REPLACE PACKAGE pkg AUTHID DEFINER AS TYPE foursome IS VARRAY(4) OF VARCHAR2(5); PROCEDURE print_foursome (x foursome); END pkg; / CREATE OR REPLACE PACKAGE BODY pkg AS PROCEDURE print_foursome (x foursome) IS BEGIN IF x.COUNT = 0 THEN DBMS_OUTPUT.PUT_LINE('Empty'); ELSE FOR i IN x.FIRST .. x.LAST LOOP DBMS_OUTPUT.PUT_LINE(x(i)); END LOOP; END IF; END; END pkg; / DECLARE directions pkg.foursome; dyn_stmt VARCHAR2(3000); BEGIN directions := pkg.foursome('north', 'south', 'east', 'west'); dyn_stmt := 'BEGIN pkg.print_foursome(:x); END;'; EXECUTE IMMEDIATE dyn_stmt USING directions; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html DECLARE TYPE date_tab_typ IS TABLE OF DATE INDEX BY PLS_INTEGER; TYPE num_tab_typ IS TABLE OF NUMBER INDEX BY PLS_INTEGER; hiredate_tab date_tab_typ; sal_tab num_tab_typ; PROCEDURE initialize (tab OUT date_tab_typ, n INTEGER) IS BEGIN DBMS_OUTPUT.PUT_LINE('Invoked first version'); FOR i IN 1..n LOOP tab(i) := SYSDATE; END LOOP; END initialize; PROCEDURE initialize (tab OUT num_tab_typ, n INTEGER) IS BEGIN DBMS_OUTPUT.PUT_LINE('Invoked second version'); FOR i IN 1..n LOOP tab(i) := 0.0; END LOOP; END initialize; BEGIN initialize(hiredate_tab, 50); initialize(sal_tab, 100); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html CREATE OR REPLACE PACKAGE pkg3 AUTHID DEFINER IS PROCEDURE s (p1 VARCHAR2); PROCEDURE s (p1 VARCHAR2, p2 VARCHAR2 := 'p2'); END pkg3; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html CREATE OR REPLACE PROCEDURE p AUTHID DEFINER IS a1 VARCHAR2(10) := 'a1'; a2 VARCHAR2(10) := 'a2'; BEGIN pkg3.s(p1=>a1, p2=>a2); -- Compiles without error pkg3.s(p1=>a1); -- Causes compile-time error PLS-00307 END p; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html CREATE OR REPLACE PACKAGE pack1 AUTHID DEFINER AS PROCEDURE proc1 (a NUMBER, b VARCHAR2); PROCEDURE proc1 (a NUMBER, b NUMBER); END; / CREATE OR REPLACE PACKAGE BODY pack1 AS PROCEDURE proc1 (a NUMBER, b VARCHAR2) IS BEGIN NULL; END; PROCEDURE proc1 (a NUMBER, b NUMBER) IS BEGIN NULL; END; END; / BEGIN pack1.proc1(1,'2'); -- Compiles without error pack1.proc1(1,2); -- Compiles without error pack1.proc1('1','2'); -- Causes compile-time error PLS-00307 pack1.proc1('1',2); -- Causes compile-time error PLS-00307 END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html ALTER SESSION SET PLSQL_IMPLICIT_CONVERSION_BOOL = FALSE; CREATE OR REPLACE PACKAGE pkg1 AUTHID DEFINER IS PROCEDURE s (p INTEGER); PROCEDURE s (p BOOLEAN); END pkg1; / CREATE OR REPLACE PACKAGE BODY pkg1 IS PROCEDURE s (p INTEGER) AS BEGIN dbms_output.put_line ( 'Integer' ); END; PROCEDURE s (p BOOLEAN) AS BEGIN dbms_output.put_line ( 'Boolean' ); END; END pkg1; / BEGIN pkg1.s('1'); -- Compiles without error END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html ALTER SESSION SET PLSQL_IMPLICIT_CONVERSION_BOOL = TRUE; exec pkg1.s('1'); -- Causes compile-time error PLS-00307 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html CREATE OR REPLACE PACKAGE pkg1 AUTHID DEFINER IS PROCEDURE s (p VARCHAR2); PROCEDURE s (p VARCHAR2); END pkg1; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html CREATE OR REPLACE PACKAGE pkg2 AUTHID DEFINER IS SUBTYPE t1 IS VARCHAR2(10); SUBTYPE t2 IS VARCHAR2(10); PROCEDURE s (p t1); PROCEDURE s (p t2); END pkg2; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html CREATE OR REPLACE PROCEDURE p AUTHID DEFINER IS a pkg2.t1 := 'a'; BEGIN pkg2.s(a); -- Causes compile-time error PLS-00307 END p; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html CREATE OR REPLACE PACKAGE pkg2 AUTHID DEFINER IS SUBTYPE t1 IS VARCHAR2(10); SUBTYPE t2 IS VARCHAR2(10); PROCEDURE s (p1 t1); PROCEDURE s (p2 t2); END pkg2; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overloaded-subprograms-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overloaded-subprograms.html CREATE OR REPLACE PROCEDURE p AUTHID DEFINER IS a pkg2.t1 := 'a'; BEGIN pkg2.s(p1=>a); -- Compiles without error END p; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-exception-handling-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-exception-handling.html CREATE OR REPLACE PROCEDURE select_item ( t_column VARCHAR2, t_name VARCHAR2 ) AUTHID DEFINER IS temp VARCHAR2(30); BEGIN temp := t_column; -- For error message if next SELECT fails -- Fails if table t_name does not have column t_column: SELECT COLUMN_NAME INTO temp FROM USER_TAB_COLS WHERE TABLE_NAME = UPPER(t_name) AND COLUMN_NAME = UPPER(t_column); temp := t_name; -- For error message if next SELECT fails -- Fails if there is no table named t_name: SELECT OBJECT_NAME INTO temp FROM USER_OBJECTS WHERE OBJECT_NAME = UPPER(t_name) AND OBJECT_TYPE = 'TABLE'; EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE ('No Data found for SELECT on ' || temp); WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE ('Unexpected error'); RAISE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-exception-handling-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-exception-handling.html BEGIN select_item('departments', 'last_name'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-exception-handling-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-exception-handling.html BEGIN select_item('emp', 'last_name'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-exception-handling-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-exception-handling.html CREATE OR REPLACE PROCEDURE loc_var AUTHID DEFINER IS stmt_no POSITIVE; name_ VARCHAR2(100); BEGIN stmt_no := 1; SELECT table_name INTO name_ FROM user_tables WHERE table_name LIKE 'ABC%'; stmt_no := 2; SELECT table_name INTO name_ FROM user_tables WHERE table_name LIKE 'XYZ%'; EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE ('Table name not found in query ' || stmt_no); END; / CALL loc_var(); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT * FROM noop(emp); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html WITH e AS (SELECT * FROM emp NATURAL JOIN dept) SELECT t.* FROM noop(e) t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT * FROM skip_col_pkg.skip_col(scott.dept, 'number', flip => 'True'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT * FROM skip_col_by_type(scott.dept, 'number', flip => 'True'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT * FROM skip_col_pkg.skip_col(scott.emp, COLUMNS(comm, hiredate, mgr)) WHERE deptno = 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html CREATE PACKAGE to_doc_p AS FUNCTION describe(tab IN OUT DBMS_TF.TABLE_T, cols IN DBMS_TF.COLUMNS_T DEFAULT NULL) RETURN DBMS_TF.DESCRIBE_T; PROCEDURE fetch_rows; END to_doc_p; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html CREATE PACKAGE BODY to_doc_p AS FUNCTION describe(tab IN OUT DBMS_TF.TABLE_T, cols IN DBMS_TF.COLUMNS_T DEFAULT NULL) RETURN DBMS_TF.DESCRIBE_T AS BEGIN FOR i IN 1 .. tab.column.count LOOP CONTINUE WHEN NOT DBMS_TF.SUPPORTED_TYPE(tab.column(i).DESCRIPTION.TYPE); IF cols IS NULL THEN tab.column(i).FOR_READ := TRUE; tab.column(i).PASS_THROUGH := FALSE; CONTINUE; END IF; FOR j IN 1 .. cols.count LOOP IF (tab.column(i).DESCRIPTION.NAME = cols(j)) THEN tab.column(i).FOR_READ := TRUE; tab.column(i).PASS_THROUGH := FALSE; END IF; END LOOP; END LOOP; RETURN DBMS_TF.describe_t(new_columns => DBMS_TF.COLUMNS_NEW_T(1 => DBMS_TF.COLUMN_METADATA_T(name =>'DOCUMENT'))); END; PROCEDURE fetch_rows AS rst DBMS_TF.ROW_SET_T; col DBMS_TF.TAB_VARCHAR2_T; rct PLS_INTEGER; BEGIN DBMS_TF.GET_ROW_SET(rst, row_count => rct); FOR rid IN 1 .. rct LOOP col(rid) := DBMS_TF.ROW_TO_CHAR(rst, rid); END LOOP; DBMS_TF.PUT_COL(1, col); END; END to_doc_p; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html CREATE FUNCTION to_doc( tab TABLE, cols COLUMNS DEFAULT NULL) RETURN TABLE PIPELINED ROW POLYMORPHIC USING to_doc_p; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT * FROM to_doc(scott.dept); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html CREATE PACKAGE skip_col_pkg AS -- OVERLOAD 1: Skip by name -- FUNCTION skip_col(tab TABLE, col COLUMNS) RETURN TABLE PIPELINED ROW POLYMORPHIC USING skip_col_pkg; FUNCTION describe(tab IN OUT DBMS_TF.TABLE_T, col DBMS_TF.COLUMNS_T) RETURN DBMS_TF.DESCRIBE_T; -- OVERLOAD 2: Skip by type -- FUNCTION skip_col(tab TABLE, type_name VARCHAR2, flip VARCHAR2 DEFAULT 'False') RETURN TABLE PIPELINED ROW POLYMORPHIC USING skip_col_pkg; FUNCTION describe(tab IN OUT DBMS_TF.TABLE_T, type_name VARCHAR2, flip VARCHAR2 DEFAULT 'False') RETURN DBMS_TF.DESCRIBE_T; END skip_col_pkg; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT deptno, ename, document FROM to_doc(scott.emp, COLUMNS(empno,job,mgr,hiredate,sal,comm)) WHERE deptno IN (10, 30) ORDER BY 1, 2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html WITH e AS ( SELECT ename name, sal, deptno, loc FROM scott.emp NATURAL JOIN scott.dept WHERE job = 'CLERK') SELECT ROWNUM doc_id, t.* FROM to_doc(e) t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html WITH t(c1,c2,c3) AS ( SELECT NULL, NULL, NULL FROM dual UNION ALL SELECT 1, NULL, NULL FROM dual UNION ALL SELECT NULL, 2, NULL FROM dual UNION ALL SELECT 0, NULL, 3 FROM dual) SELECT * FROM to_doc(t); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT JSON_VALUE(document, '$.ENAME') ename, JSON_VALUE(document, '$.COMM') comm FROM to_doc(scott.emp) WHERE JSON_VALUE(document, '$.DEPTNO') = 30; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html CREATE PACKAGE implicit_echo_package AS prefix DBMS_ID := '"ECHO_'; FUNCTION DESCRIBE(tab IN OUT DBMS_TF.TABLE_T, cols IN DBMS_TF.COLUMNS_T) RETURN DBMS_TF.DESCRIBE_T; PROCEDURE FETCH_ROWS; -- PTF FUNCTION: WITHOUT USING CLAUSE -- FUNCTION implicit_echo(tab TABLE, cols COLUMNS) RETURN TABLE PIPELINED ROW POLYMORPHIC; END implicit_echo_package; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html CREATE PACKAGE BODY implicit_echo_package AS FUNCTION DESCRIBE(tab IN OUT DBMS_TF.TABLE_T, cols IN DBMS_TF.COLUMNS_T) RETURN DBMS_TF.DESCRIBE_T AS new_cols DBMS_TF.COLUMNS_NEW_T; col_id PLS_INTEGER := 1; BEGIN FOR i in 1 .. tab.column.COUNT LOOP FOR j in 1 .. cols.COUNT LOOP IF (tab.column(i).description.name = cols(j)) THEN IF (NOT DBMS_TF.SUPPORTED_TYPE(tab.column(i).description.type)) THEN RAISE_APPLICATION_ERROR(-20102, 'Unsupported column type['|| tab.column(i).description.type||']'); END IF; tab.column(i).for_read := TRUE; new_cols(col_id) := tab.column(i).description; new_cols(col_id).name := prefix|| REGEXP_REPLACE(tab.column(i).description.name, '^"|"$'); col_id := col_id + 1; EXIT; END IF; END LOOP; END LOOP; /* VERIFY ALL COLUMNS WERE FOUND */ IF (col_id - 1 != cols.COUNT) then RAISE_APPLICATION_ERROR(-20101,'Column mismatch['||col_id-1||'], ['||cols.COUNT||']'); END IF; RETURN DBMS_TF.DESCRIBE_T(new_columns => new_cols); END; PROCEDURE FETCH_ROWS AS rowset DBMS_TF.ROW_SET_T; BEGIN DBMS_TF.GET_ROW_SET(rowset); DBMS_TF.PUT_ROW_SET(rowset); END; END implicit_echo_package; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT ENAME, ECHO_ENAME FROM implicit_echo_package.implicit_echo(SCOTT.EMP, COLUMNS(SCOTT.ENAME)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html CREATE FUNCTION skip_col_by_name(tab TABLE, col COLUMNS) RETURN TABLE PIPELINED ROW POLYMORPHIC USING skip_col_pkg; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html CREATE FUNCTION skip_col_by_type(tab TABLE, type_name VARCHAR2, flip VARCHAR2 DEFAULT 'False') RETURN TABLE PIPELINED ROW POLYMORPHIC USING skip_col_pkg; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT * FROM skip_col_pkg.skip_col(scott.dept, 'number'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/overview-polymorphic-table-functions-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/overview-polymorphic-table-functions.html SELECT * FROM skip_col_by_type(scott.dept, 'number'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-body-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-body.html CREATE PACKAGE emp_bonus AS PROCEDURE calc_bonus (date_hired employees.hire_date%TYPE); END emp_bonus; / CREATE PACKAGE BODY emp_bonus AS -- DATE does not match employees.hire_date%TYPE PROCEDURE calc_bonus (date_hired DATE) IS BEGIN DBMS_OUTPUT.PUT_LINE ('Employees hired on ' || date_hired || ' get bonus.'); END; END emp_bonus; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-body-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-body.html SHOW ERRORS ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-body-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-body.html CREATE OR REPLACE PACKAGE BODY emp_bonus AS PROCEDURE calc_bonus (date_hired employees.hire_date%TYPE) IS BEGIN DBMS_OUTPUT.PUT_LINE ('Employees hired on ' || date_hired || ' get bonus.'); END; END emp_bonus; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-example-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-example.html DROP TABLE log; CREATE TABLE log ( date_of_action DATE, user_id VARCHAR2(20), package_name VARCHAR2(30) ); CREATE OR REPLACE PACKAGE emp_admin AUTHID DEFINER AS -- Declare public type, cursor, and exception: TYPE EmpRecTyp IS RECORD (emp_id NUMBER, sal NUMBER); CURSOR desc_salary RETURN EmpRecTyp; invalid_salary EXCEPTION; -- Declare public subprograms: FUNCTION hire_employee ( last_name VARCHAR2, first_name VARCHAR2, email VARCHAR2, phone_number VARCHAR2, job_id VARCHAR2, salary NUMBER, commission_pct NUMBER, manager_id NUMBER, department_id NUMBER ) RETURN NUMBER; -- Overload preceding public subprogram: PROCEDURE fire_employee (emp_id NUMBER); PROCEDURE fire_employee (emp_email VARCHAR2); PROCEDURE raise_salary (emp_id NUMBER, amount NUMBER); FUNCTION nth_highest_salary (n NUMBER) RETURN EmpRecTyp; END emp_admin; / CREATE OR REPLACE PACKAGE BODY emp_admin AS number_hired NUMBER; -- private variable, visible only in this package -- Define cursor declared in package specification: CURSOR desc_salary RETURN EmpRecTyp IS SELECT employee_id, salary FROM employees ORDER BY salary DESC; -- Define subprograms declared in package specification: FUNCTION hire_employee ( last_name VARCHAR2, first_name VARCHAR2, email VARCHAR2, phone_number VARCHAR2, job_id VARCHAR2, salary NUMBER, commission_pct NUMBER, manager_id NUMBER, department_id NUMBER ) RETURN NUMBER IS new_emp_id NUMBER; BEGIN new_emp_id := employees_seq.NEXTVAL; INSERT INTO employees ( employee_id, last_name, first_name, email, phone_number, hire_date, job_id, salary, commission_pct, manager_id, department_id ) VALUES ( new_emp_id, hire_employee.last_name, hire_employee.first_name, hire_employee.email, hire_employee.phone_number, SYSDATE, hire_employee.job_id, hire_employee.salary, hire_employee.commission_pct, hire_employee.manager_id, hire_employee.department_id ); number_hired := number_hired + 1; DBMS_OUTPUT.PUT_LINE('The number of employees hired is ' || TO_CHAR(number_hired) ); RETURN new_emp_id; END hire_employee; PROCEDURE fire_employee (emp_id NUMBER) IS BEGIN DELETE FROM employees WHERE employee_id = emp_id; END fire_employee; PROCEDURE fire_employee (emp_email VARCHAR2) IS BEGIN DELETE FROM employees WHERE email = emp_email; END fire_employee; -- Define private function, available only inside package: FUNCTION sal_ok ( jobid VARCHAR2, sal NUMBER ) RETURN BOOLEAN IS min_sal NUMBER; max_sal NUMBER; BEGIN SELECT MIN(salary), MAX(salary) INTO min_sal, max_sal FROM employees WHERE job_id = jobid; RETURN (sal >= min_sal) AND (sal <= max_sal); END sal_ok; PROCEDURE raise_salary ( emp_id NUMBER, amount NUMBER ) IS sal NUMBER(8,2); jobid VARCHAR2(10); BEGIN SELECT job_id, salary INTO jobid, sal FROM employees WHERE employee_id = emp_id; IF sal_ok(jobid, sal + amount) THEN -- Invoke private function UPDATE employees SET salary = salary + amount WHERE employee_id = emp_id; ELSE RAISE invalid_salary; END IF; EXCEPTION WHEN invalid_salary THEN DBMS_OUTPUT.PUT_LINE ('The salary is out of the specified range.'); END raise_salary; FUNCTION nth_highest_salary ( n NUMBER ) RETURN EmpRecTyp IS emp_rec EmpRecTyp; BEGIN OPEN desc_salary; FOR i IN 1..n LOOP FETCH desc_salary INTO emp_rec; END LOOP; CLOSE desc_salary; RETURN emp_rec; END nth_highest_salary; BEGIN -- initialization part of package body INSERT INTO log (date_of_action, user_id, package_name) VALUES (SYSDATE, USER, 'EMP_ADMIN'); number_hired := 0; END emp_admin; / DECLARE new_emp_id NUMBER(6); BEGIN new_emp_id := emp_admin.hire_employee ( 'Belden', 'Enrique', 'EBELDEN', '555.111.2222', 'ST_CLERK', 2500, .1, 101, 110 ); DBMS_OUTPUT.PUT_LINE ('The employee id is ' || TO_CHAR(new_emp_id)); emp_admin.raise_salary (new_emp_id, 100); DBMS_OUTPUT.PUT_LINE ( 'The 10th highest salary is '|| TO_CHAR (emp_admin.nth_highest_salary(10).sal) || ', belonging to employee: ' || TO_CHAR (emp_admin.nth_highest_salary(10).emp_id) ); emp_admin.fire_employee(new_emp_id); -- You can also delete the newly added employee as follows: -- emp_admin.fire_employee('EBELDEN'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-specification-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-specification.html CREATE OR REPLACE PACKAGE trans_data AUTHID DEFINER AS TYPE TimeRec IS RECORD ( minutes SMALLINT, hours SMALLINT); TYPE TransRec IS RECORD ( category VARCHAR2(10), account INT, amount REAL, time_of TimeRec); minimum_balance CONSTANT REAL := 10.00; number_processed INT; insufficient_funds EXCEPTION; PRAGMA EXCEPTION_INIT(insufficient_funds, -4097); END trans_data; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-specification-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-specification.html CREATE OR REPLACE PACKAGE aa_pkg AUTHID DEFINER IS TYPE aa_type IS TABLE OF INTEGER INDEX BY VARCHAR2(15); END; / CREATE OR REPLACE PROCEDURE print_aa ( aa aa_pkg.aa_type ) AUTHID DEFINER IS i VARCHAR2(15); BEGIN i := aa.FIRST; WHILE i IS NOT NULL LOOP DBMS_OUTPUT.PUT_LINE (aa(i) || ' ' || i); i := aa.NEXT(i); END LOOP; END; / DECLARE aa_var aa_pkg.aa_type; BEGIN aa_var('zero') := 0; aa_var('one') := 1; aa_var('two') := 2; print_aa(aa_var); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-writing-guidelines-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-writing-guidelines.html CREATE PACKAGE emp_stuff AS CURSOR c1 RETURN employees%ROWTYPE; -- Declare cursor END emp_stuff; / CREATE PACKAGE BODY emp_stuff AS CURSOR c1 RETURN employees%ROWTYPE IS SELECT * FROM employees WHERE salary > 2500; -- Define cursor END emp_stuff; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-writing-guidelines-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-writing-guidelines.html CREATE OR REPLACE PACKAGE helper AUTHID DEFINER ACCESSIBLE BY (api) IS PROCEDURE h1; PROCEDURE h2; END; / CREATE OR REPLACE PACKAGE BODY helper IS PROCEDURE h1 IS BEGIN DBMS_OUTPUT.PUT_LINE('Helper procedure h1'); END; PROCEDURE h2 IS BEGIN DBMS_OUTPUT.PUT_LINE('Helper procedure h2'); END; END; / CREATE OR REPLACE PACKAGE api AUTHID DEFINER IS PROCEDURE p1; PROCEDURE p2; END; / CREATE OR REPLACE PACKAGE BODY api IS PROCEDURE p1 IS BEGIN DBMS_OUTPUT.PUT_LINE('API procedure p1'); helper.h1; END; PROCEDURE p2 IS BEGIN DBMS_OUTPUT.PUT_LINE('API procedure p2'); helper.h2; END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-writing-guidelines-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-writing-guidelines.html BEGIN api.p1; api.p2; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/package-writing-guidelines-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/package-writing-guidelines.html BEGIN helper.h1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html SELECT rc1.NAME, rc2.STATUS, rc3.STATUS, rc2.BLOCK_COUNT FROM V$RESULT_CACHE_OBJECTS rc1, V$RESULT_CACHE_OBJECTS rc2 WHERE rc1.TYPE = 'Result' AND rc2.TYPE = 'Temp' AND rc1.CACHE_KEY = rc2.CACHE_KEY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html SELECT SCAN_COUNT, COUNT(CACHE_KEY) FROM V$RESULT_CACHE_OBJECTS WHERE NAMESPACE = 'PLSQL' GROUP BY SCAN_COUNT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html CREATE OR REPLACE FUNCTION get_hire_date (emp_id NUMBER) RETURN VARCHAR RESULT_CACHE AUTHID DEFINER IS date_hired DATE; BEGIN SELECT hire_date INTO date_hired FROM HR.EMPLOYEES WHERE EMPLOYEE_ID = emp_id; RETURN TO_CHAR(date_hired); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html SELECT value FROM config_tab WHERE name = param_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html SELECT value FROM config_tab WHERE name = param_name AND app_id = SYS_CONTEXT('Config', 'App_ID'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html CREATE OR REPLACE FUNCTION get_param_value ( param_name VARCHAR, appctx VARCHAR DEFAULT SYS_CONTEXT('Config', 'App_ID') ) RETURN VARCHAR RESULT_CACHE AUTHID DEFINER IS rec VARCHAR(2000); BEGIN SELECT val INTO rec FROM config_tab WHERE name = param_name; RETURN rec; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html CREATE OR REPLACE FUNCTION get_product_name_1 ( prod_id NUMBER, lang_id VARCHAR2 ) RETURN NVARCHAR2 RESULT_CACHE AUTHID DEFINER IS result_ VARCHAR2(50); BEGIN SELECT translated_name INTO result_ FROM OE.Product_Descriptions WHERE PRODUCT_ID = prod_id AND LANGUAGE_ID = lang_id; RETURN result_; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html CREATE OR REPLACE FUNCTION get_product_name_2 ( prod_id NUMBER, lang_id VARCHAR2 ) RETURN NVARCHAR2 AUTHID DEFINER IS TYPE product_names IS TABLE OF NVARCHAR2(50) INDEX BY PLS_INTEGER; FUNCTION all_product_names (lang_id VARCHAR2) RETURN product_names RESULT_CACHE IS all_names product_names; BEGIN FOR c IN (SELECT * FROM OE.Product_Descriptions WHERE LANGUAGE_ID = lang_id) LOOP all_names(c.PRODUCT_ID) := c.TRANSLATED_NAME; END LOOP; RETURN all_names; END; BEGIN RETURN all_product_names(lang_id)(prod_id); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html SELECT cache_id, COUNT(cache_key) AS uniq_args FROM GV$RESULT_CACHE_OBJECTS WHERE type = 'Result' GROUP BY cache_id ORDER BY uniq_args DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html SELECT object_no, SUM(invalidations) AS num_invals FROM GV$RESULT_CACHE_OBJECTS WHERE type = 'Dependency' GROUP BY object_no ORDER BY num_invals DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html BEGIN DBMS_RESULT_CACHE.Bypass(TRUE); DBMS_RESULT_CACHE.Flush; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html BEGIN DBMS_RESULT_CACHE.Bypass(FALSE); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html CREATE OR REPLACE PACKAGE department_pkg AUTHID DEFINER IS TYPE dept_info_record IS RECORD ( dept_name departments.department_name%TYPE, mgr_name employees.last_name%TYPE, dept_size PLS_INTEGER ); -- Function declaration FUNCTION get_dept_info (dept_id NUMBER) RETURN dept_info_record RESULT_CACHE; END department_pkg; / CREATE OR REPLACE PACKAGE BODY department_pkg IS -- Function definition FUNCTION get_dept_info (dept_id NUMBER) RETURN dept_info_record RESULT_CACHE IS rec dept_info_record; BEGIN SELECT department_name INTO rec.dept_name FROM departments WHERE department_id = dept_id; SELECT e.last_name INTO rec.mgr_name FROM departments d, employees e WHERE d.department_id = dept_id AND d.manager_id = e.employee_id; SELECT COUNT(*) INTO rec.dept_size FROM EMPLOYEES WHERE department_id = dept_id; RETURN rec; END get_dept_info; END department_pkg; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html DROP TABLE global_config_params; CREATE TABLE global_config_params (name VARCHAR2(20), -- parameter NAME val VARCHAR2(20), -- parameter VALUE PRIMARY KEY (name) ); CREATE TABLE app_level_config_params (app_id VARCHAR2(20), -- application ID name VARCHAR2(20), -- parameter NAME val VARCHAR2(20), -- parameter VALUE PRIMARY KEY (app_id, name) ); CREATE TABLE role_level_config_params (role_id VARCHAR2(20), -- application (role) ID name VARCHAR2(20), -- parameter NAME val VARCHAR2(20), -- parameter VALUE PRIMARY KEY (role_id, name) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html CREATE OR REPLACE FUNCTION get_value (p_param VARCHAR2, p_app_id NUMBER, p_role_id NUMBER ) RETURN VARCHAR2 RESULT_CACHE AUTHID DEFINER IS answer VARCHAR2(20); BEGIN -- Is parameter set at role level? BEGIN SELECT val INTO answer FROM role_level_config_params WHERE role_id = p_role_id AND name = p_param; RETURN answer; -- Found EXCEPTION WHEN no_data_found THEN NULL; -- Fall through to following code END; -- Is parameter set at application level? BEGIN SELECT val INTO answer FROM app_level_config_params WHERE app_id = p_app_id AND name = p_param; RETURN answer; -- Found EXCEPTION WHEN no_data_found THEN NULL; -- Fall through to following code END; -- Is parameter set at global level? SELECT val INTO answer FROM global_config_params WHERE name = p_param; RETURN answer; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html CREATE OR REPLACE FUNCTION fibonacci (n NUMBER) RETURN NUMBER RESULT_CACHE AUTHID DEFINER IS BEGIN IF (n =0) OR (n =1) THEN RETURN 1; ELSE RETURN fibonacci(n - 1) + fibonacci(n - 2); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pl-sql-function-result-cache-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pl-sql-function-result-cache.html CREATE OR REPLACE FUNCTION get_hire_date (emp_id NUMBER, fmt VARCHAR) RETURN VARCHAR RESULT_CACHE AUTHID DEFINER IS date_hired DATE; BEGIN SELECT hire_date INTO date_hired FROM HR.EMPLOYEES WHERE EMPLOYEE_ID = emp_id; RETURN TO_CHAR(date_hired, fmt); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pls_integer-and-binary_integer-data-types-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pls_integer-and-binary_integer-data-types.html DECLARE p1 PLS_INTEGER := 2147483647; p2 PLS_INTEGER := 1; n NUMBER; BEGIN n := p1 + p2; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pls_integer-and-binary_integer-data-types-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pls_integer-and-binary_integer-data-types.html DECLARE p1 PLS_INTEGER := 2147483647; p2 INTEGER := 1; n NUMBER; BEGIN n := p1 + p2; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pls_integer-and-binary_integer-data-types-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pls_integer-and-binary_integer-data-types.html DECLARE a SIMPLE_INTEGER := 1; b PLS_INTEGER := NULL; BEGIN a := b; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/pls_integer-and-binary_integer-data-types-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/pls_integer-and-binary_integer-data-types.html DECLARE n SIMPLE_INTEGER := 2147483645; BEGIN FOR j IN 1..4 LOOP n := n + 1; DBMS_OUTPUT.PUT_LINE(TO_CHAR(n, 'S9999999999')); END LOOP; FOR j IN 1..4 LOOP n := n - 1; DBMS_OUTPUT.PUT_LINE(TO_CHAR(n, 'S9999999999')); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/plsql-program-limits-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/plsql-program-limits.html CREATE OR REPLACE PACKAGE pkg1 AS TYPE numset_t IS TABLE OF NUMBER; FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED; END pkg1; / CREATE OR REPLACE PACKAGE BODY pkg1 AS -- FUNCTION f1 returns a collection of elements (1,2,3,... x) FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED IS BEGIN FOR i IN 1..x LOOP PIPE ROW(i); END LOOP; RETURN; END f1; END pkg1; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/plsql-program-limits-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/plsql-program-limits.html COLUMN name FORMAT A4 COLUMN type FORMAT A12 COLUMN source_size FORMAT 999 COLUMN parsed_size FORMAT 999 COLUMN code_size FORMAT 999 COLUMN error_size FORMAT 999 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/plsql-program-limits-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/plsql-program-limits.html SELECT * FROM user_object_size WHERE name = 'PKG1' ORDER BY type; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/predefined-exceptions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/predefined-exceptions.html DECLARE stock_price NUMBER := 9.73; net_earnings NUMBER := 0; pe_ratio NUMBER; BEGIN pe_ratio := stock_price / net_earnings; -- raises ZERO_DIVIDE exception DBMS_OUTPUT.PUT_LINE('Price/earnings ratio = ' || pe_ratio); EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Company had zero earnings.'); pe_ratio := NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/predefined-exceptions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/predefined-exceptions.html DECLARE stock_price NUMBER := 9.73; net_earnings NUMBER := 0; pe_ratio NUMBER; BEGIN pe_ratio := CASE net_earnings WHEN 0 THEN NULL ELSE stock_price / net_earnings END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/predefined-exceptions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/predefined-exceptions.html CREATE OR REPLACE PACKAGE emp_dept_data AUTHID DEFINER AS TYPE cv_type IS REF CURSOR; PROCEDURE open_cv ( cv IN OUT cv_type, discrim IN POSITIVE ); END emp_dept_data; / CREATE OR REPLACE PACKAGE BODY emp_dept_data AS PROCEDURE open_cv ( cv IN OUT cv_type, discrim IN POSITIVE) IS BEGIN IF discrim = 1 THEN OPEN cv FOR SELECT * FROM EMPLOYEES ORDER BY employee_id; ELSIF discrim = 2 THEN OPEN cv FOR SELECT * FROM DEPARTMENTS ORDER BY department_id; END IF; END open_cv; END emp_dept_data; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/predefined-exceptions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/predefined-exceptions.html DECLARE emp_rec EMPLOYEES%ROWTYPE; dept_rec DEPARTMENTS%ROWTYPE; cv Emp_dept_data.CV_TYPE; BEGIN emp_dept_data.open_cv(cv, 1); -- Open cv for EMPLOYEES fetch. FETCH cv INTO dept_rec; -- Fetch from DEPARTMENTS. DBMS_OUTPUT.PUT(dept_rec.DEPARTMENT_ID); DBMS_OUTPUT.PUT_LINE(' ' || dept_rec.LOCATION_ID); EXCEPTION WHEN ROWTYPE_MISMATCH THEN BEGIN DBMS_OUTPUT.PUT_LINE ('Row type mismatch, fetching EMPLOYEES data ...'); FETCH cv INTO emp_rec; DBMS_OUTPUT.PUT(emp_rec.DEPARTMENT_ID); DBMS_OUTPUT.PUT_LINE(' ' || emp_rec.LAST_NAME); END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/processing-query-result-sets-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/processing-query-result-sets.html BEGIN FOR item IN ( SELECT last_name, job_id FROM employees WHERE job_id LIKE '%CLERK%' AND manager_id > 120 ORDER BY last_name ) LOOP DBMS_OUTPUT.PUT_LINE ('Name = ' || item.last_name || ', Job = ' || item.job_id); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/processing-query-result-sets-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/processing-query-result-sets.html DECLARE CURSOR c1 IS SELECT department_id, last_name, salary FROM employees t WHERE salary > ( SELECT AVG(salary) FROM employees WHERE t.department_id = department_id ) ORDER BY department_id, last_name; BEGIN FOR person IN c1 LOOP DBMS_OUTPUT.PUT_LINE('Making above-average salary = ' || person.last_name); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/processing-query-result-sets-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/processing-query-result-sets.html DECLARE CURSOR c1 IS SELECT last_name, job_id FROM employees WHERE job_id LIKE '%CLERK%' AND manager_id > 120 ORDER BY last_name; BEGIN FOR item IN c1 LOOP DBMS_OUTPUT.PUT_LINE ('Name = ' || item.last_name || ', Job = ' || item.job_id); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/processing-query-result-sets-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/processing-query-result-sets.html DECLARE CURSOR c1 (job VARCHAR2, max_wage NUMBER) IS SELECT * FROM employees WHERE job_id = job AND salary > max_wage; BEGIN FOR person IN c1('ST_CLERK', 3000) LOOP -- process data record DBMS_OUTPUT.PUT_LINE ( 'Name = ' || person.last_name || ', salary = ' || person.salary || ', Job Id = ' || person.job_id ); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/processing-query-result-sets-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/processing-query-result-sets.html BEGIN FOR item IN ( SELECT first_name || ' ' || last_name AS full_name, salary * 10 AS dream_salary FROM employees WHERE ROWNUM <= 5 ORDER BY dream_salary DESC, last_name ASC ) LOOP DBMS_OUTPUT.PUT_LINE (item.full_name || ' dreams of making ' || item.dream_salary); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/processing-query-result-sets-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/processing-query-result-sets.html DECLARE CURSOR c1 IS SELECT t1.department_id, department_name, staff FROM departments t1, ( SELECT department_id, COUNT(*) AS staff FROM employees GROUP BY department_id ) t2 WHERE (t1.department_id = t2.department_id) AND staff >= 5 ORDER BY staff; BEGIN FOR dept IN c1 LOOP DBMS_OUTPUT.PUT_LINE ('Department = ' || dept.department_name || ', staff = ' || dept.staff); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/qualified-names-and-dot-notation-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/qualified-names-and-dot-notation.html CREATE OR REPLACE PACKAGE pkg1 AUTHID DEFINER AS m NUMBER; TYPE t1 IS RECORD (a NUMBER); v1 t1; TYPE t2 IS TABLE OF t1 INDEX BY PLS_INTEGER; v2 t2; FUNCTION f1 (p1 NUMBER) RETURN t1; FUNCTION f2 (q1 NUMBER) RETURN t2; END pkg1; / CREATE OR REPLACE PACKAGE BODY pkg1 AS FUNCTION f1 (p1 NUMBER) RETURN t1 IS n NUMBER; BEGIN n := m; -- Unqualified variable name n := pkg1.m; -- Variable name qualified by package name n := pkg1.f1.p1; -- Parameter name qualified by function name, -- which is qualified by package name n := v1.a; -- Variable name followed by component name n := pkg1.v1.a; -- Variable name qualified by package name -- and followed by component name n := v2(10).a; -- Indexed name followed by component name n := f1(10).a; -- Function invocation followed by component name n := f2(10)(10).a; -- Function invocation followed by indexed name -- and followed by component name n := hr.pkg1.f2(10)(10).a; -- Schema name, package name, -- function invocation, index, component name v1.a := p1; RETURN v1; END f1; FUNCTION f2 (q1 NUMBER) RETURN t2 IS v_t1 t1; v_t2 t2; BEGIN v_t1.a := q1; v_t2(1) := v_t1; RETURN v_t2; END f2; END pkg1; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/raising-exceptions-explicitly-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/raising-exceptions-explicitly.html CREATE PROCEDURE account_status ( due_date DATE, today DATE ) AUTHID DEFINER IS past_due EXCEPTION; -- declare exception BEGIN IF due_date < today THEN RAISE past_due; -- explicitly raise exception END IF; EXCEPTION WHEN past_due THEN -- handle exception DBMS_OUTPUT.PUT_LINE ('Account past due.'); END; / BEGIN account_status (TO_DATE('01-JUL-2010', 'DD-MON-YYYY'), TO_DATE('09-JUL-2010', 'DD-MON-YYYY')); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/raising-exceptions-explicitly-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/raising-exceptions-explicitly.html DROP TABLE t; CREATE TABLE t (c NUMBER); CREATE PROCEDURE p (n NUMBER) AUTHID DEFINER IS default_number NUMBER := 0; BEGIN IF n < 0 THEN RAISE INVALID_NUMBER; -- raise explicitly ELSE INSERT INTO t VALUES(TO_NUMBER('100.00', '9G999')); -- raise implicitly END IF; EXCEPTION WHEN INVALID_NUMBER THEN DBMS_OUTPUT.PUT_LINE('Substituting default value for invalid number.'); INSERT INTO t VALUES(default_number); END; / BEGIN p(-1); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/raising-exceptions-explicitly-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/raising-exceptions-explicitly.html BEGIN p(1); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/raising-exceptions-explicitly-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/raising-exceptions-explicitly.html DECLARE salary_too_high EXCEPTION; current_salary NUMBER := 20000; max_salary NUMBER := 10000; erroneous_salary NUMBER; BEGIN BEGIN IF current_salary > max_salary THEN RAISE salary_too_high; -- raise exception END IF; EXCEPTION WHEN salary_too_high THEN -- start handling exception erroneous_salary := current_salary; DBMS_OUTPUT.PUT_LINE('Salary ' || erroneous_salary ||' is out of range.'); DBMS_OUTPUT.PUT_LINE ('Maximum salary is ' || max_salary || '.'); RAISE; -- reraise current exception (exception name is optional) END; EXCEPTION WHEN salary_too_high THEN -- finish handling exception current_salary := max_salary; DBMS_OUTPUT.PUT_LINE ( 'Revising salary from ' || erroneous_salary || ' to ' || current_salary || '.' ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/raising-exceptions-explicitly-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/raising-exceptions-explicitly.html CREATE OR REPLACE PROCEDURE account_status ( due_date DATE, today DATE ) AUTHID DEFINER IS BEGIN IF due_date < today THEN -- explicitly raise exception RAISE_APPLICATION_ERROR(-20000, 'Account past due.'); END IF; END; / DECLARE past_due EXCEPTION; -- declare exception PRAGMA EXCEPTION_INIT (past_due, -20000); -- assign error code to exception BEGIN account_status (TO_DATE('01-JUL-2010', 'DD-MON-YYYY'), TO_DATE('09-JUL-2010', 'DD-MON-YYYY')); -- invoke procedure EXCEPTION WHEN past_due THEN -- handle exception DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQLERRM(-20000))); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE TYPE My_Rec IS RECORD (a NUMBER, b NUMBER); r CONSTANT My_Rec := My_Rec(0,1); BEGIN DBMS_OUTPUT.PUT_LINE('r.a = ' || r.a); DBMS_OUTPUT.PUT_LINE('r.b = ' || r.b); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html CREATE OR REPLACE PACKAGE My_Types AUTHID CURRENT_USER IS TYPE My_Rec IS RECORD (a NUMBER, b NUMBER); FUNCTION Init_My_Rec RETURN My_Rec; END My_Types; / CREATE OR REPLACE PACKAGE BODY My_Types IS FUNCTION Init_My_Rec RETURN My_Rec IS Rec My_Rec; BEGIN Rec.a := 0; Rec.b := 1; RETURN Rec; END Init_My_Rec; END My_Types; / DECLARE r CONSTANT My_Types.My_Rec := My_Types.Init_My_Rec(); BEGIN DBMS_OUTPUT.PUT_LINE('r.a = ' || r.a); DBMS_OUTPUT.PUT_LINE('r.b = ' || r.b); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html CREATE OR REPLACE PACKAGE pkg AS TYPE rec_type IS RECORD ( -- package RECORD type f1 INTEGER, f2 VARCHAR2(4) ); PROCEDURE print_rec_type (rec rec_type); END pkg; / CREATE OR REPLACE PACKAGE BODY pkg AS PROCEDURE print_rec_type (rec rec_type) IS BEGIN DBMS_OUTPUT.PUT_LINE(rec.f1); DBMS_OUTPUT.PUT_LINE(rec.f2); END; END pkg; / DECLARE TYPE rec_type IS RECORD ( -- local RECORD type f1 INTEGER, f2 VARCHAR2(4) ); r1 pkg.rec_type; -- package type r2 rec_type; -- local type BEGIN r1.f1 := 10; r1.f2 := 'abcd'; r2.f1 := 25; r2.f2 := 'wxyz'; pkg.print_rec_type(r1); -- succeeds pkg.print_rec_type(r2); -- fails END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE dept_rec departments%ROWTYPE; BEGIN -- Assign values to fields: dept_rec.department_id := 10; dept_rec.department_name := 'Administration'; dept_rec.manager_id := 200; dept_rec.location_id := 1700; -- Print fields: DBMS_OUTPUT.PUT_LINE('dept_id: ' || dept_rec.department_id); DBMS_OUTPUT.PUT_LINE('dept_name: ' || dept_rec.department_name); DBMS_OUTPUT.PUT_LINE('mgr_id: ' || dept_rec.manager_id); DBMS_OUTPUT.PUT_LINE('loc_id: ' || dept_rec.location_id); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html CREATE OR REPLACE PROCEDURE print (n INTEGER) IS BEGIN IF n IS NOT NULL THEN DBMS_OUTPUT.PUT_LINE(n); ELSE DBMS_OUTPUT.PUT_LINE('NULL'); END IF; END print; / DROP TABLE t1; CREATE TABLE t1 ( c1 INTEGER DEFAULT 0 NOT NULL, c2 INTEGER DEFAULT 1 NOT NULL ); DECLARE t1_row t1%ROWTYPE; BEGIN DBMS_OUTPUT.PUT('t1.c1 = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(t1_row.c1), 'NULL')); DBMS_OUTPUT.PUT('t1.c2 = '); print(t1_row.c2); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(t1_row.c2), 'NULL')); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE CURSOR c IS SELECT first_name, last_name, phone_number FROM employees; friend c%ROWTYPE; BEGIN friend.first_name := 'John'; friend.last_name := 'Smith'; friend.phone_number := '1-650-555-1234'; DBMS_OUTPUT.PUT_LINE ( friend.first_name || ' ' || friend.last_name || ', ' || friend.phone_number ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE CURSOR c2 IS SELECT employee_id, email, employees.manager_id, location_id FROM employees, departments WHERE employees.department_id = departments.department_id; join_rec c2%ROWTYPE; -- includes columns from two tables BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DROP TABLE plch_departure; CREATE TABLE plch_departure ( destination VARCHAR2(100), departure_time DATE, delay NUMBER(10), expected GENERATED ALWAYS AS (departure_time + delay/24/60/60) ); DECLARE dep_rec plch_departure%ROWTYPE; BEGIN dep_rec.destination := 'X'; dep_rec.departure_time := SYSDATE; dep_rec.delay := 1500; INSERT INTO plch_departure VALUES dep_rec; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE dep_rec plch_departure%rowtype; BEGIN dep_rec.destination := 'X'; dep_rec.departure_time := SYSDATE; dep_rec.delay := 1500; INSERT INTO plch_departure (destination, departure_time, delay) VALUES (dep_rec.destination, dep_rec.departure_time, dep_rec.delay); end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html CREATE TABLE t (a INT, b INT, c INT INVISIBLE); INSERT INTO t (a, b, c) VALUES (1, 2, 3); COMMIT; DECLARE t_rec t%ROWTYPE; -- t_rec has fields a and b, but not c BEGIN SELECT * INTO t_rec FROM t WHERE ROWNUM < 2; -- t_rec(a)=1, t_rec(b)=2 DBMS_OUTPUT.PUT_LINE('c = ' || t_rec.c); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html ALTER TABLE t MODIFY (c VISIBLE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE TYPE t_size IS RECORD (x NUMBER, y NUMBER); c_small CONSTANT t_size := t_size(32,36); c_large CONSTANT t_size := t_size(x => 192, y => 292); BEGIN DBMS_OUTPUT.PUT_LINE('Small size is ' || c_small.x || ' by ' || c_small.y); DBMS_OUTPUT.PUT_LINE('Large size is ' || c_large.x || ' by ' || c_large.y); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE t_rec t%ROWTYPE; -- t_rec has fields a, b, and c BEGIN SELECT * INTO t_rec FROM t WHERE ROWNUM < 2; -- t_rec(a)=1, t_rec(b)=2, -- t_rec(c)=3 DBMS_OUTPUT.PUT_LINE('c = ' || t_rec.c); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE TYPE DeptRecTyp IS RECORD ( dept_id NUMBER(4) NOT NULL := 10, dept_name VARCHAR2(30) NOT NULL := 'Administration', mgr_id NUMBER(6) := 200, loc_id NUMBER(4) := 1700 ); dept_rec DeptRecTyp; BEGIN DBMS_OUTPUT.PUT_LINE('dept_id: ' || dept_rec.dept_id); DBMS_OUTPUT.PUT_LINE('dept_name: ' || dept_rec.dept_name); DBMS_OUTPUT.PUT_LINE('mgr_id: ' || dept_rec.mgr_id); DBMS_OUTPUT.PUT_LINE('loc_id: ' || dept_rec.loc_id); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE TYPE name_rec IS RECORD ( first employees.first_name%TYPE, last employees.last_name%TYPE ); TYPE contact IS RECORD ( name name_rec, -- nested record phone employees.phone_number%TYPE ); friend contact; BEGIN friend.name.first := 'John'; friend.name.last := 'Smith'; friend.phone := '1-650-555-1234'; DBMS_OUTPUT.PUT_LINE ( friend.name.first || ' ' || friend.name.last || ', ' || friend.phone ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/record-variables-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/record-variables.html DECLARE TYPE full_name IS VARRAY(2) OF VARCHAR2(20); TYPE contact IS RECORD ( name full_name := full_name('John', 'Smith'), -- varray field phone employees.phone_number%TYPE ); friend contact; BEGIN friend.phone := '1-650-555-1234'; DBMS_OUTPUT.PUT_LINE ( friend.name(1) || ' ' || friend.name(2) || ', ' || friend.phone ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/recursive-subprograms-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/recursive-subprograms.html CREATE OR REPLACE FUNCTION factorial ( n POSITIVE ) RETURN POSITIVE AUTHID DEFINER IS BEGIN IF n = 1 THEN -- terminating condition RETURN n; ELSE RETURN n * factorial(n-1); -- recursive invocation END IF; END; / BEGIN FOR i IN 1..5 LOOP DBMS_OUTPUT.PUT_LINE(i || '! = ' || factorial(i)); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/recursive-subprograms-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/recursive-subprograms.html CREATE OR REPLACE FUNCTION fibonacci ( n PLS_INTEGER ) RETURN PLS_INTEGER AUTHID DEFINER IS fib_1 PLS_INTEGER := 0; fib_2 PLS_INTEGER := 1; BEGIN IF n = 1 THEN -- terminating condition RETURN fib_1; ELSIF n = 2 THEN RETURN fib_2; -- terminating condition ELSE RETURN fibonacci(n-2) + fibonacci(n-1); -- recursive invocations END IF; END; / BEGIN FOR i IN 1..10 LOOP DBMS_OUTPUT.PUT(fibonacci(i)); IF i < 10 THEN DBMS_OUTPUT.PUT(', '); END IF; END LOOP; DBMS_OUTPUT.PUT_LINE(' ...'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/redeclared-predefined-exceptions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/redeclared-predefined-exceptions.html DROP TABLE t; CREATE TABLE t (c NUMBER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/redeclared-predefined-exceptions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/redeclared-predefined-exceptions.html DECLARE default_number NUMBER := 0; BEGIN INSERT INTO t VALUES(TO_NUMBER('100.00', '9G999')); EXCEPTION WHEN INVALID_NUMBER THEN DBMS_OUTPUT.PUT_LINE('Substituting default value for invalid number.'); INSERT INTO t VALUES(default_number); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/redeclared-predefined-exceptions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/redeclared-predefined-exceptions.html DECLARE default_number NUMBER := 0; i NUMBER := 5; invalid_number EXCEPTION; -- redeclare predefined exception BEGIN INSERT INTO t VALUES(TO_NUMBER('100.00', '9G999')); EXCEPTION WHEN INVALID_NUMBER THEN DBMS_OUTPUT.PUT_LINE('Substituting default value for invalid number.'); INSERT INTO t VALUES(default_number); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/redeclared-predefined-exceptions-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/redeclared-predefined-exceptions.html DECLARE default_number NUMBER := 0; i NUMBER := 5; invalid_number EXCEPTION; -- redeclare predefined exception BEGIN INSERT INTO t VALUES(TO_NUMBER('100.00', '9G999')); EXCEPTION WHEN STANDARD.INVALID_NUMBER THEN DBMS_OUTPUT.PUT_LINE('Substituting default value for invalid number.'); INSERT INTO t VALUES(default_number); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/references-identifiers-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/references-identifiers.html DECLARE a INTEGER; -- Declaration BEGIN a := 1; -- Reference with simple name END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/release-changes-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/release-changes.html CREATE OR REPLACE FUNCTION useBool(p1 BOOLEAN) RETURN NUMBER AS BEGIN IF p1 THEN RETURN 100; ELSE RETURN 200; END IF; END; / SET SERVEROUTPUT ON; DECLARE v1 NUMBER; v2 BOOLEAN := TRUE; BEGIN SELECT useBool(v2) INTO v1 FROM dual; --boolean argument function called from SELECT DBMS_OUTPUT.PUT_LINE(v1); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/release-changes-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/release-changes.html CREATE PROCEDURE IF NOT EXISTS hello AS BEGIN DBMS_OUTPUT.PUT_LINE('Hello there'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/release-changes-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/release-changes.html CREATE PROCEDURE IF NOT EXISTS hello AS BEGIN DBMS_OUTPUT.PUT_LINE('Second hello'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/release-changes-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/release-changes.html SELECT TEXT FROM USER_SOURCE WHERE NAME='HELLO'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/retrieving-error-code-and-error-message-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/retrieving-error-code-and-error-message.html DROP TABLE errors; CREATE TABLE errors ( code NUMBER, message VARCHAR2(64) ); CREATE OR REPLACE PROCEDURE p AUTHID DEFINER AS name EMPLOYEES.LAST_NAME%TYPE; v_code NUMBER; v_errm VARCHAR2(64); BEGIN SELECT last_name INTO name FROM EMPLOYEES WHERE EMPLOYEE_ID = -1; EXCEPTION WHEN OTHERS THEN v_code := SQLCODE; v_errm := SUBSTR(SQLERRM, 1, 64); DBMS_OUTPUT.PUT_LINE ('Error code ' || v_code || ': ' || v_errm); /* Invoke another procedure, declared with PRAGMA AUTONOMOUS_TRANSACTION, to insert information about errors. */ INSERT INTO errors (code, message) VALUES (v_code, v_errm); RAISE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/retrying-transactions-handling-exceptions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/retrying-transactions-handling-exceptions.html DROP TABLE results; CREATE TABLE results ( res_name VARCHAR(20), res_answer VARCHAR2(3) ); CREATE UNIQUE INDEX res_name_ix ON results (res_name); INSERT INTO results (res_name, res_answer) VALUES ('SMYTHE', 'YES'); INSERT INTO results (res_name, res_answer) VALUES ('JONES', 'NO'); DECLARE name VARCHAR2(20) := 'SMYTHE'; answer VARCHAR2(3) := 'NO'; suffix NUMBER := 1; BEGIN FOR i IN 1..5 LOOP -- Try transaction at most 5 times. DBMS_OUTPUT.PUT('Try #' || i); BEGIN -- sub-block begins SAVEPOINT start_transaction; -- transaction begins DELETE FROM results WHERE res_answer = 'NO'; INSERT INTO results (res_name, res_answer) VALUES (name, answer); -- Nonunique name raises DUP_VAL_ON_INDEX. -- If transaction succeeded: COMMIT; DBMS_OUTPUT.PUT_LINE(' succeeded.'); EXIT; EXCEPTION WHEN DUP_VAL_ON_INDEX THEN DBMS_OUTPUT.PUT_LINE(' failed; trying again.'); ROLLBACK TO start_transaction; -- Undo changes. suffix := suffix + 1; -- Try to fix problem. name := name || TO_CHAR(suffix); END; -- sub-block ends END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/scope-and-visibility-identifiers-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/scope-and-visibility-identifiers.html DECLARE a CHAR; -- Scope of a (CHAR) begins b REAL; -- Scope of b begins BEGIN -- Visible: a (CHAR), b -- First sub-block: DECLARE a INTEGER; -- Scope of a (INTEGER) begins c REAL; -- Scope of c begins BEGIN -- Visible: a (INTEGER), b, c NULL; END; -- Scopes of a (INTEGER) and c end -- Second sub-block: DECLARE d REAL; -- Scope of d begins BEGIN -- Visible: a (CHAR), b, d NULL; END; -- Scope of d ends -- Visible: a (CHAR), b END; -- Scopes of a (CHAR) and b end / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/scope-and-visibility-identifiers-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/scope-and-visibility-identifiers.html <> -- label DECLARE birthdate DATE := TO_DATE('09-AUG-70', 'DD-MON-YY'); BEGIN DECLARE birthdate DATE := TO_DATE('29-SEP-70', 'DD-MON-YY'); BEGIN IF birthdate = outer.birthdate THEN DBMS_OUTPUT.PUT_LINE ('Same Birthday'); ELSE DBMS_OUTPUT.PUT_LINE ('Different Birthday'); END IF; END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/scope-and-visibility-identifiers-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/scope-and-visibility-identifiers.html <> <> DECLARE numerator NUMBER := 22; denominator NUMBER := 7; BEGIN <> DECLARE denominator NUMBER := 0; BEGIN DBMS_OUTPUT.PUT_LINE('Ratio with compute_ratio.denominator = '); DBMS_OUTPUT.PUT_LINE(numerator/compute_ratio.denominator); DBMS_OUTPUT.PUT_LINE('Ratio with another_label.denominator = '); DBMS_OUTPUT.PUT_LINE(numerator/another_label.denominator); EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('Divide-by-zero error: can''t divide ' || numerator || ' by ' || denominator); WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('Unexpected error.'); END another_label; END compute_ratio; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/scope-and-visibility-identifiers-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/scope-and-visibility-identifiers.html CREATE OR REPLACE PROCEDURE check_credit (credit_limit NUMBER) AS rating NUMBER := 3; FUNCTION check_rating RETURN BOOLEAN IS rating NUMBER := 1; over_limit BOOLEAN; BEGIN IF check_credit.rating <= credit_limit THEN -- reference global variable over_limit := FALSE; ELSE over_limit := TRUE; rating := credit_limit; -- reference local variable END IF; RETURN over_limit; END check_rating; BEGIN IF check_rating THEN DBMS_OUTPUT.PUT_LINE ('Credit rating over limit (' || TO_CHAR(credit_limit) || '). ' || 'Rating: ' || TO_CHAR(rating)); ELSE DBMS_OUTPUT.PUT_LINE ('Credit rating OK. ' || 'Rating: ' || TO_CHAR(rating)); END IF; END; / BEGIN check_credit(1); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/scope-and-visibility-identifiers-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/scope-and-visibility-identifiers.html DECLARE id BOOLEAN; id VARCHAR2(5); -- duplicate identifier BEGIN id := FALSE; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/scope-and-visibility-identifiers-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/scope-and-visibility-identifiers.html DECLARE PROCEDURE p IS x VARCHAR2(1); BEGIN x := 'a'; -- Assign the value 'a' to x DBMS_OUTPUT.PUT_LINE('In procedure p, x = ' || x); END; PROCEDURE q IS x VARCHAR2(1); BEGIN x := 'b'; -- Assign the value 'b' to x DBMS_OUTPUT.PUT_LINE('In procedure q, x = ' || x); END; BEGIN p; q; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/scope-and-visibility-identifiers-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/scope-and-visibility-identifiers.html <> DECLARE x NUMBER := 5; PROCEDURE echo AS x NUMBER := 0; BEGIN DBMS_OUTPUT.PUT_LINE('x = ' || x); DBMS_OUTPUT.PUT_LINE('echo.x = ' || echo.x); END; BEGIN echo; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sequential-control-statements-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sequential-control-statements.html DECLARE v_job_id VARCHAR2(10); v_emp_id NUMBER(6) := 110; BEGIN SELECT job_id INTO v_job_id FROM employees WHERE employee_id = v_emp_id; IF v_job_id = 'SA_REP' THEN UPDATE employees SET commission_pct = commission_pct * 1.2; ELSE NULL; -- Employee is not a sales rep END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sequential-control-statements-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sequential-control-statements.html CREATE OR REPLACE PROCEDURE award_bonus ( emp_id NUMBER, bonus NUMBER ) AUTHID DEFINER AS BEGIN -- Executable part starts here NULL; -- Placeholder -- (raises "unreachable code" if warnings enabled) END award_bonus; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sequential-control-statements-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sequential-control-statements.html CREATE OR REPLACE PROCEDURE print_grade ( grade CHAR ) AUTHID DEFINER AS BEGIN CASE grade WHEN 'A' THEN DBMS_OUTPUT.PUT_LINE('Excellent'); WHEN 'B' THEN DBMS_OUTPUT.PUT_LINE('Very Good'); WHEN 'C' THEN DBMS_OUTPUT.PUT_LINE('Good'); WHEN 'D' THEN DBMS_OUTPUT.PUT_LINE('Fair'); WHEN 'F' THEN DBMS_OUTPUT.PUT_LINE('Poor'); ELSE NULL; END CASE; END; / BEGIN print_grade('A'); print_grade('S'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/serially_reusable-packages-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/serially_reusable-packages.html CREATE OR REPLACE PACKAGE bodiless_pkg AUTHID DEFINER IS PRAGMA SERIALLY_REUSABLE; n NUMBER := 5; END; / CREATE OR REPLACE PACKAGE pkg AUTHID DEFINER IS PRAGMA SERIALLY_REUSABLE; n NUMBER := 5; END; / CREATE OR REPLACE PACKAGE BODY pkg IS PRAGMA SERIALLY_REUSABLE; BEGIN n := 5; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/serially_reusable-packages-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/serially_reusable-packages.html CREATE OR REPLACE PACKAGE pkg IS n NUMBER := 5; END pkg; / CREATE OR REPLACE PACKAGE sr_pkg IS PRAGMA SERIALLY_REUSABLE; n NUMBER := 5; END sr_pkg; / BEGIN pkg.n := 10; sr_pkg.n := 10; END; / BEGIN DBMS_OUTPUT.PUT_LINE('pkg.n: ' || pkg.n); DBMS_OUTPUT.PUT_LINE('sr_pkg.n: ' || sr_pkg.n); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/serially_reusable-packages-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/serially_reusable-packages.html DROP TABLE people; CREATE TABLE people (name VARCHAR2(20)); INSERT INTO people (name) VALUES ('John Smith'); INSERT INTO people (name) VALUES ('Mary Jones'); INSERT INTO people (name) VALUES ('Joe Brown'); INSERT INTO people (name) VALUES ('Jane White'); CREATE OR REPLACE PACKAGE sr_pkg IS PRAGMA SERIALLY_REUSABLE; CURSOR c IS SELECT name FROM people; END sr_pkg; / CREATE OR REPLACE PROCEDURE fetch_from_cursor IS v_name people.name%TYPE; BEGIN IF sr_pkg.c%ISOPEN THEN DBMS_OUTPUT.PUT_LINE('Cursor is open.'); ELSE DBMS_OUTPUT.PUT_LINE('Cursor is closed; opening now.'); OPEN sr_pkg.c; END IF; FETCH sr_pkg.c INTO v_name; DBMS_OUTPUT.PUT_LINE('Fetched: ' || v_name); FETCH sr_pkg.c INTO v_name; DBMS_OUTPUT.PUT_LINE('Fetched: ' || v_name); END fetch_from_cursor; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/serially_reusable-packages-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/serially_reusable-packages.html BEGIN fetch_from_cursor; fetch_from_cursor; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/serially_reusable-packages-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/serially_reusable-packages.html BEGIN fetch_from_cursor; fetch_from_cursor; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE t_b boolean := TRUE; f_b boolean := FALSE; BEGIN DBMS_OUTPUT.PUT_LINE('My bool is: ' || t_b); DBMS_OUTPUT.PUT_LINE('My bool is: ' || f_b); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theNSTTAB IS TABLE OF NUMBER; myNSTTAB theNSTTAB; BEGIN myNSTTAB := JSON_VALUE(JSON('{"1":10, "2":20, "3":30, "4":40}'), '$' RETURNING theNSTTAB); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theIBPLS IS TABLE OF NUMBER INDEX BY PLS_INTEGER; myIBPLS theIBPLS := theIBPLS(-1=>1, 2=>2, -3=>3); myJSON JSON; BEGIN myJSON := JSON(myIBPLS); DBMS_OUTPUT.PUT_LINE(JSON_SERIALIZE(myJSON)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theNSTTAB IS TABLE OF NUMBER; myNSTTAB theNSTTAB := theNSTTAB(1=>1, 2=>2, 3=>3); myJSON JSON; BEGIN myNSTTAB.delete(2); --myNSTTAB becomes sparse when elements are deleted myJSON := JSON(myNSTTAB); DBMS_OUTPUT.PUT_LINE(JSON_SERIALIZE(myJSON)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theIBPLS IS TABLE OF NUMBER INDEX BY PLS_INTEGER; myIBPLS theIBPLS; BEGIN myIBPLS := JSON_VALUE(JSON('[1, 2, 3, 4, 5]'), '$' RETURNING theIBPLS); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theVARRAY IS VARRAY(5) OF NUMBER; myVARRAY theVARRAY; BEGIN myVARRAY := JSON_VALUE(JSON('[1, 2, 3, 4, 5]'), '$' RETURNING theVARRAY); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theNESTEDTABLE IS TABLE OF NUMBER; myNESTEDTABLE theNESTEDTABLE; BEGIN myNESTEDTABLE := JSON_VALUE(JSON('[1, 2, 3, 4, 5]'), '$' RETURNING theNESTEDTABLE); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theVarray IS VARRAY(4) OF NUMBER; myVarray theVarray := theVarray(1, 2, 3, null); myJSON JSON; BEGIN myJSON := JSON(myVarray); DBMS_OUTPUT.PUT_LINE(JSON_SERIALIZE(myJSON)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theASCARRAY IS TABLE OF NUMBER INDEX BY VARCHAR2(10); myAscArray theASCARRAY; BEGIN myAscArray := JSON_VALUE(JSON('{"Key1":10, "Key2":20}'), '$' RETURNING theASCARRAY); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE AsscArray IS TABLE OF VARCHAR2(10) INDEX BY VARCHAR2(10); myAsscArray AsscArray := AsscArray('FIRST_NAME' => 'Bob', 'LAST_NAME' => 'Jones'); myJson JSON; BEGIN myJson := JSON(myAsscArray); DBMS_OUTPUT.PUT_LINE(JSON_SERIALIZE(myJson)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html CREATE TABLE PLS_VEC_TAB( v1 vector, v2 vector(100), v3 vector(*, INT8), v4 vector(100, INT8), v5 vector(1024, BINARY), v6 vector(100, FLOAT32, DENSE), v7 vector(100, FLOAT32, SPARSE) ); DECLARE vec0 vector; -- dimension and format are flexible, storage format is DENSE vec1 PLS_VEC_TAB.v1%TYPE; -- dimension and format are flexible, storage format is DENSE vec2 PLS_VEC_TAB.v2%TYPE; -- dimension is 100, format is flexible, storage format is DENSE vec3 PLS_VEC_TAB.v3%TYPE; -- dimension is flexible, format is INT8, storage format is DENSE vec4 PLS_VEC_TAB.v4%TYPE; -- dimension is 100, format is INT8, storage format is DENSE vec5 PLS_VEC_TAB.v5%TYPE; -- dimension is 1024, format is BINARY, storage format is DENSE vec6 PLS_VEC_TAB.v6%TYPE; -- dimension is 100, format is FLOAT32, storage format is DENSE vec7 PLS_VEC_TAB.v7%TYPE; -- dimension is 100, format is FLOAT32, storage format is SPARSE vec_0 vec0%TYPE; -- dimension and format are flexible, storage format is DENSE vec_1 vec1%TYPE; -- dimension and format are flexible, storage format is DENSE vec_2 vec2%TYPE; -- dimension is 100, format is flexible, storage format is DENSE vec_3 vec3%TYPE; -- dimension is flexible, format is INT8, storage format is DENSE vec_4 vec4%TYPE; -- dimension is 100, format is INT8, storage format is DENSE vec_5 vec5%TYPE; -- dimension is 1024, format is BINARY, storage format is DENSE vec_6 vec6%TYPE; -- dimension is 100, format is FLOAT32, storage format is DENSE vec_7 vec7%TYPE; -- dimension is 100, format is FLOAT32, storage format is SPARSE BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE personrecord IS RECORD(first VARCHAR2(10), last VARCHAR2(10)); p personrecord; BEGIN p := JSON_VALUE(JSON('{"FIRST":"Jane", "LAST":"Cooper"}'), '$' RETURNING personrecord USING CASE_SENSITIVE MAPPING); DBMS_OUTPUT.PUT_LINE(p.first ||' '|| p.last); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html SELECT VECTOR_DISTANCE(v1, v2, COSINE) INTO dist; SELECT v1 <=> v2 INTO dist; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DROP TABLE theVectorTable; CREATE TABLE theVectorTable (embedding VECTOR(3, float32), id NUMBER); INSERT INTO theVectorTable VALUES ('[1.11, 2.22, 3.33]', 1); INSERT INTO theVectorTable VALUES ('[4.44, 5.55, 6.66]', 2); INSERT INTO theVectorTable VALUES ('[7.77, 8.88, 9.99]', 3); SET SERVEROUTPUT ON; DECLARE v_embedding theVectorTable.embedding%TYPE; BEGIN SELECT embedding INTO v_embedding FROM theVectorTable WHERE id=3; DBMS_OUTPUT.PUT_LINE('Embedding is ' || FROM_VECTOR(v_embedding)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE vecTabT IS TABLE OF theVectorTable%ROWTYPE INDEX BY BINARY_INTEGER; v_vecTabT vecTabT; CURSOR c IS SELECT * FROM theVectorTable; BEGIN OPEN c; FETCH c BULK COLLECT INTO v_vecTabT; CLOSE c; -- display the contents of the vector index table FOR i IN 1..v_vecTabT.LAST LOOP DBMS_OUTPUT.PUT_LINE('Embedding ID ' || v_vecTabT(i).id || ': ' || FROM_VECTOR(v_vecTabT(i).embedding)); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DROP TABLE vecLogTable; DROP SEQUENCE vecTrgSeq; CREATE TABLE vecLogTable (embedding VECTOR(3, float32), describe VARCHAR2(25), seq NUMBER); CREATE SEQUENCE vecTrgSeq; CREATE OR REPLACE TRIGGER vecTrg BEFORE UPDATE ON theVectorTable FOR EACH ROW BEGIN INSERT INTO vecLogTable VALUES (:old.embedding, 'OLD.VECTRG', vecTrgSeq.NEXTVAL); INSERT INTO vecLogTable VALUES (:new.embedding, 'NEW.VECTRG', vecTrgSeq.NEXTVAL); END; / UPDATE theVectorTable SET embedding='[2.22, 4.44, 6.66]' WHERE id=2; SELECT * FROM vecLogTable ORDER BY seq; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE v1 VECTOR := TO_VECTOR('[1, 2, 3]'); v2 VECTOR := TO_VECTOR('[4, 5, 6]'); v3 VECTOR := TO_VECTOR('[1, 2, 0, 6]', *, BINARY); v4 VECTOR := TO_VECTOR('[0, 6, 0, 3]', *, BINARY); man_dist NUMBER; euc_dist NUMBER; cos_dist NUMBER; inn_dist NUMBER; ham_dist NUMBER; dot_dist NUMBER; jac_dist NUMBER; BEGIN man_dist := L1_DISTANCE(v1, v2); --Manhattan Distance euc_dist := L2_DISTANCE(v1, v2); --Euclidean Distance cos_dist := COSINE_DISTANCE(v1, v2); --Cosine Distance inn_dist := INNER_PRODUCT(v1, v2); --Inner Product --The Hamming Distance has no standalone function in PL/SQL ham_dist := VECTOR_DISTANCE(v1, v2, HAMMING); --The Negative Inner (Dot) Product has no standalone function in PL/SQL dot_dist := VECTOR_DISTANCE(v1, v2, DOT); --The Jaccard Distance has no standalone function in PL/SQL jac_dist := VECTOR_DISTANCE(v3, v4, JACCARD); DBMS_OUTPUT.PUT_LINE('The Manhattan distance is: ' || man_dist); DBMS_OUTPUT.PUT_LINE('The Euclidean distance is: ' || euc_dist); DBMS_OUTPUT.PUT_LINE('The Cosine distance is: ' || cos_dist); DBMS_OUTPUT.PUT_LINE('The Inner Product is: ' || inn_dist); DBMS_OUTPUT.PUT_LINE('The Hamming distance is: ' || ham_dist); DBMS_OUTPUT.PUT_LINE('The Dot Product is: ' || dot_dist); DBMS_OUTPUT.PUT_LINE('The Jaccard Distance between the BINARY vectors v3 and v4 is: ' || jac_dist); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theRec1 IS RECORD (field1 NUMBER, field2 VARCHAR2(10)); TYPE theRec2 IS RECORD ("fIeLd2" VARCHAR2(20), "FielD1" NUMBER); Rec1 theRec1; Rec2 theRec2; BEGIN Rec1 := JSON_VALUE(JSON('{"FIELD1":10, "field2":"hello"}'), '$' RETURNING theRec1); Rec2 := JSON_VALUE(JSON('{"FIELD1":10, "field2":"hello"}'), '$' RETURNING theRec2); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE v1 VECTOR := VECTOR('[10, 20, 30]', 3, INT8); v2 VECTOR := VECTOR('[6, 4, 2]', 3, INT8); BEGIN DBMS_OUTPUT.PUT_LINE(TO_CHAR(v1 + v2)); DBMS_OUTPUT.PUT_LINE(TO_CHAR(v1 - v2)); DBMS_OUTPUT.PUT_LINE(TO_CHAR(v1 * v2)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-44.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE vs1 VECTOR(*, *, SPARSE) := VECTOR('[10, [0, 3, 4, 6, 7], [1.9, 4, 7.2, 30, 60]]', *, *, SPARSE); vs2 VECTOR(*, *, SPARSE) := VECTOR('[10, [1, 3, 4, 8, 9], [4.5, 7.6, 4, 8.1, 5]]', *, *, SPARSE); vd1 VECTOR(*, *, DENSE) := VECTOR('[1.9, 0, 0, 4, 7.2, 0, 30, 60, 0, 0]', *, *, DENSE); vd2 VECTOR(*, *, DENSE) := VECTOR('[0, 4.5, 0, 7.6, 4, 0, 0, 0, 8.1, 5]', *, *, DENSE); BEGIN DBMS_OUTPUT.PUT_LINE('Vector Distance Sparse: ' || TRUNC(VECTOR_DISTANCE(vs1, vs2), 5)); DBMS_OUTPUT.PUT_LINE('Vector Distance Dense: ' || TRUNC(VECTOR_DISTANCE(vd1, vd2), 5)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-46.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE c VARCHAR2(3 CHAR); BEGIN c := 'abc '; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-48.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DROP TABLE t; CREATE TABLE t (c CHAR(3 CHAR)); DECLARE s VARCHAR2(5 CHAR) := 'abc '; BEGIN INSERT INTO t(c) VALUES(s); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE c VARCHAR2(3 CHAR); BEGIN c := RTRIM('abc '); INSERT INTO t(c) VALUES(RTRIM('abc ')); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE first_name CHAR(10 CHAR); last_name VARCHAR2(10 CHAR); BEGIN first_name := 'John '; last_name := 'Chen '; DBMS_OUTPUT.PUT_LINE('*' || first_name || '*'); DBMS_OUTPUT.PUT_LINE('*' || last_name || '*'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theRec IS RECORD(field1 NUMBER, "Field2" NUMBER); myRec theRec := theRec(10, 20); myJson JSON; BEGIN myJson := JSON(myRec); DBMS_OUTPUT.PUT_LINE(JSON_SERIALIZE(myJson)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-data-types-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-data-types.html DECLARE TYPE theIBPLS IS TABLE OF NUMBER INDEX BY BINARY_INTEGER; myIBPLS theIBPLS; BEGIN myIBPLS := JSON_VALUE(JSON('{"-10":10, "-1":1, "100":-100}'), '$' RETURNING theIBPLS); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html DROP TABLE secret_records; CREATE TABLE secret_records ( user_name VARCHAR2(9), service_type VARCHAR2(12), value VARCHAR2(30), date_created DATE ); INSERT INTO secret_records ( user_name, service_type, value, date_created ) VALUES ('Andy', 'Waiter', 'Serve dinner at Cafe Pete', SYSDATE); INSERT INTO secret_records ( user_name, service_type, value, date_created ) VALUES ('Chuck', 'Merger', 'Buy company XYZ', SYSDATE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html CREATE OR REPLACE PROCEDURE get_record ( user_name IN VARCHAR2, service_type IN VARCHAR2, rec OUT VARCHAR2 ) AUTHID DEFINER IS query VARCHAR2(4000); BEGIN -- Following SELECT statement is vulnerable to modification -- because it uses concatenation to build WHERE clause. query := 'SELECT value FROM secret_records WHERE user_name=''' || user_name || ''' AND service_type=''' || service_type || ''''; DBMS_OUTPUT.PUT_LINE('Query: ' || query); EXECUTE IMMEDIATE query INTO rec ; DBMS_OUTPUT.PUT_LINE('Rec: ' || rec ); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html SELECT * FROM secret_records ORDER BY user_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html BEGIN p('Anybody', 'Anything''); DELETE FROM secret_records WHERE service_type=INITCAP(''Merger'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html DELETE FROM secret_records WHERE service_type=INITCAP('Merger'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html SELECT * FROM secret_records; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html SELECT * FROM secret_records; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html CREATE OR REPLACE PROCEDURE get_recent_record ( user_name IN VARCHAR2, service_type IN VARCHAR2, rec OUT VARCHAR2 ) AUTHID DEFINER IS query VARCHAR2(4000); BEGIN /* Following SELECT statement is vulnerable to modification because it uses concatenation to build WHERE clause and because SYSDATE depends on the value of NLS_DATE_FORMAT. */ query := 'SELECT value FROM secret_records WHERE user_name=''' || user_name || ''' AND service_type=''' || service_type || ''' AND date_created>''' || (SYSDATE - 30) || ''''; DBMS_OUTPUT.PUT_LINE('Query: ' || query); EXECUTE IMMEDIATE query INTO rec; DBMS_OUTPUT.PUT_LINE('Rec: ' || rec); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html SET SERVEROUTPUT ON; ALTER SESSION SET NLS_DATE_FORMAT='DD-MON-YYYY'; DECLARE record_value VARCHAR2(4000); BEGIN get_recent_record('Andy', 'Waiter', record_value); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html SET SERVEROUTPUT ON; DECLARE record_value VARCHAR2(4000); BEGIN get_record('Andy', 'Waiter', record_value); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html ALTER SESSION SET NLS_DATE_FORMAT='"'' OR service_type=''Merger"'; DECLARE record_value VARCHAR2(4000); BEGIN get_recent_record('Anybody', 'Anything', record_value); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html CREATE OR REPLACE PROCEDURE get_record_2 ( user_name IN VARCHAR2, service_type IN VARCHAR2, rec OUT VARCHAR2 ) AUTHID DEFINER IS query VARCHAR2(4000); BEGIN query := 'SELECT value FROM secret_records WHERE user_name=:a AND service_type=:b'; DBMS_OUTPUT.PUT_LINE('Query: ' || query); EXECUTE IMMEDIATE query INTO rec USING user_name, service_type; DBMS_OUTPUT.PUT_LINE('Rec: ' || rec); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html SET SERVEROUTPUT ON; DECLARE record_value VARCHAR2(4000); BEGIN get_record_2('Andy', 'Waiter', record_value); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html DECLARE record_value VARCHAR2(4000); BEGIN get_record_2('Anybody '' OR service_type=''Merger''--', 'Anything', record_value); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html CREATE OR REPLACE PROCEDURE raise_emp_salary ( column_value NUMBER, emp_column VARCHAR2, amount NUMBER ) AUTHID DEFINER IS v_column VARCHAR2(30); sql_stmt VARCHAR2(200); BEGIN -- Check validity of column name that was given as input: SELECT column_name INTO v_column FROM USER_TAB_COLS WHERE TABLE_NAME = 'EMPLOYEES' AND COLUMN_NAME = emp_column; sql_stmt := 'UPDATE employees SET salary = salary + :1 WHERE ' || DBMS_ASSERT.ENQUOTE_NAME(v_column,FALSE) || ' = :2'; EXECUTE IMMEDIATE sql_stmt USING amount, column_value; -- If column name is valid: IF SQL%ROWCOUNT > 0 THEN DBMS_OUTPUT.PUT_LINE('Salaries were updated for: ' || emp_column || ' = ' || column_value); END IF; -- If column name is not valid: EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE ('Invalid Column: ' || emp_column); END raise_emp_salary; / DECLARE plsql_block VARCHAR2(500); BEGIN -- Invoke raise_emp_salary from a dynamic PL/SQL block: plsql_block := 'BEGIN raise_emp_salary(:cvalue, :cname, :amt); END;'; EXECUTE IMMEDIATE plsql_block USING 110, 'DEPARTMENT_ID', 10; -- Invoke raise_emp_salary from a dynamic SQL statement: EXECUTE IMMEDIATE 'BEGIN raise_emp_salary(:cvalue, :cname, :amt); END;' USING 112, 'EMPLOYEE_ID', 10; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html CREATE OR REPLACE PROCEDURE get_recent_record ( user_name IN VARCHAR2, service_type IN VARCHAR2, rec OUT VARCHAR2 ) AUTHID DEFINER IS query VARCHAR2(4000); BEGIN /* Following SELECT statement is vulnerable to modification because it uses concatenation to build WHERE clause. */ query := 'SELECT value FROM secret_records WHERE user_name=''' || user_name || ''' AND service_type=''' || service_type || ''' AND date_created> DATE ''' || TO_CHAR(SYSDATE - 30,'YYYY-MM-DD') || ''''; DBMS_OUTPUT.PUT_LINE('Query: ' || query); EXECUTE IMMEDIATE query INTO rec; DBMS_OUTPUT.PUT_LINE('Rec: ' || rec); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html ALTER SESSION SET NLS_DATE_FORMAT='"'' OR service_type=''Merger"'; DECLARE record_value VARCHAR2(4000); BEGIN get_recent_record('Anybody', 'Anything', record_value); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html DECLARE record_value VARCHAR2(4000); BEGIN get_record( 'Anybody '' OR service_type=''Merger''--', 'Anything', record_value); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html CREATE OR REPLACE PROCEDURE p ( user_name IN VARCHAR2, service_type IN VARCHAR2 ) AUTHID DEFINER IS block1 VARCHAR2(4000); BEGIN -- Following block is vulnerable to statement injection -- because it is built by concatenation. block1 := 'BEGIN DBMS_OUTPUT.PUT_LINE(''user_name: ' || user_name || ''');' || 'DBMS_OUTPUT.PUT_LINE(''service_type: ' || service_type || '''); END;'; DBMS_OUTPUT.PUT_LINE('Block1: ' || block1); EXECUTE IMMEDIATE block1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html SET SERVEROUTPUT ON; BEGIN p('Andy', 'Waiter'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/sql-injection-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/sql-injection.html COLUMN date_created FORMAT A12; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-invocation-resolution-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-invocation-resolution.html DECLARE PROCEDURE swap ( n1 NUMBER, n2 NUMBER ) IS num1 NUMBER; num2 NUMBER; FUNCTION balance (bal NUMBER) RETURN NUMBER IS x NUMBER := 10; PROCEDURE swap ( d1 DATE, d2 DATE ) IS BEGIN NULL; END; PROCEDURE swap ( b1 BOOLEAN, b2 BOOLEAN ) IS BEGIN NULL; END; BEGIN -- balance swap(num1, num2); RETURN x; END balance; BEGIN -- enclosing procedure swap NULL; END swap; BEGIN -- anonymous block NULL; END; -- anonymous block / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html CREATE OR REPLACE PROCEDURE p ( n NUMBER ) AUTHID DEFINER IS BEGIN NULL; END; / DECLARE x NUMBER := 1; y VARCHAR2(1) := '1'; BEGIN p(x); -- No conversion needed p(y); -- z implicitly converted from VARCHAR2 to NUMBER p(TO_NUMBER(y)); -- z explicitly converted from VARCHAR2 to NUMBER END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html CREATE OR REPLACE PROCEDURE p (x OUT INTEGER, y OUT INTEGER) AS BEGIN x := 17; y := 93; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html CREATE OR REPLACE PROCEDURE p ( a PLS_INTEGER, -- IN by default b IN PLS_INTEGER, c OUT PLS_INTEGER, d IN OUT BINARY_FLOAT ) AUTHID DEFINER IS BEGIN -- Print values of parameters: DBMS_OUTPUT.PUT_LINE('Inside procedure p:'); DBMS_OUTPUT.PUT('IN a = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(a), 'NULL')); DBMS_OUTPUT.PUT('IN b = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(b), 'NULL')); DBMS_OUTPUT.PUT('OUT c = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(c), 'NULL')); DBMS_OUTPUT.PUT_LINE('IN OUT d = ' || TO_CHAR(d)); -- Can reference IN parameters a and b, -- but cannot assign values to them. c := a+10; -- Assign value to OUT parameter d := 10/b; -- Assign value to IN OUT parameter END; / DECLARE aa CONSTANT PLS_INTEGER := 1; bb PLS_INTEGER := 2; cc PLS_INTEGER := 3; dd BINARY_FLOAT := 4; ee PLS_INTEGER; ff BINARY_FLOAT := 5; BEGIN DBMS_OUTPUT.PUT_LINE('Before invoking procedure p:'); DBMS_OUTPUT.PUT('aa = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(aa), 'NULL')); DBMS_OUTPUT.PUT('bb = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(bb), 'NULL')); DBMS_OUTPUT.PUT('cc = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(cc), 'NULL')); DBMS_OUTPUT.PUT_LINE('dd = ' || TO_CHAR(dd)); p (aa, -- constant bb, -- initialized variable cc, -- initialized variable dd -- initialized variable ); DBMS_OUTPUT.PUT_LINE('After invoking procedure p:'); DBMS_OUTPUT.PUT('aa = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(aa), 'NULL')); DBMS_OUTPUT.PUT('bb = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(bb), 'NULL')); DBMS_OUTPUT.PUT('cc = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(cc), 'NULL')); DBMS_OUTPUT.PUT_LINE('dd = ' || TO_CHAR(dd)); DBMS_OUTPUT.PUT_LINE('Before invoking procedure p:'); DBMS_OUTPUT.PUT('ee = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(ee), 'NULL')); DBMS_OUTPUT.PUT_LINE('ff = ' || TO_CHAR(ff)); p (1, -- literal (bb+3)*4, -- expression ee, -- uninitialized variable ff -- initialized variable ); DBMS_OUTPUT.PUT_LINE('After invoking procedure p:'); DBMS_OUTPUT.PUT('ee = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(ee), 'NULL')); DBMS_OUTPUT.PUT_LINE('ff = ' || TO_CHAR(ff)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE j PLS_INTEGER := 10; k BINARY_FLOAT := 15; BEGIN DBMS_OUTPUT.PUT_LINE('Before invoking procedure p:'); DBMS_OUTPUT.PUT('j = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(j), 'NULL')); DBMS_OUTPUT.PUT_LINE('k = ' || TO_CHAR(k)); p(4, 0, j, k); -- causes p to exit with exception ZERO_DIVIDE EXCEPTION WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE('After invoking procedure p:'); DBMS_OUTPUT.PUT('j = '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(j), 'NULL')); DBMS_OUTPUT.PUT_LINE('k = ' || TO_CHAR(k)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html CREATE OR REPLACE PACKAGE r_types AUTHID DEFINER IS TYPE r_type_1 IS RECORD (f VARCHAR2(5) := 'abcde'); TYPE r_type_2 IS RECORD (f VARCHAR2(5)); END; / CREATE OR REPLACE PROCEDURE p ( x OUT r_types.r_type_1, y OUT r_types.r_type_2, z OUT VARCHAR2) AUTHID CURRENT_USER IS BEGIN DBMS_OUTPUT.PUT_LINE('x.f is ' || NVL(x.f,'NULL')); DBMS_OUTPUT.PUT_LINE('y.f is ' || NVL(y.f,'NULL')); DBMS_OUTPUT.PUT_LINE('z is ' || NVL(z,'NULL')); END; / DECLARE r1 r_types.r_type_1; r2 r_types.r_type_2; s VARCHAR2(5) := 'fghij'; BEGIN p (r1, r2, s); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE TYPE Definition IS RECORD ( word VARCHAR2(20), meaning VARCHAR2(200) ); TYPE Dictionary IS VARRAY(2000) OF Definition; lexicon Dictionary := Dictionary(); -- global variable PROCEDURE add_entry ( word_list IN OUT NOCOPY Dictionary -- formal NOCOPY parameter ) IS BEGIN word_list(1).word := 'aardvark'; END; BEGIN lexicon.EXTEND; lexicon(1).word := 'aardwolf'; add_entry(lexicon); -- global variable is actual parameter DBMS_OUTPUT.PUT_LINE(lexicon(1).word); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE emp_num NUMBER(6) := 120; bonus NUMBER(6) := 100; merit NUMBER(4) := 50; PROCEDURE raise_salary ( emp_id NUMBER, -- formal parameter amount NUMBER -- formal parameter ) IS BEGIN UPDATE employees SET salary = salary + amount -- reference to formal parameter WHERE employee_id = emp_id; -- reference to formal parameter END raise_salary; BEGIN raise_salary(emp_num, bonus); -- actual parameters /* raise_salary runs this statement: UPDATE employees SET salary = salary + 100 WHERE employee_id = 120; */ raise_salary(emp_num, merit + bonus); -- actual parameters /* raise_salary runs this statement: UPDATE employees SET salary = salary + 150 WHERE employee_id = 120; */ END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE n NUMBER := 10; PROCEDURE p ( n1 IN NUMBER, n2 IN OUT NUMBER, n3 IN OUT NOCOPY NUMBER ) IS BEGIN n2 := 20; -- actual parameter is 20 only after procedure succeeds DBMS_OUTPUT.put_line(n1); -- actual parameter value is still 10 n3 := 30; -- might change actual parameter immediately DBMS_OUTPUT.put_line(n1); -- actual parameter value is either 10 or 30 END; BEGIN p(n, n, n); DBMS_OUTPUT.put_line(n); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE TYPE EmpCurTyp IS REF CURSOR; c1 EmpCurTyp; c2 EmpCurTyp; PROCEDURE get_emp_data ( emp_cv1 IN OUT EmpCurTyp, emp_cv2 IN OUT EmpCurTyp ) IS emp_rec employees%ROWTYPE; BEGIN OPEN emp_cv1 FOR SELECT * FROM employees; emp_cv2 := emp_cv1; -- now both variables refer to same location FETCH emp_cv1 INTO emp_rec; -- fetches first row of employees FETCH emp_cv1 INTO emp_rec; -- fetches second row of employees FETCH emp_cv2 INTO emp_rec; -- fetches third row of employees CLOSE emp_cv1; -- closes both variables FETCH emp_cv2 INTO emp_rec; -- causes error when get_emp_data is invoked END; BEGIN get_emp_data(c1, c2); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE PROCEDURE raise_salary ( emp_id IN employees.employee_id%TYPE, amount IN employees.salary%TYPE := 100, extra IN employees.salary%TYPE := 50 ) IS BEGIN UPDATE employees SET salary = salary + amount + extra WHERE employee_id = emp_id; END raise_salary; BEGIN raise_salary(120); -- same as raise_salary(120, 100, 50) raise_salary(121, 200); -- same as raise_salary(121, 200, 50) END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE global PLS_INTEGER := 0; FUNCTION f RETURN PLS_INTEGER IS BEGIN DBMS_OUTPUT.PUT_LINE('Inside f.'); global := global + 1; RETURN global * 2; END f; PROCEDURE p ( x IN PLS_INTEGER := f() ) IS BEGIN DBMS_OUTPUT.PUT_LINE ( 'Inside p. ' || ' global = ' || global || ', x = ' || x || '.' ); DBMS_OUTPUT.PUT_LINE('--------------------------------'); END p; PROCEDURE pre_p IS BEGIN DBMS_OUTPUT.PUT_LINE ( 'Before invoking p, global = ' || global || '.' ); DBMS_OUTPUT.PUT_LINE('Invoking p.'); END pre_p; BEGIN pre_p; p(); -- default expression is evaluated pre_p; p(100); -- default expression is not evaluated pre_p; p(); -- default expression is evaluated END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html CREATE OR REPLACE PROCEDURE print_name ( first VARCHAR2, last VARCHAR2 ) AUTHID DEFINER IS BEGIN DBMS_OUTPUT.PUT_LINE(first || ' ' || last); END print_name; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html BEGIN print_name('John', 'Doe'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html CREATE OR REPLACE PROCEDURE print_name ( first VARCHAR2, last VARCHAR2, mi VARCHAR2 := NULL ) AUTHID DEFINER IS BEGIN IF mi IS NULL THEN DBMS_OUTPUT.PUT_LINE(first || ' ' || last); ELSE DBMS_OUTPUT.PUT_LINE(first || ' ' || mi || '. ' || last); END IF; END print_name; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html BEGIN print_name('John', 'Doe'); -- original invocation print_name('John', 'Public', 'Q'); -- new invocation END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE emp_num NUMBER(6) := 120; bonus NUMBER(6) := 50; PROCEDURE raise_salary ( emp_id NUMBER, amount NUMBER ) IS BEGIN UPDATE employees SET salary = salary + amount WHERE employee_id = emp_id; END raise_salary; BEGIN -- Equivalent invocations: raise_salary(emp_num, bonus); -- positional notation raise_salary(amount => bonus, emp_id => emp_num); -- named notation raise_salary(emp_id => emp_num, amount => bonus); -- named notation raise_salary(emp_num, amount => bonus); -- mixed notation END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html CREATE OR REPLACE FUNCTION compute_bonus ( emp_id NUMBER, bonus NUMBER ) RETURN NUMBER AUTHID DEFINER IS emp_sal NUMBER; BEGIN SELECT salary INTO emp_sal FROM employees WHERE employee_id = emp_id; RETURN emp_sal + bonus; END compute_bonus; / SELECT compute_bonus(120, 50) FROM DUAL; SELECT compute_bonus(bonus => 50, emp_id => 120) FROM DUAL; SELECT compute_bonus(120, bonus => 50) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE SUBTYPE License IS VARCHAR2(7) NOT NULL; n License := 'DLLLDDD'; PROCEDURE p (x License) IS BEGIN DBMS_OUTPUT.PUT_LINE(x); END; BEGIN p('1ABC123456789'); -- Succeeds; size is not inherited p(NULL); -- Raises error; NOT NULL is inherited END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE FUNCTION test (p INTEGER) RETURN INTEGER IS BEGIN DBMS_OUTPUT.PUT_LINE('p = ' || p); RETURN p; END test; BEGIN DBMS_OUTPUT.PUT_LINE('test(p) = ' || test(0.66)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parameters-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parameters.html DECLARE FUNCTION test (p NUMBER) RETURN NUMBER IS q INTEGER := p; -- Implicitly converts p to INTEGER BEGIN DBMS_OUTPUT.PUT_LINE('p = ' || q); -- Display q, not p RETURN q; -- Return q, not p END test; BEGIN DBMS_OUTPUT.PUT_LINE('test(p) = ' || test(0.66)); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parts-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parts.html DECLARE first_name employees.first_name%TYPE; last_name employees.last_name%TYPE; email employees.email%TYPE; employer VARCHAR2(8) := 'AcmeCorp'; -- Declare and define procedure PROCEDURE create_email ( -- Subprogram heading begins name1 VARCHAR2, name2 VARCHAR2, company VARCHAR2 ) -- Subprogram heading ends IS -- Declarative part begins error_message VARCHAR2(30) := 'Email address is too long.'; BEGIN -- Executable part begins email := name1 || '.' || name2 || '@' || company; EXCEPTION -- Exception-handling part begins WHEN VALUE_ERROR THEN DBMS_OUTPUT.PUT_LINE(error_message); END create_email; BEGIN first_name := 'John'; last_name := 'Doe'; create_email(first_name, last_name, employer); -- invocation DBMS_OUTPUT.PUT_LINE ('With first name first, email is: ' || email); create_email(last_name, first_name, employer); -- invocation DBMS_OUTPUT.PUT_LINE ('With last name first, email is: ' || email); first_name := 'Elizabeth'; last_name := 'MacDonald'; create_email(first_name, last_name, employer); -- invocation END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parts-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parts.html BEGIN BEGIN DBMS_OUTPUT.PUT_LINE('Inside inner block.'); RETURN; DBMS_OUTPUT.PUT_LINE('Unreachable statement.'); END; DBMS_OUTPUT.PUT_LINE('Inside outer block. Unreachable statement.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parts-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parts.html DECLARE -- Declare and define function FUNCTION square (original NUMBER) -- parameter list RETURN NUMBER -- RETURN clause AS -- Declarative part begins original_squared NUMBER; BEGIN -- Executable part begins original_squared := original * original; RETURN original_squared; -- RETURN statement END; BEGIN DBMS_OUTPUT.PUT_LINE(square(100)); -- invocation END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parts-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parts.html DECLARE x INTEGER; FUNCTION f (n INTEGER) RETURN INTEGER IS BEGIN RETURN (n*n); END; BEGIN DBMS_OUTPUT.PUT_LINE ( 'f returns ' || f(2) || '. Execution returns here (1).' ); x := f(2); DBMS_OUTPUT.PUT_LINE('Execution returns here (2).'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parts-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parts.html CREATE OR REPLACE FUNCTION f (n INTEGER) RETURN INTEGER AUTHID DEFINER IS BEGIN IF n = 0 THEN RETURN 1; ELSIF n = 1 THEN RETURN n; END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parts-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parts.html CREATE OR REPLACE FUNCTION f (n INTEGER) RETURN INTEGER AUTHID DEFINER IS BEGIN IF n = 0 THEN RETURN 1; ELSIF n = 1 THEN RETURN n; ELSE RETURN n*n; END IF; END; / BEGIN FOR i IN 0 .. 3 LOOP DBMS_OUTPUT.PUT_LINE('f(' || i || ') = ' || f(i)); END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprogram-parts-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprogram-parts.html DECLARE PROCEDURE p IS BEGIN DBMS_OUTPUT.PUT_LINE('Inside p'); RETURN; DBMS_OUTPUT.PUT_LINE('Unreachable statement.'); END; BEGIN p; DBMS_OUTPUT.PUT_LINE('Control returns here.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/subprograms-invoked-triggers-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/subprograms-invoked-triggers.html CREATE OR REPLACE PROCEDURE Before_delete (Id IN NUMBER, Ename VARCHAR2) IS LANGUAGE Java name 'thjvTriggers.beforeDelete (oracle.jdbc.NUMBER, oracle.jdbc.CHAR)'; CREATE OR REPLACE TRIGGER Pre_del_trigger BEFORE DELETE ON Tab FOR EACH ROW CALL Before_delete (:OLD.Id, :OLD.Ename) / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/system-triggers-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/system-triggers.html CREATE OR REPLACE TRIGGER drop_trigger BEFORE DROP ON hr.SCHEMA BEGIN RAISE_APPLICATION_ERROR ( num => -20000, msg => 'Cannot drop object'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/system-triggers-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/system-triggers.html CREATE TRIGGER log_errors AFTER SERVERERROR ON DATABASE BEGIN IF (IS_SERVERERROR (1017)) THEN NULL; -- (substitute code that processes logon error) ELSE NULL; -- (substitute code that logs error code) END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/system-triggers-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/system-triggers.html CREATE OR REPLACE TRIGGER check_user AFTER LOGON ON DATABASE BEGIN check_user; EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR (-20000, 'Unexpected error: '|| DBMS_Utility.Format_Error_Stack); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/system-triggers-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/system-triggers.html CREATE OR REPLACE TRIGGER t INSTEAD OF CREATE ON SCHEMA BEGIN EXECUTE IMMEDIATE 'CREATE TABLE T (n NUMBER, m NUMBER)'; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html DROP TABLE accounts; CREATE TABLE accounts ( account_id NUMBER(6), balance NUMBER (10,2) ); INSERT INTO accounts (account_id, balance) VALUES (7715, 6350.00); INSERT INTO accounts (account_id, balance) VALUES (7720, 5100.50); CREATE OR REPLACE PROCEDURE transfer ( from_acct NUMBER, to_acct NUMBER, amount NUMBER ) AUTHID CURRENT_USER AS BEGIN UPDATE accounts SET balance = balance - amount WHERE account_id = from_acct; UPDATE accounts SET balance = balance + amount WHERE account_id = to_acct; COMMIT WRITE IMMEDIATE NOWAIT; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html SELECT * FROM accounts; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html DROP TABLE emp; CREATE TABLE emp AS SELECT * FROM employees; DECLARE CURSOR c1 IS SELECT last_name, job_id, rowid FROM emp; -- no FOR UPDATE clause my_lastname employees.last_name%TYPE; my_jobid employees.job_id%TYPE; my_rowid UROWID; BEGIN OPEN c1; LOOP FETCH c1 INTO my_lastname, my_jobid, my_rowid; EXIT WHEN c1%NOTFOUND; UPDATE emp SET salary = salary * 1.02 WHERE rowid = my_rowid; -- simulates WHERE CURRENT OF c1 COMMIT; END LOOP; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html BEGIN transfer(7715, 7720, 250); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html SELECT * FROM accounts; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html DROP TABLE emp_name; CREATE TABLE emp_name AS SELECT employee_id, last_name FROM employees; CREATE UNIQUE INDEX empname_ix ON emp_name (employee_id); DROP TABLE emp_sal; CREATE TABLE emp_sal AS SELECT employee_id, salary FROM employees; CREATE UNIQUE INDEX empsal_ix ON emp_sal (employee_id); DROP TABLE emp_job; CREATE TABLE emp_job AS SELECT employee_id, job_id FROM employees; CREATE UNIQUE INDEX empjobid_ix ON emp_job (employee_id); DECLARE emp_id NUMBER(6); emp_lastname VARCHAR2(25); emp_salary NUMBER(8,2); emp_jobid VARCHAR2(10); BEGIN SELECT employee_id, last_name, salary, job_id INTO emp_id, emp_lastname, emp_salary, emp_jobid FROM employees WHERE employee_id = 120; INSERT INTO emp_name (employee_id, last_name) VALUES (emp_id, emp_lastname); INSERT INTO emp_sal (employee_id, salary) VALUES (emp_id, emp_salary); INSERT INTO emp_job (employee_id, job_id) VALUES (emp_id, emp_jobid); EXCEPTION WHEN DUP_VAL_ON_INDEX THEN ROLLBACK; DBMS_OUTPUT.PUT_LINE('Inserts were rolled back'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html DROP TABLE emp_name; CREATE TABLE emp_name AS SELECT employee_id, last_name, salary FROM employees; CREATE UNIQUE INDEX empname_ix ON emp_name (employee_id); DECLARE emp_id employees.employee_id%TYPE; emp_lastname employees.last_name%TYPE; emp_salary employees.salary%TYPE; BEGIN SELECT employee_id, last_name, salary INTO emp_id, emp_lastname, emp_salary FROM employees WHERE employee_id = 120; UPDATE emp_name SET salary = salary * 1.1 WHERE employee_id = emp_id; DELETE FROM emp_name WHERE employee_id = 130; SAVEPOINT do_insert; INSERT INTO emp_name (employee_id, last_name, salary) VALUES (emp_id, emp_lastname, emp_salary); EXCEPTION WHEN DUP_VAL_ON_INDEX THEN ROLLBACK TO do_insert; DBMS_OUTPUT.PUT_LINE('Insert was rolled back'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html DROP TABLE emp_name; CREATE TABLE emp_name AS SELECT employee_id, last_name, salary FROM employees; CREATE UNIQUE INDEX empname_ix ON emp_name (employee_id); DECLARE emp_id employees.employee_id%TYPE; emp_lastname employees.last_name%TYPE; emp_salary employees.salary%TYPE; BEGIN SELECT employee_id, last_name, salary INTO emp_id, emp_lastname, emp_salary FROM employees WHERE employee_id = 120; SAVEPOINT my_savepoint; UPDATE emp_name SET salary = salary * 1.1 WHERE employee_id = emp_id; DELETE FROM emp_name WHERE employee_id = 130; SAVEPOINT my_savepoint; INSERT INTO emp_name (employee_id, last_name, salary) VALUES (emp_id, emp_lastname, emp_salary); EXCEPTION WHEN DUP_VAL_ON_INDEX THEN ROLLBACK TO my_savepoint; DBMS_OUTPUT.PUT_LINE('Transaction rolled back.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html DECLARE daily_order_total NUMBER(12,2); weekly_order_total NUMBER(12,2); monthly_order_total NUMBER(12,2); BEGIN COMMIT; -- end previous transaction SET TRANSACTION READ ONLY NAME 'Calculate Order Totals'; SELECT SUM (order_total) INTO daily_order_total FROM orders WHERE order_date = SYSDATE; SELECT SUM (order_total) INTO weekly_order_total FROM orders WHERE order_date = SYSDATE - 7; SELECT SUM (order_total) INTO monthly_order_total FROM orders WHERE order_date = SYSDATE - 30; COMMIT; -- ends read-only transaction END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/transaction-processing-and-control-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/transaction-processing-and-control.html DROP TABLE emp; CREATE TABLE emp AS SELECT * FROM employees; DECLARE CURSOR c1 IS SELECT * FROM emp FOR UPDATE OF salary ORDER BY employee_id; emp_rec emp%ROWTYPE; BEGIN OPEN c1; LOOP FETCH c1 INTO emp_rec; -- fails on second iteration EXIT WHEN c1%NOTFOUND; DBMS_OUTPUT.PUT_LINE ( 'emp_rec.employee_id = ' || TO_CHAR(emp_rec.employee_id) ); UPDATE emp SET salary = salary * 1.05 WHERE employee_id = 105; COMMIT; -- releases locks END LOOP; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-design-guidelines-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-design-guidelines.html SELECT Username FROM USER_USERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-design-guidelines-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-design-guidelines.html CREATE OR REPLACE TRIGGER my_trigger AFTER CREATE ON DATABASE BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-restrictions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-restrictions.html DROP TABLE log; CREATE TABLE log ( emp_id NUMBER(6), l_name VARCHAR2(25), f_name VARCHAR2(20) ); CREATE OR REPLACE TRIGGER log_deletions AFTER DELETE ON employees FOR EACH ROW DECLARE n INTEGER; BEGIN INSERT INTO log VALUES ( :OLD.employee_id, :OLD.last_name, :OLD.first_name ); SELECT COUNT(*) INTO n FROM employees; DBMS_OUTPUT.PUT_LINE('There are now ' || n || ' employees.'); END; / DELETE FROM employees WHERE employee_id = 197; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-restrictions-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-restrictions.html UPDATE p SET p1 = p1+1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-restrictions-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-restrictions.html SELECT * FROM p ORDER BY p1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-restrictions-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-restrictions.html SELECT * FROM f ORDER BY f1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-restrictions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-restrictions.html SELECT count(*) FROM log; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-restrictions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-restrictions.html SELECT employee_id, last_name FROM employees WHERE employee_id = 197; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-restrictions-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-restrictions.html DROP TABLE p; CREATE TABLE p (p1 NUMBER CONSTRAINT pk_p_p1 PRIMARY KEY); INSERT INTO p VALUES (1); INSERT INTO p VALUES (2); INSERT INTO p VALUES (3); DROP TABLE f; CREATE TABLE f (f1 NUMBER CONSTRAINT fk_f_f1 REFERENCES p); INSERT INTO f VALUES (1); INSERT INTO f VALUES (2); INSERT INTO f VALUES (3); CREATE TRIGGER pt AFTER UPDATE ON p FOR EACH ROW BEGIN UPDATE f SET f1 = :NEW.p1 WHERE f1 = :OLD.p1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-restrictions-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-restrictions.html SELECT * FROM p ORDER BY p1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/trigger-restrictions-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/trigger-restrictions.html SELECT * FROM f ORDER BY f1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html TYPE ora_name_list_t IS TABLE OF VARCHAR2(2*(ORA_MAX_NAME_LEN+2)+1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html DECLARE name_list ora_name_list_t; number_modified PLS_INTEGER; BEGIN IF (ora_sysevent='ASSOCIATE STATISTICS') THEN number_modified := ora_dict_obj_name_list(name_list); END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES ('object owner is' || ora_dict_obj_owner); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html DECLARE owner_list ora_name_list_t; number_modified PLS_INTEGER; BEGIN IF (ora_sysevent='ASSOCIATE STATISTICS') THEN number_modified := ora_dict_obj_name_list(owner_list); END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES ('This object is a ' || ora_dict_obj_type); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html DECLARE user_list ora_name_list_t; number_of_grantees PLS_INTEGER; BEGIN IF (ora_sysevent = 'GRANT') THEN number_of_grantees := ora_grantee(user_list); END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html DECLARE v_addr VARCHAR2(11); BEGIN IF (ora_sysevent = 'LOGON') THEN v_addr := ora_client_ip_address; END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES ('1'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES ('A nested table is created'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES ('Server error!!'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html SELECT ora_login_user FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html DECLARE privilege_list ora_name_list_t; number_of_privileges PLS_INTEGER; BEGIN IF (ora_sysevent = 'GRANT' OR ora_sysevent = 'REVOKE') THEN number_of_privileges := ora_privilege_list(privilege_list); END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html DECLARE user_list ora_name_list_t; number_of_users PLS_INTEGER; BEGIN IF (ora_sysevent = 'REVOKE') THEN number_of_users := ora_revokee(user_list); END IF; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES ('top stack error ' || ora_server_error(1)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html DECLARE v_db_name VARCHAR2(50); BEGIN v_db_name := ora_database_name; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES ('top stack error message' || ora_server_error_msg(1)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-48.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html CREATE TABLE event_table (col VARCHAR2(2030)); DECLARE sql_text ora_name_list_t; n PLS_INTEGER; v_stmt VARCHAR2(2000); BEGIN n := ora_sql_txt(sql_text); FOR i IN 1..n LOOP v_stmt := v_stmt || sql_text(i); END LOOP; INSERT INTO event_table VALUES ('text of triggering statement: ' || v_stmt); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES (ora_sysevent); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES ('with grant option'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES (ora_des_encrypted_password); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/triggers-publishing-events-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/triggers-publishing-events.html INSERT INTO event_table VALUES ('Changed object is ' || ora_dict_obj_name); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/updating-rows-records-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/updating-rows-records.html DECLARE default_week schedule%ROWTYPE; BEGIN default_week.Mon := 'Day Off'; default_week.Tue := '0900-1800'; default_week.Wed := '0900-1800'; default_week.Thu := '0900-1800'; default_week.Fri := '0900-1800'; default_week.Sat := '0900-1800'; default_week.Sun := 'Day Off'; FOR i IN 1..3 LOOP default_week.week := i; UPDATE schedule SET ROW = default_week WHERE week = i; END LOOP; END; / SELECT * FROM schedule; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/user-defined-pl-sql-subtypes-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/user-defined-pl-sql-subtypes.html DECLARE SUBTYPE Balance IS NUMBER; checking_account Balance(6,2); savings_account Balance(8,2); certificate_of_deposit Balance(8,2); max_insured CONSTANT Balance(8,2) := 250000.00; SUBTYPE Counter IS NATURAL; accounts Counter := 1; deposits Counter := 0; withdrawals Counter := 0; overdrafts Counter := 0; PROCEDURE deposit ( account IN OUT Balance, amount IN Balance ) IS BEGIN account := account + amount; deposits := deposits + 1; END; BEGIN NULL; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/user-defined-pl-sql-subtypes-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/user-defined-pl-sql-subtypes.html DECLARE SUBTYPE Balance IS NUMBER(8,2); checking_account Balance; savings_account Balance; BEGIN checking_account := 2000.00; savings_account := 1000000.00; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/user-defined-pl-sql-subtypes-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/user-defined-pl-sql-subtypes.html DECLARE SUBTYPE Digit IS PLS_INTEGER RANGE 0..9; SUBTYPE Double_digit IS PLS_INTEGER RANGE 10..99; SUBTYPE Under_100 IS PLS_INTEGER RANGE 0..99; d Digit := 4; dd Double_digit := 35; u Under_100; BEGIN u := d; -- Succeeds; Under_100 range includes Digit range u := dd; -- Succeeds; Under_100 range includes Double_digit range dd := d; -- Raises error; Double_digit range does not include Digit range END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/user-defined-pl-sql-subtypes-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/user-defined-pl-sql-subtypes.html DECLARE SUBTYPE Word IS CHAR(6); SUBTYPE Text IS VARCHAR2(15); verb Word := 'run'; sentence1 Text; sentence2 Text := 'Hurry!'; sentence3 Text := 'See Tom run.'; BEGIN sentence1 := verb; -- 3-character value, 15-character limit verb := sentence2; -- 6-character value, 6-character limit verb := sentence3; -- 12-character value, 6-character limit END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/views-information-triggers-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/views-information-triggers.html CREATE OR REPLACE TRIGGER Emp_count AFTER DELETE ON employees DECLARE n INTEGER; BEGIN SELECT COUNT(*) INTO n FROM employees; DBMS_OUTPUT.PUT_LINE('There are now ' || n || ' employees.'); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/views-information-triggers-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/views-information-triggers.html COLUMN Trigger_type FORMAT A15 COLUMN Triggering_event FORMAT A16 COLUMN Table_name FORMAT A11 COLUMN Trigger_body FORMAT A50 SET LONG 9999 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/views-information-triggers-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/views-information-triggers.html SELECT Trigger_type, Triggering_event, Table_name FROM USER_TRIGGERS WHERE Trigger_name = 'EMP_COUNT'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/views-information-triggers-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/views-information-triggers.html SELECT Trigger_body FROM USER_TRIGGERS WHERE Trigger_name = 'EMP_COUNT'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/views-information-triggers-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/views-information-triggers.html DECLARE n INTEGER; BEGIN SELECT COUNT(*) INTO n FROM employees; DBMS_OUTPUT.PUT_LINE('There are now ' || n || ' employees.'); END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/what-is-capture-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/what-is-capture.html DROP TABLE tab1; CREATE TABLE tab1 (col1 NUMBER, col2 NUMBER); INSERT INTO tab1 (col1, col2) VALUES (100, 10); DROP TABLE tab2; CREATE TABLE tab2 (col1 NUMBER); INSERT INTO tab2 (col1) VALUES (100); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/what-is-capture-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/what-is-capture.html CREATE OR REPLACE PROCEDURE proc AUTHID DEFINER AS CURSOR c1 IS SELECT * FROM tab1 WHERE EXISTS (SELECT * FROM tab2 WHERE col2 = 10); BEGIN OPEN c1; CLOSE c1; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/what-is-capture-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/what-is-capture.html ALTER TABLE tab2 ADD (col2 NUMBER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms.html DECLARE package_text VARCHAR2(32767); -- text for creating package spec and body FUNCTION generate_spec (pkgname VARCHAR2) RETURN VARCHAR2 AS BEGIN RETURN 'CREATE PACKAGE ' || pkgname || ' AUTHID CURRENT_USER AS PROCEDURE raise_salary (emp_id NUMBER, amount NUMBER); PROCEDURE fire_employee (emp_id NUMBER); END ' || pkgname || ';'; END generate_spec; FUNCTION generate_body (pkgname VARCHAR2) RETURN VARCHAR2 AS BEGIN RETURN 'CREATE PACKAGE BODY ' || pkgname || ' AS PROCEDURE raise_salary (emp_id NUMBER, amount NUMBER) IS BEGIN UPDATE employees SET salary = salary + amount WHERE employee_id = emp_id; END raise_salary; PROCEDURE fire_employee (emp_id NUMBER) IS BEGIN DELETE FROM employees WHERE employee_id = emp_id; END fire_employee; END ' || pkgname || ';'; END generate_body; BEGIN package_text := generate_spec('emp_actions'); -- Generate package spec EXECUTE IMMEDIATE package_text; -- Create package spec package_text := generate_body('emp_actions'); -- Generate package body SYS.DBMS_DDL.CREATE_WRAPPED(package_text); -- Create wrapped package body END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms.html SELECT text FROM USER_SOURCE WHERE name = 'EMP_ACTIONS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms.html PROCEDURE raise_salary (emp_id NUMBER, amount NUMBER); PROCEDURE fire_employee (emp_id NUMBER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/wrapping-pl-sql-source-text-dbms_ddl-subprograms.html DECLARE s employees.salary%TYPE; BEGIN SELECT salary INTO s FROM employees WHERE employee_id=130; DBMS_OUTPUT.PUT_LINE('Old salary: ' || s); emp_actions.raise_salary(130, 100); SELECT salary INTO s FROM employees WHERE employee_id=130; DBMS_OUTPUT.PUT_LINE('New salary: ' || s); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/wrapping-pl-sql-source-text-pl-sql-wrapper-utility-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/wrapping-pl-sql-source-text-pl-sql-wrapper-utility.html SELECT COUNT(*) FROM EMPLOYEES / CREATE PROCEDURE wraptest AUTHID CURRENT_USER /* C style comment in procedure declaration */ IS TYPE emp_tab IS TABLE OF employees%ROWTYPE INDEX BY PLS_INTEGER; all_emps emp_tab; BEGIN SELECT * BULK COLLECT INTO all_emps FROM employees; FOR i IN 1..10 LOOP /* C style in pl/sql source */ DBMS_OUTPUT.PUT_LINE('Emp Id: ' || all_emps(i).employee_id); END LOOP; END; / CREATE OR REPLACE FUNCTION fibonacci ( n PLS_INTEGER ) RETURN PLS_INTEGER AUTHID CURRENT_USER -- PL/SQL style comment inside fibonacci function spec IS fib_1 PLS_INTEGER := 0; fib_2 PLS_INTEGER := 1; BEGIN IF n = 1 THEN -- terminating condition RETURN fib_1; ELSIF n = 2 THEN RETURN fib_2; -- terminating condition ELSE RETURN fibonacci(n-2) + fibonacci(n-1); -- recursive invocations END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/lnpls/wrapping-pl-sql-source-text-pl-sql-wrapper-utility-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/lnpls/wrapping-pl-sql-source-text-pl-sql-wrapper-utility.html SELECT COUNT(*) FROM EMPLOYEES / CREATE OR REPLACE PROCEDURE wraptest wrapped a000000 1 abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd 7 129 138 qf4HggDBeNMPlWAsPn6pGf+2LGwwg+nwJK5qZ3SVWE4+GayDZaL1bF7RwYm2/zr1qjZY3FrN 48M1bKc/MG5aY9YB+DrtT4SJN370Rpq7ck5D0sc1D5sKAwTyX13HYvRmjwkdXa0vEZ4q/mCU EQusX23UZbZjxha7CtlCDCx8guGw/M/oHZXc8wDHXL8V8OsqQMv/Hj7z68gINl7OstalRScr uSZ/l/W1YaaA9Lj8Fbx5/nJw96ZNy1SCY8VsB/G6O5f/65+EDxdThpnfU4e1vrrE9iB3/IpI +7fE1Tv29fwc+aZq3S7O / CREATE OR REPLACE FUNCTION fibonacci wrapped a000000 1 abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd 8 150 ff BFDvTL9OR04SJbx+qOy5H/h8IcwwgxDcAJnWZ3TNz51mjAmegdQcpNJfq8hUuQtv1Y5xg7Wd KqMH/HBANhnZ+E1mBWekavYjPxlqV9zIFqZAgB4SBqkqe42sai9Vb0cLEU02/ZCEyxDSfWf3 H1Lp6U9ztRXNy+oDZSNykWCUVLaZro0UmeFrNUBqzE6j9mI3AyRhPw1QbZX5oRMLgLOG3OtS SGJsz7M+bnhnp+xP4ww+SIlxx5LhDtnyPw== / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ABS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ABS.html SELECT ABS(-15) "Absolute" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ACOS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ACOS.html SELECT ACOS(.3)"Arc_Cosine" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADD_MONTHS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADD_MONTHS.html SELECT TO_CHAR(ADD_MONTHS(hire_date, 1), 'DD-MON-YYYY') "Next month" FROM employees WHERE last_name = 'Baer'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "user_id:password"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY EXTERNAL STORE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY "user_id:password"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY EXTERNAL STORE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT BACKUP KEYSTORE USING 'hr.emp_keystore' IDENTIFIED BY password TO '/etc/ORACLE/KEYSTORE/DB1/'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT ALTER KEYSTORE PASSWORD IDENTIFIED BY old_password SET new_password WITH BACKUP USING 'pwd_change'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT MERGE KEYSTORE '/etc/ORACLE/KEYSTORE/DB1' AND KEYSTORE '/etc/ORACLE/KEYSTORE/DB2' IDENTIFIED BY existing_keystore_password INTO NEW KEYSTORE '/etc/ORACLE/KEYSTORE/DB3' IDENTIFIED BY new_keystore_password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT MERGE KEYSTORE '/etc/ORACLE/KEYSTORE/DB1' INTO EXISTING KEYSTORE '/etc/ORACLE/KEYSTORE/DB2' IDENTIFIED BY existing_keystore_password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html SELECT KEY_ID FROM V$ENCRYPTION_KEYS WHERE TAG LIKE 'mytag%' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET KEY USING ALGORITHM 'SEED128' IDENTIFIED BY password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT CREATE KEY USING TAG 'mykey1' IDENTIFIED BY password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html SELECT TAG, KEY_ID FROM V$ENCRYPTION_KEYS WHERE TAG = 'mykey1'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT USE KEY 'ARgEtzPxpE/Nv8WdPu8LJJUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' IDENTIFIED BY password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET TAG 'mykey2' FOR 'ARgEtzPxpE/Nv8WdPu8LJJUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' FORCE KEYSTORE IDENTIFIED BY password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT EXPORT KEYS WITH SECRET "my_secret" TO '/etc/TDE/export.exp' IDENTIFIED BY password WITH IDENTIFIER IN 'AdoxnJ0uH08cv7xkz83ovwsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'AW5z3CoyKE/yv3cNT5CWCXUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT EXPORT KEYS WITH SECRET "my_secret" TO '/etc/TDE/export.exp' IDENTIFIED BY password WITH IDENTIFIER IN (SELECT KEY_ID FROM V$ENCRYPTION_KEYS WHERE TAG IN ('mytag1', 'mytag2')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT EXPORT KEYS WITH SECRET "my_secret" TO '/etc/TDE/export.exp' IDENTIFIED BY password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ALTER SESSION SET CONTAINER = salespdb; ADMINISTER KEY MANAGEMENT EXPORT KEYS WITH SECRET "my_secret" TO '/etc/TDE/salespdb.exp' IDENTIFIED BY password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT IMPORT KEYS WITH SECRET "my_secret" FROM '/etc/TDE/export.exp' IDENTIFIED BY password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT USE ENCRYPTION KEY '0673C1262AA1D04F14BF26D720480C55B2' IDENTIFIED BY "external_keystore_password" MIGRATE USING software_keystore_password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY IDENTIFIED BY "user_id:password" MIGRATE USING software_keystore_password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY IDENTIFIED BY software_keystore_password REVERSE MIGRATE USING "user_id:password"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT ADD SECRET 'secret1' FOR CLIENT 'client1' USING TAG 'My first secret' IDENTIFIED BY password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT ADD SECRET 'secret2' FOR CLIENT 'client2' USING TAG 'My second secret' IDENTIFIED BY "user_id:password"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT UPDATE SECRET 'secret1' FOR CLIENT 'client1' USING TAG 'New Tag 1' IDENTIFIED BY password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT UPDATE SECRET 'secret2' FOR CLIENT 'client2' USING TAG 'New Tag 2' IDENTIFIED BY "user_id:password"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT DELETE SECRET FOR CLIENT 'client1' IDENTIFIED BY password WITH BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT DELETE SECRET FOR CLIENT 'client2' IDENTIFIED BY "user_id:password"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT CREATE KEYSTORE '/etc/ORACLE/WALLETS/orcl' IDENTIFIED BY password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT CREATE AUTO_LOGIN KEYSTORE FROM KEYSTORE '/etc/ORACLE/WALLETS/orcl' IDENTIFIED BY password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ADMINISTER-KEY-MANAGEMENT-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ADMINISTER-KEY-MANAGEMENT.html ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY password CONTAINER = CURRENT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-ANALYTIC-VIEW-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-ANALYTIC-VIEW.html ALTER ANALYTIC VIEW sales_av RENAME TO mysales_av; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-ANALYTIC-VIEW-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-ANALYTIC-VIEW.html ALTER ANALYTIC VIEW TKHCSGL308_UNITS_AVIEW_CACHE ADD CACHE MEASURE GROUP (sales, units, cost) LEVELS (TIME.FISCAL.FISCAL_QUARTER, WAREHOUSE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY hr_audit_policy ADD ONLY TOPLEVEL ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY hr_audit_policy DROP ONLY TOPLEVEL ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY dp_actions_pol ADD ACTIONS COMPONENT = datapump EXPORT DROP ACTIONS COMPONENT = datapump IMPORT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY order_updates_pol CONDITION DROP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY emp_updates_pol CONDITION 'UID = 102' EVALUATE PER STATEMENT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY employee_audit_policy ACTIONS SELECT(sal) on scott.emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY employee_audit_policy ACTIONS ADD INSERT(dname) on scott.dept; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY dml_pol ADD PRIVILEGES CREATE ANY TABLE, DROP ANY TABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY java_pol ADD ACTIONS CREATE JAVA, ALTER JAVA, DROP JAVA; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY table_pol ADD ROLES dba; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY security_pol ADD PRIVILEGES CREATE ANY LIBRARY, DROP ANY LIBRARY ACTIONS DELETE on hr.employees, INSERT on hr.employees, UPDATE on hr.employees, ALL on hr.departments ROLES dba, connect; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY table_pol DROP PRIVILEGES CREATE ANY TABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY dml_pol DROP ACTIONS INSERT on hr.employees, UPDATE on hr.employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY java_pol DROP ROLES java_deploy; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-AUDIT-POLICY-Unified-Auditing.html ALTER AUDIT POLICY hr_admin_pol DROP PRIVILEGES CREATE ANY TABLE ACTIONS LOCK TABLE ROLES audit_viewer; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-CLUSTER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-CLUSTER.html ALTER CLUSTER personnel SIZE 1024 CACHE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-CLUSTER-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-CLUSTER.html ALTER CLUSTER language DEALLOCATE UNUSED KEEP 30 K; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-CLUSTER-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-CLUSTER.html CREATE CLUSTER EMP_DEPT (DEPTNO NUMBER(3)) SIZE 600 TABLESPACE USERS STORAGE (INITIAL 200K NEXT 300K MINEXTENTS 2 PCTINCREASE 33); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-CLUSTER-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-CLUSTER.html SELECT CLUSTER_NAME, TABLESPACE_NAME, KEY_SIZE, CLUSTER_TYPE, AVG_BLOCKS_PER_KEY, MIN_EXTENTS, MAX_EXTENTS FROM USER_CLUSTERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-CLUSTER-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-CLUSTER.html ALTER CLUSTER EMP_DEPT SIZE 1024; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-CLUSTER-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-CLUSTER.html SELECT CLUSTER_NAME, TABLESPACE_NAME, KEY_SIZE, CLUSTER_TYPE, AVG_BLOCKS_PER_KEY, MIN_EXTENTS, MAX_EXTENTS FROM USER_CLUSTERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-CLUSTER-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-CLUSTER.html ALTER CLUSTER EMP_DEPT DEALLOCATE UNUSED KEEP 30 K; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-CLUSTER-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-CLUSTER.html SELECT CLUSTER_NAME, TABLESPACE_NAME, KEY_SIZE, CLUSTER_TYPE, AVG_BLOCKS_PER_KEY, MIN_EXTENTS, MAX_EXTENTS FROM USER_CLUSTERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME = 'DEFAULT_EDITION'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE db_name PREPARE MIRROR COPY mirror_name WITH HIGH REDUNDANCY ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE ADD LOGFILE GROUP 3 ('diska:log3.log' , 'diskb:log3.log') SIZE 50K; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE ADD LOGFILE THREAD 5 GROUP 4 ('diska:log4.log', 'diskb:log4:log'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE ADD LOGFILE MEMBER 'diskc:log3.log' TO GROUP 3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DROP LOGFILE MEMBER 'diskb:log3.log'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DROP LOGFILE GROUP 3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE RENAME FILE 'diskc:log3.log' TO 'diskb:log3.log'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE SET DEFAULT BIGFILE TABLESPACE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DEFAULT TEMPORARY TABLESPACE tbs_05; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DEFAULT TEMPORARY TABLESPACE tbs_grp_01; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE CREATE DATAFILE 'tbs_f03.dbf' AS 'tbs_f04.dbf'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DATAFILE td_file.df ENABLE LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE TEMPFILE 'temp02.dbf' OFFLINE; ALTER DATABASE RENAME FILE 'temp02.dbf' TO 'temp03.dbf'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE RENAME GLOBAL_NAME TO demo.world.example.com; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE 'tracking_file' REUSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DISABLE BLOCK CHANGE TRACKING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DATAFILE 'diskb:tbs_f5.dbf' RESIZE 10 M; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE CLEAR LOGFILE 'diskc:log3.log'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE RECOVER AUTOMATIC DATABASE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE RECOVER LOGFILE 'diskc:log3.log'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE RECOVER AUTOMATIC UNTIL TIME '2001-10-27:14:00:00'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DATAFILE td_file.df REMOVE LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DATAFILE td_file.df SUSPEND LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE ENABLE LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE DISABLE LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE OPEN READ ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE OPEN READ WRITE RESETLOGS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE.html ALTER DATABASE RECOVER TABLESPACE tbs_03 PARALLEL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DATABASE-LINK-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DATABASE-LINK.html ALTER DATABASE LINK private_link CONNECT TO hr IDENTIFIED BY hr_new_password; ALTER PUBLIC DATABASE LINK public_link CONNECT TO scott IDENTIFIED BY scott_new_password; ALTER SHARED PUBLIC DATABASE LINK shared_pub_link CONNECT TO scott IDENTIFIED BY scott_new_password AUTHENTICATED BY hr IDENTIFIED BY hr_new_password; ALTER SHARED DATABASE LINK shared_pub_link CONNECT TO scott IDENTIFIED BY scott_new_password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DIMENSION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DIMENSION.html ALTER DIMENSION customers_dim DROP ATTRIBUTE country; ALTER DIMENSION customers_dim ADD LEVEL zone IS customers.cust_postal_code ADD ATTRIBUTE zone DETERMINES (cust_city); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP hmdg ADD FILEGROUP fgtem TEMPLATE SET 'datafile.redundancy'='unprotected' ALTER DISKGROUP hmdg ADD FILEGROUP fgdb DATABASE NONE FROM TEMPLATE fgtem ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 MODIFY TEMPLATE template_01 ATTRIBUTES (FINE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 DROP TEMPLATE template_01; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 ADD DIRECTORY '+dgroup_01/alias_dir'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 ADD ALIAS '+dgroup_01/alias_dir/datafile.dbf' FOR '+dgroup_01.261.1'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 SCRUB REPAIR WAIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 DISMOUNT FORCE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 MOUNT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP hmdg ADD FILEGROUP fgtem2 TEMPLATE CREATE TABLESPACE tbs1 datafile '+hmdg(fg$fgtem2)/dbs/tbs1.f' size 1M ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 ADD DISK '/devices/disks/d100'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 DROP DISK dgroup_01_0000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 UNDROP DISKS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 RESIZE ALL SIZE 36G; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 REBALANCE POWER 11 WAIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 CHECK ALL REPAIR; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-DISKGROUP-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-DISKGROUP.html ALTER DISKGROUP dgroup_01 ADD TEMPLATE template_01 ATTRIBUTES (UNPROTECTED COARSE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-HIERARCHY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-HIERARCHY.html ALTER HIERARCHY product_hier RENAME TO myproduct_hier; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX ord_customer_ix REBUILD REVERSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX ord_customer_ix REBUILD PARALLEL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX cost_ix SPLIT PARTITION p2 AT (1500) INTO ( PARTITION p2a TABLESPACE tbs_01 LOGGING, PARTITION p2b TABLESPACE tbs_02); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX cost_ix DROP PARTITION p1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX prod_idx MODIFY DEFAULT ATTRIBUTES INITRANS 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX oe.cust_lname_ix INITRANS 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX upper_ix PARALLEL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX upper_ix RENAME TO upper_name_ix; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX cost_ix MODIFY PARTITION p2 UNUSABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX cost_ix UNUSABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX cost_ix REBUILD PARTITION p2; ALTER INDEX cost_ix REBUILD PARTITION p3 NOLOGGING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX cost_ix MODIFY PARTITION p3 STORAGE(MAXEXTENTS 30) LOGGING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEX-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEX.html ALTER INDEX cost_ix RENAME PARTITION p3 TO p3_Q3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INDEXTYPE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INDEXTYPE.html ALTER INDEXTYPE position_indextype COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INMEMORY-JOIN-GROUP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INMEMORY-JOIN-GROUP.html ALTER INMEMORY JOIN GROUP prod_id1 ADD(product_descriptions(product_id)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-INMEMORY-JOIN-GROUP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-INMEMORY-JOIN-GROUP.html ALTER INMEMORY JOIN GROUP prod_id1 REMOVE(product_descriptions(product_id)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-JAVA-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-JAVA.html ALTER JAVA CLASS "Agent" RESOLVER (("/usr/bin/bfile_dir/*" pm)(* public)) RESOLVE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE OPTION = ('DATABASE QUEUING'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE OPTION = ('PARTITIONING'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof ENABLE OPTION = ('DATABASE QUEUING'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof ENABLE OPTION ALL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER DATABASE'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SUSPEND', 'RESUME'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER PLUGGABLE DATABASE') CLAUSE ALL EXCEPT = ('DEFAULT TABLESPACE', 'DEFAULT TEMPORARY TABLESPACE'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SESSION') CLAUSE = ('SET') OPTION = ('COMMIT_WAIT', 'CURSOR_SHARING'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SET') OPTION = ('PDB_FILE_NAME_CONVERT') VALUE = ('cdb1_pdb0', 'cdb1_pdb1'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SET') OPTION = ('CPU_COUNT') MINVALUE = '8'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html CREATE LOCKDOWN PROFILE hr_prof; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SET') OPTION = ('CPU_COUNT') MAXVALUE = '2'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE STATEMENT = ('ALTER SYSTEM') CLAUSE = ('SET') OPTION = ('CPU_COUNT') MINVALUE = '2' MAXVALUE = '6'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof ENABLE STATEMENT ALL EXCEPT = ('ALTER DATABASE'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof ENABLE STATEMENT = ('ALTER DATABASE') CLAUSE = ('MOUNT', 'OPEN'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof ENABLE STATEMENT = ('ALTER PLUGGABLE DATABASE') CLAUSE ALL EXCEPT = ('DEFAULT TABLESPACE', 'DEFAULT TEMPORARY TABLESPACE'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof ENABLE STATEMENT = ('ALTER SESSION') CLAUSE = ('SET') OPTION = ('COMMIT_WAIT', 'CURSOR_SHARING'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE FEATURE = ('NETWORK_ACCESS'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE FEATURE = ('LOB_FILE_ACCESS', 'TRACE_VIEW_ACCESS'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE FEATURE ALL EXCEPT = ('COMMON_USER_LOCAL_SCHEMA_ACCESS', 'LOCAL_USER_COMMON_SCHEMA_ACCESS'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof DISABLE FEATURE ALL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof ENABLE FEATURE = ('UTL_HTTP', 'UTL_SMTP', 'OS_ACCESS'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof ENABLE FEATURE ALL EXCEPT = ('AQ_PROTOCOLS', 'CTX_PROTOCOLS'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-LOCKDOWN-PROFILE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-LOCKDOWN-PROFILE.html ALTER LOCKDOWN PROFILE hr_prof ENABLE FEATURE ALL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW.html ALTER MATERIALIZED VIEW sales_by_month_by_state REFRESH FAST; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW.html ALTER MATERIALIZED VIEW sales_by_month_by_state REFRESH NEXT SYSDATE+7; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW.html ALTER MATERIALIZED VIEW sales_by_month_by_state CONSIDER FRESH; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW.html ALTER MATERIALIZED VIEW emp_data REFRESH COMPLETE START WITH TRUNC(SYSDATE+1) + 9/24 NEXT SYSDATE+7; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW.html ALTER MATERIALIZED VIEW emp_data ENABLE QUERY REWRITE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW.html ALTER MATERIALIZED VIEW order_data REFRESH WITH PRIMARY KEY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW.html ALTER MATERIALIZED VIEW order_data COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW.html ALTER MATERIALIZED VIEW MView1 ANNOTATIONS(DROP Snapshot); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-LOG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW-LOG.html ALTER MATERIALIZED VIEW LOG ON order_items ADD ROWID; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-VIEW-LOG-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-VIEW-LOG.html ALTER MATERIALIZED VIEW LOG ON employees ADD (commission_pct) EXCLUDING NEW VALUES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-ZONEMAP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-ZONEMAP.html ALTER MATERIALIZED ZONEMAP sales_zmap PCTFREE 20 PCTUSED 50 NOCACHE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-ZONEMAP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-ZONEMAP.html ALTER MATERIALIZED ZONEMAP sales_zmap REFRESH FAST ON COMMIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-ZONEMAP-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-ZONEMAP.html ALTER MATERIALIZED ZONEMAP sales_zmap DISABLE PRUNING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-ZONEMAP-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-ZONEMAP.html ALTER MATERIALIZED ZONEMAP sales_zmap COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-ZONEMAP-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-ZONEMAP.html ALTER MATERIALIZED ZONEMAP sales_zmap REBUILD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-MATERIALIZED-ZONEMAP-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-MATERIALIZED-ZONEMAP.html ALTER MATERIALIZED ZONEMAP sales_zmap UNUSABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-OPERATOR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-OPERATOR.html ALTER OPERATOR eq_op COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-OUTLINE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-OUTLINE.html ALTER OUTLINE salaries REBUILD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE CDB1_PDB2 UNPLUG INTO '/tmp/cdb1_pdb2.xml' ENCRYPT USING transport_secret ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE CDB1_PDB1_1 UNPLUG INTO '/tmp/CDB1_PDB1_1.pdb' ENCRYPT USING transport_secret ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE ENABLE LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE DISABLE LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb1 UNPLUG INTO '/oracle/data/pdb1.xml'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb2 STORAGE (MAXSIZE 500M); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb3 DATAFILE ALL OFFLINE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb4 OPEN READ ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb4 OPEN READ WRITE FORCE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb4 CLOSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb4 OPEN READ ONLY RESTRICTED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb5 OPEN READ WRITE INSTANCES = ('ORCLDB_1', 'ORCLDB_2'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE CONTAINERS HOST='myhost.example.com'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb6 CLOSE RELOCATE TO 'ORCLDB_3'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE ALL OPEN READ ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE CONTAINERS PORT=1599; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE APPLICATION hrapp payrollapp employeesapp SYNC ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE APPLICATION ALL EXCEPT hrapp payrollapp SYNC ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE pdb_name PREPARE MIRROR COPY mirror_name WITH HIGH REDUNDANCY ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PLUGGABLE-DATABASE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE PREPARE MIRROR COPY mirror_name WITH HIGH REDUNDANCY ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE new_profile LIMIT PASSWORD_REUSE_TIME 90 PASSWORD_REUSE_MAX UNLIMITED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE app_user LIMIT PASSWORD_REUSE_TIME DEFAULT PASSWORD_REUSE_MAX UNLIMITED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE app_user LIMIT FAILED_LOGIN_ATTEMPTS 5 PASSWORD_LOCK_TIME 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE app_user2 LIMIT PASSWORD_LIFE_TIME 90 PASSWORD_GRACE_TIME 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE app_user2 LIMIT INACTIVE_ACCOUNT_TIME 30; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE app_user LIMIT SESSIONS_PER_USER 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE app_user LIMIT IDLE_TIME DEFAULT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE default LIMIT IDLE_TIME 2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE app_user2 LIMIT IDLE_TIME UNLIMITED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-PROFILE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-PROFILE.html ALTER PROFILE usr_prof LIMIT PASSWORD_ROLLOVER_TIME 2 ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-RESOURCE-COST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-RESOURCE-COST.html ALTER RESOURCE COST CPU_PER_SESSION 100 CONNECT_TIME 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-RESOURCE-COST-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-RESOURCE-COST.html ALTER RESOURCE COST LOGICAL_READS_PER_SESSION 2 CONNECT_TIME 0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-ROLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-ROLE.html ALTER ROLE warehouse_user NOT IDENTIFIED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-ROLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-ROLE.html ALTER ROLE dw_manager IDENTIFIED BY data; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-ROLE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-ROLE.html ALTER ROLE dw_manager IDENTIFIED USING hr.admin; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-ROLLBACK-SEGMENT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-ROLLBACK-SEGMENT.html ALTER ROLLBACK SEGMENT rbs_one ONLINE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-ROLLBACK-SEGMENT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-ROLLBACK-SEGMENT.html ALTER ROLLBACK SEGMENT rbs_one SHRINK TO 100M; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SEQUENCE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SEQUENCE.html ALTER SEQUENCE customers_seq MAXVALUE 1500; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SEQUENCE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SEQUENCE.html ALTER SEQUENCE customers_seq CYCLE CACHE 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html SELECT SYS_CONTEXT('USERENV', 'CURRENT_EDITION_NAME') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html SELECT SYS_CONTEXT('USERENV', 'CON_NAME') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION ENABLE PARALLEL DML; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION ADVISE COMMIT; INSERT INTO employees@remote VALUES (8002, 'Juan', 'Fernandez', 'juanf@example.com', NULL, TO_DATE('04-OCT-1992', 'DD-MON-YYYY'), 'SA_CLERK', 3000, NULL, 121, 20); ALTER SESSION ADVISE ROLLBACK; DELETE FROM employees@local WHERE employee_id = 8002; COMMIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html UPDATE jobs@local SET min_salary = 3000 WHERE job_id = 'SH_CLERK'; COMMIT; ALTER SESSION CLOSE DATABASE LINK local; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY MM DD HH24:MI:SS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html SELECT TO_CHAR(SYSDATE) Today FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION SET NLS_DATE_LANGUAGE = French; SELECT TO_CHAR(SYSDATE, 'Day DD Month YYYY') Today FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION SET NLS_ISO_CURRENCY = America; SELECT TO_CHAR( SUM(salary), 'C999G999D99') Total FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html SELECT SYS_CONTEXT('USERENV', 'SESSION_DEFAULT_COLLATION') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ',.' ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION SET NLS_CURRENCY = 'FF'; SELECT TO_CHAR( SUM(salary), 'L999G999D99') Total FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION SET NLS_CURRENCY = 'DM'; SELECT TO_CHAR( SUM(salary), 'L999G999D99') Total FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION SET NLS_LANGUAGE = FRENCH; SELECT * FROM DMP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION SET NLS_SORT = XSpanish; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SESSION-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SESSION.html ALTER SESSION SET QUERY_REWRITE_ENABLED = TRUE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYNONYM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYNONYM.html ALTER SYNONYM offices COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYNONYM-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYNONYM.html ALTER PUBLIC SYNONYM emp_table COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYNONYM-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYNONYM.html ALTER SYNONYM offices NONEDITIONABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM KILL SESSION '20,1' FORCE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM KILL SESSION '20,1' TIMEOUT 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM ENABLE RESTRICTED SESSION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM DISABLE RESTRICTED SESSION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "password"; ALTER SYSTEM SET ENCRYPTION KEY IDENTIFIED BY "password"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET ENCRYPTION WALLET CLOSE IDENTIFIED BY "password"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET ENCRYPTION WALLET CLOSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM FLUSH SHARED_POOL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM CHECKPOINT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET RESOURCE_LIMIT = TRUE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET SHARED_SERVERS = 25; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET DISPATCHERS = '(INDEX=0)(PROTOCOL=TCP)(DISPATCHERS=5)', '(INDEX=1)(PROTOCOL=ipc)(DISPATCHERS=10)'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET LICENSE_MAX_SESSIONS = 64 LICENSE_SESSIONS_WARNING = 54; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET LICENSE_MAX_SESSIONS = 0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET LICENSE_MAX_USERS = 200; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SWITCH LOGFILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM ENABLE DISTRIBUTED RECOVERY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM DISABLE DISTRIBUTED RECOVERY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html SELECT sid, serial#, username FROM V$SESSION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM KILL SESSION '39, 23'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM DISCONNECT SESSION '13, 8' POST_TRANSACTION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html SELECT SYS_CONTEXT('SYS_CLUSTER_PROPERTIES', 'CLUSTER_STATE') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html SELECT SYS_CONTEXT('SYS_CLUSTER_PROPERTIES', 'CURRENT_PATCHLVL') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET MANDATORY_USER_PROFILE=c##cdb_profile; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM ARCHIVE LOG CHANGE 9356083; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM ARCHIVE LOG LOGFILE 'diskl:log6.log' TO 'diska:[arch$]'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-SYSTEM-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-SYSTEM.html ALTER SYSTEM SET QUERY_REWRITE_ENABLED = TRUE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employee RESULT_CACHE (MODE DEFAULT) ALTER TABLE employee RESULT_CACHE (STANDBY ENABLE) ALTER TABLE employee RESULT_CACHE (MODE DEFAULT, STANDBY ENABLE) ALTER TABLE employee RESULT_CACHE (STANDBY ENABLE, MODE FORCE) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE imm_tab NO DELETE UNTIL 120 DAYS AFTER INSERT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-100.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE departments DROP PRIMARY KEY CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-101.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE departments DROP CONSTRAINT pk_dept CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-102.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees DROP UNIQUE (email); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-103.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees ADD (resume CLOB) LOB (resume) STORE AS resume_seg (TABLESPACE example); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-104.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees MODIFY LOB (resume) (CACHE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-105.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees ADD (resume CLOB) LOB (resume) STORE AS SECUREFILE resume_seg (TABLESPACE auto_seg_ts); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-106.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees MODIFY LOB (resume) (NOCACHE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-107.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees ADD (skills skill_table_type) NESTED TABLE skills STORE AS nested_skill_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-108.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TYPE pet_t AS OBJECT (pet_id NUMBER, pet_name VARCHAR2(10), pet_dob DATE); / CREATE TYPE pet AS TABLE OF pet_t; / CREATE TABLE vet_service (vet_name VARCHAR2(30), client pet) NESTED TABLE client STORE AS client_tab; ALTER TABLE client_tab ADD UNIQUE (pet_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-109.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TYPE emp_t AS OBJECT (eno number, ename char(31)); CREATE TYPE emps_t AS TABLE OF REF emp_t; CREATE TABLE emptab OF emp_t; CREATE TABLE dept (dno NUMBER, employees emps_t) NESTED TABLE employees STORE AS deptemps; ALTER TABLE deptemps ADD (SCOPE FOR (COLUMN_VALUE) IS emptab); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE JOBS_Temp AS SELECT * FROM HR.JOBS; SELECT * FROM JOBS_Temp WHERE MIN_SALARY < 3000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-110.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE deptemps ADD (REF(column_value) WITH ROWID); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-111.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TYPE dept_t AS OBJECT (deptno NUMBER, dname VARCHAR2(20)); / CREATE TABLE staff (name VARCHAR2(100), salary NUMBER, dept REF dept_t); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-112.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE offices OF dept_t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-113.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE staff ADD (SCOPE FOR (dept) IS offices); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-114.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE staff ADD (REF(dept) WITH ROWID); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-115.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE t1 (n NUMBER, x ANYDATA); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-116.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE OR REPLACE TYPE clob_typ AS OBJECT (c clob); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-117.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE t1 MODIFY OPAQUE TYPE x STORE (XMLType, clob_typ) UNPACKED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-118.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html INSERT INTO t1 VALUES(1, anydata.convertobject(XMLType('This is test XML'))); INSERT INTO t1 VALUES(2, anydata.convertobject(clob_typ(TO_CLOB('This is a test CLOB')))); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-119.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT t1.*, anydata.getTypeName(t1.x) typename FROM t1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html UPDATE JOBS_Temp SET MIN_SALARY = 2300 WHERE MIN_SALARY < 2010; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-120.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE FUNCTION get_xmltype (ad IN ANYDATA) RETURN VARCHAR2 AS rtn_val PLS_INTEGER; my_xmltype XMLType; string_val VARCHAR2(30); BEGIN rtn_val := ad.getObject(my_xmltype); string_val := my_xmltype.getstringval(); return (string_val); END; / CREATE FUNCTION get_clob_typ (ad IN ANYDATA) RETURN VARCHAR2 AS rtn_val PLS_INTEGER; my_clob_typ clob_typ; string_val VARCHAR2(30); BEGIN rtn_val := ad.getObject(my_clob_typ); string_val := (my_clob_typ.c); return (string_val); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-121.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT t1.*, anydata.getTypeName(t1.x) typename, CASE WHEN anydata.gettypename(t1.x) = 'SYS.XMLTYPE' THEN get_xmltype(t1.x) WHEN anydata.gettypename(t1.x) = 'HR.CLOB_TYP' THEN get_clob_typ(t1.x) END string_value FROM t1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-122.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE table1 (T NUMBER) ANNOTATIONS(Operations 'Sort', Hidden); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-123.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE table1 ANNOTATIONS(DROP Operations, DROP Hidden); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-124.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE table1 ANNOTATIONS(ADD Operations '["Sort", "Group"]'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-125.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE table1 MODIFY T ANNOTATIONS(Identity 'ID'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-126.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE table1 MODIFY T ANNOTATIONS(ADD Hidden, DROP Identity); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-127.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE SHARDED TABLE departments ( department_id NUMBER(6) , department_name VARCHAR2(30) CONSTRAINT dept_name_nn NOT NULL , manager_id NUMBER(6) , location_id NUMBER(4) , CONSTRAINT dept_id_pk PRIMARY KEY(department_id) ) PARTITION BY DIRECTORY (department_id) ( PARTITION p_1 TABLESPACE tbs1, PARTITION p_2 TABLESPACE tbs2 ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-128.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE departments ADD PARTITION p_3 TABLESPACE tbs3, PARTITION p_4 TABLESPACE tbs4; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-129.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE departments SPLIT PARTITION p_1 INTO (PARTITION p_1 TABLESPACE tbs1, PARTITION p_3 TABLESPACE tbs3) UPDATE INDEXES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_Temp ADD CONSTRAINT chk_sal_min CHECK (MIN_SALARY >=2010); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT * FROM JOBS_Temp WHERE MIN_SALARY < 3000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT CONSTRAINT_NAME FROM USER_CONSTRAINTS WHERE TABLE_NAME='JOBS_TEMP'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE product( id NUMBER NOT NULL PRIMARY KEY, name VARCHAR2(50), price NUMBER CHECK (mod(price,4) = 0 and 10 <> price) PRECHECK, color NUMBER CHECK (color >= 10 and color <=50 and mod(color,2) = 0) PRECHECK, description VARCHAR2(50) CHECK (length(description) <= 40) PRECHECK, constant NUMBER CHECK (constant=10) PRECHECK, CONSTRAINT TC1 CHECK (color > 0 AND price > 10) PRECHECK, CONSTRAINT TC2 CHECK (CATEGORY IN ('home', 'apparel') AND price > 10) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE product MODIFY (name VARCHAR2(50) CHECK (regexp_like(name, '^Product')) PRECHECK); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE product MODIFY CONSTRAINT TC2 PRECHECK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE product MODIFY CONSTRAINT TC1 NOPRECHECK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE print_media MODIFY NESTED TABLE ad_textdocs_ntab RETURN AS VALUE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE customers PARALLEL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees ENABLE VALIDATE CONSTRAINT emp_manager_fk EXCEPTIONS INTO exceptions; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT e.* FROM employees e, exceptions ex WHERE e.rowid = ex.row_id AND ex.table_name = 'EMPLOYEES' AND ex.constraint = 'EMP_MANAGER_FK'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees ENABLE NOVALIDATE PRIMARY KEY ENABLE NOVALIDATE CONSTRAINT emp_last_name_nn; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE locations MODIFY PRIMARY KEY DISABLE CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html EXECUTE DBMS_IOT.BUILD_EXCEPTIONS_TABLE ('hr', 'countries', 'except_table'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE countries ENABLE PRIMARY KEY EXCEPTIONS INTO except_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees ADD CONSTRAINT check_comp CHECK (salary + (commission_pct*salary) <= 5000) DISABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees ENABLE ALL TRIGGERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees DEALLOCATE UNUSED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE students (last_name VARCHAR2(20), id NUMBER); INSERT INTO students VALUES('Dodd', 364); INSERT INTO students VALUES('de Niro', 132); INSERT INTO students VALUES('Vogel', 837); INSERT INTO students VALUES('van der Kamp', 549); INSERT INTO students VALUES('van Der Meer', 624); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT last_name, id FROM students ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE students MODIFY (last_name COLLATE BINARY_CI); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT last_name, id FROM students ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE customers RENAME COLUMN credit_limit TO credit_amount; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE t1 ( pk NUMBER PRIMARY KEY, fk NUMBER, c1 NUMBER, c2 NUMBER, CONSTRAINT ri FOREIGN KEY (fk) REFERENCES t1, CONSTRAINT ck1 CHECK (pk > 0 and c1 > 0), CONSTRAINT ck2 CHECK (c2 > 0) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE t1 DROP (pk); ALTER TABLE t1 DROP (c1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE t1 DROP (pk) CASCADE CONSTRAINTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-39.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE t1 DROP (pk, fk, c1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE t ADD (jcol JSON) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE JOBS_Temp AS SELECT * FROM HR.JOBS; SELECT * FROM JOBS_Temp WHERE MAX_SALARY > 20000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_Temp ADD (DUMMY1 NUMBER(2), DUMMY2 NUMBER(2)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html INSERT INTO JOBS_Temp(JOB_ID, JOB_TITLE, DUMMY1, DUMMY2) VALUES ('D','DUMMY',10,20); INSERT INTO JOBS_Temp(JOB_ID, JOB_TITLE, DUMMY1, DUMMY2) VALUES ('D','DUMMY',10,20) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-43.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_TEMP SET UNUSED (DUMMY1, DUMMY2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-44.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT * FROM USER_UNUSED_COL_TABS WHERE TABLE_NAME='JOBS_TEMP'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-45.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_TEMP DROP UNUSED COLUMNS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-46.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT * FROM JOBS_TEMP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-47.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE countries_demo INITRANS 4; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-48.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE countries_demo ADD OVERFLOW; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-49.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE countries_demo OVERFLOW INITRANS 4; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE DOMAIN phone_number as VARCHAR2(12) CONSTRAINT CHECK (phone_number not like '%[0-9]%') NOT NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE sales SPLIT PARTITION SALES_Q4_2000 AT (TO_DATE('15-NOV-2000','DD-MON-YYYY')) INTO (PARTITION SALES_Q4_2000, PARTITION SALES_Q4_2000b); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-51.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE sales SPLIT PARTITION SALES_Q1_2002 INTO ( PARTITION SALES_JAN_2002 VALUES LESS THAN (TO_DATE('01-FEB-2002','DD-MON-YYYY')), PARTITION SALES_FEB_2002 VALUES LESS THAN (TO_DATE('01-MAR-2002','DD-MON-YYYY')), PARTITION SALES_MAR_2002); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE print_media_part ( product_id NUMBER(6), ad_id NUMBER(6), ad_composite BLOB, ad_sourcetext CLOB, ad_finaltext CLOB, ad_fltextn NCLOB, ad_textdocs_ntab TEXTDOC_TAB, ad_photo BLOB, ad_graphic BFILE, ad_header ADHEADER_TYP) NESTED TABLE ad_textdocs_ntab STORE AS textdoc_nt PARTITION BY RANGE (product_id) (PARTITION p1 VALUES LESS THAN (100), PARTITION p2 VALUES LESS THAN (200)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-53.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE print_media_part SPLIT PARTITION p2 AT (150) INTO (PARTITION p2a TABLESPACE omf_ts1 LOB (ad_photo, ad_composite) STORE AS (TABLESPACE omf_ts2), PARTITION p2b LOB (ad_photo, ad_composite) STORE AS (TABLESPACE omf_ts2)) NESTED TABLE ad_textdocs_ntab INTO (PARTITION nt_p2a, PARTITION nt_p2b); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-54.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE sales MERGE PARTITIONS sales_q4_2000, sales_q4_2000b INTO PARTITION sales_q4_2000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-55.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE print_media_part MERGE PARTITIONS p2a, p2b INTO PARTITION p2ab TABLESPACE example NESTED TABLE ad_textdocs_ntab STORE AS nt_p2ab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-56.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE sales MERGE PARTITIONS sales_q1_2000 TO sales_q4_2000 INTO PARTITION sales_all_2000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-57.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE print_media_part ADD PARTITION p3 VALUES LESS THAN (400) LOB(ad_photo, ad_composite) STORE AS (TABLESPACE omf_ts1) LOB(ad_sourcetext, ad_finaltext) STORE AS (TABLESPACE omf_ts2) NESTED TABLE ad_textdocs_ntab STORE AS nt_p3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-58.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE print_media_part ADD PARTITION p3 values less than (300), PARTITION p4 values less than (400), PARTITION p5 values less than (500); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-59.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE list_customers SPLIT PARTITION rest VALUES ('MEXICO', 'COLOMBIA') INTO (PARTITION south, PARTITION rest); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE customers ADD (cust_cell_phone_number Varchar2(12) DOMAIN phone_number); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-60.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE list_customers MERGE PARTITIONS asia, rest INTO PARTITION rest; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-61.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE list_customers SPLIT PARTITION rest VALUES ('CHINA', 'THAILAND') INTO (PARTITION asia, PARTITION rest); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-62.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE print_media_part DROP PARTITION p3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-63.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE exchange_table ( customer_id NUMBER(6), cust_first_name VARCHAR2(20), cust_last_name VARCHAR2(20), cust_address CUST_ADDRESS_TYP, nls_territory VARCHAR2(30), cust_email VARCHAR2(40)); ALTER TABLE list_customers EXCHANGE PARTITION rest WITH TABLE exchange_table WITHOUT VALIDATION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-64.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE list_customers MODIFY PARTITION asia UNUSABLE LOCAL INDEXES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-65.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE list_customers MODIFY PARTITION asia REBUILD UNUSABLE LOCAL INDEXES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-66.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE print_media_part MOVE PARTITION p2b TABLESPACE omf_ts1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-67.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE sales RENAME PARTITION sales_q4_2003 TO sales_currentq; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-68.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE print_media_demo TRUNCATE PARTITION p1 DROP STORAGE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-69.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE sales SPLIT PARTITION sales_q1_2000 AT (TO_DATE('16-FEB-2000','DD-MON-YYYY')) INTO (PARTITION q1a_2000, PARTITION q1b_2000) UPDATE GLOBAL INDEXES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE customers ADD (cust_cell_phone_number Varchar2(12) DOMAIN phone_number DEFAULT ON NULL '650-000-0000'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-70.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE INDEX cost_ix ON costs(channel_id) LOCAL; ALTER TABLE costs SPLIT PARTITION costs_q4_2003 at (TO_DATE('01-Nov-2003','dd-mon-yyyy')) INTO (PARTITION c_p1, PARTITION c_p2) UPDATE INDEXES (cost_ix (PARTITION c_p1 tablespace tbs_02, PARTITION c_p2 tablespace tbs_03)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-71.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TYPE emp_t AS OBJECT (empno NUMBER, address CHAR(30)); CREATE TABLE emp OF emp_t ( empno PRIMARY KEY) OBJECT IDENTIFIER IS PRIMARY KEY; CREATE TABLE dept (dno NUMBER, mgr_ref REF emp_t SCOPE is emp); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-72.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE dept ADD CONSTRAINT mgr_cons FOREIGN KEY (mgr_ref) REFERENCES emp; ALTER TABLE dept ADD sr_mgr REF emp_t REFERENCES emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-73.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE countries ADD (duty_pct NUMBER(2,2) CHECK (duty_pct < 10.5), visa_needed VARCHAR2(3)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-74.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE emp2 AS SELECT * FROM employees; ALTER TABLE emp2 ADD (income AS (salary + (salary*commission_pct))); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-75.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE countries MODIFY (duty_pct NUMBER(3,2)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-76.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees PCTFREE 30 PCTUSED 60; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-77.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE JOBS_TEMP AS SELECT * FROM HR.JOBS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-78.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT initial_extent, next_extent, min_extents, max_extents, pct_increase, blocks, sample_size FROM user_tables WHERE table_name = 'JOBS_TEMP'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-79.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_TEMP MOVE STORAGE ( INITIAL 20K NEXT 40K MINEXTENTS 2 MAXEXTENTS 20 PCTINCREASE 0 ) TABLESPACE USERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE t1 DROP COLUMN f1 DROP (f2); ALTER TABLE t1 DROP COLUMN f1 SET UNUSED (f2); ALTER TABLE t1 DROP (f1) ADD (f2 NUMBER); ALTER TABLE t1 SET UNUSED (f3) ADD (CONSTRAINT ck1 CHECK (f2 > 0)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-80.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT initial_extent, next_extent, min_extents, max_extents, pct_increase, blocks, sample_size FROM user_tables WHERE table_name = 'JOBS_TEMP'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-81.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE TABLE JOBS_Temp AS SELECT * FROM HR.JOBS; SELECT * FROM JOBS_Temp WHERE MAX_SALARY > 30000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-82.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_Temp MODIFY(JOB_TITLE VARCHAR2(100)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-83.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_Temp ADD (BONUS NUMBER (7,2), COMM NUMBER (5,2), DUMMY NUMBER(2)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-84.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html SELECT JOB_ID, BONUS, COMM, DUMMY FROM JOBS_Temp WHERE MAX_SALARY > 20000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-85.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_Temp RENAME COLUMN COMM TO COMMISSION; SELECT JOB_ID, COMMISSION FROM JOBS_Temp WHERE MAX_SALARY > 20000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-86.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_Temp DROP COLUMN DUMMY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-87.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE JOBS_Temp DROP (BONUS, COMMISSION); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-88.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees MODIFY (salary ENCRYPT USING 'AES256' 'NOMAC'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-89.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE customers ADD (online_acct_pw VARCHAR2(8) ENCRYPT 'NOMAC' NO SALT); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE imm_tab NO DROP UNTIL 50 DAYS IDLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-90.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE customers MODIFY (online_acct_pw DECRYPT); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-91.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE employees ALLOCATE EXTENT (SIZE 5K INSTANCE 4); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-92.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE product_information MODIFY (min_price DEFAULT 10); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-93.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html INSERT INTO product_information (product_id, product_name, list_price) VALUES (300, 'left-handed mouse', 40.50); SELECT product_id, product_name, list_price, min_price FROM product_information WHERE product_id = 300; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-94.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE product_information MODIFY (min_price DEFAULT NULL); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-95.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html CREATE SEQUENCE s1 START WITH 1; CREATE TABLE t1 (name VARCHAR2(10)); INSERT INTO t1 VALUES('Kevin'); INSERT INTO t1 VALUES('Julia'); INSERT INTO t1 VALUES('Ryan'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-96.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE t1 ADD (id NUMBER DEFAULT ON NULL s1.NEXTVAL NOT NULL); SELECT id, name FROM t1 ORDER BY id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-97.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html INSERT INTO t1(id, name) VALUES(NULL, 'Sean'); SELECT id, name FROM t1 ORDER BY id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-98.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE xwarehouses ADD (PRIMARY KEY(XMLDATA."WarehouseID")); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLE-99.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLE.html ALTER TABLE customers RENAME CONSTRAINT cust_fname_nn TO cust_firstname_nn; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER SYSTEM SET UNDO_TABLESPACE = new_tablespace_name SCOPE = MEMORY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbsu1 ENABLE LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbs_03 DROP DATAFILE 'tbs_f04.dbf'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE temp_demo ADD TEMPFILE 'temp05.dbf' SIZE 5 AUTOEXTEND ON; ALTER TABLESPACE temp_demo DROP TEMPFILE 'temp05.dbf'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE temp_demo SHRINK SPACE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE omf_ts1 ADD DATAFILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbs_03 NOLOGGING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE undots1 RETENTION NOGUARANTEE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE undots1 RETENTION GUARANTEE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbsu1 REMOVE LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbsu1 SUSPEND LOST WRITE PROTECTION ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbs_01 BEGIN BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbs_01 END BACKUP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbs_02 OFFLINE NORMAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbs_02 RENAME DATAFILE 'diskb:tbs_f5.dbf' TO 'diska:tbs_f5.dbf'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbs_02 ONLINE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE.html ALTER TABLESPACE tbs_03 ADD DATAFILE 'tbs_f04.dbf' SIZE 100K AUTOEXTEND ON NEXT 10K MAXSIZE 100K; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-TABLESPACE-SET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-TABLESPACE-SET.html ALTER TABLESPACE SET ts1 FORCE LOGGING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER u1 IDENTIFIED BY p3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER u1 IDENTIFIED BY p3 REPLACE p1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER sidney PASSWORD EXPIRE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER sh TEMPORARY TABLESPACE tbs_grp_01; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER app_user1 GRANT CONNECT THROUGH sh WITH ROLE warehouse_user; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER app_user1 REVOKE CONNECT THROUGH sh; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER sully GRANT CONNECT THROUGH OAS1 AUTHENTICATED USING PASSWORD; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER app_user1 GRANT CONNECT THROUGH ENTERPRISE USERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER u1 IDENTIFIED BY p3 REPLACE p2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER user PASSWORD EXPIRE HTTP DIGEST ENABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER user PASSWORD EXPIRE HTTP DIGEST DISABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER sidney IDENTIFIED BY second_2nd_pwd DEFAULT TABLESPACE example; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER sh PROFILE new_profile; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER sh DEFAULT ROLE ALL EXCEPT dw_manager; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-USER-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-USER.html ALTER USER app_user1 IDENTIFIED GLOBALLY AS 'CN=tom,O=oracle,C=US'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-VIEW-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-VIEW.html ALTER VIEW customer_ro COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ALTER-VIEW-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ALTER-VIEW.html ALTER VIEW HighWageEmp ANNOTATIONS(DROP Title, ADD Identity); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ANALYZE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ANALYZE.html ANALYZE TABLE orders DELETE STATISTICS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ANALYZE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ANALYZE.html ANALYZE INDEX inv_product_ix VALIDATE STRUCTURE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ANALYZE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ANALYZE.html ANALYZE TABLE employees VALIDATE STRUCTURE CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ANALYZE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ANALYZE.html ANALYZE TABLE customers VALIDATE REF UPDATE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ANALYZE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ANALYZE.html ANALYZE TABLE customers VALIDATE STRUCTURE ONLINE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ANALYZE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ANALYZE.html ANALYZE CLUSTER personnel VALIDATE STRUCTURE CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ANALYZE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ANALYZE.html ANALYZE TABLE orders LIST CHAINED ROWS INTO chained_rows; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ANALYZE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ANALYZE.html SELECT owner_name, table_name, head_rowid, analyze_timestamp FROM chained_rows ORDER BY owner_name, table_name, head_rowid, analyze_timestamp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ANY_VALUE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ANY_VALUE.html SELECT c.cust_id, ANY_VALUE(cust_last_name), SUM(amount_sold) FROM customers c, sales s WHERE s.cust_id = c.cust_id GROUP BY c.cust_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_COUNT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_COUNT.html SELECT department_id, job_id, APPROX_COUNT(*) FROM employees GROUP BY department_id, job_id HAVING APPROX_RANK ( PARTITION BY department_id ORDER BY APPROX_COUNT(*) DESC ) <= 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_COUNT_DISTINCT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_COUNT_DISTINCT.html SELECT APPROX_COUNT_DISTINCT(manager_id) AS "Active Managers" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_COUNT_DISTINCT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_COUNT_DISTINCT.html SELECT prod_id, APPROX_COUNT_DISTINCT(cust_id) AS "Number of Customers" FROM sales GROUP BY prod_id ORDER BY prod_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL.html CREATE MATERIALIZED VIEW daily_prod_count_mv AS SELECT t.calendar_year year, t.calendar_month_number month, t.day_number_in_month day, APPROX_COUNT_DISTINCT_DETAIL(s.prod_id) daily_detail FROM times t, sales s WHERE t.time_id = s.time_id GROUP BY t.calendar_year, t.calendar_month_number, t.day_number_in_month; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL.html CREATE MATERIALIZED VIEW monthly_prod_count_mv AS SELECT year, month, APPROX_COUNT_DISTINCT_AGG(daily_detail) monthly_detail FROM daily_prod_count_mv GROUP BY year, month; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL.html CREATE MATERIALIZED VIEW annual_prod_count_mv AS SELECT year, APPROX_COUNT_DISTINCT_AGG(daily_detail) annual_detail FROM daily_prod_count_mv GROUP BY year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL.html SELECT year, month, day, TO_APPROX_COUNT_DISTINCT(daily_detail) "NUM PRODUCTS" FROM daily_prod_count_mv ORDER BY year, month, day; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL.html SELECT year, month, TO_APPROX_COUNT_DISTINCT(monthly_detail) "NUM PRODUCTS" FROM monthly_prod_count_mv ORDER BY year, month; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_COUNT_DISTINCT_DETAIL.html SELECT year, TO_APPROX_COUNT_DISTINCT(annual_detail) "NUM PRODUCTS" FROM annual_prod_count_mv ORDER BY year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_MEDIAN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_MEDIAN.html SELECT department_id "Department", APPROX_MEDIAN(salary DETERMINISTIC) "Median Salary" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_MEDIAN-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_MEDIAN.html SELECT department_id "Department", APPROX_MEDIAN(salary DETERMINISTIC, 'ERROR_RATE') "Error Rate" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_MEDIAN-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_MEDIAN.html SELECT department_id "Department", APPROX_MEDIAN(salary DETERMINISTIC, 'CONFIDENCE') "Confidence Level" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_MEDIAN-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_MEDIAN.html SELECT department_id "Department", APPROX_MEDIAN(hire_date) "Median Hire Date" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE.html SELECT department_id "Department", APPROX_PERCENTILE(0.25 DETERMINISTIC) WITHIN GROUP (ORDER BY salary ASC) "25th Percentile Salary", APPROX_PERCENTILE(0.50 DETERMINISTIC) WITHIN GROUP (ORDER BY salary ASC) "50th Percentile Salary", APPROX_PERCENTILE(0.75 DETERMINISTIC) WITHIN GROUP (ORDER BY salary ASC) "75th Percentile Salary" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE.html SELECT department_id "Department", APPROX_PERCENTILE(0.25 DETERMINISTIC, 'ERROR_RATE') WITHIN GROUP (ORDER BY salary ASC) "Error Rate" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE.html SELECT department_id "Department", APPROX_PERCENTILE(0.25 DETERMINISTIC, 'CONFIDENCE') WITHIN GROUP (ORDER BY salary ASC) "Confidence" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE.html SELECT department_id "Department", APPROX_PERCENTILE(0.25) WITHIN GROUP (ORDER BY salary ASC) "25th Percentile Salary", APPROX_PERCENTILE(0.50) WITHIN GROUP (ORDER BY salary ASC) "50th Percentile Salary", APPROX_PERCENTILE(0.75) WITHIN GROUP (ORDER BY salary ASC) "75th Percentile Salary" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE_DETAIL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE_DETAIL.html CREATE MATERIALIZED VIEW amt_sold_by_city_mv ENABLE QUERY REWRITE AS SELECT c.country_id country, c.cust_state_province state, c.cust_city city, APPROX_PERCENTILE_DETAIL(s.amount_sold) city_detail FROM customers c, sales s WHERE c.cust_id = s.cust_id GROUP BY c.country_id, c.cust_state_province, c.cust_city; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE_DETAIL-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE_DETAIL.html CREATE MATERIALIZED VIEW amt_sold_by_state_mv AS SELECT country, state, APPROX_PERCENTILE_AGG(city_detail) state_detail FROM amt_sold_by_city_mv GROUP BY country, state; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE_DETAIL-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE_DETAIL.html CREATE MATERIALIZED VIEW amt_sold_by_country_mv AS SELECT country, APPROX_PERCENTILE_AGG(city_detail) country_detail FROM amt_sold_by_city_mv GROUP BY country; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE_DETAIL-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE_DETAIL.html SELECT country, state, city, TO_APPROX_PERCENTILE(city_detail, .25, 'NUMBER') "25th Percentile", TO_APPROX_PERCENTILE(city_detail, .50, 'NUMBER') "50th Percentile", TO_APPROX_PERCENTILE(city_detail, .75, 'NUMBER') "75th Percentile" FROM amt_sold_by_city_mv ORDER BY country, state, city; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE_DETAIL-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE_DETAIL.html SELECT country, state, TO_APPROX_PERCENTILE(state_detail, .25, 'NUMBER') "25th Percentile", TO_APPROX_PERCENTILE(state_detail, .50, 'NUMBER') "50th Percentile", TO_APPROX_PERCENTILE(state_detail, .75, 'NUMBER') "75th Percentile" FROM amt_sold_by_state_mv ORDER BY country, state; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE_DETAIL-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE_DETAIL.html SELECT country, TO_APPROX_PERCENTILE(country_detail, .25, 'NUMBER') "25th Percentile", TO_APPROX_PERCENTILE(country_detail, .50, 'NUMBER') "50th Percentile", TO_APPROX_PERCENTILE(country_detail, .75, 'NUMBER') "75th Percentile" FROM amt_sold_by_country_mv ORDER BY country; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE_DETAIL-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE_DETAIL.html SELECT country, TO_APPROX_PERCENTILE(APPROX_PERCENTILE_AGG(city_detail), .25, 'NUMBER') "25th Percentile" FROM amt_sold_by_city_mv GROUP BY country ORDER BY country; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE_DETAIL-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE_DETAIL.html SELECT c.country_id country, APPROX_MEDIAN(s.amount_sold) amount_median FROM customers c, sales s WHERE c.cust_id = s.cust_id GROUP BY c.country_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_PERCENTILE_DETAIL-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_PERCENTILE_DETAIL.html SET LINESIZE 300 SET PAGESIZE 0 COLUMN plan_table_output FORMAT A150 SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(format=>'BASIC')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_RANK-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_RANK.html SELECT job_id, APPROX_SUM(sal), APPROX_RANK(PARTITION BY department_id ORDER BY APPROX_SUM(salary) DESC) FROM employees GROUP BY department_id, job_id HAVING APPROX_RANK( PARTITION BY department_id ORDER BY APPROX_SUM (salary) DESC) <= 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/APPROX_SUM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/APPROX_SUM.html SELECT department_id, job_id, APPROX_SUM(salary) FROM employees GROUP BY department_id, job_id HAVING APPROX_RANK ( PARTITION BY department_id ORDER BY APPROX_SUM(salary) DESC ) <= 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ASCII-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ASCII.html SELECT last_name FROM employees WHERE ASCII(SUBSTR(last_name, 1, 1)) = 76 ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ASCIISTR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ASCIISTR.html SELECT ASCIISTR('ABÄCDE') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ASIN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ASIN.html SELECT ASIN(.3) "Arc_Sine" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ASSOCIATE-STATISTICS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ASSOCIATE-STATISTICS.html ASSOCIATE STATISTICS WITH PACKAGES emp_mgmt DEFAULT SELECTIVITY 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ASSOCIATE-STATISTICS-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ASSOCIATE-STATISTICS.html ASSOCIATE STATISTICS WITH INDEXES salary_index DEFAULT COST (100,5,0); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ATAN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ATAN.html SELECT ATAN(.3) "Arc_Tangent" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ATAN2-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ATAN2.html SELECT ATAN2(.3, .2) "Arc_Tangent2" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AUDIT-Unified-Auditing-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AUDIT-Unified-Auditing.html AUDIT POLICY table_pol; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AUDIT-Unified-Auditing-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AUDIT-Unified-Auditing.html SELECT policy_name, enabled_option, entity_name FROM audit_unified_enabled_policies WHERE policy_name = 'TABLE_POL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AUDIT-Unified-Auditing-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AUDIT-Unified-Auditing.html AUDIT POLICY dml_pol BY hr, sh; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AUDIT-Unified-Auditing-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AUDIT-Unified-Auditing.html SELECT policy_name, enabled_option, entity_name FROM audit_unified_enabled_policies WHERE policy_name = 'DML_POL' ORDER BY entity_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AUDIT-Unified-Auditing-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AUDIT-Unified-Auditing.html AUDIT POLICY read_dir_pol EXCEPT hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AUDIT-Unified-Auditing-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AUDIT-Unified-Auditing.html SELECT policy_name, enabled_option, entity_name FROM audit_unified_enabled_policies WHERE policy_name = 'READ_DIR_POL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AUDIT-Unified-Auditing-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AUDIT-Unified-Auditing.html AUDIT POLICY security_pol BY hr WHENEVER NOT SUCCESSFUL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AUDIT-Unified-Auditing-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AUDIT-Unified-Auditing.html SELECT policy_name, enabled_option, entity_name, success, failure FROM audit_unified_enabled_policies WHERE policy_name = 'SECURITY_POL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AUDIT-Unified-Auditing-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AUDIT-Unified-Auditing.html AUDIT CONTEXT NAMESPACE userenv ATTRIBUTES current_user, db_name BY hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AVG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AVG.html SELECT AVG(salary) "Average" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/AVG-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/AVG.html SELECT manager_id, last_name, hire_date, salary, AVG(salary) OVER (PARTITION BY manager_id ORDER BY hire_date ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS c_mavg FROM employees ORDER BY manager_id, hire_date, salary; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/About-SQL-Expressions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/About-SQL-Expressions.html SET last_name = 'Smith'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/About-SQL-Expressions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/About-SQL-Expressions.html SET last_name = INITCAP(last_name); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/About-User-Defined-Functions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/About-User-Defined-Functions.html SELECT new_sal FROM new_emps; SELECT new_emps.new_sal FROM new_emps; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/About-User-Defined-Functions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/About-User-Defined-Functions.html SELECT hr.new_sal FROM new_emps; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/About-User-Defined-Functions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/About-User-Defined-Functions.html SELECT hr.tax_rate (ss_no, sal) INTO income_tax FROM tax_table WHERE ss_no = tax_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Aggregate-Functions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Aggregate-Functions.html SELECT AVG(MAX(salary)) FROM employees GROUP BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Arithmetic-Operators-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Arithmetic-Operators.html SELECT * FROM order_items WHERE quantity = -1 ORDER BY order_id, line_item_id, product_id; SELECT * FROM employees WHERE -salary < 0 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Arithmetic-Operators-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Arithmetic-Operators.html SELECT hire_date FROM employees WHERE SYSDATE - hire_date > 365 ORDER BY hire_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Arithmetic-Operators-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Arithmetic-Operators.html UPDATE employees SET salary = salary * 1.1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Automatic-Locks-in-DML-Operations-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Automatic-Locks-in-DML-Operations.html UPDATE t SET x = ( SELECT y FROM t2 WHERE t2.z = t.z ) WHERE a > 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/BETWEEN-Condition-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/BETWEEN-Condition.html SELECT * FROM employees WHERE salary BETWEEN 2000 AND 3000 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/BFILENAME-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/BFILENAME.html CREATE DIRECTORY media_dir AS '/demo/schema/product_media'; INSERT INTO print_media (product_id, ad_id, ad_graphic) VALUES (3000, 31001, BFILENAME('MEDIA_DIR', 'modem_comp_ad.gif')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/BIN_TO_NUM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/BIN_TO_NUM.html SELECT BIN_TO_NUM(1,0,1,0) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/BIN_TO_NUM-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/BIN_TO_NUM.html SELECT order_status FROM orders WHERE order_id = 2441; DECLARE warehouse NUMBER := 1; ground NUMBER := 1; insured NUMBER := 1; result NUMBER; BEGIN SELECT BIN_TO_NUM(warehouse, ground, insured) INTO result FROM DUAL; UPDATE orders SET order_status = result WHERE order_id = 2441; END; / SELECT order_status FROM orders WHERE order_id = 2441; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/BITAND-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/BITAND.html SELECT BITAND(6,3) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/BITAND-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/BITAND.html SELECT BITAND( BIN_TO_NUM(1,1,0), BIN_TO_NUM(0,1,1)) "Binary" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/BITAND-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/BITAND.html SELECT order_id, customer_id, order_status, DECODE(BITAND(order_status, 1), 1, 'Warehouse', 'PostOffice') "Location", DECODE(BITAND(order_status, 2), 2, 'Ground', 'Air') "Method", DECODE(BITAND(order_status, 4), 4, 'Insured', 'Certified') "Receipt" FROM orders WHERE sales_rep_id = 160 ORDER BY order_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/BIT_AND_AGG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/BIT_AND_AGG.html SELECT '011' num, bin_to_num(0,1,1) bits FROM dual UNION ALL SELECT '101' num, bin_to_num(1,0,1) bits FROM dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/BIT_AND_AGG-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/BIT_AND_AGG.html SELECT bit_and_agg(bits) FROM (SELECT '011' num, bin_to_num(0,1,1) bits FROM dual UNION ALL SELECT '101' num, bin_to_num(1,0,1) bits FROM dual); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CALL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CALL.html CALL my_procedure(arg1 => 3, arg2 => 4) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CALL-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CALL.html CALL my_procedure(3, 4) CALL my_procedure(3, arg2 => 4) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CALL-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CALL.html CALL emp_mgmt.remove_dept(162); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CALL-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CALL.html ALTER TYPE warehouse_typ ADD MEMBER FUNCTION ret_name RETURN VARCHAR2 CASCADE; CREATE OR REPLACE TYPE BODY warehouse_typ AS MEMBER FUNCTION ret_name RETURN VARCHAR2 IS BEGIN RETURN self.warehouse_name; END; END; / VARIABLE x VARCHAR2(25); CALL warehouse_typ(456, 'Warehouse 456', 2236).ret_name() INTO :x; PRINT x; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CALL-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CALL.html CREATE OR REPLACE FUNCTION ret_warehouse_typ(x warehouse_typ) RETURN warehouse_typ IS BEGIN RETURN x; END; / CALL ret_warehouse_typ(warehouse_typ(234, 'Warehouse 234', 2235)).ret_name() INTO :x; PRINT x; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CARDINALITY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CARDINALITY.html SELECT product_id, CARDINALITY(ad_textdocs_ntab) cardinality FROM print_media ORDER BY product_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CASE-Expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CASE-Expressions.html SELECT cust_last_name, CASE credit_limit WHEN 100 THEN 'Low' WHEN 5000 THEN 'High' ELSE 'Medium' END AS credit FROM customers ORDER BY cust_last_name, credit; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CASE-Expressions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CASE-Expressions.html SELECT AVG(CASE WHEN e.salary > 2000 THEN e.salary ELSE 2000 END) "Average Salary" FROM employees e; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST('22-OCT-1997' AS TIMESTAMP WITH LOCAL TIME ZONE) FROM DUAL; SELECT CAST(TO_DATE('22-Oct-1997', 'DD-Mon-YYYY') AS TIMESTAMP WITH LOCAL TIME ZONE) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT product_id, CAST(ad_sourcetext AS VARCHAR2(30)) text FROM print_media ORDER BY product_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html CREATE TABLE projects (employee_id NUMBER, project_name VARCHAR2(10)); CREATE TABLE emps_short (employee_id NUMBER, last_name VARCHAR2(10)); CREATE TYPE project_table_typ AS TABLE OF VARCHAR2(10); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT e.last_name, CAST(MULTISET(SELECT p.project_name FROM projects p WHERE p.employee_id = e.employee_id ORDER BY p.project_name) AS project_table_typ) FROM emps_short e ORDER BY e.last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST ( 'yes' AS BOOLEAN ), CAST ( true AS NUMBER ), CAST ( false AS VARCHAR2(10) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html CREATE DOMAIN day_of_week AS VARCHAR2(3 CHAR) CONSTRAINT CHECK (day_of_week IN('MON','TUE','WED','THU','FRI','SAT','SUN')) DISABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST ( 'N/A' AS day_of_week ) use_constraint_state; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST ( 'N/A' AS day_of_week VALIDATE ) apply_constraints; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html CREATE DOMAIN day_of_week AS VARCHAR2(3 CHAR) CONSTRAINT CHECK (day_of_week IN('MON','TUE','WED','THU','FRI','SAT','SUN')) ENABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST ( 'N/A' AS day_of_week ) use_constraint_state; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST ( 'N/A' AS DOMAIN day_of_week NOVALIDATE ) ignore_constraints; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST(200 AS NUMBER DEFAULT 0 ON CONVERSION ERROR) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST('January 15, 1989, 11:00 A.M.' AS DATE DEFAULT NULL ON CONVERSION ERROR, 'Month dd, YYYY, HH:MI A.M.') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST('1999-12-01 11:00:00 -8:00' AS TIMESTAMP WITH TIME ZONE DEFAULT '2000-01-01 01:00:00 -8:00' ON CONVERSION ERROR, 'YYYY-MM-DD HH:MI:SS TZH:TZM', 'NLS_DATE_LANGUAGE = American') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST('N/A' AS NUMBER DEFAULT '0' ON CONVERSION ERROR) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST ( 'yes' AS BOOLEAN ), CAST ( true AS NUMBER ), CAST ( false AS VARCHAR2(10) ) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html CREATE TYPE address_book_t AS TABLE OF cust_address_typ; CREATE TYPE address_array_t AS VARRAY(3) OF cust_address_typ; CREATE TABLE cust_address ( custno NUMBER, street_address VARCHAR2(40), postal_code VARCHAR2(10), city VARCHAR2(30), state_province VARCHAR2(10), country_id CHAR(2)); CREATE TABLE cust_short (custno NUMBER, name VARCHAR2(31)); CREATE TABLE states (state_id NUMBER, addresses address_array_t); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT s.custno, s.name, CAST(MULTISET(SELECT ca.street_address, ca.postal_code, ca.city, ca.state_province, ca.country_id FROM cust_address ca WHERE s.custno = ca.custno) AS address_book_t) FROM cust_short s ORDER BY s.custno; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CAST-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CAST.html SELECT CAST(s.addresses AS address_book_t) FROM states s WHERE s.state_id = 111; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CEIL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CEIL.html SELECT order_total, CEIL(order_total) FROM orders WHERE order_id = 2434; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CHARTOROWID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CHARTOROWID.html SELECT last_name FROM employees WHERE ROWID = CHARTOROWID('AAAFd1AAFAAAABSAA/'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CHR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CHR.html SELECT CHR(67)||CHR(65)||CHR(84) "Dog" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CHR-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CHR.html SELECT CHR(195)||CHR(193)||CHR(227) "Dog" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CHR-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CHR.html SELECT CHR(41378) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CHR-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CHR.html SELECT CHR(161)||CHR(162) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CHR-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CHR.html SELECT CHR(41378)||CHR(41379) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CHR-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CHR.html SELECT CHR (196 USING NCHAR_CS) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CLUSTER_DETAILS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CLUSTER_DETAILS.html SELECT S.cluster_id, probability prob, CLUSTER_DETAILS(em_sh_clus_sample, S.cluster_id, 5 USING T.*) det FROM (SELECT v.*, CLUSTER_SET(em_sh_clus_sample, NULL, 0.2 USING *) pset FROM mining_data_apply_v v WHERE cust_id = 100955) T, TABLE(T.pset) S ORDER BY 2 DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CLUSTER_DETAILS-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CLUSTER_DETAILS.html SELECT * FROM ( SELECT cust_id, CLUSTER_ID(INTO 4 USING *) OVER () cls, CLUSTER_DETAILS(INTO 4 USING *) OVER () cls_details FROM mining_data_apply_v) WHERE cust_id <= 100003 ORDER BY 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CLUSTER_DISTANCE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CLUSTER_DISTANCE.html SELECT cust_id FROM ( SELECT cust_id, rank() over (order by CLUSTER_DISTANCE(km_sh_clus_sample USING *) desc) rnk FROM mining_data_apply_v) WHERE rnk <= 11 ORDER BY rnk; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CLUSTER_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CLUSTER_ID.html SELECT CLUSTER_ID(km_sh_clus_sample USING *) AS clus, COUNT(*) AS cnt FROM mining_data_apply_v GROUP BY CLUSTER_ID(km_sh_clus_sample USING *) ORDER BY cnt DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CLUSTER_ID-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CLUSTER_ID.html SELECT * FROM ( SELECT cust_id, CLUSTER_ID(INTO 4 USING *) OVER () cls, CLUSTER_DETAILS(INTO 4 USING *) OVER () cls_details FROM mining_data_apply_v) WHERE cust_id <= 100003 ORDER BY 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CLUSTER_PROBABILITY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CLUSTER_PROBABILITY.html SELECT cust_id FROM (SELECT cust_id, rank() OVER (ORDER BY prob DESC, cust_id) rnk_clus2 FROM (SELECT cust_id, CLUSTER_PROBABILITY(km_sh_clus_sample, 2 USING *) prob FROM mining_data_apply_v)) WHERE rnk_clus2 <= 10 ORDER BY rnk_clus2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CLUSTER_SET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CLUSTER_SET.html SELECT S.cluster_id, probability prob, CLUSTER_DETAILS(em_sh_clus_sample, S.cluster_id, 5 USING T.*) det FROM (SELECT v.*, CLUSTER_SET(em_sh_clus_sample, NULL, 0.2 USING *) pset FROM mining_data_apply_v v WHERE cust_id = 100955) T, TABLE(T.pset) S ORDER BY 2 DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COALESCE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COALESCE.html SELECT product_id, list_price, min_price, COALESCE(0.9*list_price, min_price, 5) "Sale" FROM product_information WHERE supplier_id = 102050 ORDER BY product_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COLLATE-Operator-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COLLATE-Operator.html SELECT last_name FROM employees ORDER BY last_name COLLATE GENERIC_M; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COLLATION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COLLATION.html CREATE TABLE id_table (name VARCHAR2(64) COLLATE BINARY_AI, id VARCHAR2(8) COLLATE BINARY_CI); INSERT INTO id_table VALUES('Christopher', 'ABCD1234'); SELECT COLLATION(name), COLLATION(id) FROM id_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COLLECT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COLLECT.html CREATE TYPE phone_book_t AS TABLE OF phone_list_typ; / SELECT CAST(COLLECT(phone_numbers) AS phone_book_t) "Income Level L Phone Book" FROM customers WHERE income_level = 'L: 300,000 and above'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COLLECT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COLLECT.html CREATE TYPE warehouse_name_t AS TABLE OF VARCHAR2(35); / SELECT CAST(COLLECT(warehouse_name ORDER BY warehouse_name) AS warehouse_name_t) "Warehouses" FROM warehouses; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COLUMN_VALUE-Pseudocolumn-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COLUMN_VALUE-Pseudocolumn.html SELECT * FROM XMLTABLE('123'); SELECT COLUMN_VALUE FROM (XMLTable('123')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COLUMN_VALUE-Pseudocolumn-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COLUMN_VALUE-Pseudocolumn.html CREATE TYPE phone AS TABLE OF NUMBER; / CREATE TYPE phone_list AS TABLE OF phone; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COLUMN_VALUE-Pseudocolumn-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COLUMN_VALUE-Pseudocolumn.html SELECT t.COLUMN_VALUE FROM TABLE(phone(1,2,3)) t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COLUMN_VALUE-Pseudocolumn-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COLUMN_VALUE-Pseudocolumn.html SELECT t.COLUMN_VALUE FROM TABLE(phone_list(phone(1,2,3))) p, TABLE(p.COLUMN_VALUE) t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COLUMN_VALUE-Pseudocolumn-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COLUMN_VALUE-Pseudocolumn.html CREATE TABLE my_customers ( cust_id NUMBER, name VARCHAR2(25), phone_numbers phone_list, credit_limit NUMBER) NESTED TABLE phone_numbers STORE AS outer_ntab (NESTED TABLE COLUMN_VALUE STORE AS inner_ntab); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COMMENT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COMMENT.html COMMENT ON COLUMN employees.job_id IS 'abbreviated job title'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COMMENT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COMMENT.html COMMENT ON COLUMN employees.job_id IS ''; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COMMIT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COMMIT.html INSERT INTO regions VALUES (5, 'Antarctica'); COMMIT WORK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COMMIT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COMMIT.html COMMIT WRITE BATCH; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COMMIT-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COMMIT.html COMMIT COMMENT 'In-doubt transaction Code 36, Call (415) 555-2637'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COMMIT-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COMMIT.html COMMIT FORCE '22.57.53'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COMPOSE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COMPOSE.html SELECT COMPOSE( 'o' || UNISTR('\0308') ) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CONCAT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CONCAT.html SELECT CONCAT( last_name, '''s job category is ', job_id) "Job" FROM employees WHERE employee_id = 152; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CONVERT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CONVERT.html SELECT CONVERT('Ä Ê Í Õ Ø A B C D E ', 'US7ASCII', 'WE8ISO8859P1') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CONVERT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CONVERT.html SELECT * FROM V$NLS_VALID_VALUES WHERE parameter = 'CHARACTERSET'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CON_DBID_TO_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CON_DBID_TO_ID.html SELECT CON_ID, DBID FROM V$CONTAINERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CON_DBID_TO_ID-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CON_DBID_TO_ID.html SELECT CON_DBID_TO_ID(2256797992) "Container ID" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CON_GUID_TO_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CON_GUID_TO_ID.html SELECT CON_ID, GUID FROM V$CONTAINERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CON_GUID_TO_ID-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CON_GUID_TO_ID.html SELECT CON_GUID_TO_ID(HEXTORAW('D990F4BD938865C1E04305B4F00ACA18')) "Container ID" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CON_NAME_TO_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CON_NAME_TO_ID.html SELECT CON_ID, NAME FROM V$CONTAINERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CON_NAME_TO_ID-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CON_NAME_TO_ID.html SELECT CON_NAME_TO_ID('SALESPDB') "Container ID" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CON_UID_TO_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CON_UID_TO_ID.html SELECT CON_ID, CON_UID FROM V$CONTAINERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CON_UID_TO_ID-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CON_UID_TO_ID.html SELECT CON_UID_TO_ID(2256797992) "Container ID" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CORR-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CORR.html SELECT weight_class, CORR(list_price, min_price) "Correlation" FROM product_information GROUP BY weight_class ORDER BY weight_class, "Correlation"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CORR-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CORR.html SELECT employee_id, job_id, TO_CHAR((SYSDATE - hire_date) YEAR TO MONTH ) "Yrs-Mns", salary, CORR(SYSDATE-hire_date, salary) OVER(PARTITION BY job_id) AS "Correlation" FROM employees WHERE department_id in (50, 80) ORDER BY job_id, employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CORR_A-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CORR_A.html SELECT COUNT(*) count, CORR_S(salary, commission_pct) commission, CORR_S(salary, employee_id) empid FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CORR_A-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CORR_A.html SELECT CORR_K(salary, commission_pct, 'COEFFICIENT') coefficient, CORR_K(salary, commission_pct, 'TWO_SIDED_SIG') two_sided_p_value FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COS.html SELECT COS(180 * 3.14159265359/180) "Cosine of 180 degrees" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COSH-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COSH.html SELECT COSH(0) "Hyperbolic cosine of 0" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COUNT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COUNT.html SELECT COUNT(*) "Total" FROM employees; SELECT COUNT(*) "Allstars" FROM employees WHERE commission_pct > 0; SELECT COUNT(commission_pct) "Count" FROM employees; SELECT COUNT(DISTINCT manager_id) "Managers" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COUNT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COUNT.html SELECT last_name, salary, COUNT(*) OVER (ORDER BY salary RANGE BETWEEN 50 PRECEDING AND 150 FOLLOWING) AS mov_count FROM employees ORDER BY salary, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COVAR_POP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COVAR_POP.html SELECT job_id, COVAR_POP(SYSDATE-hire_date, salary) AS covar_pop, COVAR_SAMP(SYSDATE-hire_date, salary) AS covar_samp FROM employees WHERE department_id in (50, 80) GROUP BY job_id ORDER BY job_id, covar_pop, covar_samp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/COVAR_POP-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/COVAR_POP.html SELECT product_id, supplier_id, COVAR_POP(list_price, min_price) OVER (ORDER BY product_id, supplier_id) AS CUM_COVP, COVAR_SAMP(list_price, min_price) OVER (ORDER BY product_id, supplier_id) AS CUM_COVS FROM product_information p WHERE category_id = 29 ORDER BY product_id, supplier_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ANALYTIC-VIEW-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ANALYTIC-VIEW.html desc SALES_FACT ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ANALYTIC-VIEW-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ANALYTIC-VIEW.html CREATE OR REPLACE ANALYTIC VIEW sales_av USING sales_fact DIMENSION BY (time_attr_dim -- An attribute dimension of time data KEY month_id REFERENCES month_id HIERARCHIES ( time_hier DEFAULT), product_attr_dim -- An attribute dimension of product data KEY category_id REFERENCES category_id HIERARCHIES ( product_hier DEFAULT), geography_attr_dim -- An attribute dimension of store data KEY state_province_id REFERENCES state_province_id HIERARCHIES ( geography_hier DEFAULT) ) MEASURES (sales FACT sales, -- A base measure units FACT units, -- A base measure sales_prior_period AS -- Calculated measures (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1)), sales_year_ago AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL year)), chg_sales_year_ago AS (LAG_DIFF(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL year)), pct_chg_sales_year_ago AS (LAG_DIFF_PERCENT(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL year)), sales_qtr_ago AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL quarter)), chg_sales_qtr_ago AS (LAG_DIFF(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL quarter)), pct_chg_sales_qtr_ago AS (LAG_DIFF_PERCENT(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL quarter)) ) DEFAULT MEASURE SALES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ATTRIBUTE-DIMENSION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ATTRIBUTE-DIMENSION.html desc TIME_DIM ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ATTRIBUTE-DIMENSION-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ATTRIBUTE-DIMENSION.html CREATE OR REPLACE ATTRIBUTE DIMENSION time_attr_dim DIMENSION TYPE TIME USING time_dim ATTRIBUTES (year_id CLASSIFICATION caption VALUE 'YEAR_ID' CLASSIFICATION description VALUE 'YEAR ID', year_name CLASSIFICATION caption VALUE 'YEAR_NAME' CLASSIFICATION description VALUE 'Year', year_end_date CLASSIFICATION caption VALUE 'YEAR_END_DATE' CLASSIFICATION description VALUE 'Year End Date', quarter_id CLASSIFICATION caption VALUE 'QUARTER_ID' CLASSIFICATION description VALUE 'QUARTER ID', quarter_name CLASSIFICATION caption VALUE 'QUARTER_NAME' CLASSIFICATION description VALUE 'Quarter', quarter_end_date CLASSIFICATION caption VALUE 'QUARTER_END_DATE' CLASSIFICATION description VALUE 'Quarter End Date', quarter_of_year CLASSIFICATION caption VALUE 'QUARTER_OF_YEAR' CLASSIFICATION description VALUE 'Quarter of Year', month_id CLASSIFICATION caption VALUE 'MONTH_ID' CLASSIFICATION description VALUE 'MONTH ID', month_name CLASSIFICATION caption VALUE 'MONTH_NAME' CLASSIFICATION description VALUE 'Month', month_long_name CLASSIFICATION caption VALUE 'MONTH_LONG_NAME' CLASSIFICATION description VALUE 'Month Long Name', month_end_date CLASSIFICATION caption VALUE 'MONTH_END_DATE' CLASSIFICATION description VALUE 'Month End Date', month_of_quarter CLASSIFICATION caption VALUE 'MONTH_OF_QUARTER' CLASSIFICATION description VALUE 'Month of Quarter', month_of_year CLASSIFICATION caption VALUE 'MONTH_OF_YEAR' CLASSIFICATION description VALUE 'Month of Year', season CLASSIFICATION caption VALUE 'SEASON' CLASSIFICATION description VALUE 'Season', season_order CLASSIFICATION caption VALUE 'SEASON_ORDER' CLASSIFICATION description VALUE 'Season Order') LEVEL month LEVEL TYPE MONTHS CLASSIFICATION caption VALUE 'MONTH' CLASSIFICATION description VALUE 'Month' KEY month_id MEMBER NAME month_name MEMBER CAPTION month_name MEMBER DESCRIPTION month_long_name ORDER BY month_end_date DETERMINES (month_end_date, quarter_id, season, season_order, month_of_year, month_of_quarter) LEVEL quarter LEVEL TYPE QUARTERS CLASSIFICATION caption VALUE 'QUARTER' CLASSIFICATION description VALUE 'Quarter' KEY quarter_id MEMBER NAME quarter_name MEMBER CAPTION quarter_name MEMBER DESCRIPTION quarter_name ORDER BY quarter_end_date DETERMINES (quarter_end_date, quarter_of_year, year_id) LEVEL year LEVEL TYPE YEARS CLASSIFICATION caption VALUE 'YEAR' CLASSIFICATION description VALUE 'Year' KEY year_id MEMBER NAME year_name MEMBER CAPTION year_name MEMBER DESCRIPTION year_name ORDER BY year_end_date DETERMINES (year_end_date) LEVEL season LEVEL TYPE QUARTERS CLASSIFICATION caption VALUE 'SEASON' CLASSIFICATION description VALUE 'Season' KEY season MEMBER NAME season MEMBER CAPTION season MEMBER DESCRIPTION season LEVEL month_of_quarter LEVEL TYPE MONTHS CLASSIFICATION caption VALUE 'MONTH_OF_QUARTER' CLASSIFICATION description VALUE 'Month of Quarter' KEY month_of_quarter; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ATTRIBUTE-DIMENSION-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ATTRIBUTE-DIMENSION.html desc PRODUCT_DIM ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ATTRIBUTE-DIMENSION-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ATTRIBUTE-DIMENSION.html CREATE OR REPLACE ATTRIBUTE DIMENSION product_attr_dim USING product_dim ATTRIBUTES (department_id, department_name, category_id, category_name) LEVEL DEPARTMENT KEY department_id ALTERNATE KEY department_name MEMBER NAME department_name MEMBER CAPTION department_name ORDER BY department_name LEVEL CATEGORY KEY category_id ALTERNATE KEY category_name MEMBER NAME category_name MEMBER CAPTION category_name ORDER BY category_name DETERMINES(department_id) ALL MEMBER NAME 'ALL PRODUCTS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ATTRIBUTE-DIMENSION-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ATTRIBUTE-DIMENSION.html desc GEOGRAPHY_DIM ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ATTRIBUTE-DIMENSION-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ATTRIBUTE-DIMENSION.html CREATE OR REPLACE ATTRIBUTE DIMENSION geography_attr_dim USING geography_dim ATTRIBUTES (region_id, region_name, country_id, country_name, state_province_id, state_province_name) LEVEL REGION KEY region_id ALTERNATE KEY region_name MEMBER NAME region_name MEMBER CAPTION region_name ORDER BY region_name LEVEL COUNTRY KEY country_id ALTERNATE KEY country_name MEMBER NAME country_name MEMBER CAPTION country_name ORDER BY country_name DETERMINES(region_id) LEVEL STATE_PROVINCE KEY state_province_id ALTERNATE KEY state_province_name MEMBER NAME state_province_name MEMBER CAPTION state_province_name ORDER BY state_province_name DETERMINES(country_id) ALL MEMBER NAME 'ALL CUSTOMERS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html AUDIT POLICY mypolicy; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html AUDIT POLICY mypolicy WHENEVER NOT SUCCESSFUL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html AUDIT POLICY mypolicy; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY table_pol PRIVILEGES CREATE ANY TABLE, DROP ANY TABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html SELECT * FROM audit_unified_policies WHERE policy_name = 'TABLE_POL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY dml_pol ACTIONS DELETE on hr.employees, INSERT on hr.employees, UPDATE on hr.employees, ALL on hr.departments; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY read_dir_pol ACTIONS READ ON DIRECTORY bfile_dir; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html SELECT name FROM auditable_system_actions WHERE component = 'Standard' ORDER BY name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY security_pol ACTIONS ADMINISTER KEY MANAGEMENT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CONNECT hr_usr/hr_pwd@hr_pdb; PASSWORD ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY dir_pol ACTIONS READ DIRECTORY, WRITE DIRECTORY, EXECUTE DIRECTORY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html SELECT name FROM auditable_system_actions WHERE component = 'Datapump'; EXPORT ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY dp_actions_pol ACTIONS COMPONENT = datapump IMPORT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY java_pol ROLES java_admin, java_deploy; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY hr_admin_pol PRIVILEGES CREATE ANY TABLE, DROP ANY TABLE ACTIONS DELETE on hr.employees, INSERT on hr.employees, UPDATE on hr.employees, ALL on hr.departments, LOCK TABLE ROLES audit_admin, audit_viewer; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY order_updates_pol ACTIONS UPDATE ON oe.orders WHEN 'SYS_CONTEXT(''USERENV'', ''IDENTIFICATION_TYPE'') = ''EXTERNAL''' EVALUATE PER SESSION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY emp_updates_pol ACTIONS DELETE on hr.employees, INSERT on hr.employees, UPDATE on hr.employees WHEN 'UID NOT IN (100, 105, 107)' EVALUATE PER STATEMENT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY local_table_pol PRIVILEGES CREATE ANY TABLE, DROP ANY TABLE CONTAINER = CURRENT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY c##common_role1_pol ROLES c##role1 CONTAINER = ALL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html SELECT ACTION_NAME, UNIFIED_AUDIT_POLICIES, OBJECT_NAME FROM UNIFIED_AUDIT_TRAIL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html CREATE AUDIT POLICY pol ACTIONS INSERT(deptno) on scott.dept; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html SELECT name FROM auditable_system_actions WHERE component = 'Datapump'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html SELECT name FROM auditable_system_actions WHERE component = 'Direct path API'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html SELECT name FROM auditable_system_actions WHERE component = 'Label Security'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html SELECT name FROM auditable_system_actions WHERE component = 'XS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html SELECT name FROM auditable_system_actions WHERE component = 'Database Vault'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html AUDIT POLICY mypolicy; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE CLUSTER personnel (department NUMBER(4)) SIZE 512 STORAGE (initial 100K next 50K); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE INDEX idx_personnel ON CLUSTER personnel; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE INDEX emp_dept_index ON CLUSTER emp_dept TABLESPACE USERS STORAGE (INITIAL 50K NEXT 50K MINEXTENTS 2 MAXEXTENTS 10 PCTINCREASE 33); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html SELECT CLUSTER_NAME, TABLESPACE_NAME, CLUSTER_TYPE, PCT_INCREASE, MIN_EXTENTS, MAX_EXTENTS FROM USER_CLUSTERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html SELECT * FROM USER_CLU_COLUMNS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html SELECT INDEX_NAME, INDEX_TYPE, PCT_INCREASE, MIN_EXTENTS, MAX_EXTENTS FROM USER_INDEXES WHERE TABLE_NAME='EMP_DEPT'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE TABLE dept_10 CLUSTER personnel (department_id) AS SELECT * FROM employees WHERE department_id = 10; CREATE TABLE dept_20 CLUSTER personnel (department_id) AS SELECT * FROM employees WHERE department_id = 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE CLUSTER language (cust_language VARCHAR2(3)) SIZE 512 HASHKEYS 10 STORAGE (INITIAL 100k next 50k); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE CLUSTER address (postal_code NUMBER, country_id CHAR(2)) HASHKEYS 20 HASH IS MOD(postal_code + country_id, 101); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE CLUSTER cust_orders (customer_id NUMBER(6)) SIZE 512 SINGLE TABLE HASHKEYS 100; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE CLUSTER sales (amount_sold NUMBER, prod_id NUMBER) HASHKEYS 100000 HASH IS (amount_sold * 10 + prod_id) SIZE 300 TABLESPACE example PARTITION BY RANGE (amount_sold) (PARTITION p1 VALUES LESS THAN (2001), PARTITION p2 VALUES LESS THAN (4001), PARTITION p3 VALUES LESS THAN (6001), PARTITION p4 VALUES LESS THAN (8001), PARTITION p5 VALUES LESS THAN (MAXVALUE)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE CLUSTER emp_dept (deptno NUMBER(3)) SIZE 600 TABLESPACE USERS STORAGE (INITIAL 200K NEXT 300K MINEXTENTS 2 PCTINCREASE 33); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE TABLE dept ( deptno NUMBER(3) PRIMARY KEY) CLUSTER emp_dept (deptno); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CLUSTER-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CLUSTER.html CREATE TABLE empl ( emplno NUMBER(5) PRIMARY KEY, emplname VARCHAR2(15) NOT NULL, deptno NUMBER(3) REFERENCES dept) CLUSTER emp_dept (deptno); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CONTEXT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CONTEXT.html CREATE CONTEXT hr_context USING emp_mgmt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CONTEXT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CONTEXT.html CREATE VIEW hr_org_secure_view AS SELECT * FROM employees WHERE department_id = SYS_CONTEXT('hr_context', 'department_id'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-CONTROLFILE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-CONTROLFILE.html STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "demo" NORESETLOGS NOARCHIVELOG MAXLOGFILES 32 MAXLOGMEMBERS 2 MAXDATAFILES 32 MAXINSTANCES 1 MAXLOGHISTORY 449 LOGFILE GROUP 1 '/path/oracle/dbs/t_log1.f' SIZE 500K, GROUP 2 '/path/oracle/dbs/t_log2.f' SIZE 500K # STANDBY LOGFILE DATAFILE '/path/oracle/dbs/t_db1.f', '/path/oracle/dbs/dbu19i.dbf', '/path/oracle/dbs/tbs_11.f', '/path/oracle/dbs/smundo.dbf', '/path/oracle/dbs/demo.dbf' CHARACTER SET WE8DEC ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE.html CREATE DATABASE sample CONTROLFILE REUSE LOGFILE GROUP 1 ('diskx:log1.log', 'disky:log1.log') SIZE 50K, GROUP 2 ('diskx:log2.log', 'disky:log2.log') SIZE 50K MAXLOGFILES 5 MAXLOGHISTORY 100 MAXDATAFILES 10 MAXINSTANCES 2 ARCHIVELOG CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 DATAFILE 'disk1:df1.dbf' AUTOEXTEND ON, 'disk2:df2.dbf' AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED DEFAULT TEMPORARY TABLESPACE temp_ts UNDO TABLESPACE undo_ts SET TIME_ZONE = '+02:00'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE.html CREATE DATABASE newcdb USER SYS IDENTIFIED BY sys_password USER SYSTEM IDENTIFIED BY system_password LOGFILE GROUP 1 ('/u01/logs/my/redo01a.log','/u02/logs/my/redo01b.log') SIZE 100M BLOCKSIZE 512, GROUP 2 ('/u01/logs/my/redo02a.log','/u02/logs/my/redo02b.log') SIZE 100M BLOCKSIZE 512, GROUP 3 ('/u01/logs/my/redo03a.log','/u02/logs/my/redo03b.log') SIZE 100M BLOCKSIZE 512 MAXLOGHISTORY 1 MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 1024 CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 EXTENT MANAGEMENT LOCAL DATAFILE '/u01/app/oracle/oradata/newcdb/system01.dbf' SIZE 700M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED SYSAUX DATAFILE '/u01/app/oracle/oradata/newcdb/sysaux01.dbf' SIZE 550M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED DEFAULT TABLESPACE deftbs DATAFILE '/u01/app/oracle/oradata/newcdb/deftbs01.dbf' SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED DEFAULT TEMPORARY TABLESPACE tempts1 TEMPFILE '/u01/app/oracle/oradata/newcdb/temp01.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED UNDO TABLESPACE undotbs1 DATAFILE '/u01/app/oracle/oradata/newcdb/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED ENABLE PLUGGABLE DATABASE SEED FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/newcdb/', '/u01/app/oracle/oradata/pdbseed/') SYSTEM DATAFILES SIZE 125M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED SYSAUX DATAFILES SIZE 100M USER_DATA TABLESPACE usertbs DATAFILE '/u01/app/oracle/oradata/pdbseed/usertbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-LINK-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html CREATE PUBLIC DATABASE LINK remote USING 'remote'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-LINK-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html UPDATE employees@remote SET salary=salary*1.1 WHERE last_name = 'Baer'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-LINK-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html CREATE DATABASE LINK local CONNECT TO hr IDENTIFIED BY password USING 'local'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-LINK-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html SELECT * FROM employees@local; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-LINK-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html INSERT INTO employees@local (employee_id, last_name, email, hire_date, job_id) VALUES (999, 'Claus', 'sclaus@example.com', SYSDATE, 'SH_CLERK'); UPDATE jobs@local SET min_salary = 3000 WHERE job_id = 'SH_CLERK'; DELETE FROM employees@local WHERE employee_id = 999; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-LINK-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html SELECT * FROM oe.customers@local; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-LINK-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html CREATE DATABASE LINK remote.us.example.com CONNECT TO CURRENT_USER USING 'remote'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DATABASE-LINK-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html CREATE SYNONYM emp_table FOR oe.employees@remote.us.example.com; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DIMENSION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DIMENSION.html CREATE DIMENSION customers_dim LEVEL customer IS (customers.cust_id) LEVEL city IS (customers.cust_city) LEVEL state IS (customers.cust_state_province) LEVEL country IS (countries.country_id) LEVEL subregion IS (countries.country_subregion) LEVEL region IS (countries.country_region) HIERARCHY geog_rollup ( customer CHILD OF city CHILD OF state CHILD OF country CHILD OF subregion CHILD OF region JOIN KEY (customers.country_id) REFERENCES country ) ATTRIBUTE customer DETERMINES (cust_first_name, cust_last_name, cust_gender, cust_marital_status, cust_year_of_birth, cust_income_level, cust_credit_limit) ATTRIBUTE country DETERMINES (countries.country_name) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DIMENSION-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DIMENSION.html CREATE DIMENSION customers_dim LEVEL customer IS (customers.cust_id) LEVEL city IS (customers.cust_city) LEVEL state IS (customers.cust_state_province) LEVEL country IS (countries.country_id) LEVEL subregion IS (countries.country_subregion) LEVEL region IS (countries.country_region) HIERARCHY geog_rollup ( customer CHILD OF city CHILD OF state CHILD OF country CHILD OF subregion CHILD OF region JOIN KEY (customers.country_id) REFERENCES country ) ATTRIBUTE customer_info LEVEL customer DETERMINES (cust_first_name, cust_last_name, cust_gender, cust_marital_status, cust_year_of_birth, cust_income_level, cust_credit_limit) ATTRIBUTE country DETERMINES (countries.country_name); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DIMENSION-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DIMENSION.html CREATE DIMENSION customers_dim LEVEL customer IS (customers.cust_id) LEVEL status IS (customers.cust_marital_status) SKIP WHEN NULL LEVEL city IS (customers.cust_city) LEVEL state IS (customers.cust_state_province) LEVEL country IS (countries.country_id) LEVEL subregion IS (countries.country_subregion) SKIP WHEN NULL LEVEL region IS (countries.country_region) HIERARCHY geog_rollup ( customer CHILD OF city CHILD OF state CHILD OF country CHILD OF subregion CHILD OF region JOIN KEY (customers.country_id) REFERENCES country ) ATTRIBUTE customer DETERMINES (cust_first_name, cust_last_name, cust_gender, cust_marital_status, cust_year_of_birth, cust_income_level, cust_credit_limit) ATTRIBUTE country DETERMINES (countries.country_name) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DIRECTORY-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DIRECTORY.html CREATE DIRECTORY mydir AS '/scratch/data/file_data'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DIRECTORY-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DIRECTORY.html CREATE DIRECTORY mydir AS '/scratch/../file_data'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DIRECTORY-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DIRECTORY.html CREATE DIRECTORY admin AS '/disk1/oracle/admin'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DIRECTORY-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DIRECTORY.html CREATE OR REPLACE DIRECTORY bfile_dir AS '/usr/bin/bfile_dir'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-DISKGROUP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DISKGROUP.html CREATE DISKGROUP dgroup_01 EXTERNAL REDUNDANCY DISK '/devices/disks/c*'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-EDITION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-EDITION.html GRANT CREATE ANY EDITION, DROP ANY EDITION to HR; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-EDITION-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-EDITION.html CREATE EDITION test_ed; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-EDITION-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-EDITION.html SELECT SYS_CONTEXT('userenv', 'current_edition_name') FROM DUAL; CREATE EDITIONING VIEW e_view AS SELECT last_name, first_name, email FROM employees; DESCRIBE e_view ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-EDITION-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-EDITION.html ALTER SESSION SET EDITION = TEST_ED; CREATE OR REPLACE EDITIONING VIEW e_view AS SELECT last_name, first_name, email, salary FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-EDITION-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-EDITION.html DESCRIBE e_view ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-EDITION-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-EDITION.html ALTER SESSION SET EDITION = ora$base; DESCRIBE e_view; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-EDITION-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-EDITION.html ALTER SESSION SET EDITION = TEST_ED; DROP VIEW e_view; ALTER SESSION SET EDITION = ORA$BASE; DESCRIBE e_view; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-EDITION-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-EDITION.html DROP EDITION TEST_ED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-FLASHBACK-ARCHIVE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-FLASHBACK-ARCHIVE.html CREATE FLASHBACK ARCHIVE DEFAULT test_archive1 TABLESPACE example QUOTA 1 M RETENTION 1 DAY; CREATE FLASHBACK ARCHIVE test_archive2 TABLESPACE example QUOTA 1 M RETENTION 1 DAY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-FLASHBACK-ARCHIVE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-FLASHBACK-ARCHIVE.html ALTER TABLE oe.customers FLASHBACK ARCHIVE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-FLASHBACK-ARCHIVE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-FLASHBACK-ARCHIVE.html ALTER TABLE oe.orders FLASHBACK ARCHIVE test_archive2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-FLASHBACK-ARCHIVE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-FLASHBACK-ARCHIVE.html DROP FLASHBACK ARCHIVE test_archive2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-HIERARCHY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-HIERARCHY.html CREATE OR REPLACE HIERARCHY time_hier -- Hierarchy name USING time_attr_dim -- Refers to TIME_ATTR_DIM attribute dimension (month CHILD OF -- Months in the attribute dimension quarter CHILD OF year); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-HIERARCHY-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-HIERARCHY.html CREATE OR REPLACE HIERARCHY product_hier USING product_attr_dim (category CHILD OF department); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-HIERARCHY-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-HIERARCHY.html CREATE OR REPLACE HIERARCHY geography_hier USING geography_attr_dim (state_province CHILD OF country CHILD OF region); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE MULTIVALUE INDEX mvi_1 ON mytable t (t.jcol.credit_score.numberOnly()); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX area_index ON xwarehouses e (EXTRACTVALUE(VALUE(e),'/Warehouse/Area')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html SELECT e.getClobVal() AS warehouse FROM xwarehouses e WHERE EXISTSNODE(VALUE(e),'/Warehouse[Area>50000]') = 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX upper_ix ON employees (UPPER(last_name)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html SELECT first_name, last_name FROM employees WHERE UPPER(last_name) IS NOT NULL ORDER BY UPPER(last_name); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX income_ix ON employees(salary + (salary*commission_pct)); SELECT first_name||' '||last_name "Name" FROM employees WHERE (salary*commission_pct) + salary > 15000 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX src_idx ON print_media(text_length(ad_sourcetext)); SELECT product_id FROM print_media WHERE text_length(ad_sourcetext) < 1000 ORDER BY product_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE TYPE rectangle AS OBJECT ( length NUMBER, width NUMBER, MEMBER FUNCTION area RETURN NUMBER DETERMINISTIC ); CREATE OR REPLACE TYPE BODY rectangle AS MEMBER FUNCTION area RETURN NUMBER IS BEGIN RETURN (length*width); END; END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE TABLE rect_tab OF rectangle; CREATE INDEX area_idx ON rect_tab x (x.area()); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html SELECT * FROM rect_tab x WHERE x.area() > 100; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE UNIQUE INDEX promo_ix ON orders (CASE WHEN promotion_id =2 THEN customer_id ELSE NULL END, CASE WHEN promotion_id = 2 THEN promotion_id ELSE NULL END); INSERT INTO orders (order_id, order_date, customer_id, order_total, promotion_id) VALUES (2459, systimestamp, 106, 251, 2); INSERT INTO orders (order_id, order_date, customer_id, order_total, promotion_id) VALUES (2460, systimestamp+1, 106, 110, 2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX cost_ix ON sales (amount_sold) GLOBAL PARTITION BY RANGE (amount_sold) (PARTITION p1 VALUES LESS THAN (1000), PARTITION p2 VALUES LESS THAN (2500), PARTITION p3 VALUES LESS THAN (MAXVALUE)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX cust_last_name_ix ON customers (cust_last_name) GLOBAL PARTITION BY HASH (cust_last_name) PARTITIONS 4; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX prod_idx ON hash_products(category_id) LOCAL STORE IN (tbs_01, tbs_02); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX sales_ix ON composite_sales(time_id, prod_id) STORAGE (INITIAL 1M) LOCAL (PARTITION q1_1998, PARTITION q2_1998, PARTITION q3_1998, PARTITION q4_1998, PARTITION q1_1999, PARTITION q2_1999, PARTITION q3_1999, PARTITION q4_1999, PARTITION q1_2000, PARTITION q2_2000 (SUBPARTITION pq2001, SUBPARTITION pq2002, SUBPARTITION pq2003, SUBPARTITION pq2004, SUBPARTITION pq2005, SUBPARTITION pq2006, SUBPARTITION pq2007, SUBPARTITION pq2008), PARTITION q3_2000 (SUBPARTITION c1 TABLESPACE tbs_02, SUBPARTITION c2 TABLESPACE tbs_02, SUBPARTITION c3 TABLESPACE tbs_02, SUBPARTITION c4 TABLESPACE tbs_02, SUBPARTITION c5 TABLESPACE tbs_02), PARTITION q4_2000 (SUBPARTITION pq4001 TABLESPACE tbs_03, SUBPARTITION pq4002 TABLESPACE tbs_03, SUBPARTITION pq4003 TABLESPACE tbs_03, SUBPARTITION pq4004 TABLESPACE tbs_03) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE BITMAP INDEX product_bm_ix ON hash_products(list_price) LOCAL(PARTITION ix_p1 TABLESPACE tbs_01, PARTITION ix_p2, PARTITION ix_p3 TABLESPACE tbs_02, PARTITION ix_p4 TABLESPACE tbs_03) TABLESPACE tbs_04; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE TABLE hash_products ( product_id NUMBER(6) , product_name VARCHAR2(50) , product_description VARCHAR2(2000) , category_id NUMBER(2) , weight_class NUMBER(1) , warranty_period INTERVAL YEAR TO MONTH , supplier_id NUMBER(6) , product_status VARCHAR2(20) , list_price NUMBER(8,2) , min_price NUMBER(8,2) , catalog_url VARCHAR2(50) , CONSTRAINT pk_product_id PRIMARY KEY (product_id) , CONSTRAINT product_status_lov_demo CHECK (product_status in ('orderable' ,'planned' ,'under development' ,'obsolete') ) ) PARTITION BY HASH (product_id) PARTITIONS 5 STORE IN (example); CREATE TABLE sales_quota ( product_id NUMBER(6) , customer_name VARCHAR2(50) , order_qty NUMBER(6) ,CONSTRAINT u_product_id UNIQUE(product_id) ); CREATE BITMAP INDEX product_bm_ix ON hash_products(list_price) FROM hash_products h, sales_quota s WHERE h.product_id = s.product_id LOCAL(PARTITION ix_p1 TABLESPACE example, PARTITION ix_p2, PARTITION ix_p3 TABLESPACE example, PARTITION ix_p4, PARTITION ix_p5 TABLESPACE example) TABLESPACE example; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE UNIQUE INDEX nested_tab_ix ON textdocs_nestedtab(NESTED_TABLE_ID, document_typ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX salary_i ON books (TREAT(author AS employee_t).salary); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX salary_func_i ON persons p (TREAT(VALUE(p) AS part_time_emp_t).salary); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE BITMAP INDEX typeid_i ON books (SYS_TYPEID(author)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX cust_eff_ix ON customers (NVL(cust_eff_to, TO_DATE('9000-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss'))); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html SELECT column_expression FROM all_ind_expressions WHERE index_name='CUST_EFF_IX'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX ord_customer_ix ON orders (customer_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX ord_customer_ix_demo ON orders (customer_id, sales_rep_id) COMPRESS 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX ord_customer_ix_demo ON orders (order_mode) NOSORT NOLOGGING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEX-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEX.html CREATE INDEX idx_personnel ON CLUSTER personnel; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INDEXTYPE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INDEXTYPE.html CREATE INDEXTYPE position_indextype FOR position_between(NUMBER, NUMBER, NUMBER) USING position_im; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INMEMORY-JOIN-GROUP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INMEMORY-JOIN-GROUP.html CREATE INMEMORY JOIN GROUP prod_id1 (inventories(product_id), order_items(product_id)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-INMEMORY-JOIN-GROUP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-INMEMORY-JOIN-GROUP.html CREATE INMEMORY JOIN GROUP prod_id2 (inventories(product_id), pm.online_media(product_id)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-JAVA-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-JAVA.html SELECT LOB FROM CREATE$JAVA$LOB$TABLE WHERE NAME = 'key_for_BLOB'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-JAVA-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-JAVA.html CREATE JAVA CLASS USING BFILE (java_dir, 'Agent.class') / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-JAVA-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-JAVA.html CREATE JAVA SOURCE NAMED "Welcome" AS public class Welcome { public static String welcome() { return "Welcome World"; } }/ ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-JAVA-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-JAVA.html CREATE JAVA RESOURCE NAMED "appText" USING BFILE (java_dir, 'textBundle.dat') / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-LOCKDOWN-PROFILE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-LOCKDOWN-PROFILE.html CREATE LOCKDOWN PROFILE hr_prof INCLUDING PRIVATE_DBAAS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW mv1 AS SELECT * FROM hr.employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW foreign_customers AS SELECT * FROM sh.customers@remote cu WHERE EXISTS (SELECT * FROM sh.countries@remote co WHERE co.country_id = cu.country_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW my_warranty_orders AS SELECT w.order_id, w.line_item_id, o.order_date FROM warranty_orders w, orders o WHERE o.order_id = o.order_id AND o.sales_rep_id = 165; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW MView1 ANNOTATIONS (Title 'Tab1 MV1', ADD Snapshot) AS SELECT * from Table1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW MView1(T ANNOTATIONS (Hidden)) ANNOTATIONS (Title 'Tab1 MV1', ADD Snapshot) AS SELECT * from Table1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW LOG ON times WITH ROWID, SEQUENCE (time_id, calendar_year) INCLUDING NEW VALUES; CREATE MATERIALIZED VIEW LOG ON products WITH ROWID, SEQUENCE (prod_id) INCLUDING NEW VALUES; CREATE MATERIALIZED VIEW sales_mv BUILD IMMEDIATE REFRESH FAST ON COMMIT AS SELECT t.calendar_year, p.prod_id, SUM(s.amount_sold) AS sum_sales FROM times t, products p, sales s WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id GROUP BY t.calendar_year, p.prod_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW sales_by_month_by_state TABLESPACE example PARALLEL 4 BUILD IMMEDIATE REFRESH COMPLETE ENABLE QUERY REWRITE AS SELECT t.calendar_month_desc, c.cust_state_province, SUM(s.amount_sold) AS sum_sales FROM times t, sales s, customers c WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id GROUP BY t.calendar_month_desc, c.cust_state_province; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE TABLE sales_sum_table (month VARCHAR2(8), state VARCHAR2(40), sales NUMBER(10,2)); CREATE MATERIALIZED VIEW sales_sum_table ON PREBUILT TABLE WITH REDUCED PRECISION ENABLE QUERY REWRITE AS SELECT t.calendar_month_desc AS month, c.cust_state_province AS state, SUM(s.amount_sold) AS sales FROM times t, customers c, sales s WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id GROUP BY t.calendar_month_desc, c.cust_state_province; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW catalog REFRESH FAST START WITH SYSDATE NEXT SYSDATE + 1/4096 WITH PRIMARY KEY AS SELECT * FROM product_information; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW order_data REFRESH WITH ROWID AS SELECT * FROM orders; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW LOG ON employees WITH PRIMARY KEY INCLUDING NEW VALUES; CREATE MATERIALIZED VIEW emp_data PCTFREE 5 PCTUSED 60 TABLESPACE example STORAGE (INITIAL 50K) REFRESH FAST NEXT sysdate + 7 AS SELECT * FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW all_customers PCTFREE 5 PCTUSED 60 TABLESPACE example STORAGE (INITIAL 50K) USING INDEX STORAGE (INITIAL 25K) REFRESH START WITH ROUND(SYSDATE + 1) + 11/24 NEXT NEXT_DAY(TRUNC(SYSDATE), 'MONDAY') + 15/24 AS SELECT * FROM sh.customers@remote UNION SELECT * FROM sh.customers@local; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW.html CREATE MATERIALIZED VIEW LOG ON inventories WITH (quantity_on_hand); CREATE MATERIALIZED VIEW warranty_orders REFRESH FAST AS SELECT order_id, line_item_id, product_id FROM order_items o WHERE EXISTS (SELECT * FROM inventories i WHERE o.product_id = i.product_id AND i.quantity_on_hand IS NOT NULL) UNION SELECT order_id, line_item_id, product_id FROM order_items WHERE quantity > 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG.html CREATE MATERIALIZED VIEW LOG ON customers PCTFREE 5 TABLESPACE example STORAGE (INITIAL 10K); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG.html CREATE MATERIALIZED VIEW LOG ON customers WITH PRIMARY KEY, ROWID; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG.html CREATE MATERIALIZED VIEW LOG ON orders PCTFREE 5 TABLESPACE example STORAGE (INITIAL 10K) PURGE REPEAT INTERVAL '5' DAY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG.html CREATE MATERIALIZED VIEW LOG ON sales WITH ROWID, SEQUENCE(amount_sold, time_id, prod_id) INCLUDING NEW VALUES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG.html CREATE MATERIALIZED VIEW LOG ON order_items WITH (product_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG.html CREATE MATERIALIZED VIEW LOG ON product_information WITH ROWID, SEQUENCE (list_price, min_price, category_id), PRIMARY KEY INCLUDING NEW VALUES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG.html CREATE MATERIALIZED VIEW products_mv REFRESH FAST ON COMMIT AS SELECT SUM(list_price - min_price), category_id FROM product_information GROUP BY category_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-VIEW-LOG.html CREATE MATERIALIZED VIEW LOG ON sales PCTFREE 5 TABLESPACE example STORAGE (INITIAL 10K) FOR SYNCHRONOUS REFRESH USING mystage_log; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-ZONEMAP-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-ZONEMAP.html CREATE MATERIALIZED ZONEMAP sales_zmap ON sales(cust_id, prod_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-ZONEMAP-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-ZONEMAP.html CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(rowid), MIN(cust_id), MAX(cust_id), MIN(prod_id), MAX(prod_id) FROM sales GROUP BY SYS_OP_ZONE_ID(rowid); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-ZONEMAP-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-ZONEMAP.html CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(s.rowid), MIN(cust_state_province), MAX(cust_state_province), MIN(cust_city), MAX(cust_city) FROM sales s LEFT OUTER JOIN customers c ON s.cust_id = c.cust_id GROUP BY SYS_OP_ZONE_ID(s.rowid); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-ZONEMAP-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-ZONEMAP.html CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(s.rowid), MIN(prod_category), MAX(prod_category), MIN(prod_subcategory), MAX(prod_subcategory), MIN(country_id), MAX(country_id), MIN(cust_state_province), MAX(cust_state_province), MIN(cust_city), MAX(cust_city) FROM sales s LEFT OUTER JOIN products p ON s.prod_id = p.prod_id LEFT OUTER JOIN customers c ON s.cust_id = c.cust_id GROUP BY sys_op_zone_id(s.rowid); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-MATERIALIZED-ZONEMAP-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-MATERIALIZED-ZONEMAP.html CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(s.rowid), MIN(prod_category), MAX(prod_category), MIN(prod_subcategory), MAX(prod_subcategory), MIN(country_id), MAX(country_id), MIN(cust_state_province), MAX(cust_state_province), MIN(cust_city), MAX(cust_city) FROM sales s, products p, customers c WHERE s.prod_id = p.prod_id(+) AND s.cust_id = c.cust_id(+) GROUP BY sys_op_zone_id(s.rowid); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-OPERATOR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-OPERATOR.html CREATE FUNCTION eq_f(a VARCHAR2, b VARCHAR2) RETURN NUMBER AS BEGIN IF a = b THEN RETURN 1; ELSE RETURN 0; END IF; END; / CREATE OPERATOR eq_op BINDING (VARCHAR2, VARCHAR2) RETURN NUMBER USING eq_f; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-OUTLINE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-OUTLINE.html CREATE OUTLINE salaries FOR CATEGORY special ON SELECT last_name, salary FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-OUTLINE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-OUTLINE.html CREATE OR REPLACE PRIVATE OUTLINE my_salaries FROM salaries; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-OUTLINE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-OUTLINE.html CREATE OR REPLACE OUTLINE public_salaries FROM PRIVATE my_salaries; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PFILE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PFILE.html CREATE PFILE = 'my_init.ora' FROM SPFILE = 's_params.ora'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PLUGGABLE-DATABASE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PLUGGABLE-DATABASE.html CREATE PLUGGABLE DATABASE newpdb FROM salespdb FILE_NAME_CONVERT = ('/disk1/oracle/dbs/salespdb/', '/disk1/oracle/dbs/newpdb/') PATH_PREFIX = '/disk1/oracle/dbs/newpdb'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PLUGGABLE-DATABASE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PLUGGABLE-DATABASE.html CREATE PLUGGABLE DATABASE salespdb USING '/disk1/usr/salespdb.xml' SOURCE_FILE_NAME_CONVERT = ('/disk1/oracle/dbs/salespdb/', '/disk2/oracle/dbs/salespdb/') NOCOPY STORAGE (MAXSIZE 2G) TEMPFILE REUSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PLUGGABLE-DATABASE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PLUGGABLE-DATABASE.html CREATE PLUGGABLE DATABASE CDB1_PDB2_C AS CLONE USING '/tmp/cdb1_pdb2.pdb' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PLUGGABLE-DATABASE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PLUGGABLE-DATABASE.html ALTER PLUGGABLE DATABASE cdb1_pdb3 OPEN ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PLUGGABLE-DATABASE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PLUGGABLE-DATABASE.html SELECT partition_name, high_value FROM dba_tab_partitions WHERE table_name='MAP' AND table_owner='SYS' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PLUGGABLE-DATABASE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PLUGGABLE-DATABASE.html CREATE PLUGGABLE DATABASE salespdb ADMIN USER salesadm IDENTIFIED BY password ROLES = (dba) DEFAULT TABLESPACE sales DATAFILE '/disk1/oracle/dbs/salespdb/sales01.dbf' SIZE 250M AUTOEXTEND ON FILE_NAME_CONVERT = ('/disk1/oracle/dbs/pdbseed/', '/disk1/oracle/dbs/salespdb/') STORAGE (MAXSIZE 2G) PATH_PREFIX = '/disk1/oracle/dbs/salespdb/'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PROFILE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PROFILE.html CREATE MANDATORY PROFILE c##cdb_profile LIMIT PASSWORD_VERIFY_FUNCTION my_mandatory_function CONTAINER = ALL ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PROFILE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PROFILE.html ALTER SYSTEM SET MANDATORY_USER_PROFILE=c##cdb_profile; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PROFILE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PROFILE.html CREATE PROFILE usr_prof LIMIT PASSWORD_ROLLOVER_TIME 1 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PROFILE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PROFILE.html CREATE PROFILE new_profile LIMIT PASSWORD_REUSE_MAX 10 PASSWORD_REUSE_TIME 30; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PROFILE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PROFILE.html CREATE PROFILE app_user LIMIT SESSIONS_PER_USER UNLIMITED CPU_PER_SESSION UNLIMITED CPU_PER_CALL 3000 CONNECT_TIME 45 LOGICAL_READS_PER_SESSION DEFAULT LOGICAL_READS_PER_CALL 1000 PRIVATE_SGA 15K COMPOSITE_LIMIT 5000000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-PROFILE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-PROFILE.html CREATE PROFILE app_user2 LIMIT FAILED_LOGIN_ATTEMPTS 5 PASSWORD_LIFE_TIME 60 PASSWORD_REUSE_TIME 60 PASSWORD_REUSE_MAX 5 PASSWORD_VERIFY_FUNCTION ora12c_verify_function PASSWORD_LOCK_TIME 1/24 PASSWORD_GRACE_TIME 10 INACTIVE_ACCOUNT_TIME 30; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-RESTORE-POINT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-RESTORE-POINT.html CREATE RESTORE POINT good_data; SELECT salary FROM employees WHERE employee_id = 108; UPDATE employees SET salary = salary*10 WHERE employee_id = 108; SELECT salary FROM employees WHERE employee_id = 108; COMMIT; FLASHBACK TABLE employees TO RESTORE POINT good_data; SELECT salary FROM employees WHERE employee_id = 108; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ROLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ROLE.html CREATE ROLE widget_sales_role IDENTIFIED GLOBALLY AS 'AZURE_ROLE=WidgetManagerGroup'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ROLE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ROLE.html CREATE ROLE dw_manager; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ROLE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ROLE.html CREATE ROLE dw_manager IDENTIFIED BY warehouse; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ROLE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ROLE.html CREATE ROLE warehouse_user IDENTIFIED GLOBALLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ROLE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ROLE.html CREATE ROLE warehouse_user IDENTIFIED EXTERNALLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ROLE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ROLE.html CREATE ROLE role1 CONTAINER = CURRENT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ROLE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ROLE.html CREATE ROLE c##role1 CONTAINER = ALL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ROLLBACK-SEGMENT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ROLLBACK-SEGMENT.html CREATE TABLESPACE rbs_ts DATAFILE 'rbs01.dbf' SIZE 10M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 100K; CREATE ROLLBACK SEGMENT rbs_one TABLESPACE rbs_ts; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-ROLLBACK-SEGMENT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-ROLLBACK-SEGMENT.html CREATE ROLLBACK SEGMENT rbs_one TABLESPACE rbs_ts STORAGE ( INITIAL 10K ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SCHEMA-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SCHEMA.html CREATE SCHEMA AUTHORIZATION oe CREATE TABLE new_product (color VARCHAR2(10) PRIMARY KEY, quantity NUMBER) CREATE VIEW new_product_view AS SELECT color, quantity FROM new_product WHERE color = 'RED' GRANT select ON new_product_view TO hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SEQUENCE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SEQUENCE.html SELECT mysequence.nextval FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SEQUENCE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SEQUENCE.html SELECT mysequence.nextval FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SEQUENCE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SEQUENCE.html CREATE SEQUENCE customers_seq START WITH 1000 INCREMENT BY 1 NOCACHE NOCYCLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SPFILE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SPFILE.html CREATE SPFILE FROM PFILE = '$ORACLE_HOME/work/t_init1.ora'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SPFILE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SPFILE.html STARTUP ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SPFILE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SPFILE.html CREATE SPFILE = 's_params.ora' FROM PFILE = '$ORACLE_HOME/work/t_init1.ora'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SPFILE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SPFILE.html STARTUP PFILE=new_param.ora ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SYNONYM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SYNONYM.html CREATE SYNONYM offices FOR hr.locations; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SYNONYM-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SYNONYM.html CREATE PUBLIC SYNONYM emp_table FOR hr.employees@remote.us.example.com; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SYNONYM-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SYNONYM.html CREATE PUBLIC SYNONYM customers FOR oe.customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SYNONYM-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SYNONYM.html SELECT COUNT(*) FROM customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SYNONYM-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SYNONYM.html SELECT COUNT(*) FROM oe.customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-SYNONYM-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-SYNONYM.html SELECT COUNT(*) FROM customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html create or replace trigger t1_t before insert or update on t1 for each row begin :new.c2 := NULL; end; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE IMMUTABLE TABLE trade_ledger (tr_id NUMBER, user_name VARCHAR2(40), tr_value NUMBER) NO DROP UNTIL 40 DAYS IDLE NO DELETE UNTIL 100 DAYS AFTER INSERT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE j_purchaseorder (id VARCHAR2 (32) NOT NULL PRIMARY KEY, date_loaded TIMESTAMP (6) WITH TIME ZONE, po_document JSON ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE SHARDED TABLE departments ( department_id NUMBER(6) , department_name VARCHAR2(30) CONSTRAINT dept_name_nn NOT NULL , manager_id NUMBER(6) , location_id NUMBER(4) , CONSTRAINT dept_id_pk PRIMARY KEY(department_id) ) PARTITION BY DIRECTORY (department_id) ( PARTITION p_1 TABLESPACE tbs1, PARTITION p_2 TABLESPACE tbs2 ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE staging_table (col1 number, col2 varchar2(100)) FOR STAGING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE part_staging_table (col1 number, col2 varchar2(100)) PARTITION BY RANGE (col1) (PARTITION p1 VALUES LESS THAN (100), PARTITION pmax VALUES LESS THAN (MAXVALUE)) FOR STAGING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE employees_demo ( employee_id NUMBER(6) , first_name VARCHAR2(20) , last_name VARCHAR2(25) CONSTRAINT emp_last_name_nn_demo NOT NULL , email VARCHAR2(25) CONSTRAINT emp_email_nn_demo NOT NULL , phone_number VARCHAR2(20) , hire_date DATE DEFAULT SYSDATE CONSTRAINT emp_hire_date_nn_demo NOT NULL , job_id VARCHAR2(10) CONSTRAINT emp_job_nn_demo NOT NULL , salary NUMBER(8,2) CONSTRAINT emp_salary_nn_demo NOT NULL , commission_pct NUMBER(2,2) , manager_id NUMBER(6) , department_id NUMBER(4) , dn VARCHAR2(300) , CONSTRAINT emp_salary_min_demo CHECK (salary > 0) , CONSTRAINT emp_email_uk_demo UNIQUE (email) ) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE employees_demo ( employee_id NUMBER(6) , first_name VARCHAR2(20) , last_name VARCHAR2(25) CONSTRAINT emp_last_name_nn_demo NOT NULL , email VARCHAR2(25) CONSTRAINT emp_email_nn_demo NOT NULL , phone_number VARCHAR2(20) , hire_date DATE DEFAULT SYSDATE CONSTRAINT emp_hire_date_nn_demo NOT NULL , job_id VARCHAR2(10) CONSTRAINT emp_job_nn_demo NOT NULL , salary NUMBER(8,2) CONSTRAINT emp_salary_nn_demo NOT NULL , commission_pct NUMBER(2,2) , manager_id NUMBER(6) , department_id NUMBER(4) , dn VARCHAR2(300) , CONSTRAINT emp_salary_min_demo CHECK (salary > 0) , CONSTRAINT emp_email_uk_demo UNIQUE (email) ) TABLESPACE example STORAGE (INITIAL 8M); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE myemp (employee_id number, last_name varchar2(25), department_id NUMBER DEFAULT ON NULL 50 NOT NULL); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html SELECT employee_id, last_name, department_id FROM employees WHERE department_id IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html INSERT INTO myemp (employee_id, last_name, department_id) (SELECT employee_id, last_name, department_id from employees); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html SELECT employee_id, last_name, department_id FROM myemp WHERE employee_id = 178; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE t1 (id NUMBER GENERATED AS IDENTITY); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE t2 (id NUMBER GENERATED BY DEFAULT AS IDENTITY (START WITH 100 INCREMENT BY 10)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE GLOBAL TEMPORARY TABLE today_sales ON COMMIT PRESERVE ROWS AS SELECT * FROM orders WHERE order_date = SYSDATE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE later (col1 NUMBER, col2 VARCHAR2(20)) SEGMENT CREATION DEFERRED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TYPE person_t AS OBJECT (name VARCHAR2(100), ssn NUMBER) NOT FINAL; / CREATE TYPE employee_t UNDER person_t (department_id NUMBER, salary NUMBER) NOT FINAL; / CREATE TYPE part_time_emp_t UNDER employee_t (num_hrs NUMBER); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE persons OF person_t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE books (title VARCHAR2(100), author person_t); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE dept_80 PARALLEL AS SELECT * FROM employees WHERE department_id = 80; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE dept_80 AS SELECT * FROM employees WHERE department_id = 80; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE departments_demo ( department_id NUMBER(4) , department_name VARCHAR2(30) CONSTRAINT dept_name_nn NOT NULL , manager_id NUMBER(6) , location_id NUMBER(4) , dn VARCHAR2(300) ) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE departments_demo ( department_id NUMBER(4) PRIMARY KEY DISABLE , department_name VARCHAR2(30) CONSTRAINT dept_name_nn NOT NULL , manager_id NUMBER(6) , location_id NUMBER(4) , dn VARCHAR2(300) ) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE print_media ( product_id NUMBER(6) , ad_id NUMBER(6) , ad_composite BLOB , ad_sourcetext CLOB , ad_finaltext CLOB , ad_fltextn NCLOB , ad_textdocs_ntab textdoc_tab , ad_photo BLOB , ad_graphic BFILE , ad_header adheader_typ ) NESTED TABLE ad_textdocs_ntab STORE AS textdocs_nestedtab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TYPE phone AS OBJECT (telephone NUMBER); / CREATE TYPE phone_list AS TABLE OF phone; / CREATE TYPE my_customers AS OBJECT ( cust_name VARCHAR2(25), phones phone_list); / CREATE TYPE customer_list AS TABLE OF my_customers; / CREATE TABLE business_contacts ( company_name VARCHAR2(25), company_reps customer_list) NESTED TABLE company_reps STORE AS outer_ntab (NESTED TABLE phones STORE AS inner_ntab); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TYPE phone AS TABLE OF NUMBER; / CREATE TYPE phone_list AS TABLE OF phone; / CREATE TABLE my_customers ( name VARCHAR2(25), phone_numbers phone_list) NESTED TABLE phone_numbers STORE AS outer_ntab (NESTED TABLE COLUMN_VALUE STORE AS inner_ntab); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE print_media_new ( product_id NUMBER(6) , ad_id NUMBER(6) , ad_composite BLOB , ad_sourcetext CLOB , ad_finaltext CLOB , ad_fltextn NCLOB , ad_textdocs_ntab textdoc_tab , ad_photo BLOB , ad_graphic BFILE , ad_header adheader_typ ) NESTED TABLE ad_textdocs_ntab STORE AS textdocs_nestedtab_new LOB (ad_sourcetext, ad_finaltext) STORE AS (TABLESPACE example STORAGE (INITIAL 6144) CHUNK 4000 NOCACHE LOGGING); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE countries_demo ( country_id CHAR(2) CONSTRAINT country_id_nn_demo NOT NULL , country_name VARCHAR2(40) , currency_name VARCHAR2(25) , currency_symbol VARCHAR2(3) , region VARCHAR2(15) , CONSTRAINT country_c_id_pk_demo PRIMARY KEY (country_id ) ) ORGANIZATION INDEX INCLUDING country_name PCTTHRESHOLD 2 STORAGE ( INITIAL 4K ) OVERFLOW STORAGE ( INITIAL 4K ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE dept_external ( deptno NUMBER(6), dname VARCHAR2(20), loc VARCHAR2(25) ) ORGANIZATION EXTERNAL (TYPE oracle_loader DEFAULT DIRECTORY admin ACCESS PARAMETERS ( RECORDS DELIMITED BY newline BADFILE 'ulcase1.bad' DISCARDFILE 'ulcase1.dis' LOGFILE 'ulcase1.log' SKIP 20 FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' ( deptno INTEGER EXTERNAL(6), dname CHAR(20), loc CHAR(25) ) ) LOCATION ('ulcase1.ctl') ) REJECT LIMIT UNLIMITED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE xwarehouses OF XMLTYPE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE xwarehouses OF XMLTYPE XMLSCHEMA "http://www.example.com/xwarehouses.xsd" ELEMENT "Warehouse"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-39.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE xwarehouses ( warehouse_id NUMBER, warehouse_spec XMLTYPE) XMLTYPE warehouse_spec STORE AS CLOB (TABLESPACE example STORAGE (INITIAL 6144) CHUNK 4000 NOCACHE LOGGING); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE xwarehouses ( warehouse_id NUMBER, warehouse_spec XMLTYPE) XMLTYPE warehouse_spec STORE AS OBJECT RELATIONAL XMLSCHEMA "http://www.example.com/xwarehouses.xsd" ELEMENT "Warehouse"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE xwarehouses ( warehouse_id NUMBER, warehouse_spec XMLTYPE) XMLTYPE warehouse_spec STORE AS SECUREFILE CLOB (TABLESPACE auto_seg_ts STORAGE (INITIAL 6144) CACHE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE range_sales ( prod_id NUMBER(6) , cust_id NUMBER , time_id DATE , channel_id CHAR(1) , promo_id NUMBER(6) , quantity_sold NUMBER(3) , amount_sold NUMBER(10,2) ) PARTITION BY RANGE (time_id) (PARTITION SALES_Q1_1998 VALUES LESS THAN (TO_DATE('01-APR-1998','DD-MON-YYYY')), PARTITION SALES_Q2_1998 VALUES LESS THAN (TO_DATE('01-JUL-1998','DD-MON-YYYY')), PARTITION SALES_Q3_1998 VALUES LESS THAN (TO_DATE('01-OCT-1998','DD-MON-YYYY')), PARTITION SALES_Q4_1998 VALUES LESS THAN (TO_DATE('01-JAN-1999','DD-MON-YYYY')), PARTITION SALES_Q1_1999 VALUES LESS THAN (TO_DATE('01-APR-1999','DD-MON-YYYY')), PARTITION SALES_Q2_1999 VALUES LESS THAN (TO_DATE('01-JUL-1999','DD-MON-YYYY')), PARTITION SALES_Q3_1999 VALUES LESS THAN (TO_DATE('01-OCT-1999','DD-MON-YYYY')), PARTITION SALES_Q4_1999 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY')), PARTITION SALES_Q1_2000 VALUES LESS THAN (TO_DATE('01-APR-2000','DD-MON-YYYY')), PARTITION SALES_Q2_2000 VALUES LESS THAN (TO_DATE('01-JUL-2000','DD-MON-YYYY')), PARTITION SALES_Q3_2000 VALUES LESS THAN (TO_DATE('01-OCT-2000','DD-MON-YYYY')), PARTITION SALES_Q4_2000 VALUES LESS THAN (MAXVALUE)) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-43.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE empl_h ( employee_id NUMBER(6) PRIMARY KEY, first_name VARCHAR2(20), last_name VARCHAR2(25), email VARCHAR2(25), phone_number VARCHAR2(20), hire_date DATE DEFAULT SYSDATE, job_id VARCHAR2(10), salary NUMBER(8, 2), part_name VARCHAR2(25) ) PARTITION BY RANGE (hire_date) ( PARTITION hire_q1 VALUES less than(to_date('01-APR-2014', 'DD-MON-YYYY')), PARTITION hire_q2 VALUES less than(to_date('01-JUL-2014', 'DD-MON-YYYY')), PARTITION hire_q3 VALUES less than(to_date('01-OCT-2014', 'DD-MON-YYYY')), PARTITION hire_q4 VALUES less than(to_date('01-JAN-2015', 'DD-MON-YYYY')) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-44.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html INSERT INTO empl_h (employee_id, first_name, last_name, email, phone_number, hire_date, job_id, salary, Part_name) VALUES (1, 'Jane', 'Doe', 'example.com', '415.555.0100', '10-Feb-2014', '1001', 5001,'HIRE_Q1'); INSERT INTO empl_h (employee_id, first_name, last_name, email, phone_number, hire_date, job_id, salary, Part_name) VALUES (2, 'John', 'Doe', 'example.net', '415.555.0101', '10-Apr-2014', '1002', 7001,'HIRE_Q2'); INSERT INTO empl_h (employee_id, first_name, last_name, email, phone_number, hire_date, job_id, salary, Part_name) VALUES (3, 'Isabelle', 'Owl', 'example.org', '415.555.0102', '10-Sep-2014', '1003', 10001,'HIRE_Q3'); INSERT INTO empl_h (employee_id, first_name, last_name, email, phone_number, hire_date, job_id, salary, Part_name) VALUES (4, 'Smith', 'Jones', 'example.in', '415.555.0103', '10-Dec-2014', '1004', 12001,'HIRE_Q4'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-45.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html SELECT PARTITION_NAME FROM USER_TAB_PARTITIONS WHERE TABLE_NAME = 'EMPL_H'; SELECT TABLE_NAME, PARTITIONING_TYPE, STATUS FROM USER_PART_TABLES WHERE TABLE_NAME = 'EMPL_H'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-46.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE parts (p_name) AS SELECT PARTITION_NAME FROM USER_TAB_PARTITIONS WHERE TABLE_NAME = 'EMPL_H'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-47.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html select * from parts; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-48.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html select E.HIRE_DATE,E.JOB_ID,P.p_name from empl_h E, parts P where E.Part_name = P.p_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-49.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE customers_demo ( customer_id number(6), cust_first_name varchar2(20), cust_last_name varchar2(20), credit_limit number(9,2)) PARTITION BY RANGE (credit_limit) INTERVAL (1000) (PARTITION p1 VALUES LESS THAN (5001)); INSERT INTO customers_demo (customer_id, cust_first_name, cust_last_name, credit_limit) (select customer_id, cust_first_name, cust_last_name, credit_limit from customers); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE BLOCKCHAIN TABLE bank_ledger (bank VARCHAR2(128), account_no NUMBER, deposit_date DATE, deposit_amount NUMBER) NO DROP UNTIL 31 DAYS IDLE NO DELETE LOCKED HASHING USING SHA2_512 WITH ROW VERSION ACCOUNT_NO (bank, account_no) VERSION V2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html SELECT partition_name, high_value FROM user_tab_partitions WHERE table_name = 'CUSTOMERS_DEMO'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-51.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html INSERT INTO customers_demo VALUES (699, 'Fred', 'Flintstone', 5500); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html SELECT partition_name, high_value FROM user_tab_partitions WHERE table_name = 'CUSTOMERS_DEMO' ORDER BY partition_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-53.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE list_customers ( customer_id NUMBER(6) , cust_first_name VARCHAR2(20) , cust_last_name VARCHAR2(20) , cust_address CUST_ADDRESS_TYP , nls_territory VARCHAR2(30) , cust_email VARCHAR2(40)) PARTITION BY LIST (nls_territory) ( PARTITION asia VALUES ('CHINA', 'THAILAND'), PARTITION europe VALUES ('GERMANY', 'ITALY', 'SWITZERLAND'), PARTITION west VALUES ('AMERICA'), PARTITION east VALUES ('INDIA'), PARTITION rest VALUES (DEFAULT)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-54.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE print_media_demo ( product_id NUMBER(6) , ad_id NUMBER(6) , ad_composite BLOB , ad_sourcetext CLOB , ad_finaltext CLOB , ad_fltextn NCLOB , ad_textdocs_ntab textdoc_tab , ad_photo BLOB , ad_graphic BFILE , ad_header adheader_typ ) NESTED TABLE ad_textdocs_ntab STORE AS textdocs_nestedtab_demo LOB (ad_composite, ad_photo, ad_finaltext) STORE AS(STORAGE (INITIAL 20M)) PARTITION BY RANGE (product_id) (PARTITION p1 VALUES LESS THAN (3000) TABLESPACE tbs_01 LOB (ad_composite, ad_photo) STORE AS (TABLESPACE tbs_02 STORAGE (INITIAL 10M)) NESTED TABLE ad_textdocs_ntab STORE AS nt_p1 (TABLESPACE example), PARTITION P2 VALUES LESS THAN (MAXVALUE) LOB (ad_composite, ad_finaltext) STORE AS SECUREFILE (TABLESPACE auto_seg_ts) NESTED TABLE ad_textdocs_ntab STORE AS nt_p2 ) TABLESPACE tbs_03; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-55.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE hash_products ( product_id NUMBER(6) PRIMARY KEY , product_name VARCHAR2(50) , product_description VARCHAR2(2000) , category_id NUMBER(2) , weight_class NUMBER(1) , warranty_period INTERVAL YEAR TO MONTH , supplier_id NUMBER(6) , product_status VARCHAR2(20) , list_price NUMBER(8,2) , min_price NUMBER(8,2) , catalog_url VARCHAR2(50) , CONSTRAINT product_status_lov_demo CHECK (product_status in ('orderable' ,'planned' ,'under development' ,'obsolete') ) ) PARTITION BY HASH (product_id) PARTITIONS 4 STORE IN (tbs_01, tbs_02, tbs_03, tbs_04); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-56.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE part_order_items ( order_id NUMBER(12) PRIMARY KEY, line_item_id NUMBER(3), product_id NUMBER(6) NOT NULL, unit_price NUMBER(8,2), quantity NUMBER(8), CONSTRAINT product_id_fk FOREIGN KEY (product_id) REFERENCES hash_products(product_id)) PARTITION BY REFERENCE (product_id_fk); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-57.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE composite_sales ( prod_id NUMBER(6) , cust_id NUMBER , time_id DATE , channel_id CHAR(1) , promo_id NUMBER(6) , quantity_sold NUMBER(3) , amount_sold NUMBER(10,2) ) PARTITION BY RANGE (time_id) SUBPARTITION BY HASH (channel_id) (PARTITION SALES_Q1_1998 VALUES LESS THAN (TO_DATE('01-APR-1998','DD-MON-YYYY')), PARTITION SALES_Q2_1998 VALUES LESS THAN (TO_DATE('01-JUL-1998','DD-MON-YYYY')), PARTITION SALES_Q3_1998 VALUES LESS THAN (TO_DATE('01-OCT-1998','DD-MON-YYYY')), PARTITION SALES_Q4_1998 VALUES LESS THAN (TO_DATE('01-JAN-1999','DD-MON-YYYY')), PARTITION SALES_Q1_1999 VALUES LESS THAN (TO_DATE('01-APR-1999','DD-MON-YYYY')), PARTITION SALES_Q2_1999 VALUES LESS THAN (TO_DATE('01-JUL-1999','DD-MON-YYYY')), PARTITION SALES_Q3_1999 VALUES LESS THAN (TO_DATE('01-OCT-1999','DD-MON-YYYY')), PARTITION SALES_Q4_1999 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY')), PARTITION SALES_Q1_2000 VALUES LESS THAN (TO_DATE('01-APR-2000','DD-MON-YYYY')), PARTITION SALES_Q2_2000 VALUES LESS THAN (TO_DATE('01-JUL-2000','DD-MON-YYYY')) SUBPARTITIONS 8, PARTITION SALES_Q3_2000 VALUES LESS THAN (TO_DATE('01-OCT-2000','DD-MON-YYYY')) (SUBPARTITION ch_c, SUBPARTITION ch_i, SUBPARTITION ch_p, SUBPARTITION ch_s, SUBPARTITION ch_t), PARTITION SALES_Q4_2000 VALUES LESS THAN (MAXVALUE) SUBPARTITIONS 4) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-58.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE customers_part ( customer_id NUMBER(6), cust_first_name VARCHAR2(20), cust_last_name VARCHAR2(20), nls_territory VARCHAR2(30), credit_limit NUMBER(9,2)) PARTITION BY RANGE (credit_limit) SUBPARTITION BY LIST (nls_territory) SUBPARTITION TEMPLATE (SUBPARTITION east VALUES ('CHINA', 'JAPAN', 'INDIA', 'THAILAND'), SUBPARTITION west VALUES ('AMERICA', 'GERMANY', 'ITALY', 'SWITZERLAND'), SUBPARTITION other VALUES (DEFAULT)) (PARTITION p1 VALUES LESS THAN (1000), PARTITION p2 VALUES LESS THAN (2500), PARTITION p3 VALUES LESS THAN (MAXVALUE)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-59.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TYPE department_typ AS OBJECT ( d_name VARCHAR2(100), d_address VARCHAR2(200) ); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE BLOCKCHAIN TABLE bank_ledger (bank VARCHAR2(128), account_no NUMBER, deposit_date DATE, deposit_amount NUMBER) NO DROP UNTIL 31 DAYS IDLE NO DELETE LOCKED HASHING USING SHA2_512 WITH ROW VERSION AND USER CHAIN bank_accounts (bank, account_no) VERSION V2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-60.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE departments_obj_t OF department_typ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-61.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE OR REPLACE TYPE salesrep_typ AS OBJECT ( repId NUMBER, repName VARCHAR2(64)); CREATE TABLE salesreps OF salesrep_typ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-62.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TYPE employees_typ AS OBJECT (e_no NUMBER, e_address CHAR(30)); / CREATE TABLE employees_obj_t OF employees_typ (e_no PRIMARY KEY) OBJECT IDENTIFIER IS PRIMARY KEY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-63.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE departments_t (d_no NUMBER, mgr_ref REF employees_typ SCOPE IS employees_obj_t); CREATE TABLE departments_t ( d_no NUMBER, mgr_ref REF employees_typ CONSTRAINT mgr_in_emp REFERENCES employees_obj_t); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-64.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TYPE address_t AS OBJECT ( hno NUMBER, street VARCHAR2(40), city VARCHAR2(20), zip VARCHAR2(5), phone VARCHAR2(10) ); / CREATE TYPE person AS OBJECT ( name VARCHAR2(40), dateofbirth DATE, homeaddress address_t, manager REF person ); / CREATE TABLE persons OF person ( homeaddress NOT NULL, UNIQUE (homeaddress.phone), CHECK (homeaddress.zip IS NOT NULL), CHECK (homeaddress.city <> 'San Francisco') ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-65.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE t1 (T NUMBER) ANNOTATIONS(Operations 'Sort', Operations 'Group', Hidden); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-66.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE t1 (T NUMBER) ANNOTATIONS (ADD Hidden); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-67.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE t1 (T NUMBER ANNOTATIONS(Operations 'Sort' , Hidden) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-69.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE DOMAIN dn1 AS NUMBER; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE BLOCKCHAIN TABLE bank_ledger (bank VARCHAR2(128), deposit_date DATE, deposit_amount NUMBER) NO DROP UNTIL 31 DAYS IDLE NO DELETE LOCKED HASHING USING SHA2_512 VERSION V2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-70.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE DOMAIN dn2 AS (c1 AS NUMBER NOT NULL, c2 as NUMBER DEFAULT 1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-71.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE DOMAIN dm1 AS (ann AS NUMBER NOT NULL , bnnpos AS NUMBER NOT NULL CONSTRAINT CHECK (bnnpos > 0), c AS VARCHAR2(10) DEFAULT 'abc', ddon AS NUMBER DEFAULT ON NULL 10) CONSTRAINT CHECK (ann+ddon < = 100) CONSTRAINT CHECK (length(c) > bnnpos); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-72.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE tm1 (c1 NUMBER, c2 NUMBER, c3 VARCHAR2(15),c4 NUMBER, c5 NUMBER, c6 NUMBER, c7 NUMBER, DOMAIN dm1 (c1, c2, c3, c4), DOMAIN dn2(c5, c6), DOMAIN dn1(c7)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-73.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE t1 OF XMLTYPE XMLTYPE STORE AS TRANSPORTABLE BINARY XML; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-74.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE t2 (id NUMBER, doc XMLTYPE) XMLTYPE doc STORE AS TRANSPORTABLE BINARY XML; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-75.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html ALTER TABLE t3 ADD (doc XMLTYPE) XMLTYPE doc STORE AS TRANSPORTABLE BINARY XML; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE mydoc(id NUMBER, docCreationTime DATE, doc CLOB, json_doc JSON) INMEMORY TEXT(DOC, JSON_DOC) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html CREATE TABLE mydoc(id NUMBER, docCreationTime DATE, doc CLOB, json_doc JSON) INMEMORY PRIORITY CRITICAL INMEMORY TEXT(DOC, JSON_DOC) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE BIGFILE TABLESPACE sh_lwp1 DATAFILE sh_lwp1.df SIZE 10M BLOCKSIZE 8K LOST WRITE PROTECTION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE BIGFILE TABLESPACE bigtbs_01 DATAFILE 'bigtbs_f1.dbf' SIZE 20M AUTOEXTEND ON; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TABLESPACE lmt1 DATAFILE 'lmt_file2.dbf' SIZE 100m REUSE EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M; CREATE TABLE lmt_table1 (col1 NUMBER, col2 VARCHAR2(20)) TABLESPACE lmt1 STORAGE (INITIAL 2m); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TABLESPACE lmt2 DATAFILE 'lmt_file3.dbf' SIZE 100m REUSE EXTENT MANAGEMENT LOCAL; CREATE TABLE lmt_table2 (col1 NUMBER, col2 VARCHAR2(20)) TABLESPACE lmt2 STORAGE (INITIAL 2m MAXSIZE 100m); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "wallet_password"; CREATE TABLESPACE encrypt_ts DATAFILE '$ORACLE_HOME/dbs/encrypt_df.dbf' SIZE 1M ENCRYPTION USING 'AES256' ENCRYPT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TABLESPACE auto_seg_ts DATAFILE 'file_2.dbf' SIZE 1M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html ALTER SYSTEM SET DB_CREATE_FILE_DEST = '$ORACLE_HOME/rdbms/dbs'; CREATE TABLESPACE omf_ts1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TABLESPACE omf_ts2 DATAFILE AUTOEXTEND OFF; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE UNDO TABLESPACE undots1 DATAFILE 'undotbs_1a.dbf' SIZE 10M AUTOEXTEND ON RETENTION GUARANTEE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TEMPORARY TABLESPACE temp_demo TEMPFILE 'temp01.dbf' SIZE 5M AUTOEXTEND ON; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html ALTER SYSTEM SET DB_CREATE_FILE_DEST = '$ORACLE_HOME/rdbms/dbs'; CREATE TEMPORARY TABLESPACE tbs_05; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TEMPORARY TABLESPACE tbs_temp_02 TEMPFILE 'temp02.dbf' SIZE 5M AUTOEXTEND ON TABLESPACE GROUP tbs_grp_01; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TABLESPACE tbs_01 DATAFILE 'tbs_f2.dbf' SIZE 40M ONLINE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TABLESPACE tbs_03 DATAFILE 'tbs_f03.dbf' SIZE 20M LOGGING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TABLESPACE tbs_02 DATAFILE 'diskb:tbs_f5.dbf' SIZE 500K REUSE AUTOEXTEND ON NEXT 500K MAXSIZE 100M; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE.html CREATE TABLESPACE tbs_04 DATAFILE 'file_1.dbf' SIZE 10M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-TABLESPACE-SET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLESPACE-SET.html CREATE TABLESPACE SET ts1 IN SHARDSPACE sgr1 USING TEMPLATE ( DATAFILE SIZE 100m EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER jsmith IDENTIFIED EXTERNALLY AS "CN=foo,DNQ=123,SERIAL=234"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER tjones IDENTIFIED EXTERNALLY AS "CN=foo,dnQualifier=123,SERIALNUMER=234"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER peter_fitch IDENTIFIED GLOBALLY AS 'AZURE_USER=peter.fitch@example.com'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER dba_azure IDENTIFIED GLOBALLY AS 'AZURE_ROLE=AZURE_DBA'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER u1 IDENTIFIED BY p1 PROFILE prof1 ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER sidney IDENTIFIED BY out_standing1 DEFAULT TABLESPACE example QUOTA 10M ON example TEMPORARY TABLESPACE temp QUOTA 5M ON system PROFILE app_user PASSWORD EXPIRE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER app_user1 IDENTIFIED EXTERNALLY DEFAULT TABLESPACE example QUOTA 5M ON example PROFILE app_user; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER ops$external_user IDENTIFIED EXTERNALLY DEFAULT TABLESPACE example QUOTA 5M ON example PROFILE app_user; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER global_user IDENTIFIED GLOBALLY AS 'CN=analyst, OU=division1, O=oracle, C=US' DEFAULT TABLESPACE example QUOTA 5M ON example; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-USER-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-USER.html CREATE USER c##comm_user IDENTIFIED BY comm_pwd DEFAULT TABLESPACE example QUOTA 20M ON example TEMPORARY TABLESPACE temp_tbs; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE VIEW emp_view AS SELECT last_name, salary*12 annual_salary FROM employees WHERE department_id = 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE VIEW customer_ro (name, language, credit) AS SELECT cust_last_name, nls_language, credit_limit FROM customers WITH READ ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE TYPE inventory_typ OID '82A4AF6A4CD4656DE034080020E0EE3D' AS OBJECT ( product_id NUMBER(6) , warehouse warehouse_typ , quantity_on_hand NUMBER(8) ) ; / CREATE OR REPLACE VIEW oc_inventories OF inventory_typ WITH OBJECT OID (product_id) AS SELECT i.product_id, warehouse_typ(w.warehouse_id, w.warehouse_name, w.location_id), i.quantity_on_hand FROM inventories i, warehouses w WHERE i.warehouse_id=w.warehouse_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE VIEW warehouse_view AS SELECT VALUE(p) AS warehouse_xml FROM xwarehouses p; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html SELECT e.warehouse_xml.getclobval() FROM warehouse_view e WHERE EXISTSNODE(warehouse_xml, '//Docks') =1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE TABLE warehouse_table ( WarehouseID NUMBER, Area NUMBER, Docks NUMBER, DockType VARCHAR2(100), WaterAccess VARCHAR2(10), RailAccess VARCHAR2(10), Parking VARCHAR2(20), VClearance NUMBER ); INSERT INTO warehouse_table VALUES(5, 103000,3,'Side Load','false','true','Lot',15); CREATE VIEW warehouse_view OF XMLTYPE XMLSCHEMA "http://www.example.com/xwarehouses.xsd" ELEMENT "Warehouse" WITH OBJECT ID (extract(OBJECT_VALUE, '/Warehouse/Area/text()').getnumberval()) AS SELECT XMLELEMENT("Warehouse", XMLFOREST(WarehouseID as "Building", area as "Area", docks as "Docks", docktype as "DockType", wateraccess as "WaterAccess", railaccess as "RailAccess", parking as "Parking", VClearance as "VClearance")) FROM warehouse_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html SELECT VALUE(e) FROM warehouse_view e; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE EDITIONING VIEW ed_orders_view (o_id, o_date, o_status) AS SELECT order_id, order_date, order_status FROM orders WITH READ ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE VIEW emp_sal (emp_id, last_name, email UNIQUE RELY DISABLE NOVALIDATE, CONSTRAINT id_pk PRIMARY KEY (emp_id) RELY DISABLE NOVALIDATE) AS SELECT employee_id, last_name, email FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE VIEW clerk AS SELECT employee_id, last_name, department_id, job_id FROM employees WHERE job_id = 'PU_CLERK' or job_id = 'SH_CLERK' or job_id = 'ST_CLERK'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html UPDATE clerk SET job_id = 'PU_MAN' WHERE employee_id = 118; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE VIEW clerk AS SELECT employee_id, last_name, department_id, job_id FROM employees WHERE job_id = 'PU_CLERK' or job_id = 'SH_CLERK' or job_id = 'ST_CLERK' WITH CHECK OPTION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html CREATE VIEW locations_view AS SELECT d.department_id, d.department_name, l.location_id, l.city FROM departments d, locations l WHERE d.location_id = l.location_id; SELECT column_name, updatable FROM user_updatable_columns WHERE table_name = 'LOCATIONS_VIEW' ORDER BY column_name, updatable; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html INSERT INTO locations_view VALUES (999, 'Entertainment', 87, 'Roma'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CREATE-VIEW-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-VIEW.html INSERT INTO locations_view (department_id, department_name) VALUES (999, 'Entertainment'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CUBE_TABLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CUBE_TABLE.html SELECT dim_key, level_name, long_description, channel_total_id tot_id, channel_channel_id chan_id, channel_long_description chan_desc, total_long_description tot_desc FROM TABLE(CUBE_TABLE('global.channel')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CUBE_TABLE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CUBE_TABLE.html SELECT sales, units, cost, time, customer, product, channel FROM TABLE(CUBE_TABLE('global.units_cube HIERARCHY customer market HIERARCHY time calendar')) WHERE rownum < 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CUME_DIST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CUME_DIST.html SELECT CUME_DIST(15500, .05) WITHIN GROUP (ORDER BY salary, commission_pct) "Cume-Dist of 15500" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CUME_DIST-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CUME_DIST.html SELECT job_id, last_name, salary, CUME_DIST() OVER (PARTITION BY job_id ORDER BY salary) AS cume_dist FROM employees WHERE job_id LIKE 'PU%' ORDER BY job_id, last_name, salary, cume_dist; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CURRENT_DATE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CURRENT_DATE.html ALTER SESSION SET TIME_ZONE = '-5:0'; ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; SELECT SESSIONTIMEZONE, CURRENT_DATE FROM DUAL; ALTER SESSION SET TIME_ZONE = '-8:0'; SELECT SESSIONTIMEZONE, CURRENT_DATE FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CURRENT_TIMESTAMP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CURRENT_TIMESTAMP.html ALTER SESSION SET TIME_ZONE = '-5:0'; ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; SELECT SESSIONTIMEZONE, CURRENT_TIMESTAMP FROM DUAL; ALTER SESSION SET TIME_ZONE = '-8:0'; SELECT SESSIONTIMEZONE, CURRENT_TIMESTAMP FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CURRENT_TIMESTAMP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CURRENT_TIMESTAMP.html CREATE TABLE current_test (col1 TIMESTAMP WITH TIME ZONE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CURRENT_TIMESTAMP-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CURRENT_TIMESTAMP.html INSERT INTO current_test VALUES (TO_TIMESTAMP_TZ(CURRENT_TIMESTAMP, 'DD-MON-RR HH.MI.SSXFF PM')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CURRENT_TIMESTAMP-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CURRENT_TIMESTAMP.html INSERT INTO current_test VALUES (TO_TIMESTAMP_TZ(CURRENT_TIMESTAMP, 'DD-MON-RR HH.MI.SSXFF PM TZH:TZM')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CURSOR-Expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CURSOR-Expressions.html SELECT department_name, CURSOR(SELECT salary, commission_pct FROM employees e WHERE e.department_id = d.department_id) FROM departments d ORDER BY department_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CURSOR-Expressions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CURSOR-Expressions.html CREATE FUNCTION f(cur SYS_REFCURSOR, mgr_hiredate DATE) RETURN NUMBER IS emp_hiredate DATE; before number :=0; after number:=0; begin loop fetch cur into emp_hiredate; exit when cur%NOTFOUND; if emp_hiredate > mgr_hiredate then after:=after+1; else before:=before+1; end if; end loop; close cur; if before > after then return 1; else return 0; end if; end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CURSOR-Expressions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CURSOR-Expressions.html SELECT e1.last_name FROM employees e1 WHERE f( CURSOR(SELECT e2.hire_date FROM employees e2 WHERE e1.employee_id = e2.manager_id), e1.hire_date) = 1 ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/CV-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CV.html SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER ( s[FOR prod IN ('Mouse Pad', 'Standard Mouse'), 2001] = s[CV( ), 1999] + s[CV( ), 2000] ) ORDER BY country, prod, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT last_name, employee_id, salary + NVL(commission_pct, 0), job_id, e.department_id /* Select all employees whose compensation is greater than that of Pataballa.*/ FROM employees e, departments d /*The DEPARTMENTS table is used to get the department name.*/ WHERE e.department_id = d.department_id AND salary + NVL(commission_pct,0) > /* Subquery: */ (SELECT salary + NVL(commission_pct,0) /* total compensation is salary + commission_pct */ FROM employees WHERE last_name = 'Pataballa') ORDER BY last_name, employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html CREATE VIEW v AS SELECT e.last_name, e.department_id, d.location_id FROM employees e, departments d WHERE e.department_id = d.department_id; CREATE TABLE t AS SELECT * from employees WHERE employee_id < 200; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ DYNAMIC_SAMPLING(e 1) */ count(*) FROM employees e; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ FIRST_ROWS(10) */ employee_id, last_name, salary, job_id FROM employees WHERE department_id = 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ FULL(e) */ employee_id, last_name FROM hr.employees e WHERE last_name LIKE :b1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ INDEX (employees emp_department_ix)*/ employee_id, department_id FROM employees WHERE department_id > 50; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ INDEX_COMBINE(e emp_manager_ix emp_department_ix) */ * FROM employees e WHERE manager_id = 108 OR department_id = 110; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ INDEX_DESC(e emp_name_ix) */ * FROM employees e; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ INDEX_FFS(e emp_name_ix) */ first_name FROM employees e; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ INDEX_JOIN(e emp_manager_ix emp_department_ix) */ department_id FROM employees e WHERE manager_id < 110 AND department_id < 50; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html EXPLAIN PLAN SET STATEMENT_ID = 'Test 1' INTO plan_table FOR (SELECT /*+ LEADING(v.e v.d t) */ * FROM t, v WHERE t.department_id = v.department_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ INDEX_SS(e emp_name_ix) */ last_name FROM employees e WHERE first_name = 'Steven'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ INDEX_SS_DESC(e emp_name_ix) */ last_name FROM employees e WHERE first_name = 'Steven'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ LEADING(e j) */ * FROM employees e, departments d, job_history j WHERE e.department_id = d.department_id AND e.hire_date = j.start_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ MERGE(v) */ e1.last_name, e1.salary, v.avg_salary FROM employees e1, (SELECT department_id, avg(salary) avg_salary FROM employees e2 GROUP BY department_id) v WHERE e1.department_id = v.department_id AND e1.salary > v.avg_salary ORDER BY e1.last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ FULL(hr_emp) NOCACHE(hr_emp) */ last_name FROM employees hr_emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_EXPAND */ * FROM employees e, departments d WHERE e.manager_id = 108 OR d.department_id = 110; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_INDEX(employees emp_empid) */ employee_id FROM employees WHERE employee_id > 200; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_INDEX_FFS(items item_order_ix) */ order_id FROM order_items items; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_MERGE(seattle_dept) */ e1.last_name, seattle_dept.department_name FROM employees e1, (SELECT location_id, department_id, department_name FROM departments WHERE location_id = 1700) seattle_dept WHERE e1.department_id = seattle_dept.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html ALTER TABLE employees PARALLEL 8; SELECT /*+ NO_PARALLEL(hr_emp) */ last_name FROM employees hr_emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT id, LPAD(' ',2*(LEVEL-1))||operation operation, options, object_name, object_alias FROM plan_table START WITH id = 0 AND statement_id = 'Test 1' CONNECT BY PRIOR id = parent_id AND statement_id = 'Test 1' ORDER BY id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_MERGE(v) NO_PUSH_PRED(v) */ * FROM employees e, (SELECT manager_id FROM employees) v WHERE e.manager_id = v.manager_id(+) AND e.employee_id = 100; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_QUERY_TRANSFORMATION */ employee_id, last_name FROM (SELECT * FROM employees e) v WHERE v.last_name = 'Smith'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_REWRITE */ sum(s.amount_sold) AS dollars FROM sales s, times t WHERE s.time_id = t.time_id GROUP BY t.calendar_month_desc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_STATEMENT_QUEUING */ emp.last_name, dpt.department_name FROM employees emp, departments dpt WHERE emp.department_id = dpt.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_USE_BAND(e1 e2) */ e1.last_name || ' has salary between 100 less and 100 more than ' || e2.last_name AS "SALARY COMPARISON" FROM employees e1, employees e2 WHERE e1.salary BETWEEN e2.salary - 100 AND e2.salary + 100; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_USE_HASH(e d) */ * FROM employees e, departments d WHERE e.department_id = d.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_USE_MERGE(e d) */ * FROM employees e, departments d WHERE e.department_id = d.department_id ORDER BY d.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_USE_NL(l h) */ * FROM orders h, order_items l WHERE l.order_id = h.order_id AND l.order_id > 2400; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+NO_XML_QUERY_REWRITE*/ XMLQUERY('' RETURNING CONTENT) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-39.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+NO_XMLINDEX_REWRITE*/ count(*) FROM warehouses WHERE existsNode(warehouse_spec, '/Warehouse/Building') = 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html EXPLAIN PLAN SET STATEMENT_ID = 'Test 2' INTO plan_table FOR (SELECT /*+ LEADING(E@SEL$2 D@SEL$2 T@SEL$1) */ * FROM t, v WHERE t.department_id = v.department_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ ORDERED */ o.order_id, c.customer_id, l.unit_price * l.quantity FROM customers c, order_items l, orders o WHERE c.cust_last_name = 'Taylor' AND o.customer_id = c.customer_id AND o.order_id = l.order_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ PARALLEL */ last_name FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-43.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ PARALLEL (AUTO) */ last_name FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-44.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html CREATE TABLE parallel_table (col1 number, col2 VARCHAR2(10)) PARALLEL 5; SELECT /*+ PARALLEL (MANUAL) */ col2 FROM parallel_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-45.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ FULL(hr_emp) PARALLEL(hr_emp, 5) */ last_name FROM employees hr_emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-46.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ FULL(hr_emp) PARALLEL(hr_emp, DEFAULT) */ last_name FROM employees hr_emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-48.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html INSERT /*+ APPEND PARALLEL(target_table, 16) PQ_DISTRIBUTE(target_table, NONE) */ INTO target_table SELECT * FROM source_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-49.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html CREATE /*+ PQ_DISTRIBUTE(target_table, PARTITION) */ TABLE target_table NOLOGGING PARALLEL 16 PARTITION BY HASH (l_orderkey) PARTITIONS 512 AS SELECT * FROM source_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT id, LPAD(' ',2*(LEVEL-1))||operation operation, options, object_name, object_alias FROM plan_table START WITH id = 0 AND statement_id = 'Test 2' CONNECT BY PRIOR id = parent_id AND statement_id = 'Test 2' ORDER BY id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ORDERED PQ_DISTRIBUTE(s HASH, HASH) USE_HASH (s)*/ column_list FROM r,s WHERE r.c=s.c; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-51.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ORDERED PQ_DISTRIBUTE(s BROADCAST, NONE) USE_HASH (s) */ column_list FROM r,s WHERE r.c=s.c; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ NO_MERGE(v) PUSH_PRED(v) */ * FROM employees e, (SELECT manager_id FROM employees) v WHERE e.manager_id = v.manager_id(+) AND e.employee_id = 100; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-53.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ QB_NAME(qb) FULL(@qb e) */ employee_id, last_name FROM employees e WHERE last_name = 'Smith'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-56.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ STAR_TRANSFORMATION */ s.time_id, s.prod_id, s.channel_id FROM sales s, times t, products p, channels c WHERE s.time_id = t.time_id AND s.prod_id = p.prod_id AND s.channel_id = c.channel_id AND c.channel_desc = 'Tele Sales'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-57.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ STATEMENT_QUEUING */ emp.last_name, dpt.department_name FROM employees emp, departments dpt WHERE emp.department_id = dpt.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-58.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ USE_BAND(e1 e2) */ e1.last_name || ' has salary between 100 less and 100 more than ' || e2.last_name AS "SALARY COMPARISON" FROM employees e1, employees e2 WHERE e1.salary BETWEEN e2.salary - 100 AND e2.salary + 100; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-59.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ USE_CONCAT */ * FROM employees e WHERE manager_id = 108 OR department_id = 110; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ ALL_ROWS */ employee_id, last_name, salary, job_id FROM employees WHERE employee_id = 107; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-60.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ USE_HASH(l h) */ * FROM orders h, order_items l WHERE l.order_id = h.order_id AND l.order_id > 2400; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-61.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ USE_MERGE(employees departments) */ * FROM employees, departments WHERE employees.department_id = departments.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-62.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ USE_NL(l h) */ h.customer_id, l.unit_price * l.quantity FROM orders h, order_items l WHERE l.order_id = h.order_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-63.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html select /*+ LEADING(t2) USE_NL(t1) */ sum(t1.a),sum(t2.a) from t1 , t2 where t1.b = t2.b; select * from table(dbms_xplan.display_cursor()) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-64.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ USE_NL_WITH_INDEX(l item_product_ix) */ * FROM orders h, order_items l WHERE l.order_id = h.order_id AND l.order_id > 2400; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ FULL (hr_emp) CACHE(hr_emp) */ last_name FROM employees hr_emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ CONTAINERS(DEFAULT_PDB_HINT='NO_PARALLEL') */ (CASE WHEN COUNT(*) < 10000 THEN 'Less than 10,000' ELSE '10,000 or more' END) "Number of Tables" FROM CONTAINERS(DBA_TABLES); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comments-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comments.html SELECT /*+ DRIVING_SITE(departments) */ * FROM employees, departments@rsite WHERE employees.department_id = departments.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comparison-Conditions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comparison-Conditions.html SELECT * FROM employees WHERE salary = 2500 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comparison-Conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comparison-Conditions.html SELECT * FROM employees WHERE salary != 2500 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comparison-Conditions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comparison-Conditions.html SELECT * FROM employees WHERE salary > 2500 ORDER BY employee_id; SELECT * FROM employees WHERE salary < 2500 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comparison-Conditions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comparison-Conditions.html SELECT * FROM employees WHERE salary >= 2500 ORDER BY employee_id; SELECT * FROM employees WHERE salary <= 2500 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comparison-Conditions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comparison-Conditions.html SELECT * FROM employees WHERE salary = ANY (SELECT salary FROM employees WHERE department_id = 30) ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Comparison-Conditions-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Comparison-Conditions.html SELECT * FROM employees WHERE salary >= ALL (1400, 3000) ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Concatenation-Operator-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Concatenation-Operator.html SELECT 'Name is ' || last_name FROM employees ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Concatenation-Operator-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Concatenation-Operator.html CREATE TABLE tab1 (col1 VARCHAR2(6), col2 CHAR(6), col3 VARCHAR2(6), col4 CHAR(6)); INSERT INTO tab1 (col1, col2, col3, col4) VALUES ('abc', 'def ', 'ghi ', 'jkl'); SELECT col1 || col2 || col3 || col4 "Concatenation" FROM tab1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DBTIMEZONE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DBTIMEZONE.html SELECT DBTIMEZONE FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DECODE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DECODE.html SELECT product_id, DECODE (warehouse_id, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic') "Location" FROM inventories WHERE product_id < 1775 ORDER BY product_id, "Location"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DECOMPOSE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DECOMPOSE.html SELECT DECOMPOSE ('Châteaux') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE FROM t FROM s WHERE t.t1 = s.s1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE FROM product_descriptions WHERE language_id = 'AR'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE (SELECT * FROM product_price_history) WHERE currency_code = 'EUR'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE product_price_history pp WHERE (product_id, currency_code, effective_from_date) IN (SELECT product_id, currency_code, Max(effective_from_date) FROM product_price_history GROUP BY product_id, currency_code); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE product_price_history partition (p1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html SELECT * FROM product_price_history; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE product_price_history; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE FROM employees WHERE job_id = 'SA_REP' AND commission_pct < .2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE FROM (SELECT * FROM employees) WHERE job_id = 'SA_REP' AND commission_pct < .2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE FROM hr.locations@remote WHERE location_id > 3000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE FROM sales PARTITION (sales_q1_1998) WHERE amount_sold > 1000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE FROM employees WHERE job_id = 'SA_REP' AND hire_date + TO_YMINTERVAL('01-00') < SYSDATE RETURNING salary INTO :bnd1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html CREATE TABLE product_price_history ( product_id INTEGER NOT NULL, price INTEGER NOT NULL, currency_code VARCHAR2(3 CHAR) NOT NULL, effective_from_date DATE NOT NULL, effective_to_date DATE, CONSTRAINT product_price_history_pk PRIMARY KEY (product_id, currency_code, effective_from_date) ) PARTITION BY RANGE (effective_from_date) ( PARTITION p0 VALUES less than (DATE'2015-01-02'), PARTITION p1 VALUES less than (DATE'2015-01-03'), PARTITION p2 VALUES less than (DATE'2015-01-04') ); INSERT INTO product_price_history WITH prices AS ( SELECT 1, 100, 'USD', DATE'2015-01-01', DATE'2015-01-02' FROM dual UNION ALL SELECT 1, 60, 'GBP', DATE'2015-01-01', DATE'2015-01-02' FROM dual UNION ALL SELECT 1, 110, 'EUR', DATE'2015-01-01', DATE'2015-01-02' FROM dual UNION ALL SELECT 1, 101, 'USD', DATE'2015-01-02', DATE'2015-01-03' FROM dual UNION ALL SELECT 1, 62, 'GBP', DATE'2015-01-02', DATE'2015-01-03' FROM dual UNION ALL SELECT 1, 109, 'EUR', DATE'2015-01-02', DATE'2015-01-03' FROM dual UNION ALL SELECT 1, 105, 'USD', DATE'2015-01-03', NULL FROM dual UNION ALL SELECT 1, 61, 'GBP', DATE'2015-01-03', NULL FROM dual UNION ALL SELECT 1, 107, 'EUR', DATE'2015-01-03', NULL FROM dual UNION ALL SELECT 2, 30, 'USD', DATE'2015-01-01', DATE'2015-01-03' FROM dual UNION ALL SELECT 2, 33, 'USD', DATE'2015-01-03', NULL FROM dual UNION ALL SELECT 3, 100, 'GBP', DATE'2015-01-03', NULL FROM dual ) SELECT * FROM prices; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DELETE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html DELETE FROM product_price_history WHERE product_id = 3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DENSE_RANK-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DENSE_RANK.html SELECT DENSE_RANK(15500, .05) WITHIN GROUP (ORDER BY salary DESC, commission_pct) "Dense Rank" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DENSE_RANK-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DENSE_RANK.html SELECT department_id, last_name, salary, DENSE_RANK() OVER (PARTITION BY department_id ORDER BY salary) DENSE_RANK FROM employees WHERE department_id = 60 ORDER BY DENSE_RANK, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DEPTH-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DEPTH.html SELECT PATH(1), DEPTH(2) FROM RESOURCE_VIEW WHERE UNDER_PATH(res, '/sys/schemas/OE', 1)=1 AND UNDER_PATH(res, '/sys/schemas/OE', 2)=1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DEREF-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DEREF.html INSERT INTO address_table VALUES ('1 First', 'G45 EU8', 'Paris', 'CA', 'US'); INSERT INTO customer_addresses SELECT 999, REF(a) FROM address_table a; SELECT address FROM customer_addresses ORDER BY address; SELECT DEREF(address) FROM customer_addresses; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DISASSOCIATE-STATISTICS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DISASSOCIATE-STATISTICS.html DISASSOCIATE STATISTICS FROM PACKAGES hr.emp_mgmt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-ANALYTIC-VIEW-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-ANALYTIC-VIEW.html DROP ANALYTIC VIEW sales_av; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-ATTRIBUTE-DIMENSION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-ATTRIBUTE-DIMENSION.html DROP ATTRIBUTE DIMENSION product_attr_dim; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-AUDIT-POLICY-Unified-Auditing-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-AUDIT-POLICY-Unified-Auditing.html DROP AUDIT POLICY table_pol; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-CLUSTER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-CLUSTER.html DROP CLUSTER language; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-CLUSTER-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-CLUSTER.html DROP CLUSTER personnel INCLUDING TABLES CASCADE CONSTRAINTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-CONTEXT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-CONTEXT.html DROP CONTEXT hr_context; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-DATABASE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-DATABASE.html STARTUP MOUNT ALTER SYSTEM ENABLE RESTRICTED SESSION; DROP DATABASE ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-DATABASE-LINK-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-DATABASE-LINK.html DROP PUBLIC DATABASE LINK remote; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-DIMENSION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-DIMENSION.html DROP DIMENSION customers_dim; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-DIRECTORY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-DIRECTORY.html DROP DIRECTORY bfile_dir; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-DISKGROUP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-DISKGROUP.html DROP DISKGROUP dgroup_01 INCLUDING CONTENTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-FUNCTION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-FUNCTION.html DROP FUNCTION oe.SecondMax; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-HIERARCHY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-HIERARCHY.html DROP HIERARCHY product_hier; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-INDEX-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-INDEX.html DROP INDEX ord_customer_ix_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-INDEXTYPE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-INDEXTYPE.html DROP INDEXTYPE position_indextype FORCE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-INMEMORY-JOIN-GROUP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-INMEMORY-JOIN-GROUP.html DROP INMEMORY JOIN GROUP prod_id1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-JAVA-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-JAVA.html DROP JAVA CLASS "Agent"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-LIBRARY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-LIBRARY.html DROP LIBRARY ext_lib; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-LOCKDOWN-PROFILE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-LOCKDOWN-PROFILE.html DROP LOCKDOWN PROFILE hr_prof; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-MATERIALIZED-VIEW-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-MATERIALIZED-VIEW.html DROP MATERIALIZED VIEW emp_data; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-MATERIALIZED-VIEW-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-MATERIALIZED-VIEW.html DROP MATERIALIZED VIEW sales_by_month_by_state; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-MATERIALIZED-VIEW-LOG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-MATERIALIZED-VIEW-LOG.html DROP MATERIALIZED VIEW LOG ON customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-MATERIALIZED-ZONEMAP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-MATERIALIZED-ZONEMAP.html DROP MATERIALIZED ZONEMAP sales_zmap; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-OPERATOR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-OPERATOR.html DROP OPERATOR eq_op; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-OUTLINE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-OUTLINE.html DROP OUTLINE salaries; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-PACKAGE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-PACKAGE.html DROP PACKAGE emp_mgmt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-PLUGGABLE-DATABASE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-PLUGGABLE-DATABASE.html DROP PLUGGABLE DATABASE pdb1 INCLUDING DATAFILES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-PROCEDURE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-PROCEDURE.html DROP PROCEDURE hr.remove_emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-PROFILE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-PROFILE.html DROP PROFILE app_user CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-RESTORE-POINT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-RESTORE-POINT.html DROP RESTORE POINT good_data; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-ROLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-ROLE.html DROP ROLE dw_manager; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-ROLLBACK-SEGMENT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-ROLLBACK-SEGMENT.html DROP ROLLBACK SEGMENT rbs_one; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-SEQUENCE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-SEQUENCE.html DROP SEQUENCE oe.customers_seq; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-SYNONYM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-SYNONYM.html DROP PUBLIC SYNONYM customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-TABLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-TABLE.html DROP TABLE list_customers PURGE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-TABLESPACE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-TABLESPACE.html DROP TABLESPACE tbs_01 INCLUDING CONTENTS CASCADE CONSTRAINTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-TABLESPACE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-TABLESPACE.html DROP TABLESPACE tbs_02 INCLUDING CONTENTS AND DATAFILES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-TABLESPACE-SET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-TABLESPACE-SET.html DROP TABLESPACE SET ts1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-TRIGGER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-TRIGGER.html DROP TRIGGER hr.salary_check; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-TYPE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-TYPE.html DROP TYPE person_t FORCE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-TYPE-BODY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-TYPE-BODY.html DROP TYPE BODY data_typ1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-USER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-USER.html DROP USER sidney; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-USER-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-USER.html DROP USER sidney CASCADE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DROP-VIEW-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DROP-VIEW.html DROP VIEW emp_view; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/DUMP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DUMP.html SELECT DUMP('abc', 1016) FROM DUAL; SELECT DUMP(last_name, 8, 3, 2) "OCTAL" FROM employees WHERE last_name = 'Hunold' ORDER BY employee_id; SELECT DUMP(last_name, 10, 3, 2) "ASCII" FROM employees WHERE last_name = 'Hunold' ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Type-Comparison-Rules-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Type-Comparison-Rules.html SELECT salary + '10' FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Type-Comparison-Rules-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Type-Comparison-Rules.html SELECT last_name FROM employees WHERE employee_id = '200'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Type-Comparison-Rules-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Type-Comparison-Rules.html SELECT last_name FROM employees WHERE hire_date = '24-JUN-06'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT TO_DATE('31-AUG-2004','DD-MON-YYYY') + TO_YMINTERVAL('0-1') FROM DUAL; SELECT TO_DATE('29-FEB-2004','DD-MON-YYYY') + TO_YMINTERVAL('1-0') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT TO_DATE('29-FEB-2004', 'DD-MON-YYYY') + TO_YMINTERVAL('4-0') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT order_id, order_date + INTERVAL '30' DAY AS "Due Date" FROM orders ORDER BY order_id, "Due Date"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT job_name, SUM( cpu_used ) FROM DBA_SCHEDULER_JOB_RUN_DETAILS GROUP BY job_name HAVING SUM ( cpu_used ) > interval '5' minute; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TABLE time_table (start_time TIMESTAMP, duration_1 INTERVAL DAY (6) TO SECOND (5), duration_2 INTERVAL YEAR TO MONTH); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT last_name, EXTRACT(YEAR FROM (SYSDATE - hire_date) YEAR TO MONTH) || ' years ' || EXTRACT(MONTH FROM (SYSDATE - hire_date) YEAR TO MONTH) || ' months' "Interval" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TABLE j_purchaseorder (id VARCHAR2 (32) NOT NULL PRIMARY KEY, date_loaded TIMESTAMP (6) WITH TIME ZONE, po_document JSON (OBJECT)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TABLE example (id NUMBER, c1 BOOLEAN, c2 BOOL); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html INSERT INTO example VALUES (1, TRUE, NULL); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html INSERT INTO example VALUES (2, FALSE, true); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TABLE example (id NUMBER, c1 BOOLEAN, c2 BOOL); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html INSERT INTO example VALUES (1, TRUE, NULL); INSERT INTO example VALUES (2, FALSE, true); INSERT INTO example VALUES (3, 0, 'off'); INSERT INTO example VALUES (4, 'no', 'yes'); INSERT INTO example VALUES (5, 'f', 't' ); INSERT INTO example VALUES (6, false, true); INSERT INTO example VALUES (7, 'on', 'off'); INSERT INTO example VALUES (8, -3.14, 1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT * FROM example; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT * FROM example WHERE c1 = c2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT * FROM example e1 WHERE c1 >= ALL (SELECT c2 FROM example e2 WHERE e2.id > e1.id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT * FROM example WHERE NOT c2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT * FROM example WHERE c1 AND c2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT * FROM example WHERE c1 AND TRUE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT * FROM example WHERE c1 OR c2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TABLE test (col1 NUMBER(5,2), col2 FLOAT(5)); INSERT INTO test VALUES (1.23, 1.23); INSERT INTO test VALUES (7.89, 7.89); INSERT INTO test VALUES (12.79, 12.79); INSERT INTO test VALUES (123.45, 123.45); SELECT * FROM test; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT * FROM example WHERE NOT c2; SELECT * FROM example WHERE c1 AND c2; SELECT * FROM example WHERE c1 AND TRUE; SELECT * FROM example WHERE c1 OR c2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT * FROM example WHERE c2 IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TABLE t (v VECTOR); CREATE TABLE t (v VECTOR(*, *)); CREATE TABLE t (v VECTOR(100)); CREATE TABLE t (v VECTOR(100, *)); CREATE TABLE t (v VECTOR(*, FLOAT32)); CREATE TABLE t (v VECTOR(100, FLOAT32)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TABLE my_vect_tab ( v1 VECTOR(3, FLOAT32), v2 VECTOR(2, FLOAT64), v3 VECTOR(1, INT8), v4 VECTOR(1, *), v5 VECTOR(*, FLOAT32), v6 VECTOR(*, *), v7 VECTOR ); DESC my_vect_tab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TABLE my_vectors (id NUMBER, embedding VECTOR); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TABLE my_vectors (id NUMBER, embedding VECTOR(768, INT8)) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT o.customer_ref.cust_email FROM oc_orders o WHERE o.customer_ref IS NOT DANGLING; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT TO_DATE('2009', 'YYYY') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TYPE SDO_GEOMETRY AS OBJECT (sgo_gtype NUMBER, sdo_srid NUMBER, sdo_point SDO_POINT_TYPE, sdo_elem_info SDO_ELEM_INFO_ARRAY, sdo_ordinates SDO_ORDINATE_ARRAY); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TYPE SDO_TOPO_GEOMETRY AS OBJECT (tg_type NUMBER, tg_id NUMBER, tg_layer_id NUMBER, topology_id NUMBER); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html CREATE TYPE SDO_GEORASTER AS OBJECT (rasterType NUMBER, spatialExtent SDO_GEOMETRY, rasterDataTable VARCHAR2(32), rasterID NUMBER, metadata XMLType); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Data-Types-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html SELECT TO_CHAR(TO_DATE('01-01-2009', 'MM-DD-YYYY'),'J') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Datetime-Expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Datetime-Expressions.html SELECT FROM_TZ(CAST(TO_DATE('1999-12-01 11:00:00', 'YYYY-MM-DD HH:MI:SS') AS TIMESTAMP), 'America/New_York') AT TIME ZONE 'America/Los_Angeles' "West Coast Time" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EMPTY_BLOB-EMPTY_CLOB-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EMPTY_BLOB-EMPTY_CLOB.html UPDATE print_media SET ad_photo = EMPTY_BLOB(); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXISTS-Condition-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXISTS-Condition.html SELECT department_id FROM departments d WHERE EXISTS (SELECT * FROM employees e WHERE d.department_id = e.department_id) ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXISTSNODE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXISTSNODE.html SELECT warehouse_id, warehouse_name FROM warehouses WHERE EXISTSNODE(warehouse_spec, '/Warehouse/Docks') = 1 ORDER BY warehouse_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXP.html SELECT EXP(4) "e to the 4th power" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXPLAIN-PLAN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXPLAIN-PLAN.html EXPLAIN PLAN SET STATEMENT_ID = 'Raise in Tokyo' INTO plan_table FOR UPDATE employees SET salary = salary * 1.10 WHERE department_id = (SELECT department_id FROM departments WHERE location_id = 1700); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXPLAIN-PLAN-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXPLAIN-PLAN.html SELECT id, LPAD(' ',2*(LEVEL-1))||operation operation, options, object_name, object_alias, position FROM plan_table START WITH id = 0 AND statement_id = 'Raise in Tokyo' CONNECT BY PRIOR id = parent_id AND statement_id = 'Raise in Tokyo' ORDER BY id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXPLAIN-PLAN-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXPLAIN-PLAN.html EXPLAIN PLAN FOR SELECT * FROM sales WHERE time_id BETWEEN :h AND '01-OCT-2000'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXPLAIN-PLAN-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXPLAIN-PLAN.html SELECT operation, options, partition_start, partition_stop, partition_id FROM plan_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXTRACT-XML-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXTRACT-XML.html SELECT warehouse_name, EXTRACT(warehouse_spec, '/Warehouse/Docks') "Number of Docks" FROM warehouses WHERE warehouse_spec IS NOT NULL ORDER BY warehouse_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXTRACT-datetime-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXTRACT-datetime.html SELECT EXTRACT(month FROM order_date) "Month", COUNT(order_date) "No. of Orders" FROM orders GROUP BY EXTRACT(month FROM order_date) ORDER BY "No. of Orders" DESC, "Month"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXTRACT-datetime-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXTRACT-datetime.html SELECT EXTRACT(YEAR FROM DATE '1998-03-07') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXTRACT-datetime-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXTRACT-datetime.html SELECT last_name, employee_id, hire_date FROM employees WHERE EXTRACT(YEAR FROM hire_date) > 2007 ORDER BY hire_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXTRACT-datetime-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXTRACT-datetime.html SELECT EXTRACT(TIMEZONE_REGION FROM TIMESTAMP '1999-01-01 10:00:00 -08:00') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/EXTRACTVALUE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/EXTRACTVALUE.html SELECT warehouse_name, EXTRACTVALUE(e.warehouse_spec, '/Warehouse/Docks') "Docks" FROM warehouses e WHERE warehouse_spec IS NOT NULL ORDER BY warehouse_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Expression-Lists-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Expression-Lists.html SELECT * FROM employees WHERE (first_name, last_name, email) IN (('Guy', 'Himuro', 'GHIMURO'),('Karen', 'Colmenares', 'KCOLMENA')) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Expression-Lists-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Expression-Lists.html SELECT department_id, MIN(salary) min, MAX(salary) max FROM employees GROUP BY department_id, salary ORDER BY department_id, min, max; SELECT department_id, MIN(salary) min, MAX(salary) max FROM employees GROUP BY (department_id, salary) ORDER BY department_id, min, max; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Expression-Lists-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Expression-Lists.html SELECT prod_category, prod_subcategory, country_id, cust_city, count(*) FROM products, sales, customers WHERE sales.prod_id = products.prod_id AND sales.cust_id=customers.cust_id AND sales.time_id = '01-oct-00' AND customers.cust_year_of_birth BETWEEN 1960 and 1970 GROUP BY GROUPING SETS ( (prod_category, prod_subcategory, country_id, cust_city), (prod_category, prod_subcategory, country_id), (prod_category, prod_subcategory), country_id ) ORDER BY prod_category, prod_subcategory, country_id, cust_city; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FEATURE_COMPARE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FEATURE_COMPARE.html SELECT 1-FEATURE_COMPARE(esa_wiki_mod USING 'There are several PGA tour golfers from South Africa' text AND USING 'Nick Price won the 2002 Mastercard Colonial Open' text) similarity FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FEATURE_COMPARE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FEATURE_COMPARE.html SELECT 1-FEATURE_COMPARE(esa_wiki_mod USING 'There are several PGA tour golfers from South Africa' text AND USING 'John Elway played quarterback for the Denver Broncos' text) similarity FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FEATURE_DETAILS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FEATURE_DETAILS.html SELECT S.feature_id fid, value val, FEATURE_DETAILS(nmf_sh_sample, S.feature_id, 5 using T.*) det FROM (SELECT v.*, FEATURE_SET(nmf_sh_sample, 3 USING *) fset FROM mining_data_apply_v v WHERE cust_id = 100002) T, TABLE(T.fset) S ORDER BY 2 DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FEATURE_DETAILS-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FEATURE_DETAILS.html SELECT feature_id, value FROM ( SELECT cust_id, feature_set(INTO 6 USING *) OVER () fset FROM mining_data_apply_v), TABLE (fset) WHERE cust_id = 100001 ORDER BY feature_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FEATURE_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FEATURE_ID.html SELECT FEATURE_ID(nmf_sh_sample USING *) AS feat, COUNT(*) AS cnt FROM nmf_sh_sample_apply_prepared GROUP BY FEATURE_ID(nmf_sh_sample USING *) ORDER BY cnt DESC, feat DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FEATURE_SET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FEATURE_SET.html WITH feat_tab AS ( SELECT F.feature_id fid, A.attribute_name attr, TO_CHAR(A.attribute_value) val, A.coefficient coeff FROM TABLE(DBMS_DATA_MINING.GET_MODEL_DETAILS_NMF('nmf_sh_sample')) F, TABLE(F.attribute_set) A WHERE A.coefficient > 0.25 ), feat AS ( SELECT fid, CAST(COLLECT(Featattr(attr, val, coeff)) AS Featattrs) f_attrs FROM feat_tab GROUP BY fid ), cust_10_features AS ( SELECT T.cust_id, S.feature_id, S.value FROM (SELECT cust_id, FEATURE_SET(nmf_sh_sample, 10 USING *) pset FROM nmf_sh_sample_apply_prepared WHERE cust_id = 100002) T, TABLE(T.pset) S ) SELECT A.value, A.feature_id fid, B.attr, B.val, B.coeff FROM cust_10_features A, (SELECT T.fid, F.* FROM feat T, TABLE(T.f_attrs) F) B WHERE A.feature_id = B.fid ORDER BY A.value DESC, A.feature_id ASC, coeff DESC, attr ASC, val ASC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FEATURE_VALUE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FEATURE_VALUE.html SELECT * FROM (SELECT cust_id, FEATURE_VALUE(nmf_sh_sample, 3 USING *) match_quality FROM nmf_sh_sample_apply_prepared ORDER BY match_quality DESC) WHERE ROWNUM < 11; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FIRST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FIRST.html SELECT department_id, MIN(salary) KEEP (DENSE_RANK FIRST ORDER BY commission_pct) "Worst", MAX(salary) KEEP (DENSE_RANK LAST ORDER BY commission_pct) "Best" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FIRST-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FIRST.html SELECT last_name, department_id, salary, MIN(salary) KEEP (DENSE_RANK FIRST ORDER BY commission_pct) OVER (PARTITION BY department_id) "Worst", MAX(salary) KEEP (DENSE_RANK LAST ORDER BY commission_pct) OVER (PARTITION BY department_id) "Best" FROM employees ORDER BY department_id, salary, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FIRST_VALUE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FIRST_VALUE.html SELECT employee_id, last_name, salary, hire_date, FIRST_VALUE(last_name) OVER (ORDER BY salary ASC ROWS UNBOUNDED PRECEDING) AS fv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FIRST_VALUE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FIRST_VALUE.html SELECT employee_id, last_name, salary, hire_date, FIRST_VALUE(last_name) OVER (ORDER BY salary ASC ROWS UNBOUNDED PRECEDING) AS fv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER by hire_date DESC); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FIRST_VALUE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FIRST_VALUE.html SELECT employee_id, last_name, salary, hire_date, FIRST_VALUE(last_name) OVER (ORDER BY salary ASC, employee_id ROWS UNBOUNDED PRECEDING) AS fv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date); SELECT employee_id, last_name, salary, hire_date, FIRST_VALUE(last_name) OVER (ORDER BY salary ASC, employee_id ROWS UNBOUNDED PRECEDING) AS fv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date DESC); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FIRST_VALUE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FIRST_VALUE.html SELECT employee_id, last_name, salary, hire_date, FIRST_VALUE(last_name) OVER (ORDER BY salary ASC RANGE UNBOUNDED PRECEDING) AS fv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date); SELECT employee_id, last_name, salary, hire_date, FIRST_VALUE(last_name) OVER (ORDER BY salary ASC RANGE UNBOUNDED PRECEDING) AS fv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date DESC); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-DATABASE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-DATABASE.html STARTUP MOUNT ALTER DATABASE FLASHBACK ON; ALTER DATABASE OPEN; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-DATABASE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-DATABASE.html SHUTDOWN DATABASE STARTUP MOUNT FLASHBACK DATABASE TO TIMESTAMP SYSDATE-1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html SELECT * FROM RECYCLEBIN; SELECT * FROM USER_RECYCLEBIN; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html CREATE TABLE employees_test AS SELECT * FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html SELECT object_name, droptime FROM user_recyclebin WHERE original_name = 'PRINT_MEDIA'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html SELECT salary FROM employees_test WHERE salary < 2500; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html ALTER TABLE employees_test ENABLE ROW MOVEMENT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html UPDATE employees_test SET salary = salary * 1.1 WHERE salary < 2500; COMMIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html SELECT salary FROM employees_test WHERE salary < 2500; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html FLASHBACK TABLE employees_test TO TIMESTAMP (SYSTIMESTAMP - INTERVAL '1' minute); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html SELECT salary FROM employees_test WHERE salary < 2500; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html FLASHBACK TABLE print_media TO BEFORE DROP; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLASHBACK-TABLE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLASHBACK-TABLE.html FLASHBACK TABLE print_media TO BEFORE DROP RENAME TO print_media_old; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FLOOR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FLOOR.html SELECT FLOOR(15.7) "Floor" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/FROM_TZ-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/FROM_TZ.html SELECT FROM_TZ(TIMESTAMP '2000-03-28 08:00:00', '3:00') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Floating-Point-Conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Floating-Point-Conditions.html SELECT COUNT(*) FROM employees WHERE commission_pct IS NOT NAN; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Floating-Point-Conditions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Floating-Point-Conditions.html SELECT last_name FROM employees WHERE salary IS NOT INFINITE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT TO_CHAR(number, 'fmt') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-47.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT TO_CHAR(TO_DATE('0207','MM/YY'), 'MM/YY') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-48.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT TO_CHAR(TO_DATE('0207', 'fxmm/yy'), 'mm/yy') FROM DUAL; SELECT TO_CHAR(TO_DATE('0207', 'fxmm/yy'), 'mm/yy') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-49.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT TO_CHAR (TO_DATE('02#07','MM/YY'), 'MM/YY') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT TO_CHAR(TO_DATE('27-OCT-98', 'DD-MON-RR'), 'YYYY') "Year" FROM DUAL; SELECT TO_CHAR(TO_DATE('27-OCT-17', 'DD-MON-RR'), 'YYYY') "Year" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-51.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT TO_CHAR(TO_DATE('27-OCT-98', 'DD-MON-RR'), 'YYYY') "Year" FROM DUAL; SELECT TO_CHAR(TO_DATE('27-OCT-17', 'DD-MON-RR'), 'YYYY') "Year" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT TO_CHAR(SYSDATE, 'fmDDTH') || ' of ' || TO_CHAR(SYSDATE, 'fmMonth') || ', ' || TO_CHAR(SYSDATE, 'YYYY') "Ides" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-53.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT TO_CHAR(SYSDATE, 'DDTH') || ' of ' || TO_CHAR(SYSDATE, 'Month') || ', ' || TO_CHAR(SYSDATE, 'YYYY') "Ides" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-54.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT TO_CHAR(SYSDATE, 'fmDay') || '''s Special' "Menu" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-56.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT last_name employee, TO_CHAR(salary, '$99,990.99') FROM employees WHERE department_id = 80; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-57.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html SELECT last_name employee, TO_CHAR(hire_date,'fmMonth DD, YYYY') hiredate FROM employees WHERE department_id = 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Format-Models-58.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Format-Models.html UPDATE employees SET hire_date = TO_DATE('2008 05 20','YYYY MM DD') WHERE last_name = 'Hunold'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT CREATE SESSION TO hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT CREATE SESSION TO hr, newuser IDENTIFIED BY password1, password2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT SELECT, UPDATE ON emp_view TO PUBLIC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT SELECT ON oe.customers_seq TO hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html SELECT oe.customers_seq.NEXTVAL FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT REFERENCES (employee_id), UPDATE (employee_id, salary, commission_pct) ON hr.employees TO oe; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html CREATE TABLE dependent (dependno NUMBER, dependname VARCHAR2(10), employee NUMBER CONSTRAINT in_emp REFERENCES hr.employees(employee_id) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT CREATE ANY MATERIALIZED VIEW , ALTER ANY MATERIALIZED VIEW , DROP ANY MATERIALIZED VIEW , QUERY REWRITE , GLOBAL QUERY REWRITE TO dw_manager WITH ADMIN OPTION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT dw_manager TO sh WITH ADMIN OPTION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT dw_manager TO sh WITH DELEGATE OPTION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT SELECT ON sh.sales TO warehouse_user; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT warehouse_user TO dw_manager; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT INHERIT PRIVILEGES ON USER sh TO hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT READ ON DIRECTORY bfile_dir TO hr WITH GRANT OPTION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GRANT-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GRANT.html GRANT ALL ON bonuses TO hr WITH GRANT OPTION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GREATEST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GREATEST.html SELECT GREATEST('HARRY', 'HARRIOT', 'HAROLD') "Greatest" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GREATEST-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GREATEST.html SELECT GREATEST (1, '3.925', '2.4') "Greatest" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GROUPING-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GROUPING.html SELECT DECODE(GROUPING(department_name), 1, 'ALL DEPARTMENTS', department_name) AS department, DECODE(GROUPING(job_id), 1, 'All Jobs', job_id) AS job, COUNT(*) "Total Empl", AVG(salary) * 12 "Average Sal" FROM employees e, departments d WHERE d.department_id = e.department_id GROUP BY ROLLUP (department_name, job_id) ORDER BY department, job; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GROUPING_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GROUPING_ID.html SELECT channel_id, promo_id, sum(amount_sold) s_sales, GROUPING(channel_id) gc, GROUPING(promo_id) gp, GROUPING_ID(channel_id, promo_id) gcp, GROUPING_ID(promo_id, channel_id) gpc FROM sales WHERE promo_id > 496 GROUP BY CUBE(channel_id, promo_id) ORDER BY channel_id, promo_id, s_sales, gc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/GROUP_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/GROUP_ID.html SELECT co.country_region, co.country_subregion, SUM(s.amount_sold) "Revenue", GROUP_ID() g FROM sales s, customers c, countries co WHERE s.cust_id = c.cust_id AND c.country_id = co.country_id AND s.time_id = '1-JAN-00' AND co.country_region IN ('Americas', 'Europe') GROUP BY GROUPING SETS ( (co.country_region, co.country_subregion), (co.country_region, co.country_subregion) ) ORDER BY co.country_region, co.country_subregion, "Revenue", g; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Graphic-Syntax-Diagrams-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Graphic-Syntax-Diagrams.html DROP LIBRARY hq_lib; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Graphic-Syntax-Diagrams-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Graphic-Syntax-Diagrams.html ALTER JAVA SOURCE jsource_1 COMPILE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/HEXTORAW-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/HEXTORAW.html CREATE TABLE test (raw_col RAW(10)); INSERT INTO test VALUES (HEXTORAW('7D')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/HEXTORAW-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/HEXTORAW.html SELECT UTL_RAW.CAST_TO_VARCHAR2(HEXTORAW('4041424344')) FROM DUAL; @ABCD ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Hierarchical-Queries-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Hierarchical-Queries.html SELECT employee_id, last_name, manager_id FROM employees CONNECT BY PRIOR employee_id = manager_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Hierarchical-Queries-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Hierarchical-Queries.html SELECT employee_id, last_name, manager_id, LEVEL FROM employees CONNECT BY PRIOR employee_id = manager_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Hierarchical-Queries-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Hierarchical-Queries.html SELECT last_name, employee_id, manager_id, LEVEL FROM employees START WITH employee_id = 100 CONNECT BY PRIOR employee_id = manager_id ORDER SIBLINGS BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Hierarchical-Queries-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Hierarchical-Queries.html UPDATE employees SET manager_id = 145 WHERE employee_id = 100; SELECT last_name "Employee", LEVEL, SYS_CONNECT_BY_PATH(last_name, '/') "Path" FROM employees WHERE level <= 3 AND department_id = 80 START WITH last_name = 'King' CONNECT BY PRIOR employee_id = manager_id AND LEVEL <= 4; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Hierarchical-Queries-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Hierarchical-Queries.html SELECT last_name "Employee", CONNECT_BY_ISCYCLE "Cycle", LEVEL, SYS_CONNECT_BY_PATH(last_name, '/') "Path" FROM employees WHERE level <= 3 AND department_id = 80 START WITH last_name = 'King' CONNECT BY NOCYCLE PRIOR employee_id = manager_id AND LEVEL <= 4 ORDER BY "Employee", "Cycle", LEVEL, "Path"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Hierarchical-Queries-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Hierarchical-Queries.html SELECT LTRIM(SYS_CONNECT_BY_PATH (warehouse_id,','),',') FROM (SELECT ROWNUM r, warehouse_id FROM warehouses) WHERE CONNECT_BY_ISLEAF = 1 START WITH r = 1 CONNECT BY r = PRIOR r + 1 ORDER BY warehouse_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Hierarchical-Queries-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Hierarchical-Queries.html SELECT last_name "Employee", CONNECT_BY_ROOT last_name "Manager", LEVEL-1 "Pathlen", SYS_CONNECT_BY_PATH(last_name, '/') "Path" FROM employees WHERE LEVEL > 1 and department_id = 110 CONNECT BY PRIOR employee_id = manager_id ORDER BY "Employee", "Manager", "Pathlen", "Path"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Hierarchical-Queries-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Hierarchical-Queries.html SELECT name, SUM(salary) "Total_Salary" FROM ( SELECT CONNECT_BY_ROOT last_name as name, Salary FROM employees WHERE department_id = 110 CONNECT BY PRIOR employee_id = manager_id) GROUP BY name ORDER BY name, "Total_Salary"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Hierarchical-Query-Pseudocolumns-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Hierarchical-Query-Pseudocolumns.html SELECT last_name "Employee", CONNECT_BY_ISLEAF "IsLeaf", LEVEL, SYS_CONNECT_BY_PATH(last_name, '/') "Path" FROM employees WHERE LEVEL <= 3 AND department_id = 80 START WITH employee_id = 100 CONNECT BY PRIOR employee_id = manager_id AND LEVEL <= 4 ORDER BY "Employee", "IsLeaf"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/IN-Condition-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/IN-Condition.html SELECT * FROM employees WHERE job_id IN ('PU_CLERK','SH_CLERK') ORDER BY employee_id; SELECT * FROM employees WHERE salary IN (SELECT salary FROM employees WHERE department_id =30) ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/IN-Condition-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/IN-Condition.html SELECT * FROM employees WHERE salary NOT IN (SELECT salary FROM employees WHERE department_id = 30) ORDER BY employee_id; SELECT * FROM employees WHERE job_id NOT IN ('PU_CLERK', 'SH_CLERK') ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/IN-Condition-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/IN-Condition.html SELECT 'True' FROM employees WHERE department_id NOT IN (10, 20); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/IN-Condition-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/IN-Condition.html SELECT 'True' FROM employees WHERE department_id NOT IN (10, 20, NULL); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/IN-Condition-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/IN-Condition.html SELECT 'True' FROM employees WHERE department_id NOT IN (SELECT 0 FROM DUAL WHERE 1=2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/IN-Condition-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/IN-Condition.html SELECT employee_id, last_name FROM employees WHERE (employee_id, LEVEL) IN (SELECT employee_id, 2 FROM employees) START WITH employee_id = 2 CONNECT BY PRIOR employee_id = manager_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/IN-Condition-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/IN-Condition.html SELECT v.employee_id, v.last_name, v.lev FROM (SELECT employee_id, last_name, LEVEL lev FROM employees v START WITH employee_id = 100 CONNECT BY PRIOR employee_id = manager_id) v WHERE (v.employee_id, v.lev) IN (SELECT employee_id, 2 FROM employees); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INITCAP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INITCAP.html SELECT INITCAP('the soap') "Capitals" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html CREATE TABLE raises (emp_id NUMBER, sal NUMBER CONSTRAINT check_sal CHECK(sal > 8000)); EXECUTE DBMS_ERRLOG.CREATE_ERROR_LOG('raises', 'errlog'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO raises SELECT employee_id, salary*1.1 FROM employees WHERE commission_pct > .2 LOG ERRORS INTO errlog ('my_bad') REJECT LIMIT 10; SELECT ORA_ERR_MESG$, ORA_ERR_TAG$, emp_id, sal FROM errlog; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO employees@remote VALUES (8002, 'Juan', 'Fernandez', 'juanf@example.com', NULL, TO_DATE('04-OCT-1992', 'DD-MON-YYYY'), 'SH_CLERK', 3000, NULL, 121, 20); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO departments VALUES (departments_seq.nextval, 'Entertainment', 162, 1400); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO employees (employee_id, last_name, email, hire_date, job_id, salary) VALUES (employees_seq.nextval, 'Doe', 'john.doe@example.com', SYSDATE, 'SH_CLERK', 2400) RETURNING salary*12, job_id INTO :bnd1, :bnd2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO persons VALUES (person_t('Bob', 1234)); INSERT INTO persons VALUES (employee_t('Joe', 32456, 12, 100000)); INSERT INTO persons VALUES ( part_time_emp_t('Tim', 5678, 13, 1000, 20)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO books VALUES ( 'An Autobiography', person_t('Bob', 1234)); INSERT INTO books VALUES ( 'Business Rules', employee_t('Joe', 3456, 12, 10000)); INSERT INTO books VALUES ( 'Mixing School and Work', part_time_emp_t('Tim', 5678, 13, 1000, 20)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html CREATE TABLE long_tab (pic_id NUMBER, long_pics LONG RAW); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html CREATE TABLE lob_tab (pic_id NUMBER, lob_pics BLOB); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO lob_tab SELECT pic_id, TO_LOB(long_pics) FROM long_tab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html ALTER TABLE long_tab DROP COLUMN long_pics; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html SELECT * FROM sales_input_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT ALL INTO sales (prod_id, cust_id, time_id, amount) VALUES (product_id, customer_id, weekly_start_date, sales_sun) INTO sales (prod_id, cust_id, time_id, amount) VALUES (product_id, customer_id, weekly_start_date+1, sales_mon) INTO sales (prod_id, cust_id, time_id, amount) VALUES (product_id, customer_id, weekly_start_date+2, sales_tue) INTO sales (prod_id, cust_id, time_id, amount) VALUES (product_id, customer_id, weekly_start_date+3, sales_wed) INTO sales (prod_id, cust_id, time_id, amount) VALUES (product_id, customer_id, weekly_start_date+4, sales_thu) INTO sales (prod_id, cust_id, time_id, amount) VALUES (product_id, customer_id, weekly_start_date+5, sales_fri) INTO sales (prod_id, cust_id, time_id, amount) VALUES (product_id, customer_id, weekly_start_date+6, sales_sat) SELECT product_id, customer_id, weekly_start_date, sales_sun, sales_mon, sales_tue, sales_wed, sales_thu, sales_fri, sales_sat FROM sales_input_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html SELECT * FROM sales ORDER BY prod_id, cust_id, time_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html CREATE TABLE small_orders (order_id NUMBER(12) NOT NULL, customer_id NUMBER(6) NOT NULL, order_total NUMBER(8,2), sales_rep_id NUMBER(6) ); CREATE TABLE medium_orders AS SELECT * FROM small_orders; CREATE TABLE large_orders AS SELECT * FROM small_orders; CREATE TABLE special_orders (order_id NUMBER(12) NOT NULL, customer_id NUMBER(6) NOT NULL, order_total NUMBER(8,2), sales_rep_id NUMBER(6), credit_limit NUMBER(9,2), cust_email VARCHAR2(40) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT ALL WHEN order_total <= 100000 THEN INTO small_orders WHEN order_total > 1000000 AND order_total <= 200000 THEN INTO medium_orders WHEN order_total > 200000 THEN INTO large_orders SELECT order_id, order_total, sales_rep_id, customer_id FROM orders; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT ALL WHEN order_total <= 100000 THEN INTO small_orders WHEN order_total > 100000 AND order_total <= 200000 THEN INTO medium_orders ELSE INTO large_orders SELECT order_id, order_total, sales_rep_id, customer_id FROM orders; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT ALL WHEN ottl <= 100000 THEN INTO small_orders VALUES(oid, ottl, sid, cid) WHEN ottl > 100000 and ottl <= 200000 THEN INTO medium_orders VALUES(oid, ottl, sid, cid) WHEN ottl > 200000 THEN into large_orders VALUES(oid, ottl, sid, cid) WHEN ottl > 290000 THEN INTO special_orders SELECT o.order_id oid, o.customer_id cid, o.order_total ottl, o.sales_rep_id sid, c.credit_limit cl, c.cust_email cem FROM orders o, customers c WHERE o.customer_id = c.customer_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT FIRST WHEN ottl <= 100000 THEN INTO small_orders VALUES(oid, ottl, sid, cid) WHEN ottl > 100000 and ottl <= 200000 THEN INTO medium_orders VALUES(oid, ottl, sid, cid) WHEN ottl > 290000 THEN INTO special_orders WHEN ottl > 200000 THEN INTO large_orders VALUES(oid, ottl, sid, cid) SELECT o.order_id oid, o.customer_id cid, o.order_total ottl, o.sales_rep_id sid, c.credit_limit cl, c.cust_email cem FROM orders o, customers c WHERE o.customer_id = c.customer_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html CREATE TABLE people ( person_id INTEGER NOT NULL PRIMARY KEY, given_name VARCHAR2(100) NOT NULL, family_name VARCHAR2(100) NOT NULL, title VARCHAR2(20), birth_date DATE ); CREATE TABLE patients ( patient_id INTEGER NOT NULL PRIMARY KEY REFERENCES people (person_id), last_admission_date DATE ); CREATE TABLE staff ( staff_id INTEGER NOT NULL PRIMARY KEY REFERENCES people (person_id), hired_date DATE ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO people VALUES (1, 'Dave', 'Badger', 'Mr', date'1960-05-01'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO people VALUES (2, 'Simon', 'Fox', 'Mr'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO people (person_id, given_name, family_name, title) VALUES (2, 'Simon', 'Fox', 'Mr'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO people (person_id, given_name, family_name, title) VALUES (3, 'Dave', 'Frog', (SELECT 'Mr' FROM dual)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO people (person_id, given_name, family_name, title) WITH names AS ( SELECT 4, 'Ruth', 'Fox', 'Mrs' FROM dual UNION ALL SELECT 5, 'Isabelle', 'Squirrel', 'Miss' FROM dual UNION ALL SELECT 6, 'Justin', 'Frog', 'Master' FROM dual UNION ALL SELECT 7, 'Lisa', 'Owl', 'Dr' FROM dual ) SELECT * FROM names; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO people (person_id, given_name, family_name, title) WITH names AS ( SELECT 4, 'Ruth', 'Fox' family_name, 'Mrs' FROM dual UNION ALL SELECT 5, 'Isabelle', 'Squirrel' family_name, 'Miss' FROM dual UNION ALL SELECT 6, 'Justin', 'Frog' family_name, 'Master' FROM dual UNION ALL SELECT 7, 'Lisa', 'Owl' family_name, 'Dr' FROM dual ) SELECT * FROM names WHERE family_name LIKE 'F%'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-39.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT ALL /* Every one is a person */ INTO people (person_id, given_name, family_name, title) VALUES (id, given_name, family_name, title) INTO patients (patient_id, last_admission_date) VALUES (id, admission_date) INTO staff (staff_id, hired_date) VALUES (id, hired_date) WITH names AS ( SELECT 4 id, 'Ruth' given_name, 'Fox' family_name, 'Mrs' title, NULL hired_date, DATE'2009-12-31' admission_date FROM dual UNION ALL SELECT 5 id, 'Isabelle' given_name, 'Squirrel' family_name, 'Miss' title , NULL hired_date, DATE'2014-01-01' admission_date FROM dual UNION ALL SELECT 6 id, 'Justin' given_name, 'Frog' family_name, 'Master' title, NULL hired_date, DATE'2015-04-22' admission_date FROM dual UNION ALL SELECT 7 id, 'Lisa' given_name, 'Owl' family_name, 'Dr' title, DATE'2015-01-01' hired_date, NULL admission_date FROM dual ) SELECT * FROM names; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT ALL /* Everyone is a person, so insert all rows into people */ WHEN 1=1 THEN INTO people (person_id, given_name, family_name, title) VALUES (id, given_name, family_name, title) /* Only people with an admission date are patients */ WHEN admission_date IS NOT NULL THEN INTO patients (patient_id, last_admission_date) VALUES (id, admission_date) /* Only people with a hired date are staff */ WHEN hired_date IS NOT NULL THEN INTO staff (staff_id, hired_date) VALUES (id, hired_date) WITH names AS ( SELECT 4 id, 'Ruth' given_name, 'Fox' family_name, 'Mrs' title, NULL hired_date, DATE'2009-12-31' admission_date FROM dual UNION ALL SELECT 5 id, 'Isabelle' given_name, 'Squirrel' family_name, 'Miss' title , NULL hired_date, DATE'2014-01-01' admission_date FROM dual UNION ALL SELECT 6 id, 'Justin' given_name, 'Frog' family_name, 'Master' title, NULL hired_date, DATE'2015-04-22' admission_date FROM dual UNION ALL SELECT 7 id, 'Lisa' given_name, 'Owl' family_name, 'Dr' title, DATE'2015-01-01' hired_date, NULL admission_date FROM dual ) SELECT * FROM names; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO departments VALUES (280, 'Recreation', 121, 1700); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO departments VALUES (280, 'Recreation', DEFAULT, 1700); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO employees (employee_id, last_name, email, hire_date, job_id, salary, commission_pct) VALUES (207, 'Gregory', 'pgregory@example.com', sysdate, 'PU_CLERK', 1.2E3, NULL); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO (SELECT employee_id, last_name, email, hire_date, job_id, salary, commission_pct FROM employees) VALUES (207, 'Gregory', 'pgregory@example.com', sysdate, 'PU_CLERK', 1.2E3, NULL); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSERT-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html INSERT INTO bonuses SELECT employee_id, salary*1.1 FROM employees WHERE commission_pct > 0.25; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSTR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSTR.html SELECT INSTR('CORPORATE FLOOR','OR', 3, 2) "Instring" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSTR-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSTR.html SELECT INSTR('CORPORATE FLOOR','OR', -3, 2) "Reversed Instring" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/INSTR-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSTR.html SELECT INSTRB('CORPORATE FLOOR','OR',5,2) "Instring in bytes" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/IS-OF-type-Condition-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/IS-OF-type-Condition.html SELECT * FROM persons p WHERE VALUE(p) IS OF TYPE (employee_t); SELECT * FROM persons p WHERE VALUE(p) IS OF (ONLY part_time_emp_t); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ITERATION_NUMBER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ITERATION_NUMBER.html SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER ITERATE(2) ( s['Mouse Pad', 2001 + ITERATION_NUMBER] = s['Mouse Pad', 1998 + ITERATION_NUMBER] ) ORDER BY country, prod, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Interval-Expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Interval-Expressions.html SELECT (SYSTIMESTAMP - order_date) DAY(9) TO SECOND FROM orders WHERE order_id = 2458; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON-Object-Access-Expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON-Object-Access-Expressions.html SELECT po.po_document.PONumber.number() FROM j_purchaseorder po; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON-Object-Access-Expressions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON-Object-Access-Expressions.html SELECT po.po_document.ShippingInstructions.Phone FROM j_purchaseorder po; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON-Object-Access-Expressions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON-Object-Access-Expressions.html SELECT po.po_document.LineItems.Part.Description FROM j_purchaseorder po; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_ARRAY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_ARRAY.html SELECT JSON_ARRAY ( JSON_OBJECT('percentage' VALUE .50), JSON_ARRAY(1,2,3), 100, 'California', null NULL ON NULL ) "JSON Array Example" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_ARRAYAGG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_ARRAYAGG.html CREATE TABLE id_table (id NUMBER); INSERT INTO id_table VALUES(624); INSERT INTO id_table VALUES(null); INSERT INTO id_table VALUES(925); INSERT INTO id_table VALUES(585); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_ARRAYAGG-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_ARRAYAGG.html SELECT JSON_ARRAYAGG(id ORDER BY id RETURNING VARCHAR2(100)) ID_NUMBERS FROM id_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_DATAGUIDE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_DATAGUIDE.html SELECT EXTRACT(YEAR FROM date_loaded) YEAR, JSON_DATAGUIDE(po_document) "DATA GUIDE" FROM j_purchaseorder GROUP BY extract(YEAR FROM date_loaded) ORDER BY extract(YEAR FROM date_loaded) DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_OBJECT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_OBJECT.html SELECT JSON_OBJECT( 'name' : first_name || ' ' || last_name, 'email' : email, 'phone' : phone_number, 'hire_date' : hire_date ) FROM employees WHERE employee_id = 140; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_OBJECT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_OBJECT.html SELECT JSON_OBJECT(*) FROM employees WHERE employee_id = 140; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_OBJECT-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_OBJECT.html SELECT JSON_OBJECT( 'first_name' VALUE first_name, 'last_name' VALUE last_name, 'email' VALUE email, 'hire_date' VALUE hire_date ) FROM employees WHERE employee_id = 140; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_OBJECT-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_OBJECT.html SELECT JSON_OBJECT(first_name, last_name, email, hire_date) FROM employees WHERE employee_id = 140; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_OBJECT-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_OBJECT.html SELECT JSON_OBJECT('NAME' VALUE first_name, d.*) FROM employees e, departments d WHERE e.department_id = d.department_id AND e.employee_id =140 ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_OBJECT-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_OBJECT.html SELECT JSON_ARRAYAGG(JSON_OBJECT(*)) FROM departments ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_OBJECT-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_OBJECT.html SELECT JSON_OBJECT ( KEY 'deptno' VALUE d.department_id, KEY 'deptname' VALUE d.department_name ) "Department Objects" FROM departments d ORDER BY d.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_OBJECTAGG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_OBJECTAGG.html SELECT JSON_OBJECTAGG(KEY department_name VALUE department_id) "Department Numbers" FROM departments WHERE department_id <= 30; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('{a:100, b:200, c:300}', '$') AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('{a:100, b:200, c:300}', '$.a' WITH WRAPPER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('[{"a":100},{"b":200},{"c":300}]', '$[*]' RETURNING VARCHAR2(100) WITH CONDITIONAL WRAPPER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('[{"a":100},{"b":200},{"c":300}]', '$[3]' EMPTY ON ERROR) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('{a:100, b:200, c:300}', '$.*' WITH WRAPPER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('[0,1,2,3,4]', '$') AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('[0,1,2,3,4]', '$' WITH WRAPPER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('[0,1,2,3,4]', '$[*]' WITH WRAPPER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('[0,1,2,3,4,5,6,7,8]', '$[0, 3 to 5, 7]' WITH WRAPPER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('[0,1,2,3,4]', '$[3]' WITH WRAPPER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('[{a:100},{b:200},{c:300}]', '$[0]' WITH CONDITIONAL WRAPPER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_QUERY-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_QUERY.html SELECT JSON_QUERY('[{"a":100},{"b":200},{"c":300}]', '$[*]' WITH CONDITIONAL WRAPPER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_SERIALIZE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_SERIALIZE.html SELECT JSON_SERIALIZE('{price:20, currency:" €"}' ASCII PRETTY ORDERED) from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT t.* FROM j_purchaseOrder NESTED po_document COLUMNS(PONumber, Reference, Requestor) t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT t.* FROM j_purchaseOrder LEFT OUTER JOIN JSON_TABLE(po_document COLUMNS(PONumber, Reference, Requestor)) t ON 1=1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT requestor FROM j_purchaseorder, JSON_TABLE(po_document, '$' COLUMNS (requestor VARCHAR2(32) PATH '$.Requestor', has_zip VARCHAR2(5) EXISTS PATH '$.ShippingInstructions.Address.zipCode')) WHERE (has_zip = 'true'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT * FROM JSON_TABLE('[1,2,["a","b"]]', '$' COLUMNS (outer_value_0 NUMBER PATH '$[0]', outer_value_1 NUMBER PATH '$[1]', outer_value_2 VARCHAR2(20) FORMAT JSON PATH '$[2]')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT * FROM JSON_TABLE('[1,2,["a","b"]]', '$' COLUMNS (outer_value_0 NUMBER PATH '$[0]', outer_value_1 NUMBER PATH '$[1]', NESTED PATH '$[2]' COLUMNS (nested_value_0 VARCHAR2(1) PATH '$[0]', nested_value_1 VARCHAR2(1) PATH '$[1]'))); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT * FROM JSON_TABLE('{a:100, b:200, c:{d:300, e:400}}', '$' COLUMNS (outer_value_0 NUMBER PATH '$.a', outer_value_1 NUMBER PATH '$.b', NESTED PATH '$.c' COLUMNS (nested_value_0 NUMBER PATH '$.d', nested_value_1 NUMBER PATH '$.e'))); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT jt.* FROM j_purchaseorder, JSON_TABLE(po_document, '$' COLUMNS (requestor VARCHAR2(32) PATH '$.Requestor', NESTED PATH '$.ShippingInstructions.Phone[*]' COLUMNS (phone_type VARCHAR2(32) PATH '$.type', phone_num VARCHAR2(20) PATH '$.number'))) AS jt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT c.* FROM customer t, JSON_TABLE(t.json COLUMNS( id, name, phone, address, NESTED orders[*] COLUMNS( updated, status, NESTED lineitems[*] COLUMNS( description, quantity NUMBER, price NUMBER ) ) )) c; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT c.* FROM customer t, JSON_TABLE(t.json, '$' COLUMNS( id PATH '$.id', name PATH '$.name', phone PATH '$.phone', address PATH '$.address', NESTED PATH '$.orders[*]' COLUMNS( updated PATH '$.updated', status PATH '$.status', NESTED PATH '$.lineitems[*]' COLUMNS( description PATH '$.description', quantity NUMBER PATH '$.quantity', price NUMBER PATH '$.price' ) ) )) c; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT * FROM j_purchaseOrder NESTED po_document.LineItems[*] COLUMNS(ItemNumber, Quantity NUMBER); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html CREATE TABLE j_purchaseorder (id RAW (16) NOT NULL, date_loaded TIMESTAMP(6) WITH TIME ZONE, po_document CLOB CONSTRAINT ensure_json CHECK (po_document IS JSON)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html INSERT INTO j_purchaseorder VALUES ( SYS_GUID(), SYSTIMESTAMP, '{"PONumber" : 1600, "Reference" : "ABULL-20140421", "Requestor" : "Alexis Bull", "User" : "ABULL", "CostCenter" : "A50", "ShippingInstructions" : {"name" : "Alexis Bull", "Address": {"street" : "200 Sporting Green", "city" : "South San Francisco", "state" : "CA", "zipCode" : 99236, "country" : "United States of America"}, "Phone" : [{"type" : "Office", "number" : "909-555-7307"}, {"type" : "Mobile", "number" : "415-555-1234"}]}, "Special Instructions" : null, "AllowPartialShipment" : true, "LineItems" : [{"ItemNumber" : 1, "Part" : {"Description" : "One Magic Christmas", "UnitPrice" : 19.95, "UPCCode" : 13131092899}, "Quantity" : 9.0}, {"ItemNumber" : 2, "Part" : {"Description" : "Lethal Weapon", "UnitPrice" : 19.95, "UPCCode" : 85391628927}, "Quantity" : 5.0}]}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT jt.phones FROM j_purchaseorder, JSON_TABLE(po_document, '$.ShippingInstructions' COLUMNS (phones VARCHAR2(100) FORMAT JSON PATH '$.Phone')) AS jt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT jt.* FROM j_purchaseorder, JSON_TABLE(po_document, '$.ShippingInstructions.Phone[*]' COLUMNS (row_number FOR ORDINALITY, phone_type VARCHAR2(10) PATH '$.type', phone_num VARCHAR2(20) PATH '$.number')) AS jt; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TABLE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TABLE.html SELECT requestor, has_zip FROM j_purchaseorder, JSON_TABLE(po_document, '$' COLUMNS (requestor VARCHAR2(32) PATH '$.Requestor', has_zip VARCHAR2(5) EXISTS PATH '$.ShippingInstructions.Address.zipCode')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TRANSFORM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TRANSFORM.html UPDATE t SET jcol = JSON_TRANSFORM(jcol, SET '$.lastUpdated' = SYSTIMESTAMP) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_TRANSFORM-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_TRANSFORM.html SELECT JSON_TRANSFORM (jcol, REMOVE '$.ssn') FROM t WHERE … ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('[{a:100}, {b:200}, {c:300}]', '$[*].c') AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('{firstname:"John"}', '$.lastname') AS "Last Name" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('{firstname:"John"}', '$.lastname' DEFAULT 'No last name found' ON ERROR) AS "Last Name" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('{a:100}', '$.a') AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('{a:100}', '$.a' RETURNING NUMBER) AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('{a:{b:100}}', '$.a.b') AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('{a:{b:100}, c:{d:200}, e:{f:300}}', '$.*.d') AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('[0, 1, 2, 3]', '$[0]') AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('{a:[5, 10, 15, 20]}', '$.a[2]') AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/JSON_VALUE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/JSON_VALUE.html SELECT JSON_VALUE('[{a:100}, {a:200}, {a:300}]', '$[1].a') AS value FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Joins-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Joins.html SELECT employee_id, manager_id FROM employees WHERE employees.manager_id(+) = employees.employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Joins-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Joins.html SELECT e1.employee_id, e1.manager_id, e2.employee_id FROM employees e1, employees e2 WHERE e1.manager_id(+) = e2.employee_id ORDER BY e1.employee_id, e1.manager_id, e2.employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Joins-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Joins.html SELECT * FROM A, B, D WHERE A.c1 = B.c2(+) and D.c3 = B.c4(+); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LAG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LAG.html SELECT hire_date, last_name, salary, LAG(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees WHERE job_id = 'PU_CLERK' ORDER BY hire_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LAST_DAY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LAST_DAY.html SELECT SYSDATE, LAST_DAY(SYSDATE) "Last", LAST_DAY(SYSDATE) - SYSDATE "Days Left" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LAST_DAY-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LAST_DAY.html SELECT last_name, hire_date, TO_CHAR(ADD_MONTHS(LAST_DAY(hire_date), 5)) "Eval Date" FROM employees ORDER BY last_name, hire_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LAST_VALUE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LAST_VALUE.html SELECT employee_id, last_name, salary, hire_date, LAST_VALUE(hire_date) OVER (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS lv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LAST_VALUE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LAST_VALUE.html SELECT employee_id, last_name, salary, hire_date, LAST_VALUE(hire_date) OVER (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS lv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date DESC); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LAST_VALUE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LAST_VALUE.html SELECT employee_id, last_name, salary, hire_date, LAST_VALUE(hire_date) OVER (ORDER BY salary DESC, employee_id ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS lv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date); SELECT employee_id, last_name, salary, hire_date, LAST_VALUE(hire_date) OVER (ORDER BY salary DESC, employee_id ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS lv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date DESC); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LAST_VALUE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LAST_VALUE.html SELECT employee_id, last_name, salary, hire_date, LAST_VALUE(hire_date) OVER (ORDER BY salary DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS lv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date); SELECT employee_id, last_name, salary, hire_date, LAST_VALUE(hire_date) OVER (ORDER BY salary DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS lv FROM (SELECT * FROM employees WHERE department_id = 90 ORDER BY hire_date DESC); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LEAD-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LEAD.html SELECT hire_date, last_name, LEAD(hire_date, 1) OVER (ORDER BY hire_date) AS "NextHired" FROM employees WHERE department_id = 30 ORDER BY hire_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LEAST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LEAST.html SELECT LEAST('HARRY','HARRIOT','HAROLD') "Least" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LEAST-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LEAST.html SELECT LEAST (1, '2.1', '.000832') "Least" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LENGTH-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LENGTH.html SELECT LENGTH('CANDIDE') "Length in characters" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LENGTH-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LENGTH.html SELECT LENGTHB ('CANDIDE') "Length in bytes" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LISTAGG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LISTAGG.html SELECT LISTAGG(last_name, '; ') WITHIN GROUP (ORDER BY hire_date, last_name) "Emp_list", MIN(hire_date) "Earliest" FROM employees WHERE department_id = 30; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LISTAGG-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LISTAGG.html SELECT department_id "Dept.", LISTAGG(last_name, '; ') WITHIN GROUP (ORDER BY hire_date) "Employees" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LISTAGG-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LISTAGG.html SELECT department_id "Dept.", LISTAGG(last_name, '; ' ON OVERFLOW TRUNCATE '...') WITHIN GROUP (ORDER BY hire_date) "Employees" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LISTAGG-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LISTAGG.html SELECT department_id "Dept", hire_date "Date", last_name "Name", LISTAGG(last_name, '; ') WITHIN GROUP (ORDER BY hire_date, last_name) OVER (PARTITION BY department_id) as "Emp_list" FROM employees WHERE hire_date < '01-SEP-2003' ORDER BY "Dept", "Date", "Name"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LN.html SELECT LN(95) "Natural log of 95" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LNNVL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LNNVL.html SELECT COUNT(*) FROM employees WHERE commission_pct < .2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LNNVL-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LNNVL.html SELECT COUNT(*) FROM employees WHERE LNNVL(commission_pct >= .2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LOCALTIMESTAMP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LOCALTIMESTAMP.html ALTER SESSION SET TIME_ZONE = '-5:00'; SELECT CURRENT_TIMESTAMP, LOCALTIMESTAMP FROM DUAL; ALTER SESSION SET TIME_ZONE = '-8:00'; SELECT CURRENT_TIMESTAMP, LOCALTIMESTAMP FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LOCALTIMESTAMP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LOCALTIMESTAMP.html CREATE TABLE local_test (col1 TIMESTAMP WITH LOCAL TIME ZONE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LOCALTIMESTAMP-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LOCALTIMESTAMP.html INSERT INTO local_test VALUES (TO_TIMESTAMP(LOCALTIMESTAMP, 'DD-MON-RR HH.MI.SSXFF')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LOCALTIMESTAMP-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LOCALTIMESTAMP.html INSERT INTO local_test VALUES (TO_TIMESTAMP(LOCALTIMESTAMP, 'DD-MON-RR HH.MI.SSXFF PM')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LOCK-TABLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LOCK-TABLE.html LOCK TABLE employees IN EXCLUSIVE MODE NOWAIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LOCK-TABLE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LOCK-TABLE.html LOCK TABLE employees@remote IN SHARE MODE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LOG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LOG.html SELECT LOG(10,100) "Log base 10 of 100" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LOWER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LOWER.html SELECT LOWER('MR. SCOTT MCMILLAN') "Lowercase" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LPAD-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LPAD.html SELECT LPAD('Page 1',15,'*.') "LPAD example" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/LTRIM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/LTRIM.html SELECT LTRIM('<=====>BROWNING<=====>', '<>=') "LTRIM Example" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Lexical-Conventions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Lexical-Conventions.html SELECT last_name,salary*12,MONTHS_BETWEEN(SYSDATE,hire_date) FROM employees WHERE department_id = 30 ORDER BY last_name; SELECT last_name, salary * 12, MONTHS_BETWEEN( SYSDATE, hire_date ) FROM employees WHERE department_id=30 ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT COUNT(*) FROM employees WHERE salary < BINARY_FLOAT_INFINITY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT COUNT(*) FROM employees WHERE TO_BINARY_FLOAT(commission_pct) != BINARY_FLOAT_NAN; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT COUNT(*) FROM employees WHERE salary < BINARY_DOUBLE_INFINITY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html INSERT INTO my_table VALUES (1, SYSDATE); INSERT INTO my_table VALUES (2, TRUNC(SYSDATE)); SELECT * FROM my_table; SELECT * FROM my_table WHERE datecol > TO_DATE('02-OCT-02', 'DD-MON-YY'); SELECT * FROM my_table WHERE datecol = TO_DATE('03-OCT-02','DD-MON-YY'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT * FROM my_table WHERE datecol = DATE '2002-10-03'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT * FROM my_table WHERE TRUNC(datecol) = DATE '2002-10-03'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html INSERT INTO my_table VALUES (3, TO_DATE('3-OCT-2002','DD-MON-YYYY')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html INSERT INTO my_table VALUES (4, '03-OCT-02'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html INSERT INTO my_table VALUES (5, TRUNC(SYSDATE)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT TIMESTAMP '2009-10-29 01:30:00' AT TIME ZONE 'US/Pacific' FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html ALTER SESSION SET NLS_NUMERIC_CHARACTERS=',.'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT 2 * 1.23, 3 * '2,34' FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT 2 * 1,23 FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT 3 * '2.34' FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Literals-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Literals.html SELECT COUNT(*) FROM employees WHERE TO_BINARY_FLOAT(commission_pct) != BINARY_FLOAT_NAN; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Logical-Conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Logical-Conditions.html SELECT * FROM employees WHERE NOT (job_id IS NULL) ORDER BY employee_id; SELECT * FROM employees WHERE NOT (salary BETWEEN 1000 AND 2000) ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Logical-Conditions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Logical-Conditions.html SELECT * FROM employees WHERE job_id = 'PU_CLERK' AND department_id = 30 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Logical-Conditions-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Logical-Conditions.html SELECT * FROM employees WHERE job_id = 'PU_CLERK' OR department_id = 10 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Logical-Conditions-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Logical-Conditions.html SELECT * FROM employees WHERE hire_date < TO_DATE('01-JAN-2004', 'DD-MON-YYYY') AND salary > 2500 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Logical-Conditions-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Logical-Conditions.html SELECT employee_id FROM employees WHERE commission_pct = .4 OR salary > 20000 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MAKE_REF-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MAKE_REF.html SELECT MAKE_REF (oc_inventories, 3003) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MAX-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MAX.html SELECT MAX(salary) "Maximum" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MAX-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MAX.html SELECT manager_id, last_name, salary, MAX(salary) OVER (PARTITION BY manager_id) AS mgr_max FROM employees ORDER BY manager_id, last_name, salary; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MAX-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MAX.html SELECT manager_id, last_name, salary FROM (SELECT manager_id, last_name, salary, MAX(salary) OVER (PARTITION BY manager_id) AS rmax_sal FROM employees) WHERE salary = rmax_sal ORDER BY manager_id, last_name, salary; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MEDIAN-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MEDIAN.html SELECT department_id, MEDIAN(salary) FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MEDIAN-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MEDIAN.html SELECT manager_id, employee_id, salary, MEDIAN(salary) OVER (PARTITION BY manager_id) "Median by Mgr" FROM employees WHERE department_id > 60 ORDER BY manager_id, employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html CREATE TABLE bonuses (employee_id NUMBER, bonus NUMBER DEFAULT 100); INSERT INTO bonuses(employee_id) (SELECT e.employee_id FROM hr.employees e, oe.orders o WHERE e.employee_id = o.sales_rep_id GROUP BY e.employee_id); SELECT * FROM bonuses ORDER BY employee_id; MERGE INTO bonuses D USING (SELECT employee_id, salary, department_id FROM hr.employees WHERE department_id = 80) S ON (D.employee_id = S.employee_id) WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01 DELETE WHERE (S.salary > 8000) WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus) VALUES (S.employee_id, S.salary*.01) WHERE (S.salary <= 8000); SELECT * FROM bonuses ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html CREATE TABLE people_source ( person_id INTEGER NOT NULL PRIMARY KEY, first_name VARCHAR2(20) NOT NULL, last_name VARCHAR2(20) NOT NULL, title VARCHAR2(10) NOT NULL ); CREATE TABLE people_target ( person_id INTEGER NOT NULL PRIMARY KEY, first_name VARCHAR2(20) NOT NULL, last_name VARCHAR2(20) NOT NULL, title VARCHAR2(10) NOT NULL ); INSERT INTO people_target VALUES (1, 'John', 'Smith', 'Mr'); INSERT INTO people_target VALUES (2, 'alice', 'jones', 'Mrs'); INSERT INTO people_source VALUES (2, 'Alice', 'Jones', 'Mrs.'); INSERT INTO people_source VALUES (3, 'Jane', 'Doe', 'Miss'); INSERT INTO people_source VALUES (4, 'Dave', 'Brown', 'Mr'); COMMIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html var person_id NUMBER; var first_name VARCHAR2(20); var last_name VARCHAR2(20); var title VARCHAR2(10); exec :person_id := 3; exec :first_name := 'Gerald'; exec :last_name := 'Walker'; exec :title := 'Mr'; MERGE INTO people_target ON (person_id = :person_id) WHEN MATCHED THEN UPDATE SET first_name = :first_name, last_name = :last_name, title = :title WHEN NOT MATCHED THEN INSERT (person_id, first_name, last_name, title) VALUES (:person_id, :first_name, :last_name, :title); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html SELECT * FROM people_target; ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html var person_id NUMBER; var first_name VARCHAR2(20); var last_name VARCHAR2(20); var title VARCHAR2(10); exec :person_id := 2; exec :first_name := 'Alice'; exec :last_name := 'Jones'; exec :title := 'Mrs'; MERGE INTO people_target ON (person_id = :person_id) WHEN MATCHED THEN UPDATE SET first_name = :first_name, last_name = :last_name, title = :title WHEN NOT MATCHED THEN INSERT (person_id, first_name, last_name, title) VALUES (:person_id, :first_name, :last_name, :title); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html SELECT * FROM people_target; ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html MERGE INTO people_target pt USING people_source ps ON (pt.person_id = ps.person_id) WHEN MATCHED THEN UPDATE SET pt.first_name = ps.first_name, pt.last_name = ps.last_name, pt.title = ps.title; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html SELECT * FROM people_target; ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html MERGE INTO people_target pt USING people_source ps ON (pt.person_id = ps.person_id) WHEN NOT MATCHED THEN INSERT (pt.person_id, pt.first_name, pt.last_name, pt.title) VALUES (ps.person_id, ps.first_name, ps.last_name, ps.title); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html SELECT * FROM people_target; ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html MERGE INTO people_target pt USING people_source ps ON (pt.person_id = ps.person_id) WHEN MATCHED THEN UPDATE SET pt.first_name = ps.first_name, pt.last_name = ps.last_name, pt.title = ps.title WHEN NOT MATCHED THEN INSERT (pt.person_id, pt.first_name, pt.last_name, pt.title) VALUES (ps.person_id, ps.first_name, ps.last_name, ps.title); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html SELECT * FROM people_target; ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html MERGE INTO people_target pt USING people_source ps ON (pt.person_id = ps.person_id) WHEN MATCHED THEN UPDATE SET pt.first_name = ps.first_name, pt.last_name = ps.last_name, pt.title = ps.title DELETE where pt.title = 'Mrs.' WHEN NOT MATCHED THEN INSERT (pt.person_id, pt.first_name, pt.last_name, pt.title) VALUES (ps.person_id, ps.first_name, ps.last_name, ps.title) WHERE ps.title = 'Mr'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MERGE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html SELECT * FROM people_target; ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MIN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MIN.html SELECT MIN(hire_date) "Earliest" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MIN-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MIN.html SELECT manager_id, last_name, hire_date, salary, MIN(salary) OVER(PARTITION BY manager_id ORDER BY hire_date RANGE UNBOUNDED PRECEDING) AS p_cmin FROM employees ORDER BY manager_id, last_name, hire_date, salary; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MOD-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MOD.html SELECT MOD(11,4) "Modulus" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/MONTHS_BETWEEN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MONTHS_BETWEEN.html SELECT MONTHS_BETWEEN (TO_DATE('02-02-1995','MM-DD-YYYY'), TO_DATE('01-01-1995','MM-DD-YYYY') ) "Months" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Model-Conditions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Model-Conditions.html SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER ( s[ANY, 2000] = 0 ) ORDER BY country, prod, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Model-Conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Model-Conditions.html SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER ( s['Mouse Pad', 2000] = CASE WHEN s['Mouse Pad', 1999] IS PRESENT THEN s['Mouse Pad', 1999] ELSE 0 END ) ORDER BY country, prod, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Model-Expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Model-Expressions.html SELECT country,prod,year,s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER ( s[prod='Mouse Pad', year=2000] = s['Mouse Pad', 1998] + s['Mouse Pad', 1999], s['Standard Mouse', 2001] = s['Standard Mouse', 2000] ) ORDER BY country, prod, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Conditions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Conditions.html SELECT customer_id, cust_address_ntab FROM customers_demo WHERE cust_address_ntab IS A SET ORDER BY customer_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Conditions.html SELECT product_id, TO_CHAR(ad_finaltext) AS text FROM print_media WHERE ad_textdocs_ntab IS NOT EMPTY ORDER BY product_id, text; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Conditions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Conditions.html SELECT customer_id, cust_address_ntab FROM customers_demo WHERE cust_address_typ('8768 N State Rd 37', 47404, 'Bloomington', 'IN', 'US') MEMBER OF cust_address_ntab ORDER BY customer_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Conditions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Conditions.html SELECT customer_id, cust_address_ntab FROM customers_demo WHERE cust_address_ntab SUBMULTISET OF cust_address2_ntab ORDER BY customer_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Operators-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Operators.html CREATE TABLE customers_demo AS SELECT * FROM customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Operators-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Operators.html CREATE TYPE cust_address_tab_typ AS TABLE OF cust_address_typ; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Operators-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Operators.html ALTER TABLE customers_demo ADD (cust_address_ntab cust_address_tab_typ, cust_address2_ntab cust_address_tab_typ) NESTED TABLE cust_address_ntab STORE AS cust_address_ntab_store NESTED TABLE cust_address2_ntab STORE AS cust_address2_ntab_store; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Operators-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Operators.html UPDATE customers_demo cd SET cust_address_ntab = CAST(MULTISET(SELECT cust_address FROM customers c WHERE c.customer_id = cd.customer_id) as cust_address_tab_typ); UPDATE customers_demo cd SET cust_address2_ntab = CAST(MULTISET(SELECT cust_address FROM customers c WHERE c.customer_id = cd.customer_id) as cust_address_tab_typ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Operators-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Operators.html SELECT customer_id, cust_address_ntab MULTISET EXCEPT DISTINCT cust_address2_ntab multiset_except FROM customers_demo ORDER BY customer_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Operators-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Operators.html SELECT customer_id, cust_address_ntab MULTISET INTERSECT DISTINCT cust_address2_ntab multiset_intersect FROM customers_demo ORDER BY customer_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Multiset-Operators-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Multiset-Operators.html SELECT customer_id, cust_address_ntab MULTISET UNION cust_address2_ntab multiset_union FROM customers_demo ORDER BY customer_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NANVL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NANVL.html INSERT INTO float_point_demo VALUES (0,'NaN','NaN'); SELECT * FROM float_point_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NANVL-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NANVL.html SELECT bin_float, NANVL(bin_float,0) FROM float_point_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NCHR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NCHR.html SELECT NCHR(187) FROM DUAL; SELECT CHR(187 USING NCHAR_CS) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NEW_TIME-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NEW_TIME.html ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; SELECT NEW_TIME(TO_DATE('11-10-09 01:23:45', 'MM-DD-YY HH24:MI:SS'), 'AST', 'PST') "New Date and Time" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NEXT_DAY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NEXT_DAY.html SELECT NEXT_DAY('15-OCT-2009','TUESDAY') "NEXT DAY" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLSSORT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLSSORT.html CREATE TABLE test (name VARCHAR2(15)); INSERT INTO test VALUES ('Gaardiner'); INSERT INTO test VALUES ('Gaberd'); INSERT INTO test VALUES ('Gaasten'); SELECT * FROM test ORDER BY name; SELECT * FROM test ORDER BY NLSSORT(name, 'NLS_SORT = XDanish'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLSSORT-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLSSORT.html SELECT * FROM test WHERE name > 'Gaberd' ORDER BY name; SELECT * FROM test WHERE NLSSORT(name, 'NLS_SORT = XDanish') > NLSSORT('Gaberd', 'NLS_SORT = XDanish') ORDER BY name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLSSORT-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLSSORT.html ALTER SESSION SET NLS_COMP = 'LINGUISTIC'; ALTER SESSION SET NLS_SORT = 'XDanish'; SELECT * FROM test WHERE name > 'Gaberd' ORDER BY name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_CHARSET_DECL_LEN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_CHARSET_DECL_LEN.html SELECT NLS_CHARSET_DECL_LEN(200, nls_charset_id('ja16eucfixed')) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_CHARSET_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_CHARSET_ID.html SELECT NLS_CHARSET_ID('ja16euc') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_CHARSET_NAME-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_CHARSET_NAME.html SELECT NLS_CHARSET_NAME(2) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_COLLATION_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_COLLATION_ID.html SELECT NLS_COLLATION_ID('BINARY_CI') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_COLLATION_NAME-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_COLLATION_NAME.html SELECT NLS_COLLATION_NAME(81919) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_COLLATION_NAME-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_COLLATION_NAME.html SELECT NLS_COLLATION_NAME(208897,'S') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_COLLATION_NAME-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_COLLATION_NAME.html SELECT NLS_COLLATION_NAME(208897,'L') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_INITCAP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_INITCAP.html SELECT NLS_INITCAP('ijsland') "InitCap" FROM DUAL; SELECT NLS_INITCAP('ijsland', 'NLS_SORT = XDutch') "InitCap" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_LOWER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_LOWER.html SELECT NLS_LOWER('NOKTASINDA', 'NLS_SORT = XTurkish') "Lowercase" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NLS_UPPER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NLS_UPPER.html SELECT NLS_UPPER('große') "Uppercase" FROM DUAL; SELECT NLS_UPPER('große', 'NLS_SORT = XGerman') "Uppercase" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Traditional-Auditing-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Traditional-Auditing.html NOAUDIT ROLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Traditional-Auditing-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Traditional-Auditing.html NOAUDIT SELECT TABLE BY hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Traditional-Auditing-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Traditional-Auditing.html NOAUDIT DELETE ANY TABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Traditional-Auditing-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Traditional-Auditing.html NOAUDIT SELECT ON hr.employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Traditional-Auditing-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Traditional-Auditing.html NOAUDIT SELECT ON hr.employees WHENEVER SUCCESSFUL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Unified-Auditing-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Unified-Auditing.html NOAUDIT POLICY table_pol; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Unified-Auditing-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Unified-Auditing.html SELECT * FROM audit_unified_enabled_policies WHERE policy_name = 'TABLE_POL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Unified-Auditing-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Unified-Auditing.html SELECT policy_name, enabled_option, entity_name FROM audit_unified_enabled_policies WHERE policy_name = 'DML_POL' ORDER BY entity_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Unified-Auditing-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Unified-Auditing.html NOAUDIT POLICY dml_pol BY hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Unified-Auditing-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Unified-Auditing.html SELECT policy_name, enabled_option, entity_name FROM audit_unified_enabled_policies WHERE policy_name = 'DML_POL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Unified-Auditing-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Unified-Auditing.html NOAUDIT POLICY dml_pol BY sh; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Unified-Auditing-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Unified-Auditing.html SELECT * FROM audit_unified_enabled_policies WHERE policy_name = 'DML_POL'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NOAUDIT-Unified-Auditing-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NOAUDIT-Unified-Auditing.html NOAUDIT CONTEXT NAMESPACE userenv ATTRIBUTES current_user, db_name BY hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NTH_VALUE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NTH_VALUE.html SELECT prod_id, channel_id, MIN(amount_sold), NTH_VALUE(MIN(amount_sold), 2) OVER (PARTITION BY prod_id ORDER BY channel_id ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) nv FROM sales WHERE prod_id BETWEEN 13 and 16 GROUP BY prod_id, channel_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NTILE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NTILE.html SELECT last_name, salary, NTILE(4) OVER (ORDER BY salary DESC) AS quartile FROM employees WHERE department_id = 100 ORDER BY last_name, salary, quartile; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NULLIF-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NULLIF.html SELECT e.last_name, NULLIF(j.job_id, e.job_id) "Old Job ID" FROM employees e, job_history j WHERE e.employee_id = j.employee_id ORDER BY last_name, "Old Job ID"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NUMTODSINTERVAL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NUMTODSINTERVAL.html SELECT manager_id, last_name, hire_date, COUNT(*) OVER (PARTITION BY manager_id ORDER BY hire_date RANGE NUMTODSINTERVAL(100, 'day') PRECEDING) AS t_count FROM employees ORDER BY last_name, hire_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NUMTOYMINTERVAL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NUMTOYMINTERVAL.html SELECT last_name, hire_date, salary, SUM(salary) OVER (ORDER BY hire_date RANGE NUMTOYMINTERVAL(1,'year') PRECEDING) AS t_sal FROM employees ORDER BY last_name, hire_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NVL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NVL.html SELECT last_name, NVL(TO_CHAR(commission_pct), 'Not Applicable') commission FROM employees WHERE last_name LIKE 'B%' ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/NVL2-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/NVL2.html SELECT last_name, salary, NVL2(commission_pct, salary + (salary * commission_pct), salary) income FROM employees WHERE last_name like 'B%' ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Null-Conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Null-Conditions.html SELECT last_name FROM employees WHERE commission_pct IS NULL ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ORA_DM_PARTITION_NAME-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ORA_DM_PARTITION_NAME.html SELECT prediction(mymodel using *) pred, ora_dm_partition_name(mymodel USING *) pname FROM customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ORA_HASH-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ORA_HASH.html SELECT SUM(amount_sold) FROM sales WHERE ORA_HASH(CONCAT(cust_id, prod_id), 99, 5) = 0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ORA_INVOKING_USER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ORA_INVOKING_USER.html SELECT ORA_INVOKING_USER FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ORA_INVOKING_USERID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ORA_INVOKING_USERID.html SELECT ORA_INVOKING_USERID FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ORA_ROWSCN-Pseudocolumn-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ORA_ROWSCN-Pseudocolumn.html SELECT ORA_ROWSCN, last_name FROM employees WHERE employee_id = 188; SELECT SCN_TO_TIMESTAMP(ORA_ROWSCN), last_name FROM employees WHERE employee_id = 188; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Object-Access-Expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Object-Access-Expressions.html CREATE TABLE short_orders ( sales_rep VARCHAR2(25), item order_item_typ); UPDATE short_orders s SET sales_rep = 'Unassigned'; SELECT o.item.line_item_id, o.item.quantity FROM short_orders o; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PERCENTILE_CONT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PERCENTILE_CONT.html SELECT department_id, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY salary DESC) "Median cont", PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY salary DESC) "Median disc" FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PERCENTILE_CONT-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PERCENTILE_CONT.html SELECT last_name, salary, department_id, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY salary DESC) OVER (PARTITION BY department_id) "Percentile_Cont", PERCENT_RANK() OVER (PARTITION BY department_id ORDER BY salary DESC) "Percent_Rank" FROM employees WHERE department_id IN (30, 60) ORDER BY last_name, salary, department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PERCENTILE_DISC-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PERCENTILE_DISC.html SELECT last_name, salary, department_id, PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY salary DESC) OVER (PARTITION BY department_id) "Percentile_Disc", CUME_DIST() OVER (PARTITION BY department_id ORDER BY salary DESC) "Cume_Dist" FROM employees WHERE department_id in (30, 60) ORDER BY last_name, salary, department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PERCENT_RANK-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PERCENT_RANK.html SELECT PERCENT_RANK(15000, .05) WITHIN GROUP (ORDER BY salary, commission_pct) "Percent-Rank" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PERCENT_RANK-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PERCENT_RANK.html SELECT department_id, last_name, salary, PERCENT_RANK() OVER (PARTITION BY department_id ORDER BY salary DESC) AS pr FROM employees ORDER BY pr, salary, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/POWER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/POWER.html SELECT POWER(3,2) "Raised" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/POWERMULTISET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/POWERMULTISET.html CREATE TYPE cust_address_tab_tab_typ AS TABLE OF cust_address_tab_typ; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/POWERMULTISET-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/POWERMULTISET.html SELECT CAST(POWERMULTISET(cust_address_ntab) AS cust_address_tab_tab_typ) FROM customers_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/POWERMULTISET_BY_CARDINALITY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/POWERMULTISET_BY_CARDINALITY.html CREATE TYPE cust_address_tab_tab_typ AS TABLE OF cust_address_tab_typ; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/POWERMULTISET_BY_CARDINALITY-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/POWERMULTISET_BY_CARDINALITY.html UPDATE customers_demo SET cust_address_ntab = cust_address_ntab MULTISET UNION cust_address_ntab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/POWERMULTISET_BY_CARDINALITY-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/POWERMULTISET_BY_CARDINALITY.html SELECT CAST(POWERMULTISET_BY_CARDINALITY(cust_address_ntab, 2) AS cust_address_tab_tab_typ) FROM customers_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREDICTION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREDICTION.html SELECT cust_gender, COUNT(*) AS cnt, ROUND(AVG(age)) AS avg_age FROM mining_data_apply_v WHERE PREDICTION(dt_sh_clas_sample COST MODEL USING cust_marital_status, education, household_size) = 1 GROUP BY cust_gender ORDER BY cust_gender; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREDICTION-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREDICTION.html SELECT cust_id, age, pred_age, age-pred_age age_diff, pred_det FROM (SELECT cust_id, age, pred_age, pred_det, RANK() OVER (ORDER BY ABS(age-pred_age) desc) rnk FROM (SELECT cust_id, age, PREDICTION(FOR age USING *) OVER () pred_age, PREDICTION_DETAILS(FOR age ABS USING *) OVER () pred_det FROM mining_data_apply_v)) WHERE rnk <= 3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREDICTION_BOUNDS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREDICTION_BOUNDS.html SELECT count(cust_id) cust_count, cust_marital_status FROM (SELECT cust_id, cust_marital_status FROM mining_data_apply_v WHERE PREDICTION_BOUNDS(glmr_sh_regr_sample,0.98 USING *).LOWER > 24 AND PREDICTION_BOUNDS(glmr_sh_regr_sample,0.98 USING *).UPPER < 46) GROUP BY cust_marital_status; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREDICTION_COST-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREDICTION_COST.html SELECT cust_id FROM (SELECT cust_id,rank() OVER (ORDER BY PREDICTION_COST(DT_SH_Clas_sample, 1 COST MODEL USING *) ASC, cust_id) rnk FROM mining_data_apply_v WHERE country_name = 'Italy') WHERE rnk <= 10 ORDER BY rnk; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREDICTION_DETAILS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREDICTION_DETAILS.html SELECT PREDICTION_DETAILS(svmr_sh_regr_sample, null, 3 USING *) prediction_details FROM mining_data_apply_v WHERE cust_id = 100001; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREDICTION_DETAILS-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREDICTION_DETAILS.html SELECT cust_id, age, pred_age, age-pred_age age_diff, pred_det FROM (SELECT cust_id, age, pred_age, pred_det, RANK() OVER (ORDER BY ABS(age-pred_age) DESC) rnk FROM (SELECT cust_id, age, PREDICTION(FOR age USING *) OVER () pred_age, PREDICTION_DETAILS(FOR age ABS USING *) OVER () pred_det FROM mining_data_apply_v)) WHERE rnk <= 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREDICTION_PROBABILITY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREDICTION_PROBABILITY.html SELECT cust_id FROM ( SELECT cust_id FROM mining_data_apply_v WHERE country_name = 'Italy' ORDER BY PREDICTION_PROBABILITY(DT_SH_Clas_sample, 1 USING *) DESC, cust_id) WHERE rownum < 11; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREDICTION_PROBABILITY-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREDICTION_PROBABILITY.html SELECT cust_id, cust_marital_status, rank_anom, anom_det FROM (SELECT cust_id, cust_marital_status, anom_det, rank() OVER (PARTITION BY CUST_MARITAL_STATUS ORDER BY ANOM_PROB DESC,cust_id) rank_anom FROM (SELECT cust_id, cust_marital_status, PREDICTION_PROBABILITY(OF ANOMALY, 0 USING *) OVER (PARTITION BY CUST_MARITAL_STATUS) anom_prob, PREDICTION_DETAILS(OF ANOMALY, 0, 3 USING *) OVER (PARTITION BY CUST_MARITAL_STATUS) anom_det FROM mining_data_one_class_v )) WHERE rank_anom < 3 order by 2, 3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREDICTION_SET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREDICTION_SET.html SELECT T.cust_id, S.prediction, S.probability, S.cost FROM (SELECT cust_id, PREDICTION_SET(dt_sh_clas_sample COST MODEL USING *) pset FROM mining_data_apply_v WHERE cust_id < 100006) T, TABLE(T.pset) S ORDER BY cust_id, S.prediction; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PRESENTNNV-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PRESENTNNV.html SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER ( s['Mouse Pad', 2002] = PRESENTNNV(s['Mouse Pad', 2002], s['Mouse Pad', 2002], 10) ) ORDER BY country, prod, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PRESENTV-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PRESENTV.html SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER ( s['Mouse Pad', 2001] = PRESENTV(s['Mouse Pad', 2000], s['Mouse Pad', 2000], 0) ) ORDER BY country, prod, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PREVIOUS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PREVIOUS.html SELECT dim_col, cur_val, num_of_iterations FROM (SELECT 1 AS dim_col, 10 AS cur_val FROM dual) MODEL DIMENSION BY (dim_col) MEASURES (cur_val, 0 num_of_iterations) IGNORE NAV UNIQUE DIMENSION RULES ITERATE (1000) UNTIL (PREVIOUS(cur_val[1]) - cur_val[1] < 1) ( cur_val[1] = cur_val[1]/2, num_of_iterations[1] = num_of_iterations[1] + 1 ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PURGE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PURGE.html SELECT * FROM RECYCLEBIN; SELECT * FROM USER_RECYCLEBIN; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PURGE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PURGE.html PURGE TABLE test; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PURGE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PURGE.html PURGE TABLE RB$$33750$TABLE$0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/PURGE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/PURGE.html PURGE RECYCLEBIN; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Pattern-matching-Conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Pattern-matching-Conditions.html SELECT last_name FROM employees WHERE last_name LIKE '%A\_B%' ESCAPE '\' ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Pattern-matching-Conditions-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Pattern-matching-Conditions.html CREATE TABLE ducks (f CHAR(6), v VARCHAR2(6)); INSERT INTO ducks VALUES ('DUCK', 'DUCK'); SELECT '*'||f||'*' "char", '*'||v||'*' "varchar" FROM ducks; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Pattern-matching-Conditions-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Pattern-matching-Conditions.html SELECT first_name, last_name FROM employees WHERE REGEXP_LIKE (first_name, '^Ste(v|ph)en$') ORDER BY first_name, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Pattern-matching-Conditions-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Pattern-matching-Conditions.html SELECT last_name FROM employees WHERE REGEXP_LIKE (last_name, '([aeiou])\1', 'i') ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Pattern-matching-Conditions-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Pattern-matching-Conditions.html SELECT salary FROM employees WHERE last_name LIKE 'R%' ORDER BY salary; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Pattern-matching-Conditions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Pattern-matching-Conditions.html SELECT salary FROM employees WHERE last_name = 'R%' ORDER BY salary; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Pattern-matching-Conditions-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Pattern-matching-Conditions.html SELECT salary FROM employees WHERE 'SM%' LIKE last_name ORDER BY salary; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Pattern-matching-Conditions-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Pattern-matching-Conditions.html SELECT last_name FROM employees WHERE last_name LIKE '%A\_B%' ESCAPE '\' ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RANK-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RANK.html SELECT RANK(15500, .05) WITHIN GROUP (ORDER BY salary, commission_pct) "Rank" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RANK-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RANK.html SELECT RANK(15500) WITHIN GROUP (ORDER BY salary DESC) "Rank of 15500" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RANK-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RANK.html SELECT department_id, last_name, salary, RANK() OVER (PARTITION BY department_id ORDER BY salary) RANK FROM employees WHERE department_id = 60 ORDER BY RANK, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RATIO_TO_REPORT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RATIO_TO_REPORT.html SELECT last_name, salary, RATIO_TO_REPORT(salary) OVER () AS rr FROM employees WHERE job_id = 'PU_CLERK' ORDER BY last_name, salary, rr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RAWTOHEX-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RAWTOHEX.html SELECT RAWTOHEX(raw_column) "Graphics" FROM graphics; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RAWTONHEX-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RAWTONHEX.html SELECT RAWTONHEX(raw_column), DUMP ( RAWTONHEX (raw_column) ) "DUMP" FROM graphics; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REF-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REF.html CREATE TABLE addresses OF cust_address_typ; INSERT INTO addresses VALUES ( '123 First Street', '4GF H1J', 'Our Town', 'Ourcounty', 'US'); SELECT REF(e) FROM addresses e; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REFTOHEX-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REFTOHEX.html CREATE TABLE warehouse_table OF warehouse_typ (PRIMARY KEY (warehouse_id)); CREATE TABLE location_table (location_number NUMBER, building REF warehouse_typ SCOPE IS warehouse_table); INSERT INTO warehouse_table VALUES (1, 'Downtown', 99); INSERT INTO location_table SELECT 10, REF(w) FROM warehouse_table w; SELECT REFTOHEX(building) FROM location_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html SELECT REGEXP_COUNT('123123123123123', '(12)3', 1, 'i') REGEXP_COUNT FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html SELECT REGEXP_COUNT('123123123123', '123', 3, 'i') COUNT FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC123', '[A-Z][0-9]{2}') Char_num_like_A12_anywhere, regexp_count('A1B2C34', '[A-Z][0-9]{2}') Char_num_like_A12_anywhere from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC12D3', '([A-Z][0-9]){2}') Char_num_within_2_places, regexp_count('A1B2C3', '([A-Z][0-9]){2}') Char_num_within_2_places from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html CREATE TABLE regexp_temp(empName varchar2(20)); INSERT INTO regexp_temp (empName) VALUES ('John Doe'); INSERT INTO regexp_temp (empName) VALUES ('Jane Doe'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html SELECT empName, REGEXP_COUNT(empName, 'e', 1, 'c') "CASE_SENSITIVE_E" From regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html SELECT empName, REGEXP_COUNT(empName, 'o', 1, 'c') "CASE_SENSITIVE_O" From regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html SELECT empName, REGEXP_COUNT(empName, 'E', 1, 'i') "CASE_INSENSITIVE_E" From regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html SELECT empName, REGEXP_COUNT(empName, 'do', 1, 'i') "CASE_INSENSITIVE_STRING" From regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html SELECT empName, REGEXP_COUNT(empName, 'an', 1, 'c') "CASE_SENSITIVE_STRING" From regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC123', '[A-Z]'), regexp_count('A1B2C3', '[A-Z]') from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC123', '[A-Z][0-9]'), regexp_count('A1B2C3', '[A-Z][0-9]') from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC123', '[A-Z][0-9]'), regexp_count('A1B2C3', '[A-Z][0-9]') from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC123', '[A-Z][0-9]{2}'), regexp_count('A1B2C3', '[A-Z][0-9]{2}') from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC123', '([A-Z][0-9]){2}'), regexp_count('A1B2C3', '([A-Z][0-9]){2}') from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC123', '[A-Z]') Match_char_ABC_count, regexp_count('A1B2C3', '[A-Z]') Match_char_ABC_count from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC123', '[A-Z][0-9]') Match_string_C1_count, regexp_count('A1B2C3', '[A-Z][0-9]') Match_strings_A1_B2_C3_count from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_COUNT-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_COUNT.html select regexp_count('ABC123A5', '^[A-Z][0-9]') Char_num_like_A1_at_start, regexp_count('A1B2C3', '^[A-Z][0-9]') Char_num_like_A1_at_start from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_INSTR-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_INSTR.html SELECT REGEXP_INSTR('500 Oracle Parkway, Redwood Shores, CA', '[^ ]+', 1, 6) "REGEXP_INSTR" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_INSTR-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_INSTR.html SELECT REGEXP_INSTR('500 Oracle Parkway, Redwood Shores, CA', '[s|r|p][[:alpha:]]{6}', 3, 2, 1, 'i') "REGEXP_INSTR" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_INSTR-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_INSTR.html SELECT REGEXP_INSTR('1234567890', '(123)(4(56)(78))', 1, 1, 0, 'i', 1) "REGEXP_INSTR" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_INSTR-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_INSTR.html SELECT REGEXP_INSTR('1234567890', '(123)(4(56)(78))', 1, 1, 0, 'i', 2) "REGEXP_INSTR" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_INSTR-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_INSTR.html SELECT REGEXP_INSTR('1234567890', '(123)(4(56)(78))', 1, 1, 0, 'i', 4) "REGEXP_INSTR" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_INSTR-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_INSTR.html CREATE TABLE regexp_temp(empName varchar2(20), emailID varchar2(20)); INSERT INTO regexp_temp (empName, emailID) VALUES ('John Doe', 'johndoe@example.com'); INSERT INTO regexp_temp (empName, emailID) VALUES ('Jane Doe', 'janedoe'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_INSTR-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_INSTR.html SELECT emailID, REGEXP_INSTR(emailID, '\w+@\w+(\.\w+)+') "IS_A_VALID_EMAIL" FROM regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html SELECT REGEXP_REPLACE(phone_number, '([[:digit:]]{3})\.([[:digit:]]{3})\.([[:digit:]]{4})', '(\1) \2-\3') "REGEXP_REPLACE" FROM employees ORDER BY "REGEXP_REPLACE"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html SELECT REGEXP_REPLACE(country_name, '(.)', '\1 ') "REGEXP_REPLACE" FROM countries; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html WITH strings as ( SELECT 'AddressLine1' s FROM dual union all SELECT 'ZipCode' s FROM dual union all SELECT 'Country' s FROM dual ) SELECT s "STRING", lower(regexp_replace(s, '([A-Z0-9])', '_\1', 2)) "MODIFIED_STRING" FROM strings; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html WITH date_strings AS ( SELECT '2015-01-01' d from dual union all SELECT '2000-12-31' d from dual union all SELECT '900-01-01' d from dual ) SELECT d "STRING", regexp_replace(d, '([[:digit:]]+)-([[:digit:]]{2})-([[:digit:]]{2})', '\3.\2.\1') "MODIFIED_STRING" FROM date_strings; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html WITH strings as ( SELECT 'NEW YORK' s FROM dual union all SELECT 'New York' s FROM dual union all SELECT 'new york' s FROM dual ) SELECT s "STRING", regexp_replace(s, '[a-z]', '1', 1, 0, 'i') "CASE_INSENSITIVE", regexp_replace(s, '[a-z]', '1', 1, 0, 'c') "CASE_SENSITIVE", regexp_replace(s, '[a-zA-Z]', '1', 1, 0, 'c') "CASE_SENSITIVE_MATCHING" FROM strings; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html SELECT REGEXP_REPLACE('500 Oracle Parkway, Redwood Shores, CA', '( ){2,}', ' ') "REGEXP_REPLACE" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html CREATE TABLE regexp_temp(empName varchar2(20), emailID varchar2(20)); INSERT INTO regexp_temp (empName, emailID) VALUES ('John Doe', 'johndoe@example.com'); INSERT INTO regexp_temp (empName, emailID) VALUES ('Jane Doe', 'janedoe@example.com'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html SELECT empName, REGEXP_REPLACE (empName, 'Jane', 'John') "STRING_REPLACE" FROM regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html SELECT empName, REGEXP_REPLACE (empName, 'Jane', 'John') "STRING_REPLACE" FROM regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html WITH strings AS ( SELECT 'abc123' s FROM dual union all SELECT '123abc' s FROM dual union all SELECT 'a1b2c3' s FROM dual ) SELECT s "STRING", regexp_replace(s, '[0-9]', '') "MODIFIED_STRING" FROM strings; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html WITH strings AS ( SELECT 'abc123' s from DUAL union all SELECT '123abc' s from DUAL union all SELECT 'a1b2c3' s from DUAL ) SELECT s "STRING", REGEXP_REPLACE(s, '[0-9]', '', 1, 1) "MODIFIED_STRING" FROM strings; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html WITH strings AS ( SELECT 'abc123' s from DUAL union all SELECT '123abc' s from DUAL union all SELECT 'a1b2c3' s from DUAL ) SELECT s "STRING", REGEXP_REPLACE(s, '[0-9]', '', 1, 2) "MODIFIED_STRING" FROM strings; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_REPLACE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_REPLACE.html WITH strings AS ( SELECT 'Hello World' s FROM dual union all SELECT 'Hello World' s FROM dual union all SELECT 'Hello, World !' s FROM dual ) SELECT s "STRING", regexp_replace(s, ' {2,}', ' ') "MODIFIED_STRING" FROM strings; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_SUBSTR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_SUBSTR.html SELECT REGEXP_SUBSTR('500 Oracle Parkway, Redwood Shores, CA', ',[^,]+,') "REGEXPR_SUBSTR" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_SUBSTR-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_SUBSTR.html SELECT REGEXP_SUBSTR('http://www.example.com/products', 'http://([[:alnum:]]+\.?){3,4}/?') "REGEXP_SUBSTR" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_SUBSTR-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_SUBSTR.html SELECT REGEXP_SUBSTR('1234567890', '(123)(4(56)(78))', 1, 1, 'i', 1) "REGEXP_SUBSTR" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_SUBSTR-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_SUBSTR.html SELECT REGEXP_SUBSTR('1234567890', '(123)(4(56)(78))', 1, 1, 'i', 4) "REGEXP_SUBSTR" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_SUBSTR-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_SUBSTR.html CREATE TABLE regexp_temp(empName varchar2(20), emailID varchar2(20)); INSERT INTO regexp_temp (empName, emailID) VALUES ('John Doe', 'johndoe@example.com'); INSERT INTO regexp_temp (empName, emailID) VALUES ('Jane Doe', 'janedoe'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_SUBSTR-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_SUBSTR.html SELECT empName, REGEXP_SUBSTR(emailID, '[[:alnum:]]+\@[[:alnum:]]+\.[[:alnum:]]+') "Valid Email" FROM regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_SUBSTR-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_SUBSTR.html SELECT empName, REGEXP_SUBSTR(emailID, '[[:alnum:]]+\@[[:alnum:]]+\.[[:alnum:]]+') "Valid Email", REGEXP_INSTR(emailID, '\w+@\w+(\.\w+)+') "FIELD_WITH_VALID_EMAIL" FROM regexp_temp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_SUBSTR-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_SUBSTR.html with strings as ( select 'ABC123' str from dual union all select 'A1B2C3' str from dual union all select '123ABC' str from dual union all select '1A2B3C' str from dual ) select regexp_substr(str, '[0-9]') First_Occurrence_of_Number, regexp_substr(str, '[0-9].*') Num_Followed_by_String, regexp_substr(str, '[A-Z][0-9]') Letter_Followed_by_String from strings; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGEXP_SUBSTR-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGEXP_SUBSTR.html with strings as ( select 'LHRJFK/010315/JOHNDOE' str from dual union all select 'CDGLAX/050515/JANEDOE' str from dual union all select 'LAXCDG/220515/JOHNDOE' str from dual union all select 'SFOJFK/010615/JANEDOE' str from dual ) SELECT regexp_substr(str, '[A-Z]{6}') String_of_6_characters, regexp_substr(str, '[0-9]+') First_Matching_Numbers, regexp_substr(str, '[A-Z].*$') Letter_by_other_characters, regexp_substr(str, '/[A-Z].*$') Slash_letter_and_characters FROM strings; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGR_-Linear-Regression-Functions-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGR_-Linear-Regression-Functions.html SELECT job_id, REGR_COUNT(SYSDATE-hire_date, salary) count FROM employees WHERE department_id in (30, 50) GROUP BY job_id ORDER BY job_id, count; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGR_-Linear-Regression-Functions-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGR_-Linear-Regression-Functions.html SELECT job_id, REGR_R2(SYSDATE-hire_date, salary) Regr_R2 FROM employees WHERE department_id in (80, 50) GROUP by job_id ORDER BY job_id, Regr_R2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGR_-Linear-Regression-Functions-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGR_-Linear-Regression-Functions.html SELECT job_id, REGR_AVGY(SYSDATE-hire_date, salary) avgy, REGR_AVGX(SYSDATE-hire_date, salary) avgx FROM employees WHERE department_id in (30,50) GROUP BY job_id ORDER BY job_id, avgy, avgx; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGR_-Linear-Regression-Functions-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGR_-Linear-Regression-Functions.html SELECT job_id, REGR_SXY(SYSDATE-hire_date, salary) regr_sxy, REGR_SXX(SYSDATE-hire_date, salary) regr_sxx, REGR_SYY(SYSDATE-hire_date, salary) regr_syy FROM employees WHERE department_id in (80, 50) GROUP BY job_id ORDER BY job_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGR_-Linear-Regression-Functions-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGR_-Linear-Regression-Functions.html SELECT job_id, employee_id ID, salary, REGR_SLOPE(SYSDATE-hire_date, salary) OVER (PARTITION BY job_id) slope, REGR_INTERCEPT(SYSDATE-hire_date, salary) OVER (PARTITION BY job_id) intcpt, REGR_R2(SYSDATE-hire_date, salary) OVER (PARTITION BY job_id) rsqr, REGR_COUNT(SYSDATE-hire_date, salary) OVER (PARTITION BY job_id) count, REGR_AVGX(SYSDATE-hire_date, salary) OVER (PARTITION BY job_id) avgx, REGR_AVGY(SYSDATE-hire_date, salary) OVER (PARTITION BY job_id) avgy FROM employees WHERE department_id in (50, 80) ORDER BY job_id, employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REGR_-Linear-Regression-Functions-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REGR_-Linear-Regression-Functions.html SELECT job_id, REGR_SLOPE(SYSDATE-hire_date, salary) slope, REGR_INTERCEPT(SYSDATE-hire_date, salary) intercept FROM employees WHERE department_id in (50,80) GROUP BY job_id ORDER BY job_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REMAINDER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REMAINDER.html SELECT bin_float, bin_double, REMAINDER(bin_float, bin_double) FROM float_point_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RENAME-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RENAME.html RENAME departments_new TO emp_departments; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RENAME-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RENAME.html CREATE TABLE temporary (employee_id, start_date, end_date, job_id, dept_id) AS SELECT employee_id, start_date, end_date, job_id, department_id FROM job_history; DROP TABLE job_history; RENAME temporary TO job_history; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REPLACE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REPLACE.html SELECT REPLACE('JACK and JUE','J','BL') "Changes" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE DROP ANY TABLE FROM hr, oe; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE dw_manager FROM sh; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE INHERIT PRIVILEGES ON USER sh FROM hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html GRANT SELECT ON hr.departments_seq TO oe; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE SELECT ON hr.departments_seq FROM oe; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html GRANT REFERENCES, UPDATE ON hr.employees TO oe; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html CREATE TABLE dependent (dependno NUMBER, dependname VARCHAR2(10), employee NUMBER CONSTRAINT in_emp REFERENCES hr.employees(employee_id) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE REFERENCES ON hr.employees FROM oe CASCADE CONSTRAINTS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE READ ON DIRECTORY bfile_dir FROM hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html CONNECT hr GRANT UPDATE ON employees TO oe WITH GRANT OPTION; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html CONNECT oe GRANT UPDATE ON hr.employees TO pm; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html CONNECT sh REVOKE UPDATE ON hr.employees FROM oe; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE CREATE TABLESPACE FROM dw_manager; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE dw_user FROM dw_manager; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html GRANT ALL ON orders TO hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE DELETE ON orders FROM hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE ALL ON orders FROM hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html GRANT SELECT, UPDATE ON emp_details_view TO public; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html REVOKE UPDATE ON emp_details_view FROM public; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/REVOKE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/REVOKE.html GRANT INHERIT PRIVILEGES ON USER sh TO hr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROLLBACK-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROLLBACK.html ROLLBACK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROLLBACK-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROLLBACK.html ROLLBACK TO SAVEPOINT banda_sal; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROLLBACK-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROLLBACK.html ROLLBACK WORK FORCE '25.32.87'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROUND-date-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROUND-date.html SELECT ROUND (TO_DATE ('27-OCT-00'),'YEAR') "New Year" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROUND-number-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROUND-number.html SELECT ROUND(15.193,1) "Round" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROUND-number-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROUND-number.html SELECT ROUND(15.193,-1) "Round" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROUND_TIES_TO_EVEN-number-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROUND_TIES_TO_EVEN-number.html SELECT ROUND_TIES_TO_EVEN(45.177,-1) "ROUND_EVEN" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROWID-Pseudocolumn-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROWID-Pseudocolumn.html SELECT ROWID, last_name FROM employees WHERE department_id = 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROWIDTOCHAR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROWIDTOCHAR.html SELECT ROWID FROM employees WHERE ROWIDTOCHAR(ROWID) LIKE '%JAAB%' ORDER BY ROWID; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROWIDTONCHAR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROWIDTONCHAR.html SELECT LENGTHB( ROWIDTONCHAR(ROWID) ) Length, ROWIDTONCHAR(ROWID) FROM employees ORDER BY length; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROWNUM-Pseudocolumn-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROWNUM-Pseudocolumn.html SELECT * FROM employees WHERE ROWNUM < 11; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROWNUM-Pseudocolumn-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROWNUM-Pseudocolumn.html SELECT * FROM employees WHERE ROWNUM < 11 ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROWNUM-Pseudocolumn-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROWNUM-Pseudocolumn.html SELECT * FROM (SELECT * FROM employees ORDER BY employee_id) WHERE ROWNUM < 11; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROWNUM-Pseudocolumn-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROWNUM-Pseudocolumn.html SELECT * FROM employees WHERE ROWNUM > 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROWNUM-Pseudocolumn-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROWNUM-Pseudocolumn.html UPDATE my_table SET column1 = ROWNUM; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROW_NUMBER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROW_NUMBER.html SELECT department_id, first_name, last_name, salary FROM ( SELECT department_id, first_name, last_name, salary, ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY salary desc) rn FROM employees ) WHERE rn <= 3 ORDER BY department_id, salary DESC, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ROW_NUMBER-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ROW_NUMBER.html SELECT sales_2000.channel_desc, sales_2000.prod_name, sales_2000.amt amt_2000, top_5_prods_1999_year.amt amt_1999, sales_2000.amt - top_5_prods_1999_year.amt amt_diff FROM /* The first subquery finds the 5 top-selling products per channel in year 1999. */ (SELECT channel_desc, prod_name, amt FROM ( SELECT channel_desc, prod_name, sum(amount_sold) amt, ROW_NUMBER () OVER (PARTITION BY channel_desc ORDER BY SUM(amount_sold) DESC) rn FROM sales, times, channels, products WHERE sales.time_id = times.time_id AND times.calendar_year = 1999 AND channels.channel_id = sales.channel_id AND products.prod_id = sales.prod_id GROUP BY channel_desc, prod_name ) WHERE rn <= 5 ) top_5_prods_1999_year, /* The next subquery finds sales per product and per channel in 2000. */ (SELECT channel_desc, prod_name, sum(amount_sold) amt FROM sales, times, channels, products WHERE sales.time_id = times.time_id AND times.calendar_year = 2000 AND channels.channel_id = sales.channel_id AND products.prod_id = sales.prod_id GROUP BY channel_desc, prod_name ) sales_2000 WHERE sales_2000.channel_desc = top_5_prods_1999_year.channel_desc AND sales_2000.prod_name = top_5_prods_1999_year.prod_name ORDER BY sales_2000.channel_desc, sales_2000.prod_name ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RPAD-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RPAD.html SELECT last_name, RPAD(' ', salary/1000/1, '*') "Salary" FROM employees WHERE department_id = 80 ORDER BY last_name, "Salary"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/RTRIM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/RTRIM.html SELECT RTRIM('<=====>BROWNING<=====>', '<>=') "RTRIM Example" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SAVEPOINT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SAVEPOINT.html UPDATE employees SET salary = 7000 WHERE last_name = 'Banda'; SAVEPOINT banda_sal; UPDATE employees SET salary = 12000 WHERE last_name = 'Greene'; SAVEPOINT greene_sal; SELECT SUM(salary) FROM employees; ROLLBACK TO SAVEPOINT banda_sal; UPDATE employees SET salary = 11000 WHERE last_name = 'Greene'; COMMIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SCN_TO_TIMESTAMP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SCN_TO_TIMESTAMP.html SELECT SCN_TO_TIMESTAMP(ORA_ROWSCN) FROM employees WHERE employee_id = 188; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SCN_TO_TIMESTAMP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SCN_TO_TIMESTAMP.html SELECT salary FROM employees WHERE employee_id = 188; UPDATE employees SET salary = salary*10 WHERE employee_id = 188; COMMIT; SELECT salary FROM employees WHERE employee_id = 188; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SCN_TO_TIMESTAMP-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SCN_TO_TIMESTAMP.html SELECT SCN_TO_TIMESTAMP(ORA_ROWSCN) FROM employees WHERE employee_id = 188; FLASHBACK TABLE employees TO TIMESTAMP TO_TIMESTAMP('28-AUG-03 01.00.00.000000000 PM'); SELECT salary FROM employees WHERE employee_id = 188; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT ename, mgr, FIRST_VALUE(sal) OVER w AS "first", LAST_VALUE(sal) OVER w AS "last", NTH_VALUE(sal, 2) OVER w AS "second", NTH_VALUE(sal, 4) OVER w AS "fourth" FROM emp WINDOW w AS (PARTITION BY deptno ORDER BY sal ROWS UNBOUNDED PRECEDING); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-100.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html UPDATE TABLE(SELECT h.people FROM hr_info h WHERE h.department_id = 280) p SET p.salary = p.salary + 100; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-101.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html DELETE TABLE(SELECT h.people FROM hr_info h WHERE h.department_id = 280) p WHERE p.salary > 1700; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-102.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT t1.department_id, t2.* FROM hr_info t1, TABLE(t1.people) t2 WHERE t2.department_id = t1.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-103.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT t1.department_id, t2.* FROM hr_info t1, TABLE(CAST(MULTISET( SELECT t3.last_name, t3.department_id, t3.salary FROM people t3 WHERE t3.department_id = t1.department_id) AS people_tab_typ)) t2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-105.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT LPAD(' ',2*(LEVEL-1)) || last_name org_chart, employee_id, manager_id, job_id FROM employees START WITH job_id = 'AD_VP' CONNECT BY PRIOR employee_id = manager_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-106.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT LPAD(' ',2*(LEVEL-1)) || last_name org_chart, employee_id, manager_id, job_id FROM employees WHERE job_id != 'FI_MGR' START WITH job_id = 'AD_VP' CONNECT BY PRIOR employee_id = manager_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-107.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT LPAD(' ',2*(LEVEL-1)) || last_name org_chart, employee_id, manager_id, job_id FROM employees START WITH job_id = 'AD_PRES' CONNECT BY PRIOR employee_id = manager_id AND LEVEL <= 2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-108.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT last_name, department_name FROM employees@remote, departments WHERE employees.department_id = departments.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-109.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html UPDATE table1 t_alias1 SET column = (SELECT expr FROM table2 t_alias2 WHERE t_alias1.column = t_alias2.column); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT docID FROM vec_table ORDER BY VECTOR_DISTANCE(data, :query_vec) FETCH APPROX FIRST 20 ROWS ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-110.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT department_id, last_name, salary FROM employees x WHERE salary > (SELECT AVG(salary) FROM employees WHERE x.department_id = department_id) ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-111.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT CURRENT_DATE FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-112.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT CURRENT_DATE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-113.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT employees_seq.nextval FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-114.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT employees_seq.currval FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-115.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html CREATE TABLE Ticker (SYMBOL VARCHAR2(10), tstamp DATE, price NUMBER); INSERT INTO Ticker VALUES('ACME', '01-Apr-11', 12); INSERT INTO Ticker VALUES('ACME', '02-Apr-11', 17); INSERT INTO Ticker VALUES('ACME', '03-Apr-11', 19); INSERT INTO Ticker VALUES('ACME', '04-Apr-11', 21); INSERT INTO Ticker VALUES('ACME', '05-Apr-11', 25); INSERT INTO Ticker VALUES('ACME', '06-Apr-11', 12); INSERT INTO Ticker VALUES('ACME', '07-Apr-11', 15); INSERT INTO Ticker VALUES('ACME', '08-Apr-11', 20); INSERT INTO Ticker VALUES('ACME', '09-Apr-11', 24); INSERT INTO Ticker VALUES('ACME', '10-Apr-11', 25); INSERT INTO Ticker VALUES('ACME', '11-Apr-11', 19); INSERT INTO Ticker VALUES('ACME', '12-Apr-11', 15); INSERT INTO Ticker VALUES('ACME', '13-Apr-11', 25); INSERT INTO Ticker VALUES('ACME', '14-Apr-11', 25); INSERT INTO Ticker VALUES('ACME', '15-Apr-11', 14); INSERT INTO Ticker VALUES('ACME', '16-Apr-11', 12); INSERT INTO Ticker VALUES('ACME', '17-Apr-11', 14); INSERT INTO Ticker VALUES('ACME', '18-Apr-11', 24); INSERT INTO Ticker VALUES('ACME', '19-Apr-11', 23); INSERT INTO Ticker VALUES('ACME', '20-Apr-11', 22); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-116.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT * FROM Ticker MATCH_RECOGNIZE ( PARTITION BY symbol ORDER BY tstamp MEASURES STRT.tstamp AS start_tstamp, LAST(DOWN.tstamp) AS bottom_tstamp, LAST(UP.tstamp) AS end_tstamp ONE ROW PER MATCH AFTER MATCH SKIP TO LAST UP PATTERN (STRT DOWN+ UP+) DEFINE DOWN AS DOWN.price < PREV(DOWN.price), UP AS UP.price > PREV(UP.price) ) MR ORDER BY MR.symbol, MR.start_tstamp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-117.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT deptno, ename FROM emp ORDER BY sal DESC FETCH FIRST 2 PARTITIONS BY deptno, 3 ROWS ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-118.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html CREATE TABLE chunk_table ( doc_id NUMBER, chunk_id NUMBER, data_vec VECTOR ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT employee_id FROM (SELECT * FROM employees) FOR UPDATE OF employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT employee_id FROM (SELECT employee_id+1 AS employee_id FROM employees) FOR UPDATE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT employee_id FROM (SELECT employee_id+1 AS employee_id FROM employees) FOR UPDATE OF employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT avgsal FROM (SELECT AVG(salary) AS avgsal FROM employees GROUP BY job_id) FOR UPDATE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html create or replace function greet(name varchar2 default 'World') return varchar2 SQL_MACRO(Scalar) is begin return q'{ 'Hello, ' || name || '!' }'; end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT greet ('World') from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT greet ('Bob') from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html create or replace function split_part(string varchar2, delimiter varchar2, position pls_integer) return varchar2 SQL_MACRO(Scalar) is begin return q'{ regexp_substr(replace(string, delimiter||delimiter, delimiter||' '||delimiter), '[^'||delimiter||']+', 1, position, 'imx') }'; end; / SELECT split_part( sysdate, '-', 2) month from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html create or replace function budget(job varchar2) return varchar2 SQL_MACRO is begin return q'{ select deptno, sum(sal) budget from emp where job = budget.job group by deptno }'; end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT * FROM budget ('MANAGER'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH FUNCTION get_domain(url VARCHAR2) RETURN VARCHAR2 IS pos BINARY_INTEGER; len BINARY_INTEGER; BEGIN pos := INSTR(url, 'www.'); len := INSTR(SUBSTR(url, pos + 4), '.') - 1; RETURN SUBSTR(url, pos + 4, len); END; SELECT DISTINCT get_domain(catalog_url) FROM product_information; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH dept_costs AS ( SELECT department_name, SUM(salary) dept_total FROM employees e, departments d WHERE e.department_id = d.department_id GROUP BY department_name), avg_cost AS ( SELECT SUM(dept_total)/COUNT(*) avg FROM dept_costs) SELECT * FROM dept_costs WHERE dept_total > (SELECT avg FROM avg_cost) ORDER BY department_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH reports_to_101 (eid, emp_last, mgr_id, reportLevel) AS ( SELECT employee_id, last_name, manager_id, 0 reportLevel FROM employees WHERE employee_id = 101 UNION ALL SELECT e.employee_id, e.last_name, e.manager_id, reportLevel+1 FROM reports_to_101 r, employees e WHERE r.eid = e.manager_id ) SELECT eid, emp_last, mgr_id, reportLevel FROM reports_to_101 ORDER BY reportLevel, eid; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH reports_to_101 (eid, emp_last, mgr_id, reportLevel, mgr_list) AS ( SELECT employee_id, last_name, manager_id, 0 reportLevel, CAST(manager_id AS VARCHAR2(2000)) FROM employees WHERE employee_id = 101 UNION ALL SELECT e.employee_id, e.last_name, e.manager_id, reportLevel+1, CAST(mgr_list || ',' || manager_id AS VARCHAR2(2000)) FROM reports_to_101 r, employees e WHERE r.eid = e.manager_id ) SELECT eid, emp_last, mgr_id, reportLevel, mgr_list FROM reports_to_101 ORDER BY reportLevel, eid; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH reports_to_101 (eid, emp_last, mgr_id, reportLevel) AS ( SELECT employee_id, last_name, manager_id, 0 reportLevel FROM employees WHERE employee_id = 101 UNION ALL SELECT e.employee_id, e.last_name, e.manager_id, reportLevel+1 FROM reports_to_101 r, employees e WHERE r.eid = e.manager_id ) SELECT eid, emp_last, mgr_id, reportLevel FROM reports_to_101 WHERE reportLevel <= 1 ORDER BY reportLevel, eid; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH org_chart (eid, emp_last, mgr_id, reportLevel, salary, job_id) AS ( SELECT employee_id, last_name, manager_id, 0 reportLevel, salary, job_id FROM employees WHERE manager_id is null UNION ALL SELECT e.employee_id, e.last_name, e.manager_id, r.reportLevel+1 reportLevel, e.salary, e.job_id FROM org_chart r, employees e WHERE r.eid = e.manager_id ) SEARCH DEPTH FIRST BY emp_last SET order1 SELECT lpad(' ',2*reportLevel)||emp_last emp_name, eid, mgr_id, salary, job_id FROM org_chart ORDER BY order1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH dup_hiredate (eid, emp_last, mgr_id, reportLevel, hire_date, job_id) AS ( SELECT employee_id, last_name, manager_id, 0 reportLevel, hire_date, job_id FROM employees WHERE manager_id is null UNION ALL SELECT e.employee_id, e.last_name, e.manager_id, r.reportLevel+1 reportLevel, e.hire_date, e.job_id FROM dup_hiredate r, employees e WHERE r.eid = e.manager_id ) SEARCH DEPTH FIRST BY hire_date SET order1 CYCLE hire_date SET is_cycle TO 'Y' DEFAULT 'N' SELECT lpad(' ',2*reportLevel)||emp_last emp_name, eid, mgr_id, hire_date, job_id, is_cycle FROM dup_hiredate ORDER BY order1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH emp_count (eid, emp_last, mgr_id, mgrLevel, salary, cnt_employees) AS ( SELECT employee_id, last_name, manager_id, 0 mgrLevel, salary, 0 cnt_employees FROM employees UNION ALL SELECT e.employee_id, e.last_name, e.manager_id, r.mgrLevel+1 mgrLevel, e.salary, 1 cnt_employees FROM emp_count r, employees e WHERE e.employee_id = r.mgr_id ) SEARCH DEPTH FIRST BY emp_last SET order1 SELECT emp_last, eid, mgr_id, salary, sum(cnt_employees), max(mgrLevel) mgrLevel FROM emp_count GROUP BY emp_last, eid, mgr_id, salary HAVING max(mgrLevel) > 0 ORDER BY mgr_id NULLS FIRST, emp_last; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT time_hier.member_name as TIME, sales, units FROM sales_av HIERARCHIES(time_hier) WHERE time_hier.level_name = 'YEAR' ORDER BY time_hier.hier_order; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH my_av ANALYTIC VIEW AS ( USING sales_av HIERARCHIES (time_hier) ADD MEASURES ( lag_sales AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1)) ) ) SELECT time_hier.member_name time, sales, lag_sales FROM my_av HIERARCHIES (time_hier) WHERE time_hier.level_name = 'YEAR' ORDER BY time_hier.hier_order; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH my_av ANALYTIC VIEW AS ( USING sales_av HIERARCHIES (time_hier) FILTER FACT ( time_hier TO quarter_of_year IN (1, 2) AND year_name IN ('CY2011', 'CY2012') ) ) SELECT time_hier.member_name time, sales FROM my_av HIERARCHIES (time_hier) WHERE time_hier.level_name IN ('YEAR', 'QUARTER') ORDER BY time_hier.hier_order; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT time_hier.member_name time, sales, lag_sales FROM ANALYTIC VIEW ( USING sales_av HIERARCHIES (time_hier) ADD MEASURES ( lag_sales AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1)) ) ) WHERE time_hier.level_name = 'YEAR' ORDER BY time_hier.hier_order; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-39.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT * FROM employees WHERE department_id = 30 ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT * FROM ( VALUES (1,'SCOTT'), (2,'SMITH'), (3,'JOHN' ) ) t1 (employee_id, first_name); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT last_name, job_id, salary, department_id FROM employees WHERE NOT (job_id = 'PU_CLERK' AND department_id = 30) ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT a.department_id "Department", a.num_emp/b.total_count "%_Employees", a.sal_sum/b.total_sal "%_Salary" FROM (SELECT department_id, COUNT(*) num_emp, SUM(salary) sal_sum FROM employees GROUP BY department_id) a, (SELECT COUNT(*) total_count, SUM(salary) total_sal FROM employees) b ORDER BY a.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT * FROM sales PARTITION (sales_q2_2000) s WHERE s.amount_sold > 1500 ORDER BY cust_id, time_id, channel_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-43.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT * FROM orders WHERE order_date < TO_DATE('2006-06-15', 'YYYY-MM-DD'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-44.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT COUNT(*) * 10 FROM orders SAMPLE (10); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-45.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT COUNT(*) * 10 FROM orders SAMPLE (10); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-46.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT COUNT(*) * 10 FROM orders SAMPLE(10) SEED (1); SELECT COUNT(*) * 10 FROM orders SAMPLE(10) SEED(4); SELECT COUNT(*) * 10 FROM orders SAMPLE(10) SEED (1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-47.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT salary FROM employees WHERE last_name = 'Chung'; UPDATE employees SET salary = 4000 WHERE last_name = 'Chung'; SELECT salary FROM employees WHERE last_name = 'Chung'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-48.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT salary FROM employees AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '1' MINUTE) WHERE last_name = 'Chung'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-49.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT salary FROM employees VERSIONS BETWEEN TIMESTAMP SYSTIMESTAMP - INTERVAL '10' MINUTE AND SYSTIMESTAMP - INTERVAL '1' MINUTE WHERE last_name = 'Chung'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html WITH X(foo, bar, baz) AS ( VALUES (0, 1, 2), (3, 4, 5), (6, 7, 8) ) SELECT * FROM X; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-50.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html UPDATE employees SET salary = (SELECT salary FROM employees AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '2' MINUTE) WHERE last_name = 'Chung') WHERE last_name = 'Chung'; SELECT salary FROM employees WHERE last_name = 'Chung'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-51.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT department_id, MIN(salary), MAX (salary) FROM employees GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-52.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT department_id, MIN(salary), MAX (salary) FROM employees WHERE job_id = 'PU_CLERK' GROUP BY department_id ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-53.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT TRUNC(hire_date, 'YYYY') year_hired, COUNT(*) FROM employees GROUP BY year_hired ORDER BY year_hired; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-54.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT TRUNC(hire_date, 'YYYY') hire_date, COUNT(*) FROM employees GROUP BY hire_date ORDER BY hire_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-55.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT DECODE(GROUPING(department_name), 1, 'All Departments', department_name) AS department_name, DECODE(GROUPING(job_id), 1, 'All Jobs', job_id) AS job_id, COUNT(*) "Total Empl", AVG(salary) * 12 "Average Sal" FROM employees e, departments d WHERE d.department_id = e.department_id GROUP BY CUBE (department_name, job_id) ORDER BY department_name, job_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-56.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT channel_desc, calendar_month_desc, co.country_id, TO_CHAR(sum(amount_sold) , '9,999,999,999') SALES$ FROM sales, customers, times, channels, countries co WHERE sales.time_id=times.time_id AND sales.cust_id=customers.cust_id AND sales.channel_id= channels.channel_id AND customers.country_id = co.country_id AND channels.channel_desc IN ('Direct Sales', 'Internet') AND times.calendar_month_desc IN ('2000-09', '2000-10') AND co.country_iso_code IN ('UK', 'US') GROUP BY GROUPING SETS( (channel_desc, calendar_month_desc, co.country_id), (channel_desc, co.country_id), (calendar_month_desc, co.country_id) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-57.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT last_name, employee_id, manager_id FROM employees CONNECT BY employee_id = manager_id ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-58.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT last_name, employee_id, manager_id FROM employees CONNECT BY PRIOR employee_id = manager_id AND salary > commission_pct ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-59.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT department_id, MIN(salary), MAX (salary) FROM employees GROUP BY department_id HAVING MIN(salary) < 5000 ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-60.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT department_id, manager_id FROM employees GROUP BY department_id, manager_id HAVING (department_id, manager_id) IN (SELECT department_id, manager_id FROM employees x WHERE x.department_id = employees.department_id) ORDER BY department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-61.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT * FROM employees WHERE job_id = 'PU_CLERK' ORDER BY salary DESC; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-62.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT last_name, department_id, salary FROM employees ORDER BY department_id ASC, salary DESC, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-63.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT last_name, department_id, salary FROM employees ORDER BY 2 ASC, 3 DESC, 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-64.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html CREATE OR REPLACE VIEW sales_view_ref AS SELECT country_name country, prod_name prod, calendar_year year, SUM(amount_sold) sale, COUNT(amount_sold) cnt FROM sales,times,customers,countries,products WHERE sales.time_id = times.time_id AND sales.prod_id = products.prod_id AND sales.cust_id = customers.cust_id AND customers.country_id = countries.country_id AND ( customers.country_id = 52779 OR customers.country_id = 52776 ) AND ( prod_name = 'Standard Mouse' OR prod_name = 'Mouse Pad' ) GROUP BY country_name,prod_name,calendar_year; SELECT country, prod, year, sale FROM sales_view_ref ORDER BY country, prod, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-65.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT country,prod,year,s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER ( s[prod='Mouse Pad', year=2001] = s['Mouse Pad', 1999] + s['Mouse Pad', 2000], s['Standard Mouse', 2002] = s['Standard Mouse', 2001] ) ORDER BY country, prod, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-66.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT country, year, sale, csum FROM (SELECT country, year, SUM(sale) sale FROM sales_view_ref GROUP BY country, year ) MODEL DIMENSION BY (country, year) MEASURES (sale, 0 csum) RULES (csum[any, any]= SUM(sale) OVER (PARTITION BY country ORDER BY year ROWS UNBOUNDED PRECEDING) ) ORDER BY country, year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-67.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT employee_id, last_name FROM employees ORDER BY employee_id FETCH FIRST 5 ROWS ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-68.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT employee_id, last_name FROM employees ORDER BY employee_id OFFSET 5 ROWS FETCH NEXT 5 ROWS ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-69.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT employee_id, last_name, salary FROM employees ORDER BY salary FETCH FIRST 5 PERCENT ROWS ONLY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-70.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT employee_id, last_name, salary FROM employees ORDER BY salary FETCH FIRST 5 PERCENT ROWS WITH TIES; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-71.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT e.employee_id, e.salary, e.commission_pct FROM employees e, departments d WHERE job_id = 'SA_REP' AND e.department_id = d.department_id AND location_id = 2500 ORDER BY e.employee_id FOR UPDATE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-72.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT e.employee_id, e.salary, e.commission_pct FROM employees e JOIN departments d USING (department_id) WHERE job_id = 'SA_REP' AND location_id = 2500 ORDER BY e.employee_id FOR UPDATE OF e.salary; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-73.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html INSERT INTO (SELECT department_id, department_name, location_id FROM departments WHERE location_id < 2000) VALUES (9999, 'Entertainment', 2500); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-74.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html INSERT INTO (SELECT department_id, department_name, location_id FROM departments WHERE location_id < 2000 WITH CHECK OPTION) VALUES (9999, 'Entertainment', 2500); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-75.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html CREATE TABLE pivot_table AS SELECT * FROM (SELECT EXTRACT(YEAR FROM order_date) year, order_mode, order_total FROM orders) PIVOT (SUM(order_total) FOR order_mode IN ('direct' AS Store, 'online' AS Internet)); SELECT * FROM pivot_table ORDER BY year; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-76.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT * FROM pivot_table UNPIVOT (yearly_total FOR order_mode IN (store AS 'direct', internet AS 'online')) ORDER BY year, order_mode; SELECT * FROM pivot_table UNPIVOT INCLUDE NULLS (yearly_total FOR order_mode IN (store AS 'direct', internet AS 'online')) ORDER BY year, order_mode; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-77.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT last_name, job_id, departments.department_id, department_name FROM employees, departments WHERE employees.department_id = departments.department_id ORDER BY last_name, job_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-79.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT last_name, job_id, departments.department_id, department_name FROM employees, departments WHERE employees.department_id = departments.department_id AND job_id = 'SA_MAN' ORDER BY last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-80.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT last_name, department_id FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE last_name = 'Lorentz') ORDER BY last_name, department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-81.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html UPDATE employees SET salary = salary * 1.1 WHERE employee_id IN (SELECT employee_id FROM job_history); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-82.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html CREATE TABLE new_departments (department_id, department_name, location_id) AS SELECT department_id, department_name, location_id FROM departments; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-83.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT e1.last_name||' works for '||e2.last_name "Employees and Their Managers" FROM employees e1, employees e2 WHERE e1.manager_id = e2.employee_id AND e1.last_name LIKE 'R%' ORDER BY e1.last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-85.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT d.department_id, e.last_name FROM departments d LEFT OUTER JOIN employees e ON d.department_id = e.department_id ORDER BY d.department_id, e.last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-86.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT d.department_id, e.last_name FROM departments d, employees e WHERE d.department_id = e.department_id(+) ORDER BY d.department_id, e.last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-87.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT d.department_id, e.last_name FROM departments d RIGHT OUTER JOIN employees e ON d.department_id = e.department_id ORDER BY d.department_id, e.last_name; Grant Zeuss ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-88.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT d.department_id as d_dept_id, e.department_id as e_dept_id, e.last_name FROM departments d FULL OUTER JOIN employees e ON d.department_id = e.department_id ORDER BY d.department_id, e.last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-89.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT department_id AS d_e_dept_id, e.last_name FROM departments d FULL OUTER JOIN employees e USING (department_id) ORDER BY department_id, e.last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-90.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html CREATE TABLE inventory (time_id DATE, product VARCHAR2(10), quantity NUMBER); INSERT INTO inventory VALUES (TO_DATE('01/04/01', 'DD/MM/YY'), 'bottle', 10); INSERT INTO inventory VALUES (TO_DATE('06/04/01', 'DD/MM/YY'), 'bottle', 10); INSERT INTO inventory VALUES (TO_DATE('01/04/01', 'DD/MM/YY'), 'can', 10); INSERT INTO inventory VALUES (TO_DATE('04/04/01', 'DD/MM/YY'), 'can', 10); SELECT times.time_id, product, quantity FROM inventory PARTITION BY (product) RIGHT OUTER JOIN times ON (times.time_id = inventory.time_id) WHERE times.time_id BETWEEN TO_DATE('01/04/01', 'DD/MM/YY') AND TO_DATE('06/04/01', 'DD/MM/YY') ORDER BY 2,1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-91.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT time_id, product, LAST_VALUE(quantity IGNORE NULLS) OVER (PARTITION BY product ORDER BY time_id) quantity FROM ( SELECT times.time_id, product, quantity FROM inventory PARTITION BY (product) RIGHT OUTER JOIN times ON (times.time_id = inventory.time_id) WHERE times.time_id BETWEEN TO_DATE('01/04/01', 'DD/MM/YY') AND TO_DATE('06/04/01', 'DD/MM/YY')) ORDER BY 2,1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-92.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT department_name FROM hr.departments d WHERE NOT EXISTS (SELECT asdf FROM hr.employees e WHERE e.department_id = d.department_id AND e.salary >= 10000) ORDER BY department_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-93.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT * FROM departments WHERE EXISTS (SELECT * FROM employees WHERE departments.department_id = employees.department_id AND employees.salary > 2500) ORDER BY department_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-94.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT d.department_name, v.employee_id, v.last_name FROM departments d CROSS APPLY (SELECT * FROM employees e WHERE e.department_id = d.department_id) v WHERE d.department_name IN ('Marketing', 'Operations', 'Public Relations') ORDER BY d.department_name, v.employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-95.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT d.department_name, v.employee_id, v.last_name FROM departments d OUTER APPLY (SELECT * FROM employees e WHERE e.department_id = d.department_id) v WHERE d.department_name IN ('Marketing', 'Operations', 'Public Relations') ORDER by d.department_name, v.employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-96.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT department_name, (SELECT last_name FROM (SELECT last_name FROM hr.employees e WHERE e.department_id = d.department_id ORDER BY e.salary DESC, e.employee_id ASC) WHERE ROWNUM = 1) highest_paid FROM hr.departments d; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-97.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html SELECT d.department_name, e2.last_name, e2.first_name, e2.salary, e2.email FROM hr.departments d, LATERAL (SELECT * FROM (SELECT * FROM hr.employees e WHERE e.department_id = d.department_id ORDER BY e.salary DESC, e.employee_id ASC) WHERE ROWNUM = 1) e2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-98.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html CREATE TYPE people_typ AS OBJECT ( last_name VARCHAR2(25), department_id NUMBER(4), salary NUMBER(8,2)); / CREATE TYPE people_tab_typ AS TABLE OF people_typ; / CREATE TABLE hr_info ( department_id NUMBER(4), location_id NUMBER(4), manager_id NUMBER(6), people people_tab_typ) NESTED TABLE people STORE AS people_stor_tab; INSERT INTO hr_info VALUES (280, 1800, 999, people_tab_typ()); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SELECT-99.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html INSERT INTO TABLE(SELECT h.people FROM hr_info h WHERE h.department_id = 280) VALUES ('Smith', 280, 1750); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SESSIONTIMEZONE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SESSIONTIMEZONE.html SELECT SESSIONTIMEZONE FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SET.html SELECT customer_id, SET(cust_address_ntab) address FROM customers_demo ORDER BY customer_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SET-CONSTRAINTS-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SET-CONSTRAINTS.html SET CONSTRAINTS ALL IMMEDIATE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SET-CONSTRAINTS-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SET-CONSTRAINTS.html SET CONSTRAINTS emp_job_nn, emp_salary_min, hr.jhist_dept_fk@remote DEFERRED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SET-ROLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SET-ROLE.html SET ROLE dw_manager IDENTIFIED BY password; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SET-ROLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SET-ROLE.html SET ROLE ALL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SET-ROLE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SET-ROLE.html SET ROLE ALL EXCEPT dw_manager; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SET-ROLE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SET-ROLE.html SET ROLE NONE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SET-TRANSACTION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SET-TRANSACTION.html COMMIT; SET TRANSACTION READ ONLY NAME 'West Coast'; SELECT product_id, quantity_on_hand, 'San Francisco' location FROM inventories WHERE warehouse_id = 2 ORDER BY product_id; SELECT product_id, quantity_on_hand, 'Seattle' location FROM inventories WHERE warehouse_id = 4 ORDER BY product_id; COMMIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SIGN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SIGN.html SELECT SIGN(-15) "Sign" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SIN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SIN.html SELECT SIN(30 * 3.14159265359/180) "Sine of 30 degrees" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SINH-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SINH.html SELECT SINH(1) "Hyperbolic sine of 1" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SOUNDEX-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SOUNDEX.html SELECT last_name, first_name FROM hr.employees WHERE SOUNDEX(last_name) = SOUNDEX('SMYTHE') ORDER BY last_name, first_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE tab (jcol JSON VALIDATE '{"type" : "object"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE tab (jcol JSON CONSTRAINT jchk CHECK (jcol IS JSON VALIDATE '{"type" : "object"}')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html INSERT INTO jsontab1(jschd) VALUES (json('"a json string"')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html ALTER TABLE jsontab1 ADD jschd JSON CONSTRAINT jschdsv CHECK (jschd IS JSON VALIDATE USING '{"type":"string"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT COUNT(1) FROM jsontab1 WHERE j IS JSON VALIDATE '{"type" : "object", "properties" : { "id" : { "type" : "number" } } }'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE t (col1 VARCHAR2(100)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html INSERT INTO t VALUES ( '[ "LIT192", "CS141", "HIS160" ]' ); INSERT INTO t VALUES ( '{ "Name": "John" }' ); INSERT INTO t VALUES ( '{ "Grade Values" : { A : 4.0, B : 3.0, C : 2.0 } }'); INSERT INTO t VALUES ( '{ "isEnrolled" : true }' ); INSERT INTO t VALUES ( '{ "isMatriculated" : False }' ); INSERT INTO t VALUES (NULL); INSERT INTO t VALUES ('This is not well-formed JSON data'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT col1 FROM t WHERE col1 IS JSON; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT col1 FROM t WHERE col1 IS JSON STRICT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT col1 FROM t WHERE col1 IS NOT JSON STRICT AND col1 IS JSON LAX; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE t (col1 VARCHAR2(100)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html INSERT INTO t VALUES ('{a:100, b:200, c:300}'); INSERT INTO t VALUES ('{a:100, a:200, b:300}'); INSERT INTO t VALUES ('{a:100, b : {a:100, c:300}}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT col1 FROM t WHERE col1 IS JSON WITH UNIQUE KEYS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT col1 FROM t WHERE col1 IS JSON WITHOUT UNIQUE KEYS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE j_purchaseorder (id RAW (16) NOT NULL, date_loaded TIMESTAMP(6) WITH TIME ZONE, po_document CLOB CONSTRAINT ensure_json CHECK (po_document IS JSON)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE t (name VARCHAR2(100)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html INSERT INTO t VALUES ('[{first:"John"}, {middle:"Mark"}, {last:"Smith"}]'); INSERT INTO t VALUES ('[{first:"Mary"}, {last:"Jones"}]'); INSERT INTO t VALUES ('[{first:"Jeff"}, {last:"Williams"}]'); INSERT INTO t VALUES ('[{first:"Jean"}, {middle:"Anne"}, {last:"Brown"}]'); INSERT INTO t VALUES (NULL); INSERT INTO t VALUES ('This is not well-formed JSON data'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE jtab(jcol JSON DOMAIN jd); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT name FROM t WHERE JSON_EXISTS(name, '$[0].first'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT name FROM t WHERE JSON_EXISTS(name, '$[1].middle'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT name FROM t WHERE JSON_EXISTS(name, '$[1].middle' TRUE ON ERROR); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT name FROM t WHERE JSON_EXISTS(name, '$[*].last'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-34.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT name FROM t WHERE JSON_EXISTS(name, '$[1]?(@.middle == $var1)' PASSING 'Anne' as "var1"); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE families (family_doc VARCHAR2(200)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE INDEX ix ON families(family_doc) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('SECTION GROUP CTXSYS.JSON_SECTION_GROUP SYNC (ON COMMIT)'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html INSERT INTO families VALUES ('{family : {id:10, ages:[40,38,12], address : {street : "10 Main Street"}}}'); INSERT INTO families VALUES ('{family : {id:11, ages:[42,40,10,5], address : {street : "200 East Street", apt : 20}}}'); INSERT INTO families VALUES ('{family : {id:12, ages:[25,23], address : {street : "300 Oak Street", apt : 10}}}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html COMMIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-39.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT family_doc FROM families WHERE JSON_TEXTCONTAINS(family_doc, '$', '10'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT family_doc FROM families where json_textcontains(family_doc, '$.family.id', '10'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT family_doc FROM families WHERE JSON_TEXTCONTAINS(family_doc, '$.family.ages', '10'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT family_doc FROM families WHERE JSON_TEXTCONTAINS(family_doc, '$.family.address', '10'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-43.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html SELECT family_doc FROM families WHERE JSON_TEXTCONTAINS(family_doc, '$.family.address.apt', '10'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE jtab ( id NUMBER(9) PRIMARY KEY, jcol JSON CHECK(jcol IS JSON VALIDATE CAST USING '{ "type": "object", "properties": { "firstName": { "extendedType": "string", "maxLength": 50 }, "birthDate" : { "extendedType": "date" } }, "required": ["firstName", "birthDate"] }' ) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html CREATE TABLE jsontab1( id NUMBER(4), j JSON CONSTRAINT jt1isj CHECK (j IS JSON VALIDATE USING '{ "type":"object", "minProperties": 2 }') ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html INSERT INTO jsontab1(j) VALUES ('["a", "b"]'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQL-JSON-Conditions-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQL-JSON-Conditions.html INSERT INTO jsontab1(j) VALUES ('{"a": "a", "b": "b"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SQRT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SQRT.html SELECT SQRT(26) "Square root" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_BINOMIAL_TEST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_BINOMIAL_TEST.html SELECT AVG(DECODE(cust_gender, 'M', 1, 0)) real_proportion, STATS_BINOMIAL_TEST (cust_gender, 'M', 0.68, 'EXACT_PROB') exact, STATS_BINOMIAL_TEST (cust_gender, 'M', 0.68, 'ONE_SIDED_PROB_OR_LESS') prob_or_less FROM sh.customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_CROSSTAB-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_CROSSTAB.html SELECT STATS_CROSSTAB (cust_gender, cust_income_level, 'CHISQ_OBS') chi_squared, STATS_CROSSTAB (cust_gender, cust_income_level, 'CHISQ_SIG') p_value, STATS_CROSSTAB (cust_gender, cust_income_level, 'PHI_COEFFICIENT') phi_coefficient FROM sh.customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_F_TEST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_F_TEST.html SELECT VARIANCE(DECODE(cust_gender, 'M', cust_credit_limit, null)) var_men, VARIANCE(DECODE(cust_gender, 'F', cust_credit_limit, null)) var_women, STATS_F_TEST(cust_gender, cust_credit_limit, 'STATISTIC', 'F') f_statistic, STATS_F_TEST(cust_gender, cust_credit_limit) two_sided_p_value FROM sh.customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_KS_TEST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_KS_TEST.html SELECT stats_ks_test(cust_gender, amount_sold, 'STATISTIC') ks_statistic, stats_ks_test(cust_gender, amount_sold) p_value FROM sh.customers c, sh.sales s WHERE c.cust_id = s.cust_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_MODE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_MODE.html SELECT x FROM (SELECT x, COUNT(x) AS cnt1 FROM t GROUP BY x) WHERE cnt1 = (SELECT MAX(cnt2) FROM (SELECT COUNT(x) AS cnt2 FROM t GROUP BY x)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_MODE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_MODE.html SELECT department_id, STATS_MODE(salary) FROM employees GROUP BY department_id ORDER BY department_id, stats_mode(salary); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_MODE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_MODE.html SELECT commission_pct FROM (SELECT commission_pct, COUNT(commission_pct) AS cnt1 FROM employees GROUP BY commission_pct) WHERE cnt1 = (SELECT MAX (cnt2) FROM (SELECT COUNT(commission_pct) AS cnt2 FROM employees GROUP BY commission_pct)) ORDER BY commission_pct; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_MW_TEST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_MW_TEST.html SELECT STATS_MW_TEST (cust_gender, amount_sold, 'STATISTIC') z_statistic, STATS_MW_TEST (cust_gender, amount_sold, 'ONE_SIDED_SIG', 'F') one_sided_p_value FROM sh.customers c, sh.sales s WHERE c.cust_id = s.cust_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_ONE_WAY_ANOVA-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_ONE_WAY_ANOVA.html SELECT cust_gender, STATS_ONE_WAY_ANOVA(cust_income_level, amount_sold, 'F_RATIO') f_ratio, STATS_ONE_WAY_ANOVA(cust_income_level, amount_sold, 'SIG') p_value FROM sh.customers c, sh.sales s WHERE c.cust_id = s.cust_id GROUP BY cust_gender ORDER BY cust_gender; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_T_TEST_-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_T_TEST_.html SELECT AVG(prod_list_price) group_mean, STATS_T_TEST_ONE(prod_list_price, 60, 'STATISTIC') t_observed, STATS_T_TEST_ONE(prod_list_price, 60) two_sided_p_value FROM sh.products; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_T_TEST_-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_T_TEST_.html SELECT SUBSTR(cust_income_level, 1, 22) income_level, AVG(DECODE(cust_gender, 'M', amount_sold, null)) sold_to_men, AVG(DECODE(cust_gender, 'F', amount_sold, null)) sold_to_women, STATS_T_TEST_INDEP(cust_gender, amount_sold, 'STATISTIC', 'F') t_observed, STATS_T_TEST_INDEP(cust_gender, amount_sold) two_sided_p_value FROM sh.customers c, sh.sales s WHERE c.cust_id = s.cust_id GROUP BY ROLLUP(cust_income_level) ORDER BY income_level, sold_to_men, sold_to_women, t_observed; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STATS_T_TEST_-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STATS_T_TEST_.html SELECT SUBSTR(cust_income_level, 1, 22) income_level, AVG(DECODE(cust_gender, 'M', amount_sold, null)) sold_to_men, AVG(DECODE(cust_gender, 'F', amount_sold, null)) sold_to_women, STATS_T_TEST_INDEPU(cust_gender, amount_sold, 'STATISTIC', 'F') t_observed, STATS_T_TEST_INDEPU(cust_gender, amount_sold) two_sided_p_value FROM sh.customers c, sh.sales s WHERE c.cust_id = s.cust_id GROUP BY ROLLUP(cust_income_level) ORDER BY income_level, sold_to_men, sold_to_women, t_observed; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STDDEV-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STDDEV.html SELECT STDDEV(salary) "Deviation" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STDDEV-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STDDEV.html SELECT last_name, salary, STDDEV(salary) OVER (ORDER BY hire_date) "StdDev" FROM employees WHERE department_id = 30 ORDER BY last_name, salary, "StdDev"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STDDEV_POP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STDDEV_POP.html SELECT STDDEV_POP(amount_sold) "Pop", STDDEV_SAMP(amount_sold) "Samp" FROM sales; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STDDEV_POP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STDDEV_POP.html SELECT department_id, last_name, salary, STDDEV_POP(salary) OVER (PARTITION BY department_id) AS pop_std FROM employees ORDER BY department_id, last_name, salary, pop_std; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/STDDEV_SAMP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/STDDEV_SAMP.html SELECT department_id, last_name, hire_date, salary, STDDEV_SAMP(salary) OVER (PARTITION BY department_id ORDER BY hire_date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cum_sdev FROM employees ORDER BY department_id, last_name, hire_date, salary, cum_sdev; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SUBSTR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SUBSTR.html SELECT SUBSTR('ABCDEFG',3,4) "Substring" FROM DUAL; SELECT SUBSTR('ABCDEFG',-5,4) "Substring" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SUBSTR-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SUBSTR.html SELECT SUBSTRB('ABCDEFG',5,4.2) "Substring with bytes" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SUM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SUM.html SELECT SUM(salary) "Total" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SUM-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SUM.html SELECT manager_id, last_name, salary, SUM(salary) OVER (PARTITION BY manager_id ORDER BY salary RANGE UNBOUNDED PRECEDING) l_csum FROM employees ORDER BY manager_id, last_name, salary, l_csum; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYSDATE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYSDATE.html SELECT TO_CHAR (SYSDATE, 'MM-DD-YYYY HH24:MI:SS') "NOW" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYSTIMESTAMP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYSTIMESTAMP.html SELECT SYSTIMESTAMP FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYSTIMESTAMP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYSTIMESTAMP.html SELECT TO_CHAR(SYSTIMESTAMP, 'SSSSS.FF') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYSTIMESTAMP-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYSTIMESTAMP.html SELECT SYSTIMESTAMP AT TIME ZONE 'UTC' FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_CONNECT_BY_PATH-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_CONNECT_BY_PATH.html SELECT LPAD(' ', 2*level-1)||SYS_CONNECT_BY_PATH(last_name, '/') "Path" FROM employees START WITH last_name = 'Kochhar' CONNECT BY PRIOR employee_id = manager_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_CONTEXT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_CONTEXT.html CONNECT OE SELECT SYS_CONTEXT ('USERENV', 'SESSION_USER') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_CONTEXT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_CONTEXT.html CONNECT OE SELECT role FROM session_roles; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_CONTEXT-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_CONTEXT.html SELECT SYS_CONTEXT ('hr_apps', 'group_no') "User Group" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_DBURIGEN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_DBURIGEN.html SELECT SYS_DBURIGEN(employee_id, email) FROM employees WHERE employee_id = 206; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_EXTRACT_UTC-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_EXTRACT_UTC.html SELECT SYS_EXTRACT_UTC(TIMESTAMP '2000-03-28 11:30:00.00 -08:00') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_GUID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_GUID.html ALTER TABLE locations ADD (uid_col RAW(16)); UPDATE locations SET uid_col = SYS_GUID(); SELECT location_id, uid_col FROM locations ORDER BY location_id, uid_col; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_OP_ZONE_ID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_OP_ZONE_ID.html CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(rowid), MIN(time_id), MAX(time_id) FROM sales GROUP BY SYS_OP_ZONE_ID(rowid); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_OP_ZONE_ID-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_OP_ZONE_ID.html CREATE MATERIALIZED ZONEMAP sales_zmap SCALE 8 AS SELECT SYS_OP_ZONE_ID(rowid), MIN(time_id), MAX(time_id) FROM sales GROUP BY SYS_OP_ZONE_ID(rowid); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_OP_ZONE_ID-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_OP_ZONE_ID.html CREATE MATERIALIZED ZONEMAP sales_zmap SCALE 8 AS SELECT SYS_OP_ZONE_ID(rowid,12), MIN(time_id), MAX(time_id) FROM sales GROUP BY SYS_OP_ZONE_ID(rowid,12); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_OP_ZONE_ID-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_OP_ZONE_ID.html CREATE MATERIALIZED ZONEMAP sales_zmap AS SELECT SYS_OP_ZONE_ID(s.rowid), MIN(prod_category), MAX(prod_category), MIN(country_id), MAX(country_id) FROM sales s, products p, customers c WHERE s.prod_id = p.prod_id(+) AND s.cust_id = c.cust_id(+) GROUP BY SYS_OP_ZONE_ID(s.rowid); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_TYPEID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_TYPEID.html SELECT name, SYS_TYPEID(VALUE(p)) "Type_id" FROM persons p; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_TYPEID-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_TYPEID.html SELECT b.title, b.author.name, SYS_TYPEID(author) "Type_ID" FROM books b; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_XMLAGG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_XMLAGG.html SELECT SYS_XMLAGG(SYS_XMLGEN(last_name)) XMLAGG FROM employees WHERE last_name LIKE 'R%' ORDER BY xmlagg; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/SYS_XMLGEN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SYS_XMLGEN.html SELECT SYS_XMLGEN(email) FROM employees WHERE employee_id = 205; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Sequence-Pseudocolumns-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Sequence-Pseudocolumns.html SELECT employees_seq.nextval FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Sequence-Pseudocolumns-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Sequence-Pseudocolumns.html INSERT INTO employees VALUES (employees_seq.nextval, 'John', 'Doe', 'jdoe', '555-1212', TO_DATE(SYSDATE), 'PU_CLERK', 2500, null, null, 30); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Sequence-Pseudocolumns-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Sequence-Pseudocolumns.html INSERT INTO orders (order_id, order_date, customer_id) VALUES (orders_seq.nextval, TO_DATE(SYSDATE), 106); INSERT INTO order_items (order_id, line_item_id, product_id) VALUES (orders_seq.currval, 1, 2359); INSERT INTO order_items (order_id, line_item_id, product_id) VALUES (orders_seq.currval, 2, 3290); INSERT INTO order_items (order_id, line_item_id, product_id) VALUES (orders_seq.currval, 3, 2381); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements.html INSERT INTO departments VALUES (280, 'ENTERTAINMENT_CLERK', 206, 1700); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements.html DROP TABLE hr.employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements.html CREATE VIEW Q1_2000_sales AS SELECT * FROM sales PARTITION (SALES_Q1_2000); DELETE FROM Q1_2000_sales WHERE amount_sold < 0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements.html CREATE TYPE cust_address_typ OID '82A4AF6A4CD1656DE034080020E0EE3D' AS OBJECT (street_address VARCHAR2(40), postal_code VARCHAR2(10), city VARCHAR2(30), state_province VARCHAR2(10), country_id CHAR(2)); / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements.html SELECT c.cust_address.postal_code FROM customers c; UPDATE customers c SET c.cust_address.postal_code = '14621-2604' WHERE c.cust_address.city = 'Rochester' AND c.cust_address.state_province = 'NY'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements.html SELECT TREAT(VALUE(c) AS catalog_typ).getCatalogName() "Catalog Type" FROM categories_tab c WHERE category_id = 90; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TAN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TAN.html SELECT TAN(135 * 3.14159265359/180) "Tangent of 135 degrees" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TANH-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TANH.html SELECT TANH(.5) "Hyperbolic tangent of .5" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TIMESTAMP_TO_SCN-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TIMESTAMP_TO_SCN.html INSERT INTO orders (order_id, order_date, customer_id, order_total) VALUES (5000, SYSTIMESTAMP, 188, 2345); COMMIT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_BINARY_DOUBLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_BINARY_DOUBLE.html CREATE TABLE float_point_demo (dec_num NUMBER(10,2), bin_double BINARY_DOUBLE, bin_float BINARY_FLOAT); INSERT INTO float_point_demo VALUES (1234.56,1234.56,1234.56); SELECT * FROM float_point_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_BINARY_DOUBLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_BINARY_DOUBLE.html SELECT dec_num, TO_BINARY_DOUBLE(dec_num) FROM float_point_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_BINARY_DOUBLE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_BINARY_DOUBLE.html SELECT DUMP(dec_num) "Decimal", DUMP(bin_double) "Double" FROM float_point_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_BINARY_DOUBLE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_BINARY_DOUBLE.html SELECT TO_BINARY_DOUBLE('2oo' DEFAULT 0 ON CONVERSION ERROR) "Value" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_BINARY_FLOAT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_BINARY_FLOAT.html SELECT dec_num, TO_BINARY_FLOAT(dec_num) FROM float_point_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_BINARY_FLOAT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_BINARY_FLOAT.html SELECT TO_BINARY_FLOAT('2oo' DEFAULT 0 ON CONVERSION ERROR) "Value" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_BLOB-bfile-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_BLOB-bfile.html SELECT TO_BLOB(media_col, 'JPEG') FROM media_tab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_BLOB-raw-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_BLOB-raw.html SELECT TO_BLOB(raw_column) blob FROM raw_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-bfile-blob-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-bfile-blob.html SELECT TO_CHAR(media_col, 873) FROM media_tab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-character-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-character.html SELECT TO_CHAR('01110') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-character-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-character.html SELECT TO_CHAR(ad_sourcetext) FROM print_media WHERE product_id = 2268; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-character-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-character.html CREATE TABLE empl_temp ( employee_id NUMBER(6), first_name VARCHAR2(20), last_name VARCHAR2(25), email VARCHAR2(25), hire_date DATE DEFAULT SYSDATE, job_id VARCHAR2(10), clob_column CLOB ); INSERT INTO empl_temp VALUES(111,'John','Doe','example.com','10-JAN-2015','1001','Experienced Employee'); INSERT INTO empl_temp VALUES(112,'John','Smith','example.com','12-JAN-2015','1002','Junior Employee'); INSERT INTO empl_temp VALUES(113,'Johnnie','Smith','example.com','12-JAN-2014','1002','Mid-Career Employee'); INSERT INTO empl_temp VALUES(115,'Jane','Doe','example.com','15-JAN-2015','1005','Executive Employee'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-character-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-character.html SELECT To_char(clob_column) "CLOB_TO_CHAR" FROM empl_temp WHERE employee_id IN ( 111, 112, 115 ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html CREATE TABLE date_tab ( ts_col TIMESTAMP, tsltz_col TIMESTAMP WITH LOCAL TIME ZONE, tstz_col TIMESTAMP WITH TIME ZONE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html CREATE TABLE empl_temp ( employee_id NUMBER(6), first_name VARCHAR2(20), last_name VARCHAR2(25), email VARCHAR2(25), hire_date DATE DEFAULT SYSDATE, job_id VARCHAR2(10), clob_column CLOB ); INSERT INTO empl_temp VALUES(111,'John','Doe','example.com','10-JAN-2015','1001','Experienced Employee'); INSERT INTO empl_temp VALUES(112,'John','Smith','example.com','12-JAN-2015','1002','Junior Employee'); INSERT INTO empl_temp VALUES(113,'Johnnie','Smith','example.com','12-JAN-2014','1002','Mid-Career Employee'); INSERT INTO empl_temp VALUES(115,'Jane','Doe','example.com','15-JAN-2015','1005','Executive Employee'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html SELECT hire_date "Default", TO_CHAR(hire_date,'DS') "Short", TO_CHAR(hire_date,'DL') "Long"FROM empl_temp WHERE employee_id IN (111, 112, 115); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html ALTER SESSION SET TIME_ZONE = '-8:00'; INSERT INTO date_tab VALUES ( TIMESTAMP'1999-12-01 10:00:00', TIMESTAMP'1999-12-01 10:00:00', TIMESTAMP'1999-12-01 10:00:00'); INSERT INTO date_tab VALUES ( TIMESTAMP'1999-12-02 10:00:00 -8:00', TIMESTAMP'1999-12-02 10:00:00 -8:00', TIMESTAMP'1999-12-02 10:00:00 -8:00'); SELECT TO_CHAR(ts_col, 'DD-MON-YYYY HH24:MI:SSxFF') AS ts_date, TO_CHAR(tstz_col, 'DD-MON-YYYY HH24:MI:SSxFF TZH:TZM') AS tstz_date FROM date_tab ORDER BY ts_date, tstz_date; SELECT SESSIONTIMEZONE, TO_CHAR(tsltz_col, 'DD-MON-YYYY HH24:MI:SSxFF') AS tsltz FROM date_tab ORDER BY sessiontimezone, tsltz; ALTER SESSION SET TIME_ZONE = '-5:00'; SELECT TO_CHAR(ts_col, 'DD-MON-YYYY HH24:MI:SSxFF') AS ts_col, TO_CHAR(tstz_col, 'DD-MON-YYYY HH24:MI:SSxFF TZH:TZM') AS tstz_col FROM date_tab ORDER BY ts_col, tstz_col; SELECT SESSIONTIMEZONE, TO_CHAR(tsltz_col, 'DD-MON-YYYY HH24:MI:SSxFF') AS tsltz_col FROM date_tab ORDER BY sessiontimezone, tsltz_col; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html SELECT TO_CHAR(INTERVAL '123-2' YEAR(3) TO MONTH) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html WITH dates AS ( SELECT date'2015-01-01' d FROM dual union SELECT date'2015-01-10' d FROM dual union SELECT date'2015-02-01' d FROM dual ) SELECT d "Original Date", to_char(d, 'dd-mm-yyyy') "Day-Month-Year", to_char(d, 'hh24:mi') "Time in 24-hr format", to_char(d, 'iw-iyyy') "ISO Year and Week of Year" FROM dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html WITH dates AS ( SELECT date'2015-01-01' d FROM dual union SELECT date'2015-01-10' d FROM dual union SELECT date'2015-02-01' d FROM dual union SELECT timestamp'2015-03-03 23:44:32' d FROM dual union SELECT timestamp'2015-04-11 12:34:56' d FROM dual ) SELECT d "Original Date", to_char(d, 'dd-mm-yyyy') "Day-Month-Year", to_char(d, 'hh24:mi') "Time in 24-hr format", to_char(d, 'iw-iyyy') "ISO Year and Week of Year", to_char(d, 'Month') "Month Name", to_char(d, 'Year') "Year" FROM dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html WITH dates AS ( SELECT date'2015-01-01' d FROM dual union SELECT date'2015-01-10' d FROM dual union SELECT date'2015-02-01' d FROM dual union SELECT timestamp'2015-03-03 23:44:32' d FROM dual union SELECT timestamp'2015-04-11 12:34:56' d FROM dual ) SELECT extract(minute from d) minutes, extract(hour from d) hours, extract(day from d) days, extract(month from d) months, extract(year from d) years FROM dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html WITH nums AS ( SELECT 10 n FROM dual union SELECT 9.99 n FROM dual union SELECT 1000000 n FROM dual --one million ) SELECT n "Input Number N", to_char(n), to_char(n, '9,999,999.99') "Number with Commas", to_char(n, '0,000,000.000') "Zero-padded Number", to_char(n, '9.9EEEE') "Scientific Notation" FROM nums; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html WITH nums AS ( SELECT 10 n FROM dual union SELECT 9.99 n FROM dual union SELECT .99 n FROM dual union SELECT 1000000 n FROM dual --one million ) SELECT n "Input Number N", to_char(n), to_char(n, '9,999,999.99') "Number with Commas", to_char(n, '0,000,000.000') "Zero_padded Number", to_char(n, '9.9EEEE') "Scientific Notation", to_char(n, '$9,999,990.00') Monetary, to_char(n, 'X') "Hexadecimal Value" FROM nums; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-datetime-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-datetime.html WITH nums AS ( SELECT 10 n FROM dual union SELECT 9.99 n FROM dual union SELECT .99 n FROM dual union SELECT 1000000 n FROM dual --one million ) SELECT n "Input Number N", to_char(n), to_char(n, '9,999,999.99') "Number with Commas", to_char(n, '0,000,000.000') "Zero_padded Number", to_char(n, '9.9EEEE') "Scientific Notation", to_char(n, '$9,999,990.00') Monetary, to_char(n, 'XXXXXX') "Hexadecimal Value" FROM nums; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-number-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-number.html SELECT TO_CHAR('01110' + 1) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-number-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-number.html SELECT TO_CHAR(-10000,'L99G999D99MI') "Amount" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-number-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-number.html SELECT TO_CHAR(-10000,'L99G999D99MI', 'NLS_NUMERIC_CHARACTERS = '',.'' NLS_CURRENCY = ''AusDollars'' ') "Amount" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-number-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-number.html SELECT TO_CHAR(-10000,'99G999D99C', 'NLS_NUMERIC_CHARACTERS = '',.'' NLS_ISO_CURRENCY=POLAND') "Amount" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-number-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-number.html CREATE TABLE empl_temp ( employee_id NUMBER(6), first_name VARCHAR2(20), last_name VARCHAR2(25), email VARCHAR2(25), hire_date DATE DEFAULT SYSDATE, job_id VARCHAR2(10), clob_column CLOB ); INSERT INTO empl_temp VALUES(111,'John','Doe','example.com','10-JAN-2015','1001','Experienced Employee'); INSERT INTO empl_temp VALUES(112,'John','Smith','example.com','12-JAN-2015','1002','Junior Employee'); INSERT INTO empl_temp VALUES(113,'Johnnie','Smith','example.com','12-JAN-2014','1002','Mid-Career Employee'); INSERT INTO empl_temp VALUES(115,'Jane','Doe','example.com','15-JAN-2015','1005','Executive Employee'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CHAR-number-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-number.html SELECT To_char(employee_id) "NUM_TO_CHAR" FROM empl_temp WHERE employee_id IN ( 111, 112, 113, 115 ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CLOB-bfile-blob-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CLOB-bfile-blob.html SELECT TO_CLOB(docu, 873, 'text/xml') FROM media_tab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_CLOB-character-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CLOB-character.html UPDATE PRINT_MEDIA SET AD_FINALTEXT = TO_CLOB (AD_FLTEXTN); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_DATE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_DATE.html SELECT TO_DATE( 'January 15, 1989, 11:00 A.M.', 'Month dd, YYYY, HH:MI A.M.', 'NLS_DATE_LANGUAGE = American') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_DATE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_DATE.html ALTER SESSION SET NLS_TERRITORY = 'KOREAN'; SELECT TO_DATE( 'January 15, 1989, 11:00 A.M.', 'Month dd, YYYY, HH:MI A.M.', 'NLS_DATE_LANGUAGE = American') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_DATE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_DATE.html SELECT TO_DATE('Febuary 15, 2016, 11:00 A.M.' DEFAULT 'January 01, 2016 12:00 A.M.' ON CONVERSION ERROR, 'Month dd, YYYY, HH:MI A.M.') "Value" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_DSINTERVAL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_DSINTERVAL.html SELECT employee_id, last_name FROM employees WHERE hire_date + TO_DSINTERVAL('100 00:00:00') <= DATE '2002-11-01' ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_DSINTERVAL-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_DSINTERVAL.html SELECT TO_CHAR(TIMESTAMP '2009-01-01 00:00:00' + TO_DSINTERVAL('P100DT05H'), 'YYYY-MM-DD HH24:MI:SS') "Time Stamp" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_DSINTERVAL-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_DSINTERVAL.html SELECT TO_DSINTERVAL('1o 1:02:10' DEFAULT '10 8:00:00' ON CONVERSION ERROR) "Value" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_MULTI_BYTE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_MULTI_BYTE.html SELECT dump(TO_MULTI_BYTE( 'A')) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_NCHAR-character-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_NCHAR-character.html SELECT TO_NCHAR(cust_last_name) FROM customers WHERE customer_id=103; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_NCHAR-datetime-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_NCHAR-datetime.html SELECT TO_NCHAR(ORDER_DATE) AS order_date FROM ORDERS WHERE ORDER_STATUS > 9 ORDER BY order_date; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_NCHAR-number-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_NCHAR-number.html SELECT TO_NCHAR(customer_id) "NCHAR_Customer_ID" FROM orders WHERE order_status > 9 ORDER BY "NCHAR_Customer_ID"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_NCLOB-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_NCLOB.html INSERT INTO print_media (product_id, ad_id, ad_fltextn) VALUES (3502, 31001, TO_NCLOB('Placeholder for new product description')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_NUMBER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_NUMBER.html UPDATE employees SET salary = salary + TO_NUMBER('100.00', '9G999D99') WHERE last_name = 'Perkins'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_NUMBER-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_NUMBER.html SELECT TO_NUMBER('-AusDollars100','L9G999D99', ' NLS_NUMERIC_CHARACTERS = '',.'' NLS_CURRENCY = ''AusDollars'' ') "Amount" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_NUMBER-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_NUMBER.html SELECT TO_NUMBER('2,00' DEFAULT 0 ON CONVERSION ERROR) "Value" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_SINGLE_BYTE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_SINGLE_BYTE.html SELECT TO_SINGLE_BYTE( CHR(15711393)) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_TIMESTAMP-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_TIMESTAMP.html SELECT TO_TIMESTAMP ('10-Sep-02 14:10:10.123000', 'DD-Mon-RR HH24:MI:SS.FF') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_TIMESTAMP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_TIMESTAMP.html SELECT TO_TIMESTAMP ('10-Sept-02 14:10:10.123000' DEFAULT NULL ON CONVERSION ERROR, 'DD-Mon-RR HH24:MI:SS.FF', 'NLS_DATE_LANGUAGE = American') "Value" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_TIMESTAMP_TZ-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_TIMESTAMP_TZ.html SELECT TO_TIMESTAMP_TZ('1999-12-01 11:00:00 -8:00', 'YYYY-MM-DD HH:MI:SS TZH:TZM') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_TIMESTAMP_TZ-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_TIMESTAMP_TZ.html SELECT order_id, line_item_id, CAST(NULL AS TIMESTAMP WITH LOCAL TIME ZONE) order_date FROM order_items UNION SELECT order_id, to_number(null), order_date FROM orders; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_TIMESTAMP_TZ-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_TIMESTAMP_TZ.html SELECT TO_TIMESTAMP_TZ('1999-13-01 11:00:00 -8:00' DEFAULT NULL ON CONVERSION ERROR, 'YYYY-MM-DD HH:MI:SS TZH:TZM') "Value" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_UTC_TIMESTAMP_TZ-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_UTC_TIMESTAMP_TZ.html SELECT TO_UTC_TIMESTAMP_TZ('1998-01-01') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_UTC_TIMESTAMP_TZ-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_UTC_TIMESTAMP_TZ.html SELECT TO_UTC_TIMESTAMP_TZ('2000-01-02T12:34:56.789') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_UTC_TIMESTAMP_TZ-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_UTC_TIMESTAMP_TZ.html SELECT TO_UTC_TIMESTAMP_TZ('2016-05-05T00:00:00.000Z') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_UTC_TIMESTAMP_TZ-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_UTC_TIMESTAMP_TZ.html SELECT TO_UTC_TIMESTAMP_TZ('2016-05-05T02:04:35.4678Z') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_YMINTERVAL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_YMINTERVAL.html SELECT hire_date, hire_date + TO_YMINTERVAL('01-02') "14 months" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_YMINTERVAL-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_YMINTERVAL.html SELECT hire_date, hire_date + TO_YMINTERVAL('P1Y2M') FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TO_YMINTERVAL-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_YMINTERVAL.html SELECT TO_YMINTERVAL('1x-02' DEFAULT '00-00' ON CONVERSION ERROR) "Value" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRANSLATE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRANSLATE.html SELECT TRANSLATE('SQL*Plus User''s Guide', ' */''', '___') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRANSLATE-USING-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRANSLATE-USING.html CREATE TABLE translate_tab (char_col VARCHAR2(100), nchar_col NVARCHAR2(50)); INSERT INTO translate_tab SELECT NULL, translated_name FROM product_descriptions WHERE product_id = 3501; SELECT * FROM translate_tab; UPDATE translate_tab SET char_col = TRANSLATE (nchar_col USING CHAR_CS); SELECT * FROM translate_tab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TREAT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TREAT.html SELECT name, TREAT(VALUE(p) AS employee_t).salary salary FROM persons p; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRIM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRIM.html SELECT employee_id, TO_CHAR(TRIM(LEADING 0 FROM hire_date)) FROM employees WHERE department_id = 60 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRUNC-date-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRUNC-date.html SELECT TRUNC(TO_DATE('27-OCT-92','DD-MON-YY'), 'YEAR') "New Year" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRUNC-date-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRUNC-date.html WITH dates AS ( SELECT date'2015-01-01' d FROM dual union SELECT date'2015-01-10' d FROM dual union SELECT date'2015-02-01' d FROM dual union SELECT timestamp'2015-03-03 23:45:00' d FROM dual union SELECT timestamp'2015-04-11 12:34:56' d FROM dual ) SELECT d "Original Date", trunc(d) "Nearest Day, Time Removed", trunc(d, 'ww') "Nearest Week", trunc(d, 'iw') "Start of Week", trunc(d, 'mm') "Start of Month", trunc(d, 'year') "Start of Year" FROM dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRUNC-date-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRUNC-date.html WITH dates AS ( SELECT date'2015-01-01' d FROM dual union SELECT date'2015-01-10' d FROM dual union SELECT date'2015-02-01' d FROM dual union SELECT timestamp'2015-03-03 23:45:00' d FROM dual union SELECT timestamp'2015-04-11 12:34:56' d FROM dual ) SELECT d "Original Date", trunc(d) "Date with Time Removed", to_char(trunc(d, 'mi'), 'dd-mon-yyyy hh24:mi') "Nearest Minute", trunc(d, 'iw') "Start of Week", trunc(d, 'mm') "Start of Month", trunc(d, 'year') "Start of Year" FROM dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRUNC-date-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRUNC-date.html ALTER SESSION SET nls_date_format = 'dd-mon-yyyy hh24:mi'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRUNC-date-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRUNC-date.html WITH dates AS ( SELECT date'2015-01-01' d FROM dual union SELECT date'2015-01-10' d FROM dual union SELECT date'2015-02-01' d FROM dual union SELECT timestamp'2015-03-03 23:44:32' d FROM dual union SELECT timestamp'2015-04-11 12:34:56' d FROM dual ) SELECT d "Original Date", trunc(d) "Date, time removed", to_char(trunc(d, 'mi'), 'dd-mon-yyyy hh24:mi') "Nearest Minute", trunc(d, 'iw') "Start of Week", trunc(d, 'mm') "Start of Month", trunc(d, 'year') "Start of Year" FROM dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRUNC-number-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRUNC-number.html SELECT TRUNC(15.79,1) "Truncate" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRUNCATE-CLUSTER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRUNCATE-CLUSTER.html TRUNCATE CLUSTER personnel REUSE STORAGE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRUNCATE-TABLE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRUNCATE-TABLE.html TRUNCATE TABLE employees_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TRUNCATE-TABLE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TRUNCATE-TABLE.html TRUNCATE TABLE sales_demo PRESERVE MATERIALIZED VIEW LOG; TRUNCATE TABLE orders_demo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/TZ_OFFSET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TZ_OFFSET.html SELECT TZ_OFFSET('US/Eastern') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators.html SELECT 3 FROM DUAL INTERSECT SELECT 3f FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators.html SELECT TO_BINARY_FLOAT(3) FROM DUAL INTERSECT SELECT 3f FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators.html SELECT '3' FROM DUAL INTERSECT SELECT 3f FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators.html SELECT location_id, department_name "Department", TO_CHAR(NULL) "Warehouse" FROM departments UNION SELECT location_id, TO_CHAR(NULL) "Department", warehouse_name FROM warehouses; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators.html SELECT product_id FROM order_items UNION SELECT product_id FROM inventories ORDER BY product_id; SELECT location_id FROM locations UNION ALL SELECT location_id FROM departments ORDER BY location_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators.html SELECT product_id FROM inventories INTERSECT SELECT product_id FROM order_items ORDER BY product_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators.html SELECT product_id FROM inventories MINUS SELECT product_id FROM order_items ORDER BY product_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators.html SELECT product_id FROM inventories EXCEPT SELECT product_id FROM order_items ORDER BY product_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Type-Constructor-Expressions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Type-Constructor-Expressions.html CREATE TYPE address_book_t AS TABLE OF cust_address_typ; DECLARE myaddr cust_address_typ := cust_address_typ( '500 Oracle Parkway', 94065, 'Redwood Shores', 'CA','USA'); alladdr address_book_t := address_book_t(); BEGIN INSERT INTO customers VALUES ( 666999, 'Joe', 'Smith', myaddr, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Type-Constructor-Expressions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Type-Constructor-Expressions.html CREATE TABLE warehouse_tab OF warehouse_typ; INSERT INTO warehouse_tab VALUES (warehouse_typ(101, 'new_wh', 201)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UID-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UID.html SELECT UID FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UNISTR-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UNISTR.html SELECT UNISTR('abc\00e5\00f1\00f6') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html UPDATE employees e SET e.salary = j.max_salary FROM jobs j WHERE j.job_id = e.job_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html UPDATE employees SET commission_pct = NULL WHERE job_id = 'SH_CLERK'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html UPDATE employees SET job_id = 'SA_MAN', salary = salary + 1000, department_id = 120 WHERE first_name||' '||last_name = 'Douglas Grant'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html UPDATE employees@remote SET salary = salary*1.1 WHERE last_name = 'Baer'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html UPDATE employees a SET department_id = (SELECT department_id FROM departments WHERE location_id = '2100'), (salary, commission_pct) = (SELECT 1.1*AVG(salary), 1.5*AVG(commission_pct) FROM employees b WHERE a.department_id = b.department_id) WHERE department_id IN (SELECT department_id FROM departments WHERE location_id = 2900 OR location_id = 2700); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html UPDATE sales PARTITION (sales_q1_1999) s SET s.promo_id = 494 WHERE amount_sold > 1000; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html CREATE TABLE people_demo1 OF people_typ; CREATE TABLE people_demo2 OF people_typ; UPDATE people_demo1 p SET VALUE(p) = (SELECT VALUE(q) FROM people_demo2 q WHERE p.department_id = q.department_id) WHERE p.department_id = 10; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html UPDATE employees SET job_id ='SA_MAN', salary = salary + 1000, department_id = 140 WHERE last_name = 'Jones' RETURNING salary*0.25, last_name, department_id INTO :bnd1, :bnd2, :bnd3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html UPDATE employees SET salary = salary * 1.1 WHERE department_id = 100 RETURNING SUM(salary) INTO :bnd1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPDATE-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html UPDATE hr.employees e SET e.salary = j.max_salary FROM hr.jobs j WHERE e.job_id = j.job_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/UPPER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPPER.html SELECT UPPER(last_name) "Uppercase" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/USER-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/USER.html SELECT USER, UID FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/USERENV-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/USERENV.html SELECT USERENV('LANGUAGE') "Language" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Unnesting-of-Nested-Subqueries-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Unnesting-of-Nested-Subqueries.html SELECT C.cust_last_name, C.country_id FROM customers C WHERE EXISTS (SELECT 1 FROM sales S WHERE S.quantity_sold > 1000 and S.cust_id = C.cust_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Unnesting-of-Nested-Subqueries-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Unnesting-of-Nested-Subqueries.html SELECT C.cust_last_name, C.country_id FROM customers C WHERE C.cust_id =ANY (SELECT S.cust_id FROM sales S WHERE S.quantity_sold > 1000); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Unnesting-of-Nested-Subqueries-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Unnesting-of-Nested-Subqueries.html SELECT C.cust_last_name, C.country_id FROM customers C WHERE NOT EXISTS (SELECT 1 FROM sales S, products P WHERE P.prod_id = S.prod_id and P.prod_min_price > 90 and S.cust_id = C.cust_id); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-Extensible-Indexing-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-Extensible-Indexing.html SELECT last_name, salary FROM (SELECT last_name, DENSE_RANK() OVER (ORDER BY salary DESC) rank_val, salary FROM employees) WHERE rank_val BETWEEN 10 AND 20; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-Extensible-Indexing-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-Extensible-Indexing.html CREATE OR REPLACE TYPE position_im AUTHID CURRENT_USER AS OBJECT ( curnum NUMBER, howmany NUMBER, lower_bound NUMBER, upper_bound NUMBER, /* lower_bound and upper_bound are used for the index-based functional implementation */ STATIC FUNCTION ODCIGETINTERFACES(ifclist OUT SYS.ODCIOBJECTLIST) RETURN NUMBER, STATIC FUNCTION ODCIINDEXCREATE (ia SYS.ODCIINDEXINFO, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER, STATIC FUNCTION ODCIINDEXTRUNCATE (ia SYS.ODCIINDEXINFO, env SYS.ODCIEnv) RETURN NUMBER, STATIC FUNCTION ODCIINDEXDROP(ia SYS.ODCIINDEXINFO, env SYS.ODCIEnv) RETURN NUMBER, STATIC FUNCTION ODCIINDEXINSERT(ia SYS.ODCIINDEXINFO, rid ROWID, newval NUMBER, env SYS.ODCIEnv) RETURN NUMBER, STATIC FUNCTION ODCIINDEXDELETE(ia SYS.ODCIINDEXINFO, rid ROWID, oldval NUMBER, env SYS.ODCIEnv) RETURN NUMBER, STATIC FUNCTION ODCIINDEXUPDATE(ia SYS.ODCIINDEXINFO, rid ROWID, oldval NUMBER, newval NUMBER, env SYS.ODCIEnv) RETURN NUMBER, STATIC FUNCTION ODCIINDEXSTART(SCTX IN OUT position_im, ia SYS.ODCIINDEXINFO, op SYS.ODCIPREDINFO, qi SYS.ODCIQUERYINFO, strt NUMBER, stop NUMBER, lower_pos NUMBER, upper_pos NUMBER, env SYS.ODCIEnv) RETURN NUMBER, MEMBER FUNCTION ODCIINDEXFETCH(SELF IN OUT position_im, nrows NUMBER, rids OUT SYS.ODCIRIDLIST, env SYS.ODCIEnv) RETURN NUMBER, MEMBER FUNCTION ODCIINDEXCLOSE(env SYS.ODCIEnv) RETURN NUMBER ); / CREATE OR REPLACE TYPE BODY position_im IS STATIC FUNCTION ODCIGETINTERFACES(ifclist OUT SYS.ODCIOBJECTLIST) RETURN NUMBER IS BEGIN ifclist := SYS.ODCIOBJECTLIST(SYS.ODCIOBJECT('SYS','ODCIINDEX2')); RETURN ODCICONST.SUCCESS; END ODCIGETINTERFACES; STATIC FUNCTION ODCIINDEXCREATE (ia SYS.ODCIINDEXINFO, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER IS stmt VARCHAR2(2000); BEGIN /* Construct the SQL statement */ stmt := 'Create Table ' || ia.INDEXSCHEMA || '.' || ia.INDEXNAME || '_STORAGE_TAB' || '(col_val, base_rowid, constraint pk PRIMARY KEY ' || '(col_val, base_rowid)) ORGANIZATION INDEX AS SELECT ' || ia.INDEXCOLS(1).COLNAME || ', ROWID FROM ' || ia.INDEXCOLS(1).TABLESCHEMA || '.' || ia.INDEXCOLS(1).TABLENAME; EXECUTE IMMEDIATE stmt; RETURN ODCICONST.SUCCESS; END; STATIC FUNCTION ODCIINDEXDROP(ia SYS.ODCIINDEXINFO, env SYS.ODCIEnv) RETURN NUMBER IS stmt VARCHAR2(2000); BEGIN /* Construct the SQL statement */ stmt := 'DROP TABLE ' || ia.INDEXSCHEMA || '.' || ia.INDEXNAME || '_STORAGE_TAB'; /* Execute the statement */ EXECUTE IMMEDIATE stmt; RETURN ODCICONST.SUCCESS; END; STATIC FUNCTION ODCIINDEXTRUNCATE(ia SYS.ODCIINDEXINFO, env SYS.ODCIEnv) RETURN NUMBER IS stmt VARCHAR2(2000); BEGIN /* Construct the SQL statement */ stmt := 'TRUNCATE TABLE ' || ia.INDEXSCHEMA || '.' || ia.INDEXNAME || '_STORAGE_TAB'; EXECUTE IMMEDIATE stmt; RETURN ODCICONST.SUCCESS; END; STATIC FUNCTION ODCIINDEXINSERT(ia SYS.ODCIINDEXINFO, rid ROWID, newval NUMBER, env SYS.ODCIEnv) RETURN NUMBER IS stmt VARCHAR2(2000); BEGIN /* Construct the SQL statement */ stmt := 'INSERT INTO ' || ia.INDEXSCHEMA || '.' || ia.INDEXNAME || '_STORAGE_TAB VALUES (''' || newval || ''' , ''' || rid || ''' )'; /* Execute the SQL statement */ EXECUTE IMMEDIATE stmt; RETURN ODCICONST.SUCCESS; END; STATIC FUNCTION ODCIINDEXDELETE(ia SYS.ODCIINDEXINFO, rid ROWID, oldval NUMBER, env SYS.ODCIEnv) RETURN NUMBER IS stmt VARCHAR2(2000); BEGIN /* Construct the SQL statement */ stmt := 'DELETE FROM ' || ia.INDEXSCHEMA || '.' || ia.INDEXNAME || '_STORAGE_TAB WHERE col_val = ''' || oldval || ''' AND base_rowid = ''' || rid || ''''; /* Execute the statement */ EXECUTE IMMEDIATE stmt; RETURN ODCICONST.SUCCESS; END; STATIC FUNCTION ODCIINDEXUPDATE(ia SYS.ODCIINDEXINFO, rid ROWID, oldval NUMBER, newval NUMBER, env SYS.ODCIEnv) RETURN NUMBER IS stmt VARCHAR2(2000); BEGIN /* Construct the SQL statement */ stmt := 'UPDATE ' || ia.INDEXSCHEMA || '.' || ia.INDEXNAME || '_STORAGE_TAB SET col_val = ''' || newval || ''' WHERE f2 = '''|| rid ||''''; /* Execute the statement */ EXECUTE IMMEDIATE stmt; RETURN ODCICONST.SUCCESS; END; STATIC FUNCTION ODCIINDEXSTART(SCTX IN OUT position_im, ia SYS.ODCIINDEXINFO, op SYS.ODCIPREDINFO, qi SYS.ODCIQUERYINFO, strt NUMBER, stop NUMBER, lower_pos NUMBER, upper_pos NUMBER, env SYS.ODCIEnv) RETURN NUMBER IS rid VARCHAR2(5072); storage_tab_name VARCHAR2(65); lower_bound_stmt VARCHAR2(2000); upper_bound_stmt VARCHAR2(2000); range_query_stmt VARCHAR2(2000); lower_bound NUMBER; upper_bound NUMBER; cnum INTEGER; nrows INTEGER; BEGIN /* Take care of some error cases. The only predicates in which position operator can appear are op() = 1 OR op() = 0 OR op() between 0 and 1 */ IF (((strt != 1) AND (strt != 0)) OR ((stop != 1) AND (stop != 0)) OR ((strt = 1) AND (stop = 0))) THEN RAISE_APPLICATION_ERROR(-20101, 'incorrect predicate for position_between operator'); END IF; IF (lower_pos > upper_pos) THEN RAISE_APPLICATION_ERROR(-20101, 'Upper Position must be greater than or equal to Lower Position'); END IF; IF (lower_pos <= 0) THEN RAISE_APPLICATION_ERROR(-20101, 'Both Positions must be greater than zero'); END IF; storage_tab_name := ia.INDEXSCHEMA || '.' || ia.INDEXNAME || '_STORAGE_TAB'; upper_bound_stmt := 'Select MIN(col_val) FROM (Select /*+ INDEX_DESC(' || storage_tab_name || ') */ DISTINCT ' || 'col_val FROM ' || storage_tab_name || ' ORDER BY ' || 'col_val DESC) WHERE rownum <= ' || lower_pos; EXECUTE IMMEDIATE upper_bound_stmt INTO upper_bound; IF (lower_pos != upper_pos) THEN lower_bound_stmt := 'Select MIN(col_val) FROM (Select /*+ INDEX_DESC(' || storage_tab_name || ') */ DISTINCT ' || 'col_val FROM ' || storage_tab_name || ' WHERE col_val < ' || upper_bound || ' ORDER BY ' || 'col_val DESC) WHERE rownum <= ' || (upper_pos - lower_pos); EXECUTE IMMEDIATE lower_bound_stmt INTO lower_bound; ELSE lower_bound := upper_bound; END IF; IF (lower_bound IS NULL) THEN lower_bound := upper_bound; END IF; range_query_stmt := 'Select base_rowid FROM ' || storage_tab_name || ' WHERE col_val BETWEEN ' || lower_bound || ' AND ' || upper_bound; cnum := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(cnum, range_query_stmt, DBMS_SQL.NATIVE); /* set context as the cursor number */ SCTX := position_im(cnum, 0, 0, 0); /* return success */ RETURN ODCICONST.SUCCESS; END; MEMBER FUNCTION ODCIINDEXFETCH(SELF IN OUT position_im, nrows NUMBER, rids OUT SYS.ODCIRIDLIST, env SYS.ODCIEnv) RETURN NUMBER IS cnum INTEGER; rid_tab DBMS_SQL.Varchar2_table; rlist SYS.ODCIRIDLIST := SYS.ODCIRIDLIST(); i INTEGER; d INTEGER; BEGIN cnum := SELF.curnum; IF self.howmany = 0 THEN dbms_sql.define_array(cnum, 1, rid_tab, nrows, 1); d := DBMS_SQL.EXECUTE(cnum); END IF; d := DBMS_SQL.FETCH_ROWS(cnum); IF d = nrows THEN rlist.extend(d); ELSE rlist.extend(d+1); END IF; DBMS_SQL.COLUMN_VALUE(cnum, 1, rid_tab); for i in 1..d loop rlist(i) := rid_tab(i+SELF.howmany); end loop; SELF.howmany := SELF.howmany + d; rids := rlist; RETURN ODCICONST.SUCCESS; END; MEMBER FUNCTION ODCIINDEXCLOSE(env SYS.ODCIEnv) RETURN NUMBER IS cnum INTEGER; BEGIN cnum := SELF.curnum; DBMS_SQL.CLOSE_CURSOR(cnum); RETURN ODCICONST.SUCCESS; END; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-Extensible-Indexing-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-Extensible-Indexing.html CREATE OR REPLACE FUNCTION function_for_position_between (col NUMBER, lower_pos NUMBER, upper_pos NUMBER, indexctx IN SYS.ODCIIndexCtx, scanctx IN OUT position_im, scanflg IN NUMBER) RETURN NUMBER AS rid ROWID; storage_tab_name VARCHAR2(65); lower_bound_stmt VARCHAR2(2000); upper_bound_stmt VARCHAR2(2000); col_val_stmt VARCHAR2(2000); lower_bound NUMBER; upper_bound NUMBER; column_value NUMBER; BEGIN IF (indexctx.IndexInfo IS NOT NULL) THEN storage_tab_name := indexctx.IndexInfo.INDEXSCHEMA || '.' || indexctx.IndexInfo.INDEXNAME || '_STORAGE_TAB'; IF (scanctx IS NULL) THEN /* This is the first call. Open a cursor for future calls. First, do some error checking */ IF (lower_pos > upper_pos) THEN RAISE_APPLICATION_ERROR(-20101, 'Upper Position must be greater than or equal to Lower Position'); END IF; IF (lower_pos <= 0) THEN RAISE_APPLICATION_ERROR(-20101, 'Both Positions must be greater than zero'); END IF; /* Obtain the upper and lower value bounds for the range we're interested in. */ upper_bound_stmt := 'Select MIN(col_val) FROM (Select /*+ INDEX_DESC(' || storage_tab_name || ') */ DISTINCT ' || 'col_val FROM ' || storage_tab_name || ' ORDER BY ' || 'col_val DESC) WHERE rownum <= ' || lower_pos; EXECUTE IMMEDIATE upper_bound_stmt INTO upper_bound; IF (lower_pos != upper_pos) THEN lower_bound_stmt := 'Select MIN(col_val) FROM (Select /*+ INDEX_DESC(' || storage_tab_name || ') */ DISTINCT ' || 'col_val FROM ' || storage_tab_name || ' WHERE col_val < ' || upper_bound || ' ORDER BY ' || 'col_val DESC) WHERE rownum <= ' || (upper_pos - lower_pos); EXECUTE IMMEDIATE lower_bound_stmt INTO lower_bound; ELSE lower_bound := upper_bound; END IF; IF (lower_bound IS NULL) THEN lower_bound := upper_bound; END IF; /* Store the lower and upper bounds for future function invocations for the positions. */ scanctx := position_im(0, 0, lower_bound, upper_bound); END IF; /* Fetch the column value corresponding to the rowid, and see if it falls within the determined range. */ col_val_stmt := 'Select col_val FROM ' || storage_tab_name || ' WHERE base_rowid = ''' || indexctx.Rid || ''''; EXECUTE IMMEDIATE col_val_stmt INTO column_value; IF (column_value <= scanctx.upper_bound AND column_value >= scanctx.lower_bound AND scanflg = ODCICONST.RegularCall) THEN RETURN 1; ELSE RETURN 0; END IF; ELSE RAISE_APPLICATION_ERROR(-20101, 'A column that has a domain index of' || 'Position indextype must be the first argument'); END IF; END; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-Extensible-Indexing-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-Extensible-Indexing.html CREATE OR REPLACE OPERATOR position_between BINDING (NUMBER, NUMBER, NUMBER) RETURN NUMBER WITH INDEX CONTEXT, SCAN CONTEXT position_im USING function_for_position_between; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-Extensible-Indexing-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-Extensible-Indexing.html CREATE INDEXTYPE position_indextype FOR position_between(NUMBER, NUMBER, NUMBER) USING position_im; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-Extensible-Indexing-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-Extensible-Indexing.html CREATE INDEX salary_index ON employees(salary) INDEXTYPE IS position_indextype; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-Extensible-Indexing-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-Extensible-Indexing.html SELECT last_name, salary FROM employees WHERE position_between(salary, 10, 20)=1 ORDER BY salary DESC, last_name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html CREATE TABLE xwarehouses OF XMLTYPE XMLTYPE STORE AS CLOB; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html INSERT INTO xwarehouses VALUES (xmltype(' 1 Southlake, Texas Owned 25000 2 Rear load true N Street 10 ')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html SELECT e.getClobVal() FROM xwarehouses e; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html begin dbms_xmlschema.registerSchema( 'http://www.example.com/xwarehouses.xsd', ' ', TRUE, TRUE, FALSE, FALSE); end; / ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html CREATE TABLE xwarehouses OF XMLTYPE XMLSCHEMA "http://www.example.com/xwarehouses.xsd" ELEMENT "Warehouse"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html INSERT INTO xwarehouses VALUES( xmltype.createxml(' 1 Southlake, Texas Owned 25000 2 Rear load true false Street 10 ')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html ALTER TABLE xwarehouses ADD (PRIMARY KEY(XMLDATA."WarehouseId")); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html SELECT * FROM xwarehouses x WHERE EXISTSNODE(VALUE(x), '/Warehouse[WarehouseId="1"]', 'xmlns:who="http://www.example.com/xwarehouses.xsd"') = 1; SELECT * FROM xwarehouses x WHERE EXTRACTVALUE(VALUE(x), '/Warehouse/WarehouseId', 'xmlns:who="http://www.example.com/xwarehouses.xsd"') = 1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html CREATE TABLE xwarehouses ( warehouse_id NUMBER, warehouse_spec XMLTYPE) XMLTYPE warehouse_spec STORE AS CLOB (TABLESPACE example STORAGE (INITIAL 6144) CHUNK 4000 NOCACHE LOGGING); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/Using-XML-in-SQL-Statements-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Using-XML-in-SQL-Statements.html CREATE TABLE xwarehouses ( warehouse_id NUMBER, warehouse_spec XMLTYPE) XMLTYPE warehouse_spec STORE AS OBJECT RELATIONAL XMLSCHEMA "http://www.example.com/xwarehouses.xsd" ELEMENT "Warehouse"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VALIDATE_CONVERSION-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VALIDATE_CONVERSION.html SELECT VALIDATE_CONVERSION(1000 AS BINARY_DOUBLE) FROM DUAL; SELECT VALIDATE_CONVERSION('1234.56' AS BINARY_FLOAT) FROM DUAL; SELECT VALIDATE_CONVERSION('July 20, 1969, 20:18' AS DATE, 'Month dd, YYYY, HH24:MI', 'NLS_DATE_LANGUAGE = American') FROM DUAL; SELECT VALIDATE_CONVERSION('200 00:00:00' AS INTERVAL DAY TO SECOND) FROM DUAL; SELECT VALIDATE_CONVERSION('P1Y2M' AS INTERVAL YEAR TO MONTH) FROM DUAL; SELECT VALIDATE_CONVERSION('$100,00' AS NUMBER, '$999D99', 'NLS_NUMERIC_CHARACTERS = '',.''') FROM DUAL; SELECT VALIDATE_CONVERSION('29-Jan-02 17:24:00' AS TIMESTAMP, 'DD-MON-YY HH24:MI:SS') FROM DUAL; SELECT VALIDATE_CONVERSION('1999-12-01 11:00:00 -8:00' AS TIMESTAMP WITH TIME ZONE, 'YYYY-MM-DD HH:MI:SS TZH:TZM') FROM DUAL; SELECT VALIDATE_CONVERSION('11-May-16 17:30:00' AS TIMESTAMP WITH LOCAL TIME ZONE, 'DD-MON-YY HH24:MI:SS') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VALIDATE_CONVERSION-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VALIDATE_CONVERSION.html SELECT VALIDATE_CONVERSION('$29.99' AS BINARY_FLOAT) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VALIDATE_CONVERSION-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VALIDATE_CONVERSION.html SELECT VALIDATE_CONVERSION('$29.99' AS BINARY_FLOAT, '$99D99') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VALUE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VALUE.html SELECT VALUE(p) FROM persons p; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VARIANCE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VARIANCE.html SELECT VARIANCE(salary) "Variance" FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VARIANCE-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VARIANCE.html SELECT last_name, salary, VARIANCE(salary) OVER (ORDER BY hire_date) "Variance" FROM employees WHERE department_id = 30 ORDER BY last_name, salary, "Variance"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VAR_POP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VAR_POP.html SELECT VAR_POP(salary) FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VAR_POP-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VAR_POP.html SELECT t.calendar_month_desc, VAR_POP(SUM(s.amount_sold)) OVER (ORDER BY t.calendar_month_desc) "Var_Pop", VAR_SAMP(SUM(s.amount_sold)) OVER (ORDER BY t.calendar_month_desc) "Var_Samp" FROM sales s, times t WHERE s.time_id = t.time_id AND t.calendar_year = 1998 GROUP BY t.calendar_month_desc ORDER BY t.calendar_month_desc, "Var_Pop", "Var_Samp"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VAR_SAMP-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VAR_SAMP.html SELECT VAR_SAMP(salary) FROM employees; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/VSIZE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/VSIZE.html SELECT last_name, VSIZE (last_name) "BYTES" FROM employees WHERE department_id = 10 ORDER BY employee_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/WIDTH_BUCKET-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/WIDTH_BUCKET.html SELECT customer_id, cust_last_name, credit_limit, WIDTH_BUCKET(credit_limit, 100, 5000, 10) "Credit Group" FROM customers WHERE nls_territory = 'SWITZERLAND' ORDER BY "Credit Group", customer_id, cust_last_name, credit_limit; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XML-Conditions-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XML-Conditions.html SELECT ANY_PATH FROM RESOURCE_VIEW WHERE EQUALS_PATH(res, '/sys/schemas/OE/www.example.com')=1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XML-Conditions-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XML-Conditions.html SELECT ANY_PATH FROM RESOURCE_VIEW WHERE UNDER_PATH(res, '/sys/schemas/OE/www.example.com')=1; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLAGG-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLAGG.html SELECT XMLELEMENT("Department", XMLAGG(XMLELEMENT("Employee", e.job_id||' '||e.last_name) ORDER BY last_name)) as "Dept_list" FROM employees e WHERE e.department_id = 30; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLAGG-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLAGG.html SELECT XMLELEMENT("Department", XMLAGG(XMLELEMENT("Employee", e.job_id||' '||e.last_name))) AS "Dept_list" FROM employees e GROUP BY e.department_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLCDATA-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLCDATA.html SELECT XMLELEMENT("PurchaseOrder", XMLAttributes(dummy as "pono"), XMLCdata(' ]>')) "XMLCData" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLCOLATTVAL-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLCOLATTVAL.html SELECT XMLELEMENT("Emp", XMLCOLATTVAL(e.employee_id, e.last_name, e.salary)) "Emp Element" FROM employees e WHERE employee_id = 204; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLCOMMENT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLCOMMENT.html SELECT XMLCOMMENT('OrderAnalysisComp imported, reconfigured, disassembled') AS "XMLCOMMENT" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLCONCAT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLCONCAT.html SELECT XMLCONCAT(XMLELEMENT("First", e.first_name), XMLELEMENT("Last", e.last_name)) AS "Result" FROM employees e WHERE e.employee_id > 202; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLDATA-Pseudocolumn-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLDATA-Pseudocolumn.html CREATE TABLE xml_lob_tab of XMLTYPE XMLTYPE STORE AS CLOB; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLDATA-Pseudocolumn-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLDATA-Pseudocolumn.html ALTER TABLE xml_lob_tab MODIFY LOB (XMLDATA) (STORAGE (MAXSIZE 2G) CACHE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLDATA-Pseudocolumn-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLDATA-Pseudocolumn.html ALTER TABLE xwarehouses ADD (UNIQUE(XMLDATA."WarehouseId")); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLDIFF-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLDIFF.html SELECT XMLDIFF( XMLTYPE(' Chapter 1. Chapter 2. '), XMLTYPE(' Chapter 1. ') ) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLELEMENT-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLELEMENT.html SELECT XMLELEMENT("Emp", XMLELEMENT("Name", e.job_id||' '||e.last_name), XMLELEMENT("Hiredate", e.hire_date)) as "Result" FROM employees e WHERE employee_id > 200; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLELEMENT-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLELEMENT.html SELECT XMLELEMENT("Emp", XMLATTRIBUTES(e.employee_id AS "ID", e.last_name), XMLELEMENT("Dept", e.department_id), XMLELEMENT("Salary", e.salary)) AS "Emp Element" FROM employees e WHERE e.employee_id = 206; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLELEMENT-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLELEMENT.html SELECT XMLELEMENT("Emp", XMLATTRIBUTES(e.employee_id, e.last_name), XMLELEMENT("Dept", XMLATTRIBUTES(e.department_id, (SELECT d.department_name FROM departments d WHERE d.department_id = e.department_id) as "Dept_name")), XMLELEMENT("salary", e.salary), XMLELEMENT("Hiredate", e.hire_date)) AS "Emp Element" FROM employees e WHERE employee_id = 205; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLFOREST-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLFOREST.html SELECT XMLELEMENT("Emp", XMLFOREST(e.employee_id, e.last_name, e.salary)) "Emp Element" FROM employees e WHERE employee_id = 204; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLPARSE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLPARSE.html SELECT XMLPARSE(CONTENT '124 Acme Enterprises 32987457 ' WELLFORMED) AS PO FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLPATCH-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLPATCH.html SELECT XMLPATCH( XMLTYPE(' Chapter 1. Chapter 2. '), XMLTYPE(' ') ) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLPI-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLPI.html SELECT XMLPI(NAME "Order analysisComp", 'imported, reconfigured, disassembled') AS "XMLPI" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLQUERY-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLQUERY.html SELECT warehouse_name, EXTRACTVALUE(warehouse_spec, '/Warehouse/Area'), XMLQuery( 'for $i in /Warehouse where $i/Area > 50000 return
{ if ($i/RailAccess = "Y") then "true" else "false" }
' PASSING warehouse_spec RETURNING CONTENT) "Big_warehouses" FROM warehouses; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLSEQUENCE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLSEQUENCE.html SELECT EXTRACT(warehouse_spec, '/Warehouse') as "Warehouse" FROM warehouses WHERE warehouse_name = 'San Francisco'; SELECT VALUE(p) FROM warehouses w, TABLE(XMLSEQUENCE(EXTRACT(warehouse_spec, '/Warehouse/*'))) p WHERE w.warehouse_name = 'San Francisco'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLSERIALIZE-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLSERIALIZE.html SELECT XMLSERIALIZE(CONTENT XMLTYPE('Grandco')) AS xmlserialize_doc FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLTABLE-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLTABLE.html SELECT warehouse_name warehouse, warehouse2."Water", warehouse2."Rail" FROM warehouses, XMLTABLE('/Warehouse' PASSING warehouses.warehouse_spec COLUMNS "Water" varchar2(6) PATH 'WaterAccess', "Rail" varchar2(6) PATH 'RailAccess') warehouse2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLTRANSFORM-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLTRANSFORM.html CREATE TABLE xsl_tab (col1 XMLTYPE); INSERT INTO xsl_tab VALUES ( XMLTYPE.createxml( ' ')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/XMLTRANSFORM-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/XMLTRANSFORM.html SELECT XMLTRANSFORM(w.warehouse_spec, x.col1).GetClobVal() FROM warehouses w, xsl_tab x WHERE w.warehouse_name = 'San Francisco'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/alter-domain-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/alter-domain.html ALTER DOMAIN day_of_week MODIFY DISPLAY LOWER(day_of_week); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/alter-domain-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/alter-domain.html ALTER DOMAIN day_of_week DROP DISPLAY; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/alter-domain-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/alter-domain.html ALTER DOMAIN day_of_week ADD DISPLAY INITCAP(day_of_week); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/alter-domain-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/alter-domain.html ALTER DOMAIN year_of_birth MODIFY ORDER MOD(year_of_birth,100); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/alter-domain-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/alter-domain.html ALTER DOMAIN year_of_birth DROP ORDER; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/alter-domain-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/alter-domain.html ALTER DOMAIN year_of_birth ADD ORDER FLOOR(year_of_birth/100); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/alter-domain-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/alter-domain.html ALTER DOMAIN day_of_week ANNOTATIONS(Display 'Day of week'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/alter-mle-env-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/alter-mle-env.html ALTER MLE ENV scott."myenv" SET LANGUAGE OPTIONS 'js.strict= true '; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/alter-mle-module-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/alter-mle-module.html ALTER MLE MODULE myMLEModule SET METADATA USING CLOB ( SELECT JSON( '{ "name": "value", "version": "1.2.0", "commitHash": "23fas4h", "projectName": "Database Backend" }') ) ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/analytic-view-measure-expressions-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/analytic-view-measure-expressions.html SELECT geography_hier.member_name AS "Region", units AS "Units", units_geog_rank_level AS "Rank" FROM ANALYTIC VIEW ( USING sales_av HIERARCHIES (geography_hier) ADD MEASURES ( units_geog_rank_level AS ( RANK() OVER ( HIERARCHY geography_hier ORDER BY units desc nulls last WITHIN LEVEL)) ) ) WHERE geography_hier.level_name IN ('REGION') ORDER BY units_geog_rank_level; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/annotations_clause-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/annotations_clause.html CREATE TABLE t1 (T NUMBER) ANNOTATIONS(Operations '["Sort", "Group"]', Hidden); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/annotations_clause-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/annotations_clause.html CREATE TABLE t1 (T NUMBER) ANNOTATIONS (ADD Hidden); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/annotations_clause-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/annotations_clause.html ALTER TABLE t1 ANNOTATIONS(DROP Operations, DROP Hidden); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/annotations_clause-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/annotations_clause.html CREATE TABLE t1 (T NUMBER ANNOTATIONS(Operations 'Sort' , Hidden) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/annotations_clause-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/annotations_clause.html CREATE TABLE employee ( id NUMBER(5) ANNOTATIONS(Identity, Display 'Employee ID', "Group" 'Emp_Info'), ename VARCHAR2(50) ANNOTATIONS(Display 'Employee Name', "Group" 'Emp_Info'), sal NUMBER ANNOTATIONS(Display 'Employee Salary', UI_Hidden) ) ANNOTATIONS (Display 'Employee Table'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/annotations_clause-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/annotations_clause.html ALTER TABLE employee MODIFY ename ANNOTATIONS ( DROP "Group", DROP IF EXISTS missing_annotation, REPLACE Display 'Emp name' ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_and_agg-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_and_agg.html SELECT BOOLEAN_AND_AGG(c2) FROM t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_and_agg-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_and_agg.html SELECT BOOLEAN_AND_AGG(c2) FROM t WHERE c1 = 0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_and_agg-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_and_agg.html SELECT BOOLEAN_AND_AGG(c2) FROM t WHERE c2 IS FALSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_and_agg-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_and_agg.html SELECT BOOLEAN_AND_AGG(c2) FROM t WHERE c2 IS FALSE OR c2 IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_and_agg-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_and_agg.html SELECT BOOLEAN_AND_AGG(c2) FROM t WHERE c2 IS NOT TRUE OR c2 IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_and_agg-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_and_agg.html SELECT BOOLEAN_AND_AGG(c2) FROM t WHERE c2 IS NOT FALSE OR c2 IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_and_agg-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_and_agg.html SELECT BOOLEAN_AND_AGG(c2 OR c2 OR (c2)) FROM t WHERE c2 IS NOT FALSE OR c2 IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_or_agg-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_or_agg.html SELECT BOOLEAN_OR_AGG(c2) FROM t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_or_agg-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_or_agg.html SELECT BOOLEAN_OR_AGG(c2) FROM t WHERE c1 = 0; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_or_agg-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_or_agg.html SELECT BOOLEAN_OR_AGG(c2) FROM t WHERE c2 IS TRUE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_or_agg-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_or_agg.html SELECT BOOLEAN_OR_AGG(c2) FROM t WHERE c2 IS TRUE OR c2 IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_or_agg-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_or_agg.html SELECT BOOLEAN_OR_AGG(c2) FROM t WHERE c2 IS NOT FALSE OR c2 IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_or_agg-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_or_agg.html SELECT BOOLEAN_OR_AGG(c2) FROM t WHERE c2 IS NOT TRUE OR c2 IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/boolean_or_agg-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/boolean_or_agg.html SELECT BOOLEAN_OR_AGG(c2 OR c2) FROM t WHERE c2 IS NOT TRUE OR c2 IS NULL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ceil-datetime-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ceil-datetime.html ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ceil-datetime-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ceil-datetime.html SELECT CEIL(TO_DATE ('28-FEB-2023','DD-MON-YYYY'), 'MM') AS month_ceiling; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ceil-datetime-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ceil-datetime.html SELECT CEIL(TO_TIMESTAMP ('28-FEB-2023 14:10:10','DD-MON-YYYY HH24:MI:SS'),'HH24') AS hour_ceiling; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ceil-interval-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ceil-interval.html SELECT CEIL(INTERVAL '+123-5' YEAR(3) TO MONTH) AS year_ceil; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ceil-interval-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ceil-interval.html SELECT CEIL(INTERVAL '+99-11' YEAR(2) TO MONTH, 'YEAR'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ceil-interval-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ceil-interval.html SELECT CEIL(INTERVAL '+999999999-11' YEAR(9) TO MONTH, 'YEAR') AS year_ceil; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ceil-interval-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ceil-interval.html SELECT CEIL(INTERVAL '+4 12:42:10.222' DAY(2) TO SECOND(3), 'DD') AS day_ceil; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/con_id_to_con_name-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/con_id_to_con_name.html SELECT CON_ID, NAME FROM V$CONTAINERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/con_id_to_con_name-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/con_id_to_con_name.html SELECT CON_ID_TO_CON_NAME(4) "CON_NAME" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/con_id_to_dbid-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/con_id_to_dbid.html SELECT CON_ID, NAME, DBID FROM V$CONTAINERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/con_id_to_dbid-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/con_id_to_dbid.html SELECT CON_ID_TO_DBID(4) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/con_id_to_guid-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/con_id_to_guid.html SELECT CON_ID, NAME, GUID FROM V$CONTAINERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/con_id_to_guid-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/con_id_to_guid.html SELECT CON_ID_TO_GUID(4) "CON_GUID" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/con_id_to_uid-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/con_id_to_uid.html SELECT CON_ID, NAME, CON_UID FROM V$CONTAINERS; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/con_id_to_uid-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/con_id_to_uid.html SELECT CON_ID_TO_UID(4) "PDB_UID" FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE promotions_var1 ( promo_id NUMBER(6) CONSTRAINT promo_id_u UNIQUE , promo_name VARCHAR2(20) , promo_category VARCHAR2(15) , promo_cost NUMBER(10,2) , promo_begin_date DATE , promo_end_date DATE ) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE promotions_var2 ( promo_id NUMBER(6) , promo_name VARCHAR2(20) , promo_category VARCHAR2(15) , promo_cost NUMBER(10,2) , promo_begin_date DATE , promo_end_date DATE , CONSTRAINT promo_id_u UNIQUE (promo_id) USING INDEX PCTFREE 20 TABLESPACE stocks STORAGE (INITIAL 8M) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html ALTER TABLE dept_20 ADD CONSTRAINT fk_empid_hiredate FOREIGN KEY (employee_id, hire_date) REFERENCES hr.job_history(employee_id, start_date) EXCEPTIONS INTO wrong_emp; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE divisions (div_no NUMBER CONSTRAINT check_divno CHECK (div_no BETWEEN 10 AND 99) DISABLE, div_name VARCHAR2(9) CONSTRAINT check_divname CHECK (div_name = UPPER(div_name)) DISABLE, office VARCHAR2(10) CONSTRAINT check_office CHECK (office IN ('DALLAS','BOSTON', 'PARIS','TOKYO')) DISABLE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE dept_20 (employee_id NUMBER(4) PRIMARY KEY, last_name VARCHAR2(10), job_id VARCHAR2(9), manager_id NUMBER(4), salary NUMBER(7,2), commission_pct NUMBER(7,2), department_id NUMBER(2), CONSTRAINT check_sal CHECK (salary * commission_pct <= 5000)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE order_detail (CONSTRAINT pk_od PRIMARY KEY (order_id, part_no), order_id NUMBER CONSTRAINT fk_oid REFERENCES oe.orders(order_id), part_no NUMBER CONSTRAINT fk_pno REFERENCES oe.product_information(product_id), quantity NUMBER CONSTRAINT nn_qty NOT NULL CONSTRAINT check_qty CHECK (quantity > 0), cost NUMBER CONSTRAINT check_cost CHECK (cost > 0) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE Product( Id NUMBER NOT NULL PRIMARY KEY, Name VARCHAR2(50), Price NUMBER CHECK (mod(price,4) = 0 and 10 <> price) PRECHECK, Color NUMBER CHECK (Color >= 10 and Color <=50 and mod(color,2) = 0) PRECHECK, Description VARCHAR2(50) CHECK (Length(Description) <= 40) PRECHECK, Constant NUMBER CHECK (Constant=10) PRECHECK, CONSTRAINT TC1 CHECK (Color > 0 AND Price > 10) PRECHECK, CONSTRAINT TC2 CHECK (CATEGORY IN ('Home', 'Apparel') AND Price > 10) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html ALTER TABLE Product MODIFY (Name VARCHAR2(50) CHECK (regexp_like(Name, '^Product')) PRECHECK); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html ALTER TABLE Product MODIFY CONSTRAINT TC2 PRECHECK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html ALTER TABLE Product MODIFY CONSTRAINT TC1 NOPRECHECK; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html SELECT CONSTRAINT_NAME, SEARCH_CONDITION, PRECHECK FROM USER_CONSTRAINTS WHERE table_name='PRODUCT' and constraint_type='C'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html ALTER TABLE warehouses ADD CONSTRAINT wh_unq UNIQUE (warehouse_id, warehouse_name) USING INDEX PCTFREE 5 EXCEPTIONS INTO wrong_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE products ( product_id VARCHAR2(20) COLLATE BINARY_CI CONSTRAINT product_pk PRIMARY KEY , description VARCHAR2(1000) COLLATE BINARY_CI CONSTRAINT product_description_unq UNIQUE ); CREATE TABLE product_components ( component_id VARCHAR2(40) COLLATE BINARY_CI CONSTRAINT product_component_pk PRIMARY KEY , product_id CONSTRAINT product_component_fk REFERENCES products(product_id) , description VARCHAR2(1000) COLLATE BINARY_CI CONSTRAINT product_component_descr_unq UNIQUE ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html INSERT INTO products(product_id, description) VALUES('BICY0001', 'Men''s bicycle, fr 21", wh 24", gear 3x7'); INSERT INTO product_components(component_id, product_id, description) VALUES('BICY0001_FRAME01', 'BICY0001', 'Aluminium frame 21"'); INSERT INTO product_components(component_id, product_id, description) VALUES('BICY0001_WHEEL01', 'bicy0001', 'Wheels 24"'); INSERT INTO product_components(component_id, product_id, description) VALUES('BICY0001_GEAR01', 'Bicy0001', 'Front derailleur 3 chainrings'); INSERT INTO product_components(component_id, product_id, description) VALUES('BICY0001_gear02', 'BiCy0001', 'Rear derailleur 7 chainrings'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html INSERT INTO products(product_id, description) VALUES('BICY0002', 'MEN''S BICYCLE, fr 21", wh 24", gear 3x7'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html INSERT INTO products(component_id, product_id, description) VALUES('bicy0001', 'Women''s bicycle, fr 21", wh 24", gear 2x6'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html INSERT INTO product_components(component_id, product_id, description) VALUES('BICY0001_gear03', 'BiCy0001', 'REAR DERAILLEUR 7 CHAINRINGS'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-26.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TYPE person_name AS OBJECT (first_name VARCHAR2(30), last_name VARCHAR2(30)); / CREATE TABLE students (name person_name, age INTEGER, CHECK (name.first_name IS NOT NULL AND name.last_name IS NOT NULL)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TYPE cust_address_typ_new AS OBJECT ( street_address VARCHAR2(40) , postal_code VARCHAR2(10) , city VARCHAR2(30) , state_province VARCHAR2(10) , country_id CHAR(2) ); / CREATE TABLE address_table OF cust_address_typ_new; CREATE TABLE customer_addresses ( add_id NUMBER, address REF cust_address_typ_new SCOPE IS address_table); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE customer_addresses ( add_id NUMBER, address REF cust_address_typ REFERENCES address_table); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE employees_obj ( e_name VARCHAR2(100), e_number NUMBER, e_dept REF department_typ SCOPE IS departments_obj_t ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE locations_demo ( location_id NUMBER(4) CONSTRAINT loc_id_pk PRIMARY KEY , street_address VARCHAR2(40) , postal_code VARCHAR2(12) , city VARCHAR2(30) , state_province VARCHAR2(25) , country_id CHAR(2) ) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE employees_obj ( e_name VARCHAR2(100), e_number NUMBER, e_dept REF department_typ REFERENCES departments_obj_t); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE promotions_var3 ( promo_id NUMBER(6) , promo_name VARCHAR2(20) , promo_category VARCHAR2(15) , promo_cost NUMBER(10,2) , promo_begin_date DATE , promo_end_date DATE , CONSTRAINT promo_id_u UNIQUE (promo_id, promo_cost) USING INDEX (CREATE UNIQUE INDEX promo_ix1 ON promotions_var3 (promo_id, promo_cost)) , CONSTRAINT promo_id_u2 UNIQUE (promo_cost, promo_id) USING INDEX promo_ix1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE games (scores NUMBER CHECK (scores >= 0)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE games (scores NUMBER, CONSTRAINT unq_num UNIQUE (scores) INITIALLY DEFERRED DEFERRABLE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE locations_demo ( location_id NUMBER(4) , street_address VARCHAR2(40) , postal_code VARCHAR2(12) , city VARCHAR2(30) , state_province VARCHAR2(25) , country_id CHAR(2) , CONSTRAINT loc_id_pk PRIMARY KEY (location_id)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html ALTER TABLE locations_demo MODIFY (country_id CONSTRAINT country_nn NOT NULL); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html ALTER TABLE sales ADD CONSTRAINT sales_pk PRIMARY KEY (prod_id, cust_id) DISABLE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE dept_20 (employee_id NUMBER(4), last_name VARCHAR2(10), job_id VARCHAR2(9), manager_id NUMBER(4), hire_date DATE, salary NUMBER(7,2), commission_pct NUMBER(7,2), department_id CONSTRAINT fk_deptno REFERENCES departments(department_id) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE dept_20 (employee_id NUMBER(4), last_name VARCHAR2(10), job_id VARCHAR2(9), manager_id NUMBER(4), hire_date DATE, salary NUMBER(7,2), commission_pct NUMBER(7,2), department_id, CONSTRAINT fk_deptno FOREIGN KEY (department_id) REFERENCES departments(department_id) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/constraint-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/constraint.html CREATE TABLE dept_20 (employee_id NUMBER(4) PRIMARY KEY, last_name VARCHAR2(10), job_id VARCHAR2(9), manager_id NUMBER(4) CONSTRAINT fk_mgr REFERENCES employees ON DELETE SET NULL, hire_date DATE, salary NUMBER(7,2), commission_pct NUMBER(7,2), department_id NUMBER(2) CONSTRAINT fk_deptno REFERENCES departments(department_id) ON DELETE CASCADE ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN US_city AS ( name AS VARCHAR2(30) ANNOTATIONS (Address), state AS VARCHAR2(2) ANNOTATIONS (Address), zip AS NUMBER ANNOTATIONS (Address) ) CONSTRAINT City_CK CHECK(state in ('CA','AZ','TX') and zip < 100000) DISPLAY name||', '|| state ||', '||TO_CHAR(zip) ORDER state||', '||TO_CHAR(zip)||', '||name ANNOTATIONS (Title 'Domain Annotation'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN flight_details AS ( flight_num AS VARCHAR2(100) NOT NULL, origin AS VARCHAR2(200) CONSTRAINT origin_3_char_c CHECK (LENGTH(origin) = 3), destination AS VARCHAR2(200) CONSTRAINT dest_3_char_c CHECK (LENGTH(destination) = 3) ) CONSTRAINT flight_c CHECK ( flight_num LIKE '%-%' AND origin IS NOT NULL AND destination IS NOT NULL ) CONSTRAINT origin_dest_different_c CHECK (origin <> destination) DISPLAY flight_num||', '||origin||', '||destination ORDER flight_num||destination; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN meals_details AS ( restaurant AS VARCHAR2(100) NOT NULL, meal_type AS VARCHAR2(200), diner_count AS NUMBER ) CONSTRAINT meals_c CHECK ( restaurant IS NOT NULL AND meal_type IN ('Breakfast', 'Lunch', 'Dinner') AND diner_count IS NOT NULL ) DISPLAY meal_type||', '||restaurant||', '||diner_count; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN lodging_details AS ( hotel AS VARCHAR2(100) NOT NULL, nights_count AS NUMBER ) CONSTRAINT lodging_c CHECK (hotel IS NOT NULL AND nights_count > 0) DISPLAY hotel||', '||nights_count; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE FLEXIBLE DOMAIN expense_details (val1, val2, val3, val4) CHOOSE DOMAIN USING (typ VARCHAR2(10)) FROM DECODE(typ, 'Flight', flight_details(val1, val2, val3), 'Meals', meals_details(val1, val2, val4), 'Lodging', lodging_details(val1, val4)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE FLEXIBLE DOMAIN expense_details (val1, val2, val3, val4) CHOOSE DOMAIN USING(typ VARCHAR2(10)) FROM CASE WHEN typ BETWEEN 'A' AND 'G' THEN flight_details(val1, val2, val3) WHEN typ = 'Meals' THEN meals_details(val1, val2, val4) WHEN typ LIKE 'Lodg%' THEN lodging_details(val1, val4) END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN w2_form AS JSON CONSTRAINT CHECK (VALUE IS JSON VALIDATE USING '{ "title": "W2_form", "type": "object", "properties": { "social_security_number": { "type": "string", "description": "The person social security number." }, "wages": { "description": "total wages", "type": "number", "minimum": 0 }, "social_security_wages": { "type": "number", "description": "wages subject to social security tax" }, "Federal Income Tax Withheld": { "type": "number", "description": "withheld of tax to federal income tax" }, "Social Security Tax Withheld": { "type": "number", "description": "withheld of social security tax" } }, "required": [ "social_security_number", "wages", "Federal Income Tax Withheld" ] }' ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE TABLE tax_report(id NUMBER, income JSON DOMAIN w2_form); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html INSERT INTO tax_report VALUES (1, '{"wages": 100, "social_security_number": "111", "Federal Income Tax Withheld":10}' ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html INSERT INTO tax_report VALUES (2, '{"wages": 100}' ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN w2_form AS JSON VALIDATE USING '{ "title": "W2_form", "type": "object", "properties": { "social_security_number": { "type": "string", "description": "The person social security number." }, "wages": { "description": "total wages", "type": "number", "minimum": 0 }, "social_security_wages": { "type": "number", "description": "wages subject to social security tax" }, "Federal Income Tax Withheld": { "type": "number", "description": "withheld of tax to federal income tax" }, "Social Security Tax Withheld": { "type": "number", "description": "withheld of social security tax" } }, "required": [ "social_security_number", "wages", "Federal Income Tax Withheld" ] }'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN email AS VARCHAR2(30) CONSTRAINT EMAIL_C CHECK (REGEXP_LIKE (email, '^(\S+)\@(\S+)\.(\S+)$')) DISPLAY '---' || SUBSTR(email, INSTR(email, '@') + 1) ANNOTATIONS(allowed_operations '{ "allowed_operations": { "title": "Allowed operations", "operations": [ "Sort", "Group By", "Picklist" ] } }'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-22.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html SELECT jt.* FROM user_annotations_usage a, JSON_TABLE (annotation_value, '$.allowed_operations.operations[*]' COLUMNS (value VARCHAR2(50 CHAR) PATH '$')) jt WHERE annotation_name = 'ALLOWED_OPERATIONS' AND object_name = 'EMAIL' ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-24.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN temperature AS NUMBER(3) ANNOTATIONS (display_units '{ "units": ["celsius", "fahrenheit"] }'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html SELECT jt.* FROM user_annotations_usage, JSON_TABLE(annotation_value, '$.units[*]' COLUMNS (value VARCHAR2(30 CHAR) PATH '$')) jt WHERE annotation_name = 'DISPLAY_UNITS' AND object_name = 'TEMPERATURE'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN dj5 AS JSON CONSTRAINT dj5chk CHECK (dj5 IS JSON validate '{ "type": "object", "properties": { "a": { "type": "number" } } }' ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-28.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE TABLE jtab( id NUMBER PRIMARY KEY, jcol JSON DOMAIN dj5 ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN order_status AS ENUM ( New , Open , Shipped , Closed , Cancelled ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-30.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html SELECT * FROM order_status; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-32.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE TABLE orders ( id NUMBER, cust VARCHAR2(100), status ORDER_STATUS ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html DESCRIBE orders; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html INSERT INTO orders VALUES (1, 'Costco', order_status.open ), (2, 'BMW', order_status.closed ), (3, 'Nestle', order_status.shipped ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-36.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html SELECT ID, DOMAIN_DISPLAY(STATUS) FROM orders; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html SELECT ID, STATUS FROM orders; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN day_of_week AS CHAR(3 CHAR) CONSTRAINT day_of_week_c CHECK (UPPER(VALUE) IN ('MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN')) DEFERRABLE INITIALLY DEFERRED DISPLAY SUBSTR(VALUE, 1, 2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html UPDATE orders SET STATUS = 2 WHERE STATUS = 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-41.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html SELECT 2 * ORDER_STATUS.CANCELLED; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-43.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN days_of_week AS ENUM ( Sunday = Su = 0, Monday = Mo, Tuesday = Tu, Wednesday = We, Thursday = Th, Friday = Fr, Saturday = Sa ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN year_of_birth AS NUMBER(4) CONSTRAINT CHECK ( (trunc(year_of_birth) = year_of_birth) and (year_of_birth >= 1900) ) DISPLAY (CASE WHEN year_of_birth < 2000 THEN '19-' ELSE '20-' END) || MOD(year_of_birth, 100) ORDER year_of_birth-1900 ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN day_of_week AS CHAR(3 CHAR) CONSTRAINT day_of_week_c CHECK (day_of_week IN ('MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN')) INITIALLY DEFERRED ORDER CASE day_of_week WHEN 'MON' THEN 0 WHEN 'TUE' THEN 1 WHEN 'WED' THEN 2 WHEN 'THU' THEN 3 WHEN 'FRI' THEN 4 WHEN 'SAT' THEN 5 WHEN 'SUN' THEN 6 ELSE 7 END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE SEQUENCE IF NOT EXISTS email_seq; CREATE DOMAIN email AS VARCHAR2(30) DEFAULT ON NULL email_seq.NEXTVAL || '@domain.com' CONSTRAINT EMAIL_C CHECK (REGEXP_LIKE (email, '^(\S+)\@(\S+)\.(\S+)$')) DISPLAY '---' || SUBSTR(email, INSTR(email, '@') + 1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN dept_codes AS NUMBER(3) STRICT CONSTRAINT dept_chk CHECK (dept_codes > 99 AND dept_codes != 200) ANNOTATIONS (Title 'Domain Annotation'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-domain-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html CREATE DOMAIN hourly_wages AS NUMBER(10) DEFAULT ON NULL 15 CONSTRAINT minimal_wage_c CHECK (hourly_wages >= 7 and hourly_wages <=1000) ENABLE DISPLAY TO_CHAR(hourly_wages, '$999.99') ORDER ( -1*hourly_wages ) ANNOTATIONS (Title 'Domain Annotation'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-mle-env-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-mle-env.html CREATE MLE ENV scott."myenv"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-mle-env-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-mle-env.html CREATE MLE ENV scott."myenv" CLONE "other_env"; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html CREATE PROPERTY GRAPH “myGraph” VERTEX TABLES (my_table_1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html CREATE PROPERTY GRAPH “myGraph” VERTEX TABLES (other_schema.my_table_1); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html ALTER TABLE t DROP CONSTRAINT fkc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html ALTER TABLE t DISABLE CONSTRAINT fkc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html ALTER TABLE t ENABLE NOVALIDATE CONSTRAINT fkc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html DROP TABLE t ; DROP MATERIALIZED VIEW t; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html RENAME t TO t2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html ALTER TABLE t RENAME C TO C2; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html CREATE PROPERTY GRAPH “myGraph” VERTEX TABLES (“myschema”. “mytable”, “mytable2” AS T2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-18.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html CREATE PROPERTY GRAPH “myGraph” VERTEX TABLES (“myschema”. “mytable” LABEL “person”); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html CREATE PROPERTY GRAPH “myGraph” VERTEX TABLES (“myschema”. “mytable” LABEL “mytable”); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html CREATE PROPERTY GRAPH “myGraph” VERTEX TABLES ( VT1, VT2 KEY(PK2), VT3 KEY(PK31, PK32), VT2 AS ALTVT2 KEY(PK4) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html CREATE PROPERTY GRAPH “myGraph” VERTEX TABLES (“myschema”. “mytable” LABEL “foo” LABEL “bar”); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html CREATE PROPERTY GRAPH “myGraph” VERTEX TABLES (my_table_1, other_schema.my_table_1 AS my_table2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html CREATE PROPERTY GRAPH “myGraph” VERTEX TABLES ( VT1, VT2 KEY(PK2), VT3 KEY(PK31, PK32), VT2 AS ALTVT2 KEY(PK4) ) EDGE TABLES ( E1 SOURCE VT1 DESTINATION VT2, E2 SOURCE KEY(FK1) REFERENCES VT1 (PK1) DESTINATION KEY(FK2) REFERENCES VT2 (PK2), E3 SOURCE KEY(FK1) REFERENCES VT1 (PK1) DESTINATION VT2, E4 SOURCE VT1 DESTINATION KEY(FK5) REFERENCES VT2(RK5)) ; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html ALTER TABLE t DROP CONSTRAINT pkc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html ALTER TABLE t DISABLE CONSTRAINT pkc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-property-graph-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-property-graph.html ALTER TABLE t ENABLE NOVALIDATE CONSTRAINT pkc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-vector-index-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-vector-index.html CREATE VECTOR INDEX galaxies_hnsw_idx ON galaxies (embedding) ORGANIZATION INMEMORY NEIGHBOR GRAPH DISTANCE COSINE WITH TARGET ACCURACY 95; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-vector-index-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-vector-index.html CREATE VECTOR INDEX galaxies_hnsw_idx ON galaxies (embedding) ORGANIZATION INMEMORY NEIGHBOR GRAPH DISTANCE COSINE WITH TARGET ACCURACY 90 PARAMETERS (type HNSW, neighbors 40, efconstruction 500); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-vector-index-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-vector-index.html CREATE VECTOR INDEX galaxies_ivf_idx ON galaxies (embedding) ORGANIZATION NEIGHBOR PARTITIONS DISTANCE COSINE WITH TARGET ACCURACY 95; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/create-vector-index-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-vector-index.html CREATE VECTOR INDEX galaxies_ivf_idx ON galaxies (embedding) ORGANIZATION NEIGHBOR PARTITIONS DISTANCE COSINE WITH TARGET ACCURACY 90 PARAMETERS (type IVF, neighbor partitions 10); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html CREATE DOMAIN dgreater AS (c1 AS NUMBER, c2 AS NUMBER ) CHECK (c1 > c2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html CREATE DOMAIN three_chars AS CHAR(3 CHAR) STRICT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html SELECT order_id, product_id, amount, currency_code, DOMAIN_CHECK(currency, order_id, product_id) order_product, DOMAIN_CHECK(currency, amount, currency_code) amount_currency, DOMAIN_CHECK(currency, currency_code, amount) currency_amount, DOMAIN_CHECK(currency, order_id, currency_code) order_currency FROM order_items; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html SELECT DOMAIN_CHECK(not_a_domain, 'raises an error'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html SELECT DOMAIN_CHECK (three_chars, 'ab') two_chars, DOMAIN_CHECK (three_chars, 'abc') three_chars, DOMAIN_CHECK (three_chars, 'abcd') four_chars; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html CREATE DOMAIN dgreater AS ( c1 AS NUMBER, c2 AS NUMBER ) CHECK (c1 > c2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html SELECT DOMAIN_CHECK (dgreater, 1) one_expr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html SELECT DOMAIN_CHECK (dgreater, 1, 2) first_lower, DOMAIN_CHECK (dgreater, 2, 1) first_higher, DOMAIN_CHECK (dgreater, 'b', 'a') letters; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html CREATE DOMAIN day_of_week AS CHAR(3 CHAR); CREATE TABLE calendar_dates ( calendar_date DATE, day_of_week_abbr day_of_week ); INSERT INTO calendar_dates VALUES(DATE'2023-05-01', 'MON'), (DATE'2023-05-02', 'tue'), (DATE'2023-05-05', 'fRI'); SELECT day_of_week_abbr, DOMAIN_CHECK(day_of_week, day_of_week_abbr) domain_column, DOMAIN_CHECK(day_of_week, calendar_date) nondomain_column, DOMAIN_CHECK(day_of_week, CAST('MON' AS day_of_week)) domain_value, DOMAIN_CHECK(day_of_week, 'mon') nondomain_value FROM calendar_dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html CREATE DOMAIN day_of_week AS CHAR(3 CHAR) CONSTRAINT CHECK(day_of_week IN ('MON','TUE','WED','THU','FRI','SAT','SUN')) INITIALLY DEFERRED; CREATE TABLE calendar_dates ( calendar_date DATE, day_of_week_abbr day_of_week ); INSERT INTO calendar_dates VALUES(DATE'2023-05-01', 'MON'), (DATE'2023-05-02', 'tue'), (DATE'2023-05-05', 'fRI'); SELECT day_of_week_abbr, DOMAIN_CHECK(day_of_week, day_of_week_abbr) domain_column, DOMAIN_CHECK(day_of_week, calendar_date) nondomain_column, DOMAIN_CHECK(day_of_week, CAST('MON' AS day_of_week)) domain_value, DOMAIN_CHECK(day_of_week, 'mon') nondomain_value FROM calendar_dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check.html CREATE TABLE order_items ( order_id INTEGER, product_id INTEGER, amount NUMBER(10, 2), currency_code CHAR(3 CHAR), DOMAIN currency(amount, currency_code) ); INSERT INTO order_items VALUES (1, 1, 9.99, 'USD'), (2, 2, 1234.56, 'GBP'), (3, 3, -999999, 'JPY'), (4, 4, 3141592, 'XXX') , (5, 5, 2718281, '123'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html CREATE DOMAIN three_chars AS CHAR(3 CHAR) STRICT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html SELECT DOMAIN_CHECK_TYPE (three_chars, 'ab') two_chars, DOMAIN_CHECK_TYPE (three_chars, 'abc') three_chars, DOMAIN_CHECK_TYPE (three_chars, 'abcd') four_chars; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html SELECT DOMAIN_CHECK_TYPE(not_a_domain, 'raises an error'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html CREATE DOMAIN dgreater AS ( c1 AS NUMBER, c2 AS NUMBER ) CHECK (c1 > c2); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html SELECT DOMAIN_CHECK_TYPE (dgreater, 1) one_expr; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html SELECT DOMAIN_CHECK_TYPE (dgreater, 1, 2) first_lower, DOMAIN_CHECK_TYPE (dgreater, 2, 1) first_higher, DOMAIN_CHECK_TYPE (dgreater, 'b', 'a') letters; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html CREATE DOMAIN day_of_week AS CHAR(3 CHAR); CREATE TABLE calendar_dates ( calendar_date DATE, day_of_week_abbr day_of_week ); INSERT INTO calendar_dates VALUES(DATE'2023-05-01', 'MON'), (DATE'2023-05-02', 'tue'), (DATE'2023-05-05', 'fRI'); SELECT day_of_week_abbr, DOMAIN_CHECK_TYPE(day_of_week, day_of_week_abbr) domain_column, DOMAIN_CHECK_TYPE(day_of_week, calendar_date) nondomain_column, DOMAIN_CHECK_TYPE(day_of_week, CAST('MON' AS day_of_week)) domain_value, DOMAIN_CHECK_TYPE(day_of_week, 'mon') nondomain_value FROM calendar_dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html CREATE DOMAIN day_of_week AS CHAR(3 CHAR) CONSTRAINT CHECK(day_of_week IN ('MON','TUE','WED','THU','FRI','SAT','SUN')) INITIALLY DEFERRED; CREATE TABLE calendar_dates ( calendar_date DATE, day_of_week_abbr day_of_week ); INSERT INTO calendar_dates VALUES(DATE'2023-05-01', 'MON'), (DATE'2023-05-02', 'tue'), (DATE'2023-05-05', 'fRI'); SELECT day_of_week_abbr, DOMAIN_CHECK_TYPE(day_of_week, day_of_week_abbr) domain_column, DOMAIN_CHECK_TYPE(day_of_week, calendar_date) nondomain_column, DOMAIN_CHECK_TYPE(day_of_week, CAST('MON' AS day_of_week)) domain_value, DOMAIN_CHECK_TYPE(day_of_week, 'mon') nondomain_value FROM calendar_dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html CREATE TABLE order_items ( order_id INTEGER, product_id INTEGER, amount NUMBER(10, 2), currency_code CHAR(3 CHAR), DOMAIN currency(amount, currency_code) ); INSERT INTO order_items VALUES (1, 1, 9.99, 'USD'), (2, 2, 1234.56, 'GBP'), (3, 3, -999999, 'JPY'), (4, 4, 3141592, 'XXX') , (5, 5, 2718281, '123'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_check_type-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_check_type.html SELECT order_id, product_id, amount, currency_code, DOMAIN_CHECK_TYPE(currency, order_id, product_id) order_product, DOMAIN_CHECK_TYPE(currency, amount, currency_code) amount_currency, DOMAIN_CHECK_TYPE(currency, currency_code, amount) currency_amount, DOMAIN_CHECK_TYPE(currency, order_id, currency_code) order_currency FROM order_items; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_display-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_display.html CREATE DOMAIN day_of_week AS CHAR(3 CHAR) DISPLAY INITCAP(day_of_week); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_display-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_display.html CREATE TABLE calendar_dates ( calendar_date DATE, day_of_week_abbr day_of_week ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_display-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_display.html INSERT INTO calendar_dates VALUES(DATE'2023-05-01', 'MON'), (DATE'2023-05-02', 'tue'), (DATE'2023-05-05', 'fRI'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_display-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_display.html SELECT day_of_week_abbr, DOMAIN_DISPLAY(day_of_week_abbr) domain_column, DOMAIN_DISPLAY(calendar_date) nondomain_column, DOMAIN_DISPLAY(CAST('MON' AS day_of_week)) domain_value, DOMAIN_DISPLAY('MON') nondomain_value FROM calendar_dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_display-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_display.html CREATE TABLE order_items ( order_id INTEGER, product_id INTEGER, amount NUMBER(10, 2), currency_code CHAR(3 CHAR), DOMAIN currency(amount, currency_code) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_display-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_display.html INSERT INTO order_items VALUES (1, 1, 9.99, 'USD'), (2, 2, 1234.56, 'GBP'), (3, 3, 4321, 'EUR'), (4, 4, 3141592, 'JPY'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_display-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_display.html SELECT order_id, product_id, DOMAIN_DISPLAY(amount, currency_code) domain_cols, DOMAIN_DISPLAY(currency_code, amount) domain_cols_wrong_order, DOMAIN_DISPLAY(order_id, product_id) nondomain_cols, DOMAIN_DISPLAY(amount) domain_cols_subset FROM order_items; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_name-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_name.html CREATE DOMAIN hr.day_of_week AS CHAR(3 CHAR); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_name-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_name.html CREATE TABLE hr.calendar_dates ( calendar_date DATE, day_of_week_abbr hr.day_of_week ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_name-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_name.html INSERT INTO hr.calendar_dates VALUES(DATE'2023-05-01', 'MON'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_name-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_name.html SELECT day_of_week_abbr, DOMAIN_NAME(day_of_week_abbr) domain_column, DOMAIN_NAME(calendar_date) nondomain_column, DOMAIN_NAME(CAST('MON' AS hr.day_of_week)) domain_value, DOMAIN_NAME('MON') nondomain_value FROM hr.calendar_dates; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_name-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_name.html CREATE TABLE co.order_items ( order_id INTEGER, product_id INTEGER, amount NUMBER(10, 2), currency_code CHAR(3 CHAR), DOMAIN co.currency(amount, currency_code) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_name-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_name.html INSERT INTO co.order_items VALUES (1, 1, 9.99, 'USD'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_name-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_name.html SELECT order_id, product_id, DOMAIN_NAME(amount, currency_code) domain_cols, DOMAIN_NAME(currency_code, amount) domain_cols_wrong_order, DOMAIN_NAME(order_id, product_id) nondomain_cols, DOMAIN_NAME(amount) domain_cols_subset FROM co.order_items ORDER BY domain_cols; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_order-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_order.html CREATE DOMAIN day_of_week AS CHAR(3 CHAR) ORDER CASE UPPER(day_of_week) WHEN 'MON' THEN 0 WHEN 'TUE' THEN 1 WHEN 'WED' THEN 2 WHEN 'THU' THEN 3 WHEN 'FRI' THEN 4 WHEN 'SAT' THEN 5 WHEN 'SUN' THEN 6 ELSE 7 END; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_order-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_order.html CREATE TABLE calendar_dates ( calendar_date DATE, day_of_week_abbr day_of_week ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_order-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_order.html INSERT INTO calendar_dates VALUES(DATE'2023-05-01', 'MON'), (DATE'2023-05-02', 'TUE'), (DATE'2023-05-05', 'FRI'), (DATE'2023-05-08', 'mon'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_order-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_order.html SELECT day_of_week_abbr, DOMAIN_ORDER(day_of_week_abbr) domain_column, DOMAIN_ORDER(calendar_date) nondomain_column, DOMAIN_ORDER(CAST('MON' AS day_of_week)) domain_value, DOMAIN_ORDER('MON') nondomain_value FROM calendar_dates ORDER BY DOMAIN_ORDER(day_of_week_abbr); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_order-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_order.html CREATE TABLE order_items ( order_id INTEGER, product_id INTEGER, amount NUMBER(10, 2), currency_code CHAR(3 CHAR), DOMAIN currency(amount, currency_code) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_order-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_order.html INSERT INTO order_items VALUES (1, 1, 9.99, 'USD'), (2, 2, 1234.56, 'USD'), (3, 3, 4321, 'EUR'), (4, 4, 3141592, 'JPY'), (5, 5, 2718281, 'JPY'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/domain_order-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/domain_order.html SELECT order_id, product_id, DOMAIN_ORDER(amount, currency_code) domain_cols, DOMAIN_ORDER(currency_code, amount) domain_cols_wrong_order, DOMAIN_ORDER(order_id, product_id) nondomain_cols, DOMAIN_ORDER(amount) domain_cols_subset FROM order_items ORDER BY domain_cols; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/drop-domain-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/drop-domain.html DROP DOMAIN email; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/drop-domain-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/drop-domain.html DROP DOMAIN day_of_week; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/drop-domain-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/drop-domain.html DROP DOMAIN day_of_week FORCE PRESERVE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/drop-pmem-filestore-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/drop-pmem-filestore.html DROP PMEM FILESTORE cloud_db_1 EXCLUDING CONTENTS ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/file_specification-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/file_specification.html CREATE DATABASE payable LOGFILE GROUP 1 ('diska:log1.log', 'diskb:log1.log') SIZE 50K, GROUP 2 ('diska:log2.log', 'diskb:log2.log') SIZE 50K DATAFILE 'diskc:dbone.dbf' SIZE 30M; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/file_specification-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/file_specification.html ALTER DATABASE payable ADD LOGFILE GROUP 3 ('diska:log3.log', 'diskb:log3.log') SIZE 50K REUSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/file_specification-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/file_specification.html ALTER DATABASE ADD LOGFILE GROUP 5 ('4k_disk_a:log5.log', '4k_disk_b:log5.log') SIZE 100M BLOCKSIZE 4096 REUSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/file_specification-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/file_specification.html CREATE TABLESPACE stocks DATAFILE 'stock1.dbf' SIZE 10M, 'stock2.dbf' SIZE 10M, 'stock3.dbf' SIZE 10M; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/file_specification-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/file_specification.html ALTER TABLESPACE stocks ADD DATAFILE 'stock4.dbf' SIZE 10M REUSE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/file_specification-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/file_specification.html ALTER DATABASE testdb DATAFILE '+dgroup_01/testdb/datafile/system.261.1' ONLINE; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/floor-datetime-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/floor-datetime.html ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/floor-datetime-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/floor-datetime.html SELECT FLOOR(TO_DATE ('28-FEB-2023','DD-MON-YYYY'), 'MM') AS month_floor; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/floor-datetime-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/floor-datetime.html SELECT FLOOR(TO_TIMESTAMP ('28-FEB-2023 14:10:10','DD-MON-YYYY HH24:MI:SS'),'HH24') AS hour_floor; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/floor-interval-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/floor-interval.html SELECT FLOOR(INTERVAL '+123-5' YEAR(3) TO MONTH) as year_floor; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/floor-interval-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/floor-interval.html SELECT FLOOR(INTERVAL '+99-11' YEAR(2) TO MONTH, 'YEAR') as year_floor; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/floor-interval-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/floor-interval.html SELECT FLOOR(INTERVAL '+4 12:42:10.222' DAY(2) TO SECOND(3), 'DD') as year_floor; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/from_vector-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/from_vector.html SELECT FROM_VECTOR(TO_VECTOR('[1, 2, 3]') ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/from_vector-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/from_vector.html SELECT FROM_VECTOR(TO_VECTOR('[1.1, 2.2, 3.3]', 3, FLOAT32) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/from_vector-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/from_vector.html SELECT FROM_VECTOR( TO_VECTOR('[1.1, 2.2, 3.3]', 3, FLOAT32) RETURNING VARCHAR2(1000)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/from_vector-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/from_vector.html SELECT FROM_VECTOR(TO_VECTOR('[1.1, 2.2, 3.3]', 3, FLOAT32) RETURNING CLOB ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/from_vector-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/from_vector.html SELECT FROM_VECTOR(TO_VECTOR('[5,[2,4],[1.0,2.0]]', 5, FLOAT64, SPARSE) RETURNING CLOB FORMAT SPARSE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/from_vector-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/from_vector.html SELECT FROM_VECTOR(TO_VECTOR('[5,[2,4],[1.0,2.0]]', 5, FLOAT64, SPARSE) RETURNING CLOB FORMAT DENSE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/from_vector-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/from_vector.html SELECT dataVec FROM vecTab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/from_vector-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/from_vector.html SELECT FROM_VECTOR(dataVec) FROM vecTab; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (a IS person) <-[e1 IS friends]- (b IS person) <-[e2 IS friends]- (c IS person) <-[e3 is friends]- (a IS person) WHERE a.name= 'Mary' COLUMNS (a.name AS person_a, b.name AS person_b, c.name AS person_c) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person) -[IS friends]-{2}(m IS person) WHERE n.name = 'Mary' AND m.name <> n.name COLUMNS (m.name AS fof) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-11.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person) (-[IS friends]-){2}(m IS person) WHERE n.name = 'Mary' AND m.name <> n.name COLUMNS (m.name AS fof) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT COUNT(*) FROM GRAPH_TABLE ( students_graph MATCH (v) COLUMNS (1 AS dummy) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-15.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT name, birthday FROM GRAPH_TABLE ( students_graph MATCH (p IS person WHERE p.dob > DATE '1980-01-01') COLUMNS (p.name, p.dob AS birthday) ) ORDER BY birthday; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT COUNT(*) FROM GRAPH_TABLE ( students_graph MATCH -> COLUMNS (1 AS dummy) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH -[e IS friends WHERE e.meeting_date > DATE '2001-01-01']-> COLUMNS (e.meeting_date) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (a IS person) <-[e1 IS friends]- (b IS person), (b) <-[e2 IS friends]- (c IS person), (c) <-[e3 is friends]- (a IS person) WHERE a.name= 'Mary' COLUMNS (a.name AS person_a, b.name AS person_b, c.name AS person_c) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person WHERE n.name = 'Mary') -[e IS friends WHERE e.meeting_date > DATE '2001-01-01']- () -[IS friends]- (m IS person) WHERE m.name <> n.name COLUMNS (m.name, e.meeting_date) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT DISTINCT name FROM GRAPH_TABLE ( students_graph MATCH (a IS person) -[e IS friends WHERE e.meeting_date > DATE '2000-09-15']-{2} ("b" IS person) WHERE a.name = 'John' AND a.name <> "b".name COLUMNS ("b".name) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p1 IS person) -[e1 IS friends]- (p2 IS person) , (p1) -[IS student_of]-> (u1 IS university) , (p2) -[IS student_of]-> (u2 IS university) WHERE p1.name = 'Mary' COLUMNS (p1.name, p2.name AS friend, e1.meeting_date, u1.name AS univ_1, u2.name AS univ_2) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p IS person) -[e IS friends]-{2,5} (friend IS person) WHERE p.name = 'Alice' AND COUNT(e.friendship_id) = COUNT(DISTINCT e.friendship_id) COLUMNS (LISTAGG(e.friendship_id, ', ') AS friendship_ids, COUNT(e.friendship_id) AS path_length)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-29.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (x IS person|university) COLUMNS (x.name, x.dob) ) ORDER BY name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT COUNT(*) FROM GRAPH_TABLE ( students_graph MATCH (v) COLUMNS (1 AS dummy) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-31.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person) -[e IS student_of|friends]-> (m IS university|"PERSON") WHERE n.name = 'Mary' COLUMNS (e.subject, e.meeting_date, m.name) ) ORDER BY subject, meeting_date, name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-33.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT Gt.name FROM GRAPH_TABLE ( students_graph MATCH (a IS person WHERE a.name = 'John') -[e IS friends WHERE e.meeting_date > DATE '2000-09-15']- (b IS person) COLUMNS (b.name) ) GT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-35.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT DISTINCT name FROM GRAPH_TABLE ( students_graph MATCH (a IS person) -[e IS friends WHERE e.meeting_date > DATE '2000-09-15']-{2} (b IS person) WHERE a.name = 'John' AND a.name <> b.name COLUMNS (b.name) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-37.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT DISTINCT name, height FROM GRAPH_TABLE ( students_graph MATCH (a IS person|person_ht) (-[e IS friends]- (x IS person_ht) WHERE x.height > a.height) {,3} (b IS person|person_ht) WHERE a.name = 'Mary' COLUMNS (b.name, b.height) ) ORDER BY height; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-38.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (u1 IS university) -[e]-{,3} (u2 IS university) WHERE u1.name = 'ABC' AND u2.name = 'XYZ' COLUMNS (JSON_ARRAYAGG(CASE WHEN e.subject IS NOT NULL THEN e.subject ELSE CAST(e.friendship_id AS VARCHAR(100)) END) AS path)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-40.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT DISTINCT name, birthday FROM GRAPH_TABLE ( students_graph MATCH (a IS person) ( (x) -[e IS friends]- (y IS person) WHERE x.dob < y.dob ){1,3} (b IS person) WHERE a.name = 'Bob' COLUMNS (b.name, b.dob AS birthday) ) ORDER BY birthday; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-42.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p IS person) ( -[e IS friends]-> (friend IS person) WHERE p.person_id <> friend.person_id){2,3} WHERE p.name = 'John' COLUMNS (COUNT(e.friendship_id) AS path_length, LISTAGG(friend.name, ', ') AS names, LISTAGG(e.meeting_date, ', ') AS meeting_dates )); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-44.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT Gt.name FROM GRAPH_TABLE ( students_graph MATCH (a IS person) -[e IS friends]- (b IS person) WHERE a.name = 'John' AND e.meeting_date > DATE '2000-09-15' COLUMNS (b.name) ) GT; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT COUNT(*) FROM GRAPH_TABLE ( students_graph MATCH -[e]-> COLUMNS (1 AS dummy) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-7.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person) -[IS friends]- () -[IS friends]- (m IS person) WHERE n.name = 'Mary' AND m.name <> n.name COLUMNS (m.name AS fof) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-pattern-9.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-pattern.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person) -[IS friends]- -[IS friends]- (m IS person) WHERE n.name = 'Mary' AND m.name <> n.name COLUMNS (m.name AS fof) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-reference-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-reference.html SELECT COUNT(*) FROM GRAPH_TABLE ( scott.students_graph MATCH (a IS person) COLUMNS (a.name) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-reference-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-reference.html INSERT INTO university (name) VALUES ('u3'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-reference-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-reference.html SELECT COUNT(*) FROM GRAPH_TABLE ( students_graph MATCH (u IS university) COLUMNS (u.*) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-reference-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-reference.html SELECT COUNT(*) FROM GRAPH_TABLE ( students_graph AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '2' MINUTE) MATCH (u IS university) COLUMNS (u.*) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-reference-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-reference.html DELETE FROM university WHERE name = 'u3'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-table-shape-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-table-shape.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person|person_ht) COLUMNS (n.name, n.height * 3.281 AS height_in_feet) ) ORDER BY name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-table-shape-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-table-shape.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (u1 IS university) <-[IS student_of]- (p1 IS person) -[IS friends]-{1,2} (p2 IS person) -[IS student_of]-> (u2 IS university) WHERE u1.name = 'ABC' AND u2.name = 'XYZ' ONE ROW PER VERTEX (v) COLUMNS (MATCHNUM() AS matchnum, ELEMENT_NUMBER(v) AS element_number, CASE WHEN v.person_id IS NOT NULL THEN 'person' ELSE 'university' END AS label, v.name)) ORDER BY matchnum, element_number; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-table-shape-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-table-shape.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p1 IS person) -[e IS friends]-> (p2 IS person) COLUMNS ( p1.*, p2.name AS p2_name, e.* ) ) ORDER BY 1, 2, 3, 4, 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-table-shape-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-table-shape.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (v) COLUMNS ( v.* ) ) ORDER BY 1, 2, 3, 4, 5; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-table-shape-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-table-shape.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person) -[e1 IS friends]->{0,3} (IS person) WHERE n.name = 'John' ONE ROW PER VERTEX (v) COLUMNS ( LISTAGG(e1.friendship_id, ', ') AS friendship_ids, v.name) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph-table-shape-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph-table-shape.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person) -[e1 IS friends]->{0,3} (IS person) WHERE n.name = 'John' ONE ROW PER STEP (src, e2, dst) COLUMNS ( LISTAGG(e1.friendship_id, ', ') AS friendship_ids, src.name AS src_name, e2.friendship_id, dst.name AS dst_name) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph_table-operator-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph_table-operator.html CREATE TABLE university ( id NUMBER GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1), name VARCHAR2(10), CONSTRAINT u_pk PRIMARY KEY (id)); INSERT INTO university (name) VALUES ('ABC'); INSERT INTO university (name) VALUES ('XYZ'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph_table-operator-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph_table-operator.html CREATE TABLE persons ( person_id NUMBER GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1), name VARCHAR2(10), birthdate DATE, height FLOAT DEFAULT ON NULL 0, person_data JSON, CONSTRAINT person_pk PRIMARY KEY (person_id)); INSERT INTO persons (name, height, birthdate, person_data) VALUES ('John', 1.80, to_date('13/06/1963', 'DD/MM/YYYY'), '{"department":"IT","role":"Software Developer"}'); INSERT INTO persons (name, height, birthdate, person_data) VALUES ('Mary', 1.65, to_date('25/09/1982', 'DD/MM/YYYY'), '{"department":"HR","role":"HR Manager"}'); INSERT INTO persons (name, height, birthdate, person_data) VALUES ('Bob', 1.75, to_date('11/03/1966', 'DD/MM/YYYY'), '{"department":"IT","role":"Technical Consultant"}'); INSERT INTO persons (name, height, birthdate, person_data) VALUES ('Alice', 1.70, to_date('01/02/1987', 'DD/MM/YYYY'), '{"department":"HR","role":"HR Assistant"}'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph_table-operator-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph_table-operator.html CREATE TABLE students ( s_id NUMBER GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1), s_univ_id NUMBER, s_person_id NUMBER, subject VARCHAR2(10), CONSTRAINT stud_pk PRIMARY KEY (s_id), CONSTRAINT stud_fk_person FOREIGN KEY (s_person_id) REFERENCES persons(person_id), CONSTRAINT stud_fk_univ FOREIGN KEY (s_univ_id) REFERENCES university(id) ); INSERT INTO students(s_univ_id, s_person_id,subject) VALUES (1,1,'Arts'); INSERT INTO students(s_univ_id, s_person_id,subject) VALUES (1,3,'Music'); INSERT INTO students(s_univ_id, s_person_id,subject) VALUES (2,2,'Math'); INSERT INTO students(s_univ_id, s_person_id,subject) VALUES (2,4,'Science'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph_table-operator-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph_table-operator.html CREATE TABLE friendships ( friendship_id NUMBER GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1), person_a NUMBER, person_b NUMBER, meeting_date DATE, CONSTRAINT fk_person_a_id FOREIGN KEY (person_a) REFERENCES persons(person_id), CONSTRAINT fk_person_b_id FOREIGN KEY (person_b) REFERENCES persons(person_id), CONSTRAINT fs_pk PRIMARY KEY (friendship_id) ); INSERT INTO friendships (person_a, person_b, meeting_date) VALUES (1, 3, to_date('01/09/2000', 'DD/MM/YYYY')); INSERT INTO friendships (person_a, person_b, meeting_date) VALUES (2, 4, to_date('19/09/2000', 'DD/MM/YYYY')); INSERT INTO friendships (person_a, person_b, meeting_date) VALUES (2, 1, to_date('19/09/2000', 'DD/MM/YYYY')); INSERT INTO friendships (person_a, person_b, meeting_date) VALUES (3, 2, to_date('10/07/2001', 'DD/MM/YYYY')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph_table-operator-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph_table-operator.html CREATE PROPERTY GRAPH students_graph VERTEX TABLES ( persons KEY (person_id) LABEL person PROPERTIES (person_id, name, birthdate AS dob) LABEL person_ht PROPERTIES (height), university KEY (id) ) EDGE TABLES ( friendships AS friends KEY (friendship_id) SOURCE KEY (person_a) REFERENCES persons(person_id) DESTINATION KEY (person_b) REFERENCES persons(person_id) PROPERTIES (friendship_id, meeting_date), students AS student_of SOURCE KEY (s_person_id) REFERENCES persons(person_id) DESTINATION KEY (s_univ_id) REFERENCES university(id) PROPERTIES (subject) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/graph_table-operator-5.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/graph_table-operator.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (a IS person) -[e IS friends]- (b IS person) WHERE a.name = 'John' COLUMNS (b.name) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/is_uuid-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/is_uuid.html SELECT IS_UUID('{e24e8de0-d663-428f-baaa-1be5f019cd25}') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/is_uuid-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/is_uuid.html SELECT IS_UUID('{d20f8c3cde134b958d25eff3fbdb7e71}') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ora_shardspace_name-pseudocolumn-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ora_shardspace_name-pseudocolumn.html SELECT CUST_NAME, CUST_ID FROM CUSTOMER WHERE ORA_SHARDSPACE_NAME = 'EUROPE' ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/ora_shardspace_name-pseudocolumn-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/ora_shardspace_name-pseudocolumn.html SELECT CUST_NAME, CUST_ID FROM CUSTOMER ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/raw_to_uuid-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/raw_to_uuid.html SELECT RAW_TO_UUID(UUID()) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/round-interval-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/round-interval.html SELECT ROUND(INTERVAL '+123-06' YEAR(3) TO MONTH) AS year_round; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/round-interval-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/round-interval.html SELECT ROUND(INTERVAL '+99-11' YEAR(2) TO MONTH, 'YEAR') AS year_round; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/round-interval-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/round-interval.html SELECT ROUND(INTERVAL '-999999999-11' YEAR(9) TO MONTH, 'YEAR')AS year_round; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/round-interval-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/round-interval.html SELECT ROUND(INTERVAL '+4 12:42:10.222' DAY(2) TO SECOND(3), 'DD') AS day_round; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/shard_chunk_id-operator-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/shard_chunk_id-operator.html SELECT SHARD_CHUNK_ID(null, class, custno, name) FROM customers; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/storage_clause-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/storage_clause.html CREATE TABLE divisions (div_no NUMBER(2), div_name VARCHAR2(14), location VARCHAR2(13) ) STORAGE ( INITIAL 8M MAXSIZE 1G ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/storage_clause-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/storage_clause.html SELECT INITIAL_EXTENT FROM USER_TABLES WHERE TABLE_NAME='DIVISIONS'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/sys_row_etag-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/sys_row_etag.html CREATE TABLE foo (c1 NUMBER, c2 NUMBER, c3 NUMBER); INSERT INTO foo VALUES (1, 2, 3); SELECT SYS_ROW_ETAG(c2, c1) FROM foo; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/time_bucket-datetime-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/time_bucket-datetime.html ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/to_boolean-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/to_boolean.html SELECT TO_BOOLEAN(0), TO_BOOLEAN('true'), TO_BOOLEAN('no'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/to_boolean-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/to_boolean.html SELECT TO_BOOLEAN(1) FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/to_vector-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/to_vector.html SELECT TO_VECTOR('[34.6, 77.8]'); SELECT TO_VECTOR('[34.6, 77.8]', 2, FLOAT32); SELECT TO_VECTOR('[34.6, 77.8, -89.34]', 3, FLOAT32); SELECT TO_VECTOR('[34.6, 77.8, -89.34]', 3, FLOAT32, DENSE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/to_vector-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/to_vector.html INSERT INTO vecTab VALUES(TO_VECTOR('[1.1, 2.9, 3.14]')); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/to_vector-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/to_vector.html INSERT INTO vecTab VALUES ('[1.1, 2.9, 3.14]'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/trunc-interval-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/trunc-interval.html SELECT TRUNC(INTERVAL '+123-06' YEAR(3) TO MONTH) AS year_trunc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/trunc-interval-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/trunc-interval.html SELECT TRUNC(INTERVAL '+99-11' YEAR(2) TO MONTH, 'YEAR') AS year_trunc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/trunc-interval-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/trunc-interval.html SELECT TRUNC(INTERVAL '+4 12:42:10.222' DAY(2) TO SECOND(3), 'DD') AS day_trunc; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/uuid-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/uuid.html SELECT UUID() from dual; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/uuid_to_raw-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/uuid_to_raw.html SELECT UUID_TO_RAW ('{82e19137-f810-44ad-b26e-379d828408a1}') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/uuid_to_raw-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/uuid_to_raw.html SELECT UUID_TO_RAW('{d20f8c3c-de13-4b95-8d25-eff3fbdb7e71}') FROM DUAL; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT GT.name, GT.birthday FROM GRAPH_TABLE ( students_graph MATCH (p IS person|university) COLUMNS (p.name, p.dob AS birthday) ) GT ORDER BY GT.birthday, GT.name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-10.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT name FROM GRAPH_TABLE ( students_graph MATCH (p IS person) -[IS friends]- (friend IS person) -[IS friends]- (friend_of_friend IS person) WHERE p.name = 'Mary' AND NOT vertex_equal(p, friend_of_friend) COLUMNS (friend_of_friend.name) ) ORDER BY name; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-12.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p1 IS person) -[e IS friends]- (p2 IS person) WHERE p1.name = 'Mary' COLUMNS (e.friendship_id, e.meeting_date, CASE WHEN p1 IS SOURCE OF e THEN p1.name ELSE p2.name END AS from_person, CASE WHEN p1 IS DESTINATION OF e THEN p1.name ELSE p2.name END AS to_person)) ORDER BY friendship_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-13.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p1 IS person) -[e1 IS friends]- (p2 IS person) -[e2 IS friends]- (p3 IS person) WHERE p1.name = 'John' AND ((p1 IS SOURCE OF e1 AND p2 IS SOURCE OF e2) OR (p1 IS DESTINATION OF e1 AND p2 IS DESTINATION OF e2)) COLUMNS (p1.name AS person_1, CASE WHEN p1 IS SOURCE OF e1 THEN 'Outgoing' ELSE 'Incoming' END AS e1_direction, p2.name AS person_2, CASE WHEN p2 IS SOURCE OF e2 THEN 'Outgoing' ELSE 'Incoming' END AS e2_direction, p3.name AS person_3)) ORDER BY 1, 2, 3; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-14.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p IS person) -[e IS friends]-{2,5} (friend IS person) WHERE p.name = 'Alice' AND COUNT(edge_id(e)) = COUNT(DISTINCT edge_id(e)) COLUMNS (LISTAGG(e.friendship_id, ', ') AS friendship_ids, COUNT(edge_id(e)) AS path_length)) ORDER BY path_length, friendship_ids; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-16.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (u1 IS university) -[e]-{,3} (u2 IS university) WHERE u1.name = 'ABC' AND u2.name = 'XYZ' COLUMNS (JSON_ARRAYAGG(CASE WHEN e.subject IS NOT NULL THEN e.subject ELSE CAST(e.friendship_id AS VARCHAR(100)) END) AS path)) ORDER BY path; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-17.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p IS person) ( -[e IS friends]-> (friend IS person) WHERE p.person_id <> friend.person_id){2,3} WHERE p.name = 'John' COLUMNS (COUNT(edge_id(e)) AS path_length, LISTAGG(friend.name, ', ') AS names, LISTAGG(e.meeting_date, ', ') AS meeting_dates )) ORDER BY path_length; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-19.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html CREATE PROPERTY GRAPH persons_graph VERTEX TABLES ( persons ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (n IS person) COLUMNS ( n.name, n.height ) ) ORDER BY height; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-20.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( persons_graph MATCH (n) WHERE n.person_data.department = 'HR' COLUMNS (n.name, n.person_data.role.string() AS role) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-21.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p IS person) COLUMNS (MATCHNUM() AS matchnum, p.name)) ORDER BY matchnum; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-23.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p1 IS person) -[IS friends]-{1,2} (p2 IS person) WHERE p1.name = 'John' AND p2.name = 'Mary' ONE ROW PER VERTEX (v) COLUMNS (MATCHNUM() AS matchnum, ELEMENT_NUMBER(v) AS element_number, v.name)) ORDER BY matchnum, element_number; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-25.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p1 IS person) -[IS friends]-{1,2} (p2 IS person) WHERE p1.name = 'John' AND p2.name = 'Mary' ONE ROW PER STEP (v1, e, v2) COLUMNS (MATCHNUM() AS matchnum, ELEMENT_NUMBER(e) AS element_number, v1.name AS name1, e.friendship_id, v2.name AS name2)) ORDER BY matchnum, element_number; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-27.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT * FROM GRAPH_TABLE ( students_graph MATCH (p1 IS person) -[IS friends]-{0,1} (p2 IS person) WHERE p1.name = 'John' ONE ROW PER STEP (v1, e, v2) COLUMNS (MATCHNUM() AS matchnum, ELEMENT_NUMBER(e) AS element_number, v1.name AS name1, e.friendship_id, v2.name AS name2)) ORDER BY matchnum, element_number; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT CAST(p2_id AS VARCHAR2(200)) AS p2_id FROM GRAPH_TABLE ( students_graph MATCH (p1 IS person) -[e1 IS friends]- (p2 IS person) WHERE p1.name = 'Mary' COLUMNS (vertex_id(p2) AS p2_id) ) ORDER BY p2_id; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-6.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT GT.p2_id.KEY_VALUE FROM GRAPH_TABLE ( students_graph MATCH (p1 IS person) -[e1 IS friends]- (p2 IS person) WHERE p1.name = 'Mary' COLUMNS (vertex_id(p2) AS p2_id) ) GT ORDER BY key_value; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/value-expressions-graph_table-8.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/value-expressions-graph_table.html SELECT DISTINCT json_value(e_id, '$.ELEM_TABLE') AS elem_table FROM GRAPH_TABLE ( students_graph MATCH -[e]- COLUMNS (edge_id(e) AS e_id) ) ORDER BY elem_table; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector.html INSERT INTO vecTab VALUES ('[1.1, 2.9, 3.14]'); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector.html SELECT VECTOR('[34.6, 77.8]'); SELECT VECTOR('[34.6, 77.8]', 2, FLOAT32); SELECT VECTOR('[34.6, 77.8, -89.34]', 3, FLOAT32); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_chunks-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_chunks.html COLUMN chunk_offset HEADING Offset FORMAT 999 COLUMN chunk_length HEADING Len FORMAT 999 COLUMN chunk_text HEADING Text FORMAT a60 VARIABLE txt VARCHAR2(4000) EXECUTE :txt := 'An example text value to split with VECTOR_CHUNKS, having over 10 words because the minimum MAX value is 10'; SELECT * FROM VECTOR_CHUNKS(:txt BY WORDS MAX 10); SELECT * FROM VECTOR_CHUNKS('Another example text value to split with VECTOR_CHUNKS, having over 10 words because the minimum MAX value is 10' BY WORDS MAX 10); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_chunks-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_chunks.html CREATE TABLE documentation_tab ( id NUMBER, text VARCHAR2(2000)); INSERT INTO documentation_tab VALUES(1, 'sample'); COMMIT; SET LINESIZE 100; SET PAGESIZE 20; COLUMN pos FORMAT 999; COLUMN siz FORMAT 999; COLUMN txt FORMAT a60; SELECT D.id id, C.chunk_offset pos, C.chunk_length siz, C.chunk_text txt FROM documentation_tab D, VECTOR_CHUNKS(D.text BY words MAX 200 OVERLAP 10 SPLIT BY recursively LANGUAGE american NORMALIZE all) C; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_dimension_count-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_dimension_count.html SELECT VECTOR_DIMENSION_COUNT( TO_VECTOR('[34.6, 77.8]', 2, FLOAT64) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_dimension_format-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_dimension_format.html SELECT VECTOR_DIMENSION_FORMAT(TO_VECTOR('[34.6, 77.8]', 2, FLOAT64)); SELECT VECTOR_DIMENSION_FORMAT(TO_VECTOR('[34.6, 77.8, 9]', 3, FLOAT32)); SELECT VECTOR_DIMENSION_FORMAT(TO_VECTOR('[34.6, 77.8, 9.10]', 3, INT8)); SELECT VECTOR_DIMENSION_FORMAT(TO_VECTOR('[206, 32]', 16, BINARY)); SELECT VECTOR_DIMENSION_FORMAT(TO_VECTOR('[34.6, 77.8, 9, 10]', 3, INT8)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_embedding-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_embedding.html SELECT TO_VECTOR(VECTOR_EMBEDDING(model USING 'hello' as data)) AS embedding; ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_norm-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_norm.html SELECT VECTOR_NORM( TO_VECTOR('[4, 3]', 2, FLOAT32) ); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_serialize-0.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_serialize.html SELECT VECTOR_SERIALIZE(VECTOR('[1.1,2.2,3.3]',3,FLOAT32)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_serialize-1.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_serialize.html SELECT VECTOR_SERIALIZE(VECTOR('[1.1, 2.2, 3.3]',3,FLOAT32) RETURNING VARCHAR2(1000)); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_serialize-2.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_serialize.html SELECT VECTOR_SERIALIZE(VECTOR('[1.1, 2.2, 3.3]',3,FLOAT32) RETURNING CLOB); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_serialize-3.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_serialize.html SELECT VECTOR_SERIALIZE(TO_VECTOR('[5,[2,4],[1.0,2.0]]', 5, FLOAT64, SPARSE) RETURNING CLOB FORMAT SPARSE); ================================================ FILE: zpa-checks/src/integrationTest/resources/sources/oracle-database_23/sqlrf/vector_serialize-4.sql ================================================ -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_serialize.html SELECT VECTOR_SERIALIZE(TO_VECTOR('[5,[2,4],[1.0,2.0]]', 5, FLOAT64, SPARSE) RETURNING CLOB FORMAT DENSE); ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/AbstractBaseCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.zpa.CustomAnnotationBasedRulesDefinition.Companion.convertCheckClassName import com.felipebz.zpa.api.checks.PlSqlCheck import java.util.* abstract class AbstractBaseCheck : PlSqlCheck() { private val bundle: ResourceBundle = ResourceBundle.getBundle("org.sonar.l10n.plsqlopen", Locale.getDefault()) protected fun getLocalizedMessage(): String { return bundle.getString("${convertCheckClassName(this::class.java)}.message") } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/AddParenthesesInNestedExpressionCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class AddParenthesesInNestedExpressionCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.OR_EXPRESSION) } override fun visitNode(node: AstNode) { val andExpressions = node.getChildren(PlSqlGrammar.AND_EXPRESSION) for (andExpression in andExpressions) { addIssue(andExpression, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/CharacterDatatypeUsageCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR, tags = [Tags.OBSOLETE]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class CharacterDatatypeUsageCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.CHARACTER_DATAYPE) } override fun visitNode(node: AstNode) { val datatype = node.firstChild if (datatype.typeIs(CHAR_DATATYPE)) { addIssue(node, getLocalizedMessage(), datatype.tokenValue) } } companion object { val CHAR_DATATYPE = arrayOf(PlSqlKeyword.CHAR, PlSqlKeyword.VARCHAR) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/CheckList.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks object CheckList { const val SONAR_WAY_PROFILE = "Sonar way" val checks: List> get() = listOf( EmptyBlockCheck::class.java, ParsingErrorCheck::class.java, CollapsibleIfStatementsCheck::class.java, InequalityUsageCheck::class.java, ComparisonWithNullCheck::class.java, TooManyRowsHandlerCheck::class.java, InsertWithoutColumnsCheck::class.java, DeclareSectionWithoutDeclarationsCheck::class.java, NvlWithNullParameterCheck::class.java, ComparisonWithBooleanCheck::class.java, CharacterDatatypeUsageCheck::class.java, SelectAllColumnsCheck::class.java, ColumnsShouldHaveTableNameCheck::class.java, SelectWithRownumAndOrderByCheck::class.java, ToDateWithoutFormatCheck::class.java, ExplicitInParameterCheck::class.java, VariableInitializationWithNullCheck::class.java, UselessParenthesisCheck::class.java, IdenticalExpressionCheck::class.java, EmptyStringAssignmentCheck::class.java, DuplicatedValueInInCheck::class.java, VariableInitializationWithFunctionCallCheck::class.java, IfWithExitCheck::class.java, FunctionWithOutParameterCheck::class.java, SameConditionCheck::class.java, AddParenthesesInNestedExpressionCheck::class.java, RaiseStandardExceptionCheck::class.java, NotFoundCheck::class.java, QueryWithoutExceptionHandlingCheck::class.java, UnusedVariableCheck::class.java, VariableHidingCheck::class.java, DbmsOutputPutCheck::class.java, ReturnOfBooleanExpressionCheck::class.java, UnnecessaryElseCheck::class.java, DeadCodeCheck::class.java, ConcatenationWithNullCheck::class.java, SameBranchCheck::class.java, UnusedParameterCheck::class.java, CommitRollbackCheck::class.java, UnnecessaryNullStatementCheck::class.java, DuplicateConditionIfElsifCheck::class.java, UnnecessaryAliasInQueryCheck::class.java, VariableInCountCheck::class.java, UnhandledUserDefinedExceptionCheck::class.java, UnusedCursorCheck::class.java, NotASelectedExpressionCheck::class.java, InvalidReferenceToObjectCheck::class.java, CursorBodyInPackageSpecCheck::class.java, XPathCheck::class.java, VariableNameCheck::class.java, ToCharInOrderByCheck::class.java, DisabledTestCheck::class.java, RedundantExpectationCheck::class.java, UnnecessaryLikeCheck::class.java) } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/CheckUtils.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.AstNodeType import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.matchers.MethodMatcher import com.felipebz.zpa.api.squid.SemanticAstNode import com.felipebz.zpa.api.symbols.PlSqlType object CheckUtils { private val TERMINATION_STATEMENTS = arrayOf(PlSqlGrammar.RETURN_STATEMENT, PlSqlGrammar.EXIT_STATEMENT, PlSqlGrammar.CONTINUE_STATEMENT, PlSqlGrammar.RAISE_STATEMENT) private val PROGRAM_UNITS = arrayOf(PlSqlGrammar.ANONYMOUS_BLOCK, PlSqlGrammar.CREATE_PROCEDURE, PlSqlGrammar.PROCEDURE_DECLARATION, PlSqlGrammar.CREATE_FUNCTION, PlSqlGrammar.FUNCTION_DECLARATION, PlSqlGrammar.CREATE_PACKAGE_BODY) private val WHEN = arrayOf(PlSqlKeyword.WHEN) private val NVL_WITH_NULL_MATCHER = MethodMatcher.create().name("nvl").addParameters(PlSqlType.UNKNOWN, PlSqlType.NULL) private val RAISE_APPLICATION_ERROR_MATCHER = MethodMatcher.create().name("raise_application_error").withNoParameterConstraint() val terminationStatements: Array get() = TERMINATION_STATEMENTS.clone() fun isNullLiteralOrEmptyString(node: AstNode): Boolean { return (node as SemanticAstNode).plSqlType === PlSqlType.NULL } fun isEmptyString(node: AstNode): Boolean { return node.hasDirectChildren(PlSqlGrammar.CHARACTER_LITERAL) && (node as SemanticAstNode).plSqlType === PlSqlType.NULL } @JvmStatic fun equalNodes(node1: AstNode, node2: AstNode): Boolean { val first = skipExpressionsWithoutEffect(node1) val second = skipExpressionsWithoutEffect(node2) if (first.type != second.type || first.numberOfChildren != second.numberOfChildren) { return false } if (first.numberOfChildren == 0) { return first.token.value == second.token.value } val children1 = first.children val children2 = second.children for (i in children1.indices) { if (!equalNodes(children1[i], children2[i])) { return false } } return true } fun containsNode(node1: AstNode, node2: AstNode): Boolean { val currentNode = skipParenthesis(node1) val nodeToCheck = skipParenthesis(node2) val type = currentNode.type val descendants = ArrayList() if (nodeToCheck.type === type) { descendants.add(nodeToCheck) } descendants.addAll(nodeToCheck.getDescendants(type)) var probableNode: AstNode? = null for (descendant in descendants) { if (descendant.tokenValue.equals(currentNode.tokenValue, ignoreCase = true)) { probableNode = descendant } } return probableNode != null && equalNodes(probableNode, currentNode) } fun skipExpressionsWithoutEffect(node: AstNode): AstNode { var newNode = skipParenthesis(node) newNode = skipNvlWithNull(newNode) return newNode } fun skipParenthesis(node: AstNode): AstNode { return if (node.type === PlSqlGrammar.BRACKED_EXPRESSION) { node.children[1] } else node } fun skipNvlWithNull(node: AstNode): AstNode { if (NVL_WITH_NULL_MATCHER.matches(node)) { val arguments = NVL_WITH_NULL_MATCHER.getArgumentsValues(node) return arguments[0] } return node } fun isTerminationStatement(node: AstNode): Boolean { return (node.typeIs(TERMINATION_STATEMENTS) || RAISE_APPLICATION_ERROR_MATCHER.matches(node)) && !node.hasDirectChildren(*WHEN) } fun isProgramUnit(node: AstNode?): Boolean { return node != null && node.typeIs(PROGRAM_UNITS) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/CollapsibleIfStatementsCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.asTree import com.felipebz.zpa.sslr.IfStatement import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR, tags = [Tags.CLUMSY]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class CollapsibleIfStatementsCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.IF_STATEMENT) } override fun visitNode(node: AstNode) { val ifStatement = node.asTree() val singleIfChild = singleIfChild(ifStatement) if (singleIfChild != null && !hasElseOrElsif(ifStatement) && !hasElseOrElsif(singleIfChild)) { addIssue(singleIfChild, getLocalizedMessage()) } } private fun hasElseOrElsif(ifStatement: IfStatement): Boolean { return ifStatement.elsifClauses.isNotEmpty() || ifStatement.elseClause != null } private fun singleIfChild(ifStatement: IfStatement): IfStatement? { val statements = ifStatement.statements if (statements.size == 1) { val nestedIf = statements[0].getChildren(PlSqlGrammar.IF_STATEMENT) if (nestedIf.size == 1) { return nestedIf[0].asTree() } } return null } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/ColumnsShouldHaveTableNameCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class ColumnsShouldHaveTableNameCheck : AbstractBaseCheck() { override fun init() { subscribeTo(DmlGrammar.SELECT_COLUMN) } override fun visitNode(node: AstNode) { var candidate = node.firstChild if (candidate.hasChildren()) { candidate = candidate.firstChild } val selectExpression = node.parentOrNull if (selectExpression != null && selectExpression.hasDirectChildren(DmlGrammar.FROM_CLAUSE) && selectExpression.getFirstChild(DmlGrammar.FROM_CLAUSE).getChildren(DmlGrammar.DML_TABLE_EXPRESSION_CLAUSE).size > 1 && candidate.typeIs(PlSqlGrammar.IDENTIFIER_NAME) && !candidate.hasDirectChildren(PlSqlGrammar.NON_RESERVED_KEYWORD) && semantic(candidate).symbol == null) { addIssue(candidate, getLocalizedMessage(), candidate.tokenOriginalValue) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/CommitRollbackCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR) @ConstantRemediation("30min") @RuleInfo(scope = RuleInfo.Scope.MAIN) @ActivatedByDefault class CommitRollbackCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.COMMIT_STATEMENT, PlSqlGrammar.ROLLBACK_STATEMENT) } override fun visitNode(node: AstNode) { val scope = context.currentScope var outerScope = scope while (outerScope?.outer != null && outerScope.outer?.type != null) { outerScope = outerScope.outer } val isRollbackToSavepoint = node.typeIs(PlSqlGrammar.ROLLBACK_STATEMENT) && node.hasDirectChildren(PlSqlKeyword.TO) val currentScopeIsAutonomousTransaction = scope?.isAutonomousTransaction ?: false val isInsideABlockStatement = outerScope?.type == PlSqlGrammar.BLOCK_STATEMENT if (!isRollbackToSavepoint && !currentScopeIsAutonomousTransaction && !isInsideABlockStatement) { addLineIssue(getLocalizedMessage(), node.tokenLine, node.tokenValue) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/ComparisonWithBooleanCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class ComparisonWithBooleanCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.COMPARISON_EXPRESSION) } override fun visitNode(node: AstNode) { val children = node.getChildren(PlSqlGrammar.LITERAL) for (child in children) { if (child.firstChild.typeIs(PlSqlGrammar.BOOLEAN_LITERAL)) { addLineIssue(getLocalizedMessage(), node.tokenLine, child.tokenValue) return } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/ComparisonWithNullCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.ConditionsGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.BLOCKER, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class ComparisonWithNullCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.COMPARISON_EXPRESSION) } override fun visitNode(node: AstNode) { val children = node.getChildren(PlSqlGrammar.LITERAL) for (child in children) { if (CheckUtils.isNullLiteralOrEmptyString(child)) { val operator = node.getFirstChild(ConditionsGrammar.RELATIONAL_OPERATOR) val suggestion = if (operator.firstChild.typeIs(PlSqlGrammar.EQUALS_OPERATOR)) { "IS NULL" } else { "IS NOT NULL" } addIssue(node, getLocalizedMessage(), suggestion) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/ConcatenationWithNullCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("1min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class ConcatenationWithNullCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.CONCATENATION_EXPRESSION) } override fun visitNode(node: AstNode) { for (child in node.children) { if (CheckUtils.isNullLiteralOrEmptyString(child)) { addIssue(child, getLocalizedMessage()) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/CursorBodyInPackageSpecCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.ConstantRemediation import com.felipebz.zpa.api.annotations.Priority import com.felipebz.zpa.api.annotations.Rule import com.felipebz.zpa.api.annotations.RuleInfo import com.felipebz.zpa.api.symbols.Symbol.Kind @Rule(priority = Priority.MAJOR) @ConstantRemediation("10min") @RuleInfo(scope = RuleInfo.Scope.MAIN) class CursorBodyInPackageSpecCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.CREATE_PACKAGE) } override fun visitNode(node: AstNode) { val cursors = context.currentScope?.getSymbols(Kind.CURSOR) ?: emptyList() for (cursor in cursors) { val cursorDeclaration = cursor.declaration.parent if (cursorDeclaration.hasDirectChildren(DmlGrammar.SELECT_EXPRESSION)) { addIssue(cursorDeclaration, getLocalizedMessage(), cursor.name) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/DbmsOutputPutCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.matchers.MethodMatcher @Rule(priority = Priority.MINOR) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.MAIN) @ActivatedByDefault class DbmsOutputPutCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.METHOD_CALL) } override fun visitNode(node: AstNode) { val put = MethodMatcher.create() .schema("sys").schemaIsOptional() .packageName("dbms_output") .name("put") .addParameter() val putLine = MethodMatcher.create() .schema("sys").schemaIsOptional() .packageName("dbms_output") .name("put_line") .addParameter() if (!put.matches(node) && !putLine.matches(node)) { return } addIssue(node, getLocalizedMessage()) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/DeadCodeCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR, tags = [Tags.UNUSED]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class DeadCodeCheck : AbstractBaseCheck() { override fun init() { subscribeTo(*CheckUtils.terminationStatements) subscribeTo(PlSqlGrammar.METHOD_CALL) } override fun visitNode(node: AstNode) { if (CheckUtils.isTerminationStatement(node)) { var parent = node.parent while (!checkNode(parent)) { parent = parent.parent } } } private fun checkNode(node: AstNode?): Boolean { if (!shouldCheckNode(node) || node == null) { return true } val nextSibling = node.nextSiblingOrNull if (nextSibling != null && nextSibling.typeIs(PlSqlGrammar.STATEMENT)) { addIssue(nextSibling, getLocalizedMessage()) return true } return false } private fun shouldCheckNode(node: AstNode?): Boolean { if (node == null || CheckUtils.isProgramUnit(node)) { return false } return if (node.typeIs(STATEMENT_OR_CALL)) { true } else { node.typeIs(STATEMENT_SECTION) && !node.hasDirectChildren(PlSqlGrammar.EXCEPTION_HANDLERS) } } companion object { val STATEMENT_OR_CALL = arrayOf(PlSqlGrammar.STATEMENT, PlSqlGrammar.BLOCK_STATEMENT, PlSqlGrammar.CALL_STATEMENT) val STATEMENT_SECTION = arrayOf(PlSqlGrammar.STATEMENTS_SECTION, PlSqlGrammar.STATEMENTS) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/DeclareSectionWithoutDeclarationsCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.INFO) @ConstantRemediation("1min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class DeclareSectionWithoutDeclarationsCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.BLOCK_STATEMENT) } override fun visitNode(node: AstNode) { if (node.hasDirectChildren(PlSqlKeyword.DECLARE) && !node.hasDescendant(PlSqlGrammar.DECLARE_SECTION)) { addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/DisabledTestCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.Trivia import com.felipebz.zpa.api.annotations.ActivatedByDefault import com.felipebz.zpa.api.annotations.Priority import com.felipebz.zpa.api.annotations.Rule import com.felipebz.zpa.api.annotations.RuleInfo @Rule(priority = Priority.MAJOR, tags = [Tags.UTPLSQL]) @RuleInfo(scope = RuleInfo.Scope.TEST) @ActivatedByDefault class DisabledTestCheck : AbstractBaseCheck() { override fun visitComment(trivia: Trivia, content: String) { if (content.trim().equals("%disabled", ignoreCase = true)) { addIssue(trivia.token, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/DuplicateConditionIfElsifCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.asTree import com.felipebz.zpa.sslr.IfStatement import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.BLOCKER, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class DuplicateConditionIfElsifCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.IF_STATEMENT) } override fun visitNode(node: AstNode) { val ifStatement = node.asTree() val conditions = collectConditionsFromBranches(ifStatement) findSameConditions(conditions) } private fun findSameConditions(branches: List) { for (i in 1 until branches.size) { checkCondition(branches, i) } } private fun checkCondition(conditions: List, index: Int) { val condition = conditions[index] for (j in 0 until index) { val otherCondition = conditions[j] if (CheckUtils.equalNodes(otherCondition, condition)) { addIssue(condition, getLocalizedMessage(), otherCondition.token.line) .secondary(otherCondition, "Original") return } } } private fun collectConditionsFromBranches(ifStatement: IfStatement): List { val conditionsFromBranches = ArrayList() conditionsFromBranches.add(ifStatement.condition) for (branch in ifStatement.elsifClauses) { conditionsFromBranches.add(branch.condition) } return conditionsFromBranches } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/DuplicatedValueInInCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlPunctuator import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.BLOCKER, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class DuplicatedValueInInCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.IN_EXPRESSION) } override fun visitNode(node: AstNode) { val values = getInValue(node) findSameValues(values) } private fun getInValue(inExpression: AstNode): List { val values = ArrayList() var current = inExpression.getFirstChildOrNull(PlSqlPunctuator.LPARENTHESIS) while (current != null) { current = current.nextSibling if (current.typeIs(PlSqlPunctuator.RPARENTHESIS)) { current = null } else if (!current.typeIs(PlSqlPunctuator.COMMA)) { values.add(current) } } return values } private fun findSameValues(values: List) { for (i in 1 until values.size) { checkValue(values, i) } } private fun checkValue(values: List, index: Int) { val current = values[index] for (j in 0 until index) { val other = values[j] if (CheckUtils.equalNodes(current, other)) { addIssue(current, getLocalizedMessage(), current.tokenOriginalValue) .secondary(other, "Original") return } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/EmptyBlockCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.isOf import com.felipebz.zpa.sslr.NullStatement import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR, tags = [Tags.UNUSED]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class EmptyBlockCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.STATEMENTS_SECTION) } override fun visitNode(node: AstNode) { if (context.currentScope?.isOverridingMember == true) { return } val statements = node.getFirstChild(PlSqlGrammar.STATEMENTS).getChildren(PlSqlGrammar.STATEMENT) if (statements.size == 1) { val statement = statements[0] if (statement.isOf()) { addIssue(statement, getLocalizedMessage()) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/EmptyStringAssignmentCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class EmptyStringAssignmentCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.ASSIGNMENT_STATEMENT) } override fun visitNode(node: AstNode) { val value = node.getLastChildOrNull(PlSqlGrammar.LITERAL) if (value != null && CheckUtils.isEmptyString(value)) { addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/ExplicitInParameterCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class ExplicitInParameterCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.PARAMETER_DECLARATION) } override fun visitNode(node: AstNode) { if (!node.hasDirectChildren(PlSqlKeyword.IN, PlSqlKeyword.OUT)) { addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/FunctionWithOutParameterCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR) @ConstantRemediation("1h") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class FunctionWithOutParameterCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.PARAMETER_DECLARATION) } override fun visitNode(node: AstNode) { if (node.parent.hasParent(PlSqlGrammar.FUNCTION_DECLARATION, PlSqlGrammar.CREATE_FUNCTION) && node.hasDirectChildren(PlSqlKeyword.OUT)) { addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/IdenticalExpressionCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.ConditionsGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.BLOCKER, tags = [Tags.BUG]) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class IdenticalExpressionCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.COMPARISON_EXPRESSION) } override fun visitNode(node: AstNode) { val operator = node.getFirstChildOrNull(ConditionsGrammar.RELATIONAL_OPERATOR) if (operator != null) { val leftSide = node.firstChild val rightSide = node.lastChild if (CheckUtils.equalNodes(leftSide, rightSide)) { addIssue(leftSide, getLocalizedMessage(), operator.tokenValue) .secondary(rightSide, "Original") } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/IfWithExitCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.sslr.IfStatement import com.felipebz.zpa.tryGetAsTree import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class IfWithExitCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.EXIT_STATEMENT) } override fun visitNode(node: AstNode) { val statement = node.parent val ifStatement = statement.parent.parent.tryGetAsTree() if (ifStatement != null && ifStatement.elsifClauses.isEmpty() && ifStatement.elseClause == null && ifStatement.statements.size == 1) { addIssue(ifStatement, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/InequalityUsageCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR, tags = [Tags.OBSOLETE]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class InequalityUsageCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.NOTEQUALS_NONSTANDARD_OPERATOR) } override fun visitNode(node: AstNode) { addLineIssue(getLocalizedMessage(), node.tokenLine, node.tokens.joinToString("") { it.value }) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/InsertWithoutColumnsCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.symbols.PlSqlType @Rule(priority = Priority.CRITICAL, tags = [Tags.CONVENTION, Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class InsertWithoutColumnsCheck : AbstractBaseCheck() { override fun init() { subscribeTo(DmlGrammar.SINGLE_TABLE_INSERT) } override fun visitNode(node: AstNode) { if (!node.hasDescendant(DmlGrammar.INSERT_COLUMNS)) { val valuesClause = node.getFirstChildOrNull(DmlGrammar.VALUES_CLAUSE); if (valuesClause != null && semantic(valuesClause.lastChild).plSqlType === PlSqlType.ROWTYPE) { return } if (node.parent.parent.parent.type === PlSqlGrammar.FORALL_STATEMENT) { return } addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/InvalidReferenceToObjectCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.FormsMetadataAwareCheck import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.matchers.MethodMatcher import java.util.* @Rule(priority = Priority.MAJOR, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.MAIN) @ActivatedByDefault class InvalidReferenceToObjectCheck : AbstractBaseCheck(), FormsMetadataAwareCheck { private val verifiers = listOf( Verifier(MethodMatcher.create().name("find_alert").addParameter(), ObjectType.ALERT), Verifier(MethodMatcher.create().name("set_alert_button_property").addParameters(4), ObjectType.ALERT), Verifier(MethodMatcher.create().name("set_alert_property").addParameters(3), ObjectType.ALERT), Verifier(MethodMatcher.create().name("show_alert").addParameter(), ObjectType.ALERT), Verifier(MethodMatcher.create().name("find_lov").addParameter(), ObjectType.LOV), Verifier(MethodMatcher.create().name("get_lov_property").addParameters(2), ObjectType.LOV), Verifier(MethodMatcher.create().name("set_lov_column_property").addParameters(4), ObjectType.LOV), Verifier(MethodMatcher.create().name("set_lov_property").addParameters(3), ObjectType.LOV), Verifier(MethodMatcher.create().name("set_lov_property").addParameters(4), ObjectType.LOV), Verifier(MethodMatcher.create().name("show_lov").addParameter(), ObjectType.LOV), Verifier(MethodMatcher.create().name("find_block").addParameter(), ObjectType.BLOCK), Verifier(MethodMatcher.create().name("get_block_property").addParameters(2), ObjectType.BLOCK), Verifier(MethodMatcher.create().name("go_block").addParameter(), ObjectType.BLOCK), Verifier(MethodMatcher.create().name("set_block_property").addParameters(3), ObjectType.BLOCK), Verifier(MethodMatcher.create().name("set_block_property").addParameters(4), ObjectType.BLOCK), Verifier(MethodMatcher.create().name("checkbox_checked").addParameter(), ObjectType.ITEM), Verifier(MethodMatcher.create().name("convert_other_value").addParameter(), ObjectType.ITEM), Verifier(MethodMatcher.create().name("display_item").addParameters(2), ObjectType.ITEM), Verifier(MethodMatcher.create().name("find_item").addParameter(), ObjectType.ITEM), Verifier(MethodMatcher.create().name("get_item_instance_property").addParameters(3), ObjectType.ITEM), Verifier(MethodMatcher.create().name("get_item_property").addParameters(2), ObjectType.ITEM), Verifier(MethodMatcher.create().name("get_radio_button_property").addParameters(3), ObjectType.ITEM), Verifier(MethodMatcher.create().name("go_item").addParameter(), ObjectType.ITEM), Verifier(MethodMatcher.create().name("image_scroll").addParameters(3), ObjectType.ITEM), Verifier(MethodMatcher.create().name("image_zoom").addParameters(2), ObjectType.ITEM), Verifier(MethodMatcher.create().name("image_zoom").addParameters(3), ObjectType.ITEM), Verifier(MethodMatcher.create().name("play_sound").addParameter(), ObjectType.ITEM), Verifier(MethodMatcher.create().name("read_image_file").addParameters(3), 3, ObjectType.ITEM), Verifier(MethodMatcher.create().name("read_sound_file").addParameters(3), 3, ObjectType.ITEM), Verifier(MethodMatcher.create().name("recalculate").addParameter(), ObjectType.ITEM), Verifier(MethodMatcher.create().name("set_item_instance_property").addParameters(4), ObjectType.ITEM), Verifier(MethodMatcher.create().name("set_item_property").addParameters(3), ObjectType.ITEM), Verifier(MethodMatcher.create().name("set_item_property").addParameters(4), ObjectType.ITEM), Verifier(MethodMatcher.create().name("set_radio_button_property").addParameters(4), ObjectType.ITEM), Verifier(MethodMatcher.create().name("set_radio_button_property").addParameters(5), ObjectType.ITEM), Verifier(MethodMatcher.create().name("write_image_file").addParameters(5), 3, ObjectType.ITEM), Verifier(MethodMatcher.create().name("write_sound_file").addParameters(5), 3, ObjectType.ITEM) ) override fun init() { subscribeTo(PlSqlGrammar.METHOD_CALL) } override fun visitNode(node: AstNode) { val verifier = verifiers.firstOrNull { v -> v.matcher.matches(node) } if (verifier != null) { val argument = verifier.matcher.getArgumentsValues(node)[verifier.argumentToCheck] if (!isVarcharLiteral(argument)) { return } val value = argument.tokenOriginalValue.replace("'", "") val reportIssue = when (verifier.type) { ObjectType.ALERT -> validateAlert(value) ObjectType.BLOCK -> validateBlock(value) ObjectType.ITEM -> validateItem(value) ObjectType.LOV -> validateLov(value) } if (reportIssue) { addIssue(argument, getLocalizedMessage(), value, verifier.matcher.methodName.uppercase(Locale.getDefault()) ) } } } private fun validateAlert(value: String): Boolean { return context.formsMetadata?.alerts?.none { alert -> alert.equals(value, ignoreCase = true) } ?: false } private fun validateBlock(value: String): Boolean { return context.formsMetadata?.blocks?.none { block -> block.name.equals(value, ignoreCase = true) } ?: false } private fun validateItem(value: String): Boolean { val formsMetadata = context.formsMetadata ?: return false var reportIssue = true for (block in formsMetadata.blocks) { if (block.items.any { item -> val fullName = "${block.name}.$item" fullName.equals(value, ignoreCase = true) }) { reportIssue = false } } return reportIssue } private fun validateLov(value: String): Boolean { return context.formsMetadata?.lovs?.none { lov -> lov.equals(value, ignoreCase = true) } ?: false } private enum class ObjectType { ALERT, BLOCK, ITEM, LOV } private inner class Verifier(val matcher: MethodMatcher, argumentToCheck: Int, val type: ObjectType) { val argumentToCheck: Int = argumentToCheck - 1 constructor(matcher: MethodMatcher, type: ObjectType) : this(matcher, 1, type) } private fun isVarcharLiteral(argument: AstNode): Boolean { return if (argument.typeIs(PlSqlGrammar.LITERAL)) { argument.hasDirectChildren(PlSqlGrammar.CHARACTER_LITERAL) } else false } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/NotASelectedExpressionCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.CRITICAL, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class NotASelectedExpressionCheck : AbstractBaseCheck() { override fun init() { subscribeTo(DmlGrammar.SELECT_EXPRESSION) } override fun visitNode(node: AstNode) { val firstQueryBlock = node.getFirstChild(DmlGrammar.QUERY_BLOCK) if (!firstQueryBlock.children[1].typeIs(PlSqlKeyword.DISTINCT) || !node.hasDirectChildren(DmlGrammar.ORDER_BY_CLAUSE)) { return } val columns = firstQueryBlock.getChildren(DmlGrammar.SELECT_COLUMN) val orderByItems = node.getFirstChild(DmlGrammar.ORDER_BY_CLAUSE).getChildren(DmlGrammar.ORDER_BY_ITEM) for (orderByItem in orderByItems) { checkOrderByItem(orderByItem, columns) } } private fun checkOrderByItem(orderByItem: AstNode, columns: List) { val orderByItemValue = skipVariableName(orderByItem.firstChild) if (orderByItemValue.typeIs(PlSqlGrammar.LITERAL)) { return } var found = false for (column in columns) { val candidates = extractAcceptableValuesFromColumn(column) for (candidate in candidates) { if (CheckUtils.containsNode(candidate, orderByItemValue)) { found = true } } } if (!found) { addIssue(orderByItemValue, getLocalizedMessage()) } } private fun skipVariableName(node: AstNode): AstNode { return if (node.typeIs(PlSqlGrammar.VARIABLE_NAME)) { node.firstChild } else node } private fun extractAcceptableValuesFromColumn(column: AstNode): List { val values = ArrayList() val selectedExpression = skipVariableName(column.firstChild) values.add(selectedExpression) // if the value is "table.column", "column" can be used in order by if (selectedExpression.typeIs(PlSqlGrammar.MEMBER_EXPRESSION)) { values.add(selectedExpression.lastChild) } if (column.numberOfChildren > 1) { val alias = skipVariableName(column.lastChild) values.add(alias) } return values } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/NotFoundCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlPunctuator import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class NotFoundCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.MEMBER_EXPRESSION) } override fun visitNode(node: AstNode) { val parent = node.parent if (parent.typeIs(PlSqlGrammar.NOT_EXPRESSION) && node.numberOfChildren == 3) { val foundCandidate = node.lastChild val percentCandidate = foundCandidate.previousAstNode if (percentCandidate.typeIs(PlSqlPunctuator.MOD) && "FOUND" == foundCandidate.tokenValue) { addIssue(node, getLocalizedMessage()) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/NvlWithNullParameterCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.matchers.MethodMatcher @Rule(priority = Priority.BLOCKER, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class NvlWithNullParameterCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.METHOD_CALL) } override fun visitNode(node: AstNode) { val nvl = MethodMatcher.create().name("nvl").addParameters(2) if (!nvl.matches(node)) { return } for (argument in nvl.getArgumentsValues(node)) { if (CheckUtils.isNullLiteralOrEmptyString(argument)) { addIssue(node, getLocalizedMessage(), argument.tokenValue) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/ParsingErrorCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.Priority import com.felipebz.zpa.api.annotations.Rule import com.felipebz.zpa.api.annotations.RuleInfo @Rule(priority = Priority.INFO) @RuleInfo(scope = RuleInfo.Scope.ALL) class ParsingErrorCheck : AbstractBaseCheck() { override fun init() { val parsingException = context.parsingException() if (parsingException != null) { parsingException.message?.let { addLineIssue(it, parsingException.line) } } subscribeTo(PlSqlGrammar.RECOVERY) } override fun visitNode(node: AstNode) { addIssue(node, getLocalizedMessage()) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/QueryWithoutExceptionHandlingCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.CRITICAL) @ConstantRemediation("20min") @RuleInfo(scope = RuleInfo.Scope.MAIN) @ActivatedByDefault class QueryWithoutExceptionHandlingCheck : AbstractBaseCheck() { @RuleProperty(key = "strict", defaultValue = "true") var strictMode = true override fun init() { subscribeTo(PlSqlGrammar.SELECT_STATEMENT) } override fun visitNode(node: AstNode) { val intoClause = node.getFirstDescendantOrNull(DmlGrammar.INTO_CLAUSE) if (intoClause?.firstChild.typeIs(PlSqlKeyword.BULK)) { return } if (strictMode) { val parentBlock = node.getFirstAncestorOrNull(PlSqlGrammar.STATEMENTS_SECTION) if (parentBlock?.hasDirectChildren(PlSqlGrammar.EXCEPTION_HANDLERS) == false) { addIssue(node, getLocalizedMessage()) } } else { val hasExceptionHandler = context.currentScope?.hasExceptionHandler ?: false if (!hasExceptionHandler) { addIssue(node, getLocalizedMessage()) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/RaiseStandardExceptionCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.asTree import com.felipebz.zpa.sslr.RaiseStatement import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR) @ConstantRemediation("20min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class RaiseStandardExceptionCheck : AbstractBaseCheck() { private val standardExceptions = listOf( "ACCESS_INTO_NULL", "CASE_NOT_FOUND", "COLLECTION_IS_NULL", "CURSOR_ALREADY_OPEN", "DUP_VAL_ON_INDEX", "INVALID_CURSOR", "INVALID_NUMBER", "LOGIN_DENIED", "NO_DATA_FOUND", "NOT_LOGGED_ON", "PROGRAM_ERROR", "ROWTYPE_MISMATCH", "SELF_IS_NULL", "STORAGE_ERROR", "SUBSCRIPT_BEYOND_COUNT", "SUBSCRIPT_OUTSIDE_LIMIT", "SYS_INVALID_ROWID", "TIMEOUT_ON_RESOURCE", "TOO_MANY_ROWS", "VALUE_ERROR", "ZERO_DIVIDE") override fun init() { subscribeTo(PlSqlGrammar.RAISE_STATEMENT) } override fun visitNode(node: AstNode) { val statement = node.asTree() val exceptionIdentifier = statement.exception if (exceptionIdentifier != null) { val exceptionName = exceptionIdentifier.tokenValue if (standardExceptions.contains(exceptionName)) { addLineIssue(getLocalizedMessage(), exceptionIdentifier.tokenLine, exceptionName) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/RedundantExpectationCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.matchers.MethodMatcher @Rule(priority = Priority.MAJOR, tags = [Tags.UTPLSQL, Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.TEST) @ActivatedByDefault class RedundantExpectationCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.METHOD_CALL) } override fun visitNode(node: AstNode) { if (expectMatcher.matches(node)) { val expectationNode = node.nextSibling.nextSibling val actualValue = expectMatcher.getArgumentsValues(node)[0] val matcherArguments = expectMatcher.getArgumentsValues(expectationNode) if (matcherArguments.isEmpty()) { return } val expectedValue = matcherArguments[0] if (CheckUtils.equalNodes(actualValue, expectedValue)) { addIssue(actualValue, getLocalizedMessage()).secondary(expectedValue, "Expected value") } } } companion object { private val expectMatcher = MethodMatcher.create() .packageName("UT") .name("EXPECT") .withNoParameterConstraint() } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/ReturnOfBooleanExpressionCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.asTree import com.felipebz.zpa.sslr.IfStatement import com.felipebz.zpa.sslr.TreeWithStatements import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR, tags = [Tags.CLUMSY]) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class ReturnOfBooleanExpressionCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.IF_STATEMENT) } override fun visitNode(node: AstNode) { val ifStatement = node.asTree() val elseClause = ifStatement.elseClause if (!hasElsif(ifStatement) && elseClause != null) { val firstBoolean = getBooleanValue(ifStatement) val secondBoolean = getBooleanValue(elseClause) if (firstBoolean != null && secondBoolean != null && firstBoolean.tokenValue != secondBoolean.tokenValue) { addIssue(node, getLocalizedMessage()) } } } private fun hasElsif(ifStatement: IfStatement): Boolean { return ifStatement.elsifClauses.isNotEmpty() } private fun getBooleanValue(node: TreeWithStatements): AstNode? { return extractBooleanValueFromReturn(getStatementFrom(node)) } private fun getStatementFrom(node: TreeWithStatements): AstNode? { val statements = node.statements return if (statements.size == 1) { statements[0] } else null } private fun extractBooleanValueFromReturn(node: AstNode?): AstNode? { if (node != null) { val child = node.firstChild if (child.typeIs(PlSqlGrammar.RETURN_STATEMENT)) { val expression = child.getFirstChildOrNull(PlSqlGrammar.LITERAL) return getBooleanLiteral(expression) } } return null } private fun getBooleanLiteral(expression: AstNode?): AstNode? { return expression?.getFirstChildOrNull(PlSqlGrammar.BOOLEAN_LITERAL) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/SameBranchCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.asTree import com.felipebz.zpa.sslr.IfStatement import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR, tags = [Tags.BUG]) @ConstantRemediation("10min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class SameBranchCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.IF_STATEMENT) } override fun visitNode(node: AstNode) { val ifStatement = node.asTree() val branches = collectStatementsFromBranches(ifStatement) findSameBranches(branches) } private fun findSameBranches(branches: List) { for (i in 1 until branches.size) { checkBranch(branches, i) } } private fun checkBranch(branches: List, index: Int) { val branch = branches[index] val previousBranchIndex = index - 1 val otherBranch = branches[previousBranchIndex] if (CheckUtils.equalNodes(otherBranch, branch)) { addIssue(branch, getLocalizedMessage(), otherBranch.token.line) .secondary(otherBranch, "Original") } } private fun collectStatementsFromBranches(ifStatement: IfStatement): List { val statementsFromBranches = ArrayList() statementsFromBranches.add(ifStatement.statements.astNode) for (branch in ifStatement.elsifClauses) { statementsFromBranches.add(branch.statements.astNode) } val elseBranch = ifStatement.elseClause if (elseBranch != null) { statementsFromBranches.add(elseBranch.statements.astNode) } return statementsFromBranches } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/SameConditionCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.BLOCKER, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class SameConditionCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.AND_EXPRESSION) subscribeTo(PlSqlGrammar.OR_EXPRESSION) } override fun visitNode(node: AstNode) { val expressions = getExpressions(node) findSameConditions(expressions) } private fun findSameConditions(conditions: List) { for (i in 1 until conditions.size) { checkCondition(conditions, i) } } private fun checkCondition(conditions: List, index: Int) { val condition = conditions[index] for (j in 0 until index) { val otherCondition = conditions[j] if (CheckUtils.equalNodes(otherCondition, condition)) { addIssue(condition, getLocalizedMessage(), otherCondition.token.line) .secondary(otherCondition, "Original") return } } } private fun getExpressions(node: AstNode): List { val expressions = ArrayList() for (subnode in node.children) { if (!subnode.typeIs(PlSqlKeyword.AND) && !subnode.typeIs(PlSqlKeyword.OR)) { expressions.add(subnode) } } return expressions } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/SelectAllColumnsCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlPunctuator import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.symbols.PlSqlType @Rule(priority = Priority.MAJOR, tags = [Tags.PERFORMANCE]) @ConstantRemediation("30min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class SelectAllColumnsCheck : AbstractBaseCheck() { override fun init() { subscribeTo(DmlGrammar.SELECT_COLUMN) } override fun visitNode(node: AstNode) { val topParent = node.parent.parent.parent if (topParent.typeIs(PlSqlGrammar.EXISTS_EXPRESSION)) { return } if (topParent.typeIs(PlSqlGrammar.CURSOR_DECLARATION)) { // TODO this is very complex and it probably can be simplified in the future val fetchDestination = semantic(topParent.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME)) .symbol?.usages.orEmpty() .map { it.parent.parent } .filter { it.typeIs(PlSqlGrammar.FETCH_STATEMENT) } .map { it.getFirstChild(DmlGrammar.INTO_CLAUSE).getFirstChildOrNull(PlSqlGrammar.VARIABLE_NAME) } .firstOrNull() if (fetchDestination != null && semantic(fetchDestination).plSqlType == PlSqlType.ROWTYPE) { return } } var candidate = node.firstChild if (candidate.typeIs(PlSqlGrammar.OBJECT_REFERENCE)) { candidate = candidate.lastChild } if (candidate.typeIs(PlSqlPunctuator.MULTIPLICATION)) { val intoClause = node.parent.getFirstChildOrNull(DmlGrammar.INTO_CLAUSE) if (intoClause != null) { val variablesInInto = intoClause.getChildren(PlSqlGrammar.VARIABLE_NAME, PlSqlGrammar.MEMBER_EXPRESSION, PlSqlGrammar.METHOD_CALL) val type = semantic(variablesInInto[0]).plSqlType if (variablesInInto.size == 1 && (type == PlSqlType.ROWTYPE || type == PlSqlType.ASSOCIATIVE_ARRAY)) { return } } addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/SelectWithRownumAndOrderByCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.BLOCKER, tags = [Tags.BUG]) @ConstantRemediation("20min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class SelectWithRownumAndOrderByCheck : AbstractBaseCheck() { override fun init() { subscribeTo(DmlGrammar.SELECT_EXPRESSION) } override fun visitNode(node: AstNode) { if (!hasOrderByClause(node)) { return } val queryBlock = node.getFirstChild(DmlGrammar.QUERY_BLOCK) val whereClause = queryBlock.getChildren(DmlGrammar.WHERE_CLAUSE) if (whereClause.isEmpty()) { return } val whereComparisonConditions = whereClause[0].getDescendants(PlSqlGrammar.COMPARISON_EXPRESSION) if (whereComparisonConditions.isEmpty()) { return } for (comparison in whereComparisonConditions) { for (child in comparison.getChildren(PlSqlGrammar.VARIABLE_NAME)) { if ("rownum".equals(child.tokenValue, ignoreCase = true) && node == child.getFirstAncestor(DmlGrammar.SELECT_EXPRESSION)) { addIssue(comparison, getLocalizedMessage()) } } } } private fun hasOrderByClause(node: AstNode): Boolean { return node.hasDirectChildren(DmlGrammar.ORDER_BY_CLAUSE) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/Tags.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks object Tags { const val BRAIN_OVERLOAD = "brain-overload" const val BUG = "bug" const val CLUMSY = "clumsy" const val CONVENTION = "convention" const val OBSOLETE = "obsolete" const val SECURITY = "security" const val UNUSED = "unused" const val CERT = "cert" const val PITFALL = "pitfall" const val MISRA = "misra" const val CONFUSING = "confusing" const val CWE = "cwe" const val PERFORMANCE = "performance" const val UTPLSQL = "utplsql" } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/ToCharInOrderByCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.matchers.MethodMatcher import com.felipebz.zpa.api.symbols.PlSqlType @Rule(priority = Priority.MAJOR, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class ToCharInOrderByCheck : AbstractBaseCheck() { override fun init() { subscribeTo(DmlGrammar.ORDER_BY_ITEM) } override fun visitNode(node: AstNode) { val expression = node.firstChild if (toChar.matches(expression)) { addIssue(node, getLocalizedMessage()) } if (expression.type === PlSqlGrammar.LITERAL && semantic(expression).plSqlType === PlSqlType.NUMERIC) { val index = Integer.parseInt(expression.tokenOriginalValue) val selectExpression = node.getFirstAncestor(DmlGrammar.SELECT_EXPRESSION) val queryBlock = selectExpression.getFirstChild(DmlGrammar.QUERY_BLOCK) val columns = queryBlock.getChildren(DmlGrammar.SELECT_COLUMN) if (index > 0 && index <= columns.size) { val selectColumn = columns[index - 1].firstChild if (toChar.matches(selectColumn)) { addIssue(node, getLocalizedMessage()) } } } } companion object { private val toChar = MethodMatcher.create().name("to_char").withNoParameterConstraint() } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/ToDateWithoutFormatCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.SingleRowSqlFunctionsGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class ToDateWithoutFormatCheck : AbstractBaseCheck() { override fun init() { subscribeTo(SingleRowSqlFunctionsGrammar.TO_DATE_EXPRESSION) } override fun visitNode(node: AstNode) { val arguments = node.getChildren(PlSqlGrammar.ARGUMENT) if (arguments.size == 1 && !CheckUtils.isNullLiteralOrEmptyString(arguments.first().lastChild)) { addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/TooManyRowsHandlerCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.isOf import com.felipebz.zpa.sslr.NullStatement import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.CRITICAL, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class TooManyRowsHandlerCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.EXCEPTION_HANDLER) } override fun visitNode(node: AstNode) { // is a TOO_MANY_ROWS handler val exceptions = node.getChildren(PlSqlGrammar.VARIABLE_NAME) for (exception in exceptions) { val child = exception.firstChild if (child.typeIs(PlSqlGrammar.IDENTIFIER_NAME) && "TOO_MANY_ROWS".equals(child.tokenValue, ignoreCase = true)) { // and have only one NULL_STATEMENT val children = node.getFirstChild(PlSqlGrammar.STATEMENTS).children if (children.size == 1 && children[0].isOf()) { addIssue(node, getLocalizedMessage()) } } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/UnhandledUserDefinedExceptionCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.asTree import com.felipebz.zpa.sslr.RaiseStatement import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.ConstantRemediation import com.felipebz.zpa.api.annotations.Priority import com.felipebz.zpa.api.annotations.Rule import com.felipebz.zpa.api.annotations.RuleInfo import com.felipebz.zpa.api.symbols.Symbol import java.util.* @Rule(priority = Priority.CRITICAL, tags = [Tags.BUG]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) class UnhandledUserDefinedExceptionCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.RAISE_STATEMENT) } override fun visitNode(node: AstNode) { val statement = node.asTree() val identifier = statement.exception ?: return val identifierName = identifier.tokenValue val symbols = context.currentScope?.getSymbolsAcessibleInScope(identifierName) ?: ArrayDeque() if (symbols.isNotEmpty()) { val checkException = exceptionShouldBeChecked(symbols.first) if (checkException && !isHandled(identifierName)) { addIssue(node, getLocalizedMessage(), identifierName) } } } private fun exceptionShouldBeChecked(exceptionDeclaration: Symbol): Boolean { return exceptionDeclaration.scope.type !in PACKAGE_SPEC_OR_BODY } private fun isHandled(identifierName: String): Boolean { var outerScope = context.currentScope do { val scopeNode = outerScope?.tree val statements = scopeNode?.getFirstChildOrNull(PlSqlGrammar.STATEMENTS_SECTION) val exceptionHandlers = statements?.getFirstChildOrNull(PlSqlGrammar.EXCEPTION_HANDLERS) if (statements != null && exceptionHandlers != null) { for (handler in exceptionHandlers.getChildren(PlSqlGrammar.EXCEPTION_HANDLER)) { if (handler.hasDirectChildren(PlSqlKeyword.OTHERS) && !handler.hasDescendant(PlSqlKeyword.SQLERRM)) { return true } for (exceptionName in handler.getChildren(PlSqlGrammar.VARIABLE_NAME)) { if (exceptionName.tokenValue == identifierName) { return true } } } } outerScope = outerScope?.outer } while (outerScope != null) return false } companion object { val PACKAGE_SPEC_OR_BODY = arrayOf(PlSqlGrammar.CREATE_PACKAGE, PlSqlGrammar.CREATE_PACKAGE_BODY) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/UnnecessaryAliasInQueryCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.AstNodeType import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("1min") @RuleInfo(scope = RuleInfo.Scope.ALL) class UnnecessaryAliasInQueryCheck : AbstractBaseCheck() { @RuleProperty(key = "acceptedLength", defaultValue = "" + DEFAULT_ACCEPTED_LENGTH) var acceptedLength = DEFAULT_ACCEPTED_LENGTH private val dmlStatements = arrayOf( DmlGrammar.QUERY_BLOCK, PlSqlGrammar.UPDATE_STATEMENT, PlSqlGrammar.DELETE_STATEMENT) override fun init() { subscribeTo(*dmlStatements) } override fun visitNode(node: AstNode) { if (node.hasAncestor(*dmlStatements)) { // if the current node is inside another DML statement (i.e. subquery), the node should be // ignored because it is considered in the analysis of the outer statement return } val tableReferences = hashMapOf>() for (fromClause in node.getDescendants(DmlGrammar.DML_TABLE_EXPRESSION_CLAUSE)) { val table = fromClause.getFirstChildOrNull(DmlGrammar.TABLE_REFERENCE) val alias = fromClause.getFirstChildOrNull(DmlGrammar.ALIAS) if (table != null) { tableReferences.getOrPut(table.tokenValue) { mutableListOf() } .add(TableReference(table, alias)) } } for (references in tableReferences.values) { checkReference(references) } } private fun checkReference(references: MutableList) { if (references.size == 1) { val reference: TableReference = references[0] var alias: String? = null if (reference.alias != null) { alias = reference.alias.tokenValue } if (alias != null && reference.alias != null && alias.length < acceptedLength) { addIssue(reference.alias, getLocalizedMessage(), reference.table.tokenOriginalValue, reference.alias.tokenOriginalValue) } } } internal class TableReference(val table: AstNode, val alias: AstNode?) companion object { private const val DEFAULT_ACCEPTED_LENGTH = 3 } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/UnnecessaryElseCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class UnnecessaryElseCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.ELSE_CLAUSE) } override fun visitNode(node: AstNode) { val ifStatement = checkNotNull(node.parent) if (!hasElsifClause(ifStatement) && hasTerminationStatement(ifStatement)) { addLineIssue(getLocalizedMessage(), node.tokenLine) } } private fun hasElsifClause(node: AstNode): Boolean { return node.hasDirectChildren(PlSqlGrammar.ELSIF_CLAUSE) } private fun hasTerminationStatement(ifStatement: AstNode): Boolean { for (statement in ifStatement.getFirstChild(PlSqlGrammar.STATEMENTS).children) { val internal = statement.firstChild if (CheckUtils.isTerminationStatement(internal)) { return true } } return false } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/UnnecessaryLikeCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.ConditionsGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR, tags = [Tags.CONFUSING]) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class UnnecessaryLikeCheck : AbstractBaseCheck() { private val escapeRegex = Regex("[%_]") override fun init() { subscribeTo(ConditionsGrammar.LIKE_CONDITION) } override fun visitNode(node: AstNode) { val escapeChar = if (node.hasDescendant(PlSqlKeyword.ESCAPE) && node.lastChild.hasDirectChildren(PlSqlGrammar.CHARACTER_LITERAL)) node.lastChild.tokenValue.trim('\'') else "" val regex = if (escapeChar.isEmpty()) escapeRegex else Regex("[^${Regex.escape(escapeChar)}][%_]") val likeNode = node.getFirstChild(PlSqlKeyword.LIKE).nextSibling if (likeNode.hasDirectChildren(PlSqlGrammar.CHARACTER_LITERAL) && !likeNode.tokenValue.contains(regex)) { addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/UnnecessaryNullStatementCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("1min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class UnnecessaryNullStatementCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.NULL_STATEMENT) } override fun visitNode(node: AstNode) { val parent = node.parent if (parent.previousSiblingOrNull != null || parent.nextSiblingOrNull != null) { addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/UnusedCursorCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.Symbol @Rule(priority = Priority.MAJOR, tags = [Tags.UNUSED]) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class UnusedCursorCheck : AbstractBaseCheck() { override fun leaveFile(node: AstNode) { val scopes = context.symbolTable.scopes for (scope in scopes) { if (scope.type == PlSqlGrammar.CREATE_PACKAGE) { continue } checkScope(scope) } } private fun checkScope(scope: Scope) { val symbols = scope.getSymbols(Symbol.Kind.CURSOR) for (symbol in symbols) { val parent = checkNotNull(symbol.declaration.parent) if (symbol.usages.isEmpty() && !parent.hasDirectChildren(PlSqlKeyword.RETURN)) { addIssue(parent, getLocalizedMessage(), symbol.name) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/UnusedParameterCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.Symbol import java.util.regex.Pattern @Rule(priority = Priority.MAJOR, tags = [Tags.UNUSED]) @ConstantRemediation("30min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class UnusedParameterCheck : AbstractBaseCheck() { @RuleProperty(key = "ignoreMethods", defaultValue = "") var ignoreMethods = "" private val ignoreRegex: Pattern? by lazy { if ("" != ignoreMethods) { Pattern.compile(ignoreMethods, Pattern.CASE_INSENSITIVE) } else null } override fun leaveFile(node: AstNode) { val scopes = context.symbolTable.scopes for (scope in scopes) { // is overriding something? if (scope.isOverridingMember) { continue } val scopeNode = scope.tree ?: continue // ignore procedure/function specification and overriding members if (scope.type in DECLARATION_OR_CONSTRUCTOR) { // is specification? if (!scopeNode.hasDirectChildren(PlSqlGrammar.STATEMENTS_SECTION)) { continue } } // cursor declaration (without implementation) if (scope.type == PlSqlGrammar.CURSOR_DECLARATION && !scopeNode.hasDirectChildren(DmlGrammar.SELECT_EXPRESSION)) { continue } // ignore methods by name if (scope.type in PROCEDURE_OR_FUNCTION && ignoreRegex != null) { val matchesRegex = ignoreRegex?.matcher(scope.identifier)?.matches() ?: false if (matchesRegex) { continue } } checkScope(scope) } } private fun checkScope(scope: Scope) { val symbols = scope.getSymbols(Symbol.Kind.PARAMETER) for (symbol in symbols) { // SELF parameter in type members if (scope.outer?.type == PlSqlGrammar.CREATE_TYPE_BODY && symbol.name.equals("self", ignoreCase = true)) { continue } if (symbol.usages.isEmpty()) { val parent = checkNotNull(symbol.declaration.parent) addIssue(parent, getLocalizedMessage(), symbol.name) } } } companion object { val DECLARATION_OR_CONSTRUCTOR = arrayOf(PlSqlGrammar.PROCEDURE_DECLARATION, PlSqlGrammar.FUNCTION_DECLARATION, PlSqlGrammar.TYPE_CONSTRUCTOR) val PROCEDURE_OR_FUNCTION = arrayOf(PlSqlGrammar.PROCEDURE_DECLARATION, PlSqlGrammar.FUNCTION_DECLARATION, PlSqlGrammar.CREATE_PROCEDURE, PlSqlGrammar.CREATE_FUNCTION) } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/UnusedVariableCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.Symbol @Rule(priority = Priority.MAJOR, tags = [Tags.UNUSED]) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class UnusedVariableCheck : AbstractBaseCheck() { override fun leaveFile(node: AstNode) { val scopes = context.symbolTable.scopes for (scope in scopes) { if (scope.type !in arrayOf(PlSqlGrammar.CREATE_PACKAGE, PlSqlGrammar.FOR_STATEMENT)) { checkScope(scope) } } } private fun checkScope(scope: Scope) { val symbols = scope.getSymbols(Symbol.Kind.VARIABLE) for (symbol in symbols) { if (symbol.usages.isEmpty()) { addIssue(symbol.declaration, getLocalizedMessage(), symbol.name) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/UselessParenthesisCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class UselessParenthesisCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.BRACKED_EXPRESSION) } override fun visitNode(node: AstNode) { val parent = node.parent if (parent.typeIs(PlSqlGrammar.BRACKED_EXPRESSION) && parent.numberOfChildren == 3) { addIssue(node, getLocalizedMessage()) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/VariableHidingCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.asSemantic import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.symbols.Symbol @Rule(priority = Priority.MAJOR) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class VariableHidingCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.VARIABLE_DECLARATION, PlSqlGrammar.EXCEPTION_DECLARATION) } override fun visitNode(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val name = identifier.tokenValue val scope = identifier.asSemantic().symbol?.scope if (scope != null) { val symbols = scope.getSymbolsAcessibleInScope(name, Symbol.Kind.VARIABLE, Symbol.Kind.PARAMETER) if (symbols.size > 1) { val originalVariable = symbols.last.declaration if (originalVariable != identifier) { addIssue(identifier, getLocalizedMessage(), name, originalVariable.tokenLine) .secondary(originalVariable, "Original") } } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/VariableInCountCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import com.felipebz.zpa.api.matchers.MethodMatcher @Rule(priority = Priority.BLOCKER, tags = [Tags.BUG]) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class VariableInCountCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.METHOD_CALL) } override fun visitNode(node: AstNode) { val count = MethodMatcher.create().name("count").addParameter() if (!node.parent.typeIs(DmlGrammar.SELECT_COLUMN) || !count.matches(node)) { return } checkArguments(node, count.getArgumentsValues(node)) } private fun checkArguments(currentNode: AstNode, arguments: List) { if (arguments.size != 1) { return } val value = arguments[0] val symbol = semantic(value).symbol if (symbol != null) { addIssue(currentNode, getLocalizedMessage(), value.tokenOriginalValue) } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/VariableInitializationWithFunctionCallCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR) @ConstantRemediation("5min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class VariableInitializationWithFunctionCallCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.DEFAULT_VALUE_ASSIGNMENT) } override fun visitNode(node: AstNode) { if (node.hasParent(PlSqlGrammar.VARIABLE_DECLARATION)) { val datatype = node.parent.getFirstChild(PlSqlGrammar.DATATYPE) val expression = node.lastChild if (expression.typeIs(PlSqlGrammar.METHOD_CALL) && datatype.tokenValue != expression.tokenValue) { addIssue(node, getLocalizedMessage()) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/VariableInitializationWithNullCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MINOR) @ConstantRemediation("2min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class VariableInitializationWithNullCheck : AbstractBaseCheck() { override fun init() { subscribeTo(PlSqlGrammar.DEFAULT_VALUE_ASSIGNMENT) } override fun visitNode(node: AstNode) { if (node.hasParent(PlSqlGrammar.VARIABLE_DECLARATION, PlSqlGrammar.RECORD_FIELD_DECLARATION)) { val expression = node.lastChild if (CheckUtils.isNullLiteralOrEmptyString(expression)) { addIssue(node, getLocalizedMessage()) } } } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/VariableNameCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.annotations.* import java.util.regex.Pattern @Rule(priority = Priority.MINOR) @ConstantRemediation("10min") @RuleInfo(scope = RuleInfo.Scope.ALL) @ActivatedByDefault class VariableNameCheck : AbstractBaseCheck() { @RuleProperty(key = "regexp", defaultValue = DEFAULT_REGEXP) var regexp = DEFAULT_REGEXP private val pattern: Pattern by lazy { Pattern.compile(regexp) } override fun init() { subscribeTo(PlSqlGrammar.VARIABLE_DECLARATION) } override fun visitNode(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val name = identifier.tokenOriginalValue if (!pattern.matcher(name).matches()) { addIssue(identifier, getLocalizedMessage(), name, regexp) } } companion object { private const val DEFAULT_REGEXP = "[a-zA-Z]([a-zA-Z0-9_]*[a-zA-Z0-9])?" } } ================================================ FILE: zpa-checks/src/main/kotlin/com/felipebz/zpa/checks/XPathCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.flr.xpath.api.AstNodeXPathQuery import com.felipebz.zpa.squid.AnalysisException import com.felipebz.zpa.api.annotations.* @Rule(priority = Priority.MAJOR) @RuleInfo(scope = RuleInfo.Scope.ALL) @RuleTemplate class XPathCheck : AbstractBaseCheck() { @RuleProperty(key = "xpathQuery") var xpathQuery = DEFAULT_XPATH_QUERY @RuleProperty(key = "message", defaultValue = "" + DEFAULT_MESSAGE) var message = DEFAULT_MESSAGE private var query: AstNodeXPathQuery? = null private fun query(): AstNodeXPathQuery? { if (query == null && xpathQuery.isNotEmpty()) { try { query = AstNodeXPathQuery.create(xpathQuery) } catch (e: RuntimeException) { throw AnalysisException( "Unable to initialize the XPath engine, perhaps because of an invalid query: $xpathQuery", e) } } return query } override fun visitFile(node: AstNode) { if (query() != null) { val objects = query()?.selectNodes(node) ?: emptyList() for (obj in objects) { if (obj is AstNode) { addIssue(obj, message) } else if (obj is Boolean && obj) { addFileIssue(message) } } } } companion object { private const val DEFAULT_XPATH_QUERY = "" private const val DEFAULT_MESSAGE = "The XPath expression matches this piece of code" } } ================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/AddParenthesesInNestedExpression.html ================================================

An AND condition has a higher precedence than an OR condition, so you should wrap the AND condition in parentheses for clarity and to ensure that the operators are evaluated in the order that you intend.

Consider this example:

SELECT dogs.name
  FROM dogs
 WHERE dogs.sex = 'male'
   and dogs.color = 'white'
    or dogs.size = 'big';

Without parentheses, one would think that it is equivalent to:

SELECT dogs.name
  FROM dogs
 WHERE dogs.sex = 'male'
   and (dogs.color = 'white' or dogs.size = 'big');

But the original query is parsed as:

SELECT dogs.name
  FROM dogs
 WHERE (dogs.sex = 'male' and dogs.color = 'white')
    or dogs.size = 'big';
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/CharacterDatatypeUsage.html ================================================

Currently, the VARCHAR and VARCHAR2 data types are identical. But to accommodate emerging SQL standards, VARCHAR might become a separate data type in future.

The CHAR data type doesn't have any advantage over VARCHAR2 and makes searching more difficult because the right-padded values.

declare
  var1 varchar(10); -- noncompliant
  var2 char(10); -- noncompliant
  
  var3 varchar2(10); -- compliant
begin
  null;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/CollapsibleIfStatements.html ================================================

Merging collapsible if statements increases the code's readability.

Noncompliant Code Example

if condition1 then
  if condition2 then
    -- code
  end if;
end if;

Compliant Solution

if condition1 and condition2 then
  -- code
end if;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/ColumnsShouldHaveTableName.html ================================================

Specify the table name of the columns in a SELECT statement to improve readability and guarantee that the code won't stop working when the table changes.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/CommitRollback.html ================================================

Usually, the control of the transaction should be handled by the its "owner". If the transaction was started by some Java code, the commit and rollback of this should be done in the Java code.

So, in this situation, calling a COMMIT or ROLLBACK from a database object is a bad pratice and should be avoided.

This rule ignores procedures and functions with PRAGMA AUTONOMOUS_TRANSACTION.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/ComparisonWithBoolean.html ================================================

Remove literal boolean values from comparisons to improve readability.

Noncompliant Code Example

if var = true then ...
if var = false then ...

Compliant Solution

if var then ...
if not var then ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/ComparisonWithNull.html ================================================

To test for nulls, use only the comparison conditions IS NULL and IS NOT NULL. Any other comparison with nulls will result in NULL.

Keep in mind that an empty string is equivalent to a NULL literal.

Noncompliant Code Example

if var = null then
  -- code
end if;
Or:
if other_var = '' then
  -- code
end if;

Compliant Solution

if var is null then
  -- code
end if;
if other_var is null then
  -- code
end if;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/ConcatenationWithNull.html ================================================

Concatenating a VARCHAR2 value with NULL is no-op. So, the NULL value should be removed.

A concatenation of any other datatype with NULL will cause a implicit cast to VARCHAR2. If this is the desired behavior, replace the concatenation by a TO_CHAR call to make the intention explicit. See this example:

var := NVL(''||id, 'Empty');

You should use this:

var := NVL(TO_CHAR(id), 'Empty');
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/CursorBodyInPackageSpec.html ================================================

Cursor declarations can be splitted in two parts: specification and body. When declaring a cursor in a package specification, the package specification should contains only the cursor specification and the cursor body should be added to the package body.

In newer versions of Oracle Forms, the usage of cursors declared with body in a package specification also causes the compilation error "internal error [Unexpected fragile external reference.]".

Noncompliant Code Example

create or replace package pkg is
  cursor cur is
    select dummy from dual;
end;

Compliant Solution

create or replace package pkg is
  type cur_type is record(dummy varchar2(1));
  cursor cur return cur_type;
end;
/
create or replace package body pkg is
  cursor cur return cur_type is
    select dummy from dual;
end;
/
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/DbmsOutputPut.html ================================================

The output of DBMS_OUTPUT.PUT/DBMS_OUTPUT.PUT_LINE will not be visible when SERVEROUTPUT is set to OFF. Moreover, unless this call is explicitly necessary, is better to use logging mechanism instead.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/DeadCode.html ================================================

Jump statements (return, exit, continue, and raise) move control flow out of the current code block. Typically, any statements in a block that come after a jump are simply wasted keystrokes lying in wait to confuse the unwary.

Noncompliant Code Example

begin
  raise my_error;
  log('finished'); -- this code will never be executed
end;

Compliant Solution

begin
  raise my_error;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/DeclareSectionWithoutDeclarations.html ================================================

You don't need to add the DECLARE keyword in a block if it doesn't contains any declaration.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/DisabledTest.html ================================================

When a test fails due, for example, to infrastructure issues, you might want to ignore it temporarily. But without some kind of notation about why the test is being disabled, it may never be reactivated.

This rule raises an issue for each disabled test that does not have a notation about why it was disabled.

Noncompliant Code Example

-- %test(my test)
-- %disabled
procedure test;

Compliant Solution

-- %test(my test)
procedure test;

Exceptions

The rule doesn't raise an issue if there is a comment in the %disabled annotation.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/DuplicateConditionIfElsif.html ================================================

A chain of if/elsif statements is evaluated from top to bottom. At most, only one branch will be executed: the first one with a condition that evaluates to true.

Therefore, duplicating a condition automatically leads to dead code. Usually, this is due to a copy/paste error. At best, it's simply dead code and at worst, it's a bug that is likely to induce further bugs as the code is maintained, and obviously it could lead to unexpected behavior.

Noncompliant Code Example

IF (param = 1) THEN
  open();
ELSIF (param = 2) THEN
  close();
ELSIF (param = 1) THEN // Incorrect
  move();
END IF;

Compliant Solution

IF (param = 1) THEN
  open();
ELSIF (param = 2) THEN
  close();
ELSIF (param = 3) THEN
  move();
END IF;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/DuplicatedValueInIn.html ================================================

Duplicated values in an IN condition can be either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified.

Noncompliant Code Example

if value in (a, a, b) then ...

Compliant Solution

if value in (a, b) then ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/EmptyBlock.html ================================================

Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.

Noncompliant Code Example

begin
  null;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/EmptyStringAssignment.html ================================================

To improve the readability, avoid using empty strings to represent NULL.

Noncompliant Code Example

var := '';

Compliant Solution

var := null;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/ExplicitInParameter.html ================================================

If not set, the parameter mode is IN. However, defining it explicitly does make the code easier to read.

CREATE OR REPLACE PROCEDURE myproc(value VARCHAR2) IS -- violation
BEGIN
  NULL;
END;

CREATE OR REPLACE PROCEDURE myproc(value IN VARCHAR2) IS -- correct, the parameter mode is defined
BEGIN
  NULL;
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/FunctionWithOutParameter.html ================================================

Functions with OUT parameters are complex to understand. It is impossible to tell whether an argument is a input or output just by looking at the function call. Also, functions with OUT parameters cannot be called from SQL.

Noncompliant Code Example

CREATE OR REPLACE FUNCTION get_product_info(id IN NUMBER, value OUT NUMBER) RETURN VARCHAR2 IS
BEGIN
 ...
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/IdenticalExpression.html ================================================

Using the same value on either side of an operator is almost always a mistake. It can be either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified.

Noncompliant Code Example

if a = a then ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/IfWithExit.html ================================================

To improve the code readability always use EXIT WHEN instead of an IF statement to exit from a loop.

Noncompliant Code Example

if condition1 then
  exit;
end if;

Compliant Solution

exit when condition1;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/InequalityUsage.html ================================================

The forms "<>", "!=", "~=" and "^=" are equivalent, but only the "<>" form is defined in ANSI SQL.

Noncompliant Code Example

if a != b then

Compliant Solution

if a <> b then
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/InsertWithoutColumns.html ================================================

Specify the columns in an INSERT statement to guarantee that the code won't stop working when a new column is added.

Noncompliant Code Example

insert into tab values (1);

Compliant Solution

insert into tab (col) values (1);
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/InvalidReferenceToObject.html ================================================

In Oracle Forms, many procedures and functions need a reference to an object (blocks, itens, alerts...). Unfortunately, the only way to pass a reference to an object is using a VARCHAR2 variable and these references are not checked by the compiler.

Currently this rule checks the following methods:

Alert bultins:
  • FIND_ALERT
  • SET_ALERT_BUTTON_PROPERTY
  • SET_ALERT_PROPERTY
  • SHOW_ALERT
Block bultins:
  • FIND_BLOCK
  • GET_BLOCK_PROPERTY
  • GO_BLOCK
  • SET_BLOCK_PROPERTY
Item bultins:
  • CHECKBOX_CHECKED
  • CONVERT_OTHER_VALUE
  • DISPLAY_ITEM
  • FIND_ITEM
  • GET_ITEM_INSTANCE_PROPERTY
  • GET_ITEM_PROPERTY
  • GET_RADIO_BUTTON_PROPERTY
  • GO_ITEM
  • IMAGE_SCROLL
  • IMAGE_ZOOM
  • IMAGE_ZOOM
  • PLAY_SOUND
  • READ_IMAGE_FILE
  • READ_SOUND_FILE
  • RECALCULATE
  • SET_ITEM_INSTANCE_PROPERTY
  • SET_ITEM_PROPERTY
  • SET_ITEM_PROPERTY
  • SET_RADIO_BUTTON_PROPERTY
  • SET_RADIO_BUTTON_PROPERTY
  • WRITE_IMAGE_FILE
  • WRITE_SOUND_FILE
LOV bultins:
  • FIND_LOV
  • GET_LOV_PROPERTY
  • SET_LOV_COLUMN_PROPERTY
  • SET_LOV_PROPERTY
  • SHOW_LOV

Note: this rule is automatically disabled when the project's sonar.plsql.forms.metadata is not specified.

. ================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/NotASelectedExpression.html ================================================

In a SELECT DISTINCT with an ORDER BY clause, if you specify a value in the ORDER BY that does not exists in the SELECT clause, Oracle will raise the exception ORA-01791: not a SELECTed expression.

See this example:

SELECT DISTINCT item.name
  FROM item
 ORDER BY item.group_id

The item.id column is not in the SELECT clause, so Oracle will raise an ORA-01791. The corrected version can be:

SELECT DISTINCT item.name, item.group_id
  FROM item
 ORDER BY item.group_id

If the column in SELECT clause has an alias, you also can use the alias in the ORDER BY clause:

-- valid queries
SELECT DISTINCT item.name AS full_name
  FROM item
 ORDER BY item.name;
 
SELECT DISTINCT item.name AS full_name
  FROM item
 ORDER BY full_name;

Be aware that until the version 11.2.0.4, Oracle accepted some incorrect values in ORDER BY, like:

SELECT DISTINCT UPPER(item.name) AS full_name, item.group_id
  FROM item
 ORDER BY item.name -- should be "UPPER(item.name)" or "full_name" 

You should fix the queries to avoid compatibility issues with newer versions of the Oracle database.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/NotFound.html ================================================

Use cursor%NOTFOUND instead of NOT cursor%FOUND.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/NvlWithNullParameter.html ================================================

The NVL function lets you replace a null value with a valid value value. So, don't specify a NULL literal or an empty string as a parameter of a NVL call.

Noncompliant Code Example

var := nvl(x, '');
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/ParsingError.html ================================================

When the PL/SQL parser fails, it is possible to record the failure as a violation on the file. This way, not only it is possible to track the number of files that do not parse but also to easily find out why they do not parse.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/QueryWithoutExceptionHandling.html ================================================

Usually you should add an exception handling block for SELECT statements, to avoid unexpected exceptions.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/RaiseStandardException.html ================================================

You should review all the RAISE statements that causes a predefined exception, because usually this is a sign of bad logic. Consider this example:

CREATE OR REPLACE FUNCTION group_has_users(id IN NUMBER) RETURN BOOLEAN IS
  has_users BOOLEAN;
  user_id   user_group.user_id%TYPE;
BEGIN
  BEGIN
    SELECT user_group.user_id
      INTO user_id
      FROM user_group
     WHERE user_group.group_id = id;
     
    RAISE TOO_MANY_ROWS;
  EXCEPTION
    WHEN NO_DATA_FOUND THEN
      has_users := FALSE;
    WHEN TOO_MANY_ROWS THEN
      has_users := TRUE;
  END;
  
  RETURN has_users;
END;

In this case, the TOO_MANY_ROWS exception is being used as a flow control mechanism. This function could be rewritten to avoid the RAISE statement:

CREATE OR REPLACE FUNCTION group_has_users(id IN NUMBER) RETURN BOOLEAN IS
  number_of_users NUMBER;
BEGIN
  BEGIN
    SELECT COUNT(*)
      INTO number_of_users
      FROM user_group
     WHERE user_group.group_id = id;
  EXCEPTION
    WHEN OTHERS THEN
      number_of_users := 0;
  END;
  
  RETURN number_of_users > 0;
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/RedundantExpectation.html ================================================

From the utPLSQL documentation:

Validation of the code under test (the tested logic of procedure/function etc.) is performed by comparing the actual data against the expected data. utPLSQL uses a combination of expectation and matcher to perform the check on the data.

Some validations are written in the form of ut.expect(actual_value).matcher(expected_value). This rules checks if the actual_value and the expected_value are the same thing. Example:

...
begin
  v_expected := '2345';
  v_actual := betwnstr('1234567', 2, 5);
  ut.expect(v_actual).to_equal(v_actual); -- This expectation is wrong, it's always true
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/ReturnOfBooleanExpression.html ================================================

Return of boolean literal statements wrapped into IF-THEN-ELSE ones should be simplified.

Noncompliant Code Example

IF expression THEN
  RETURN TRUE;
ELSE
  RETURN FALSE;
END IF;

Compliant Solution

RETURN expression;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/SameBranch.html ================================================

Having two branches in the same if structure with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then they should be combined.

Noncompliant Code Example

IF var BETWEEN 0 AND 10 THEN
  do_the_thing();
ELSIF var BETWEEN 10 AND 20 THEN
  do_the_thing(); -- Noncompliant; duplicates first condition
ELSIF var BETWEEN 20 AND 50 THEN
  do_the_another_thing();
ELSE
  do_the_rest()
END IF;

Compliant Solution

IF var BETWEEN 0 AND 10 THEN
  do_the_thing();
ELSIF var BETWEEN 10 AND 20 THEN
  do_the_second_thing();
ELSIF var BETWEEN 20 AND 50 THEN
  do_the_another_thing();
ELSE
  do_the_rest()
END IF;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/SameCondition.html ================================================

Duplicate a condition in a comparison is almost always a mistake. It can be either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified.

Noncompliant Code Example

IF (x = 1) AND (x = 1) THEN ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/SelectAllColumns.html ================================================

SELECT * returns all the available columns. You should explicitly list the necessary columns. When considering using *, you should consider the possibility that more fields will be added to the table later.

Noncompliant Code Example

begin
  select *
    into var
    from emp;
  
  select emp.*
    into var
    from emp;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/SelectWithRownumAndOrderBy.html ================================================

In a SELECT expression, the WHERE clause is executed before the ORDER BY clause. Consider this example:

DECLARE
  CURSOR recent_users IS
    SELECT user.name,
           user.creation_date
      FROM user
     WHERE ROWNUM <= 5
     ORDER BY user.creation_date DESC;
BEGIN
  ...

This query won't return the last 5 created users. The database will filter the users without any ordering and after, apply the ORDER BY clause. The corrected query is:

DECLARE
  CURSOR recent_users IS
    SELECT name,
           creation_date
      FROM (SELECT user.name,
                   user.creation_date
              FROM user
             ORDER BY user.creation_date DESC)
     WHERE ROWNUM <= 5;
BEGIN
  ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/ToCharInOrderBy.html ================================================

The usage of TO_CHAR function in a ORDER BY is almost always a mistake. The column value will be ordered alphabetically instead of being ordered according its datatype.

Noncompliant Code Example

Suppose we have the data below in the EMP table:

empno hiredate
1 2019-10-01
5 2019-10-10
15 2018-10-02
20 2018-10-20
The queries below return an unwanted result:

select empno from emp order by to_char(empno);

empno
1
15
20
5

select hiredate from emp order by to_char(hiredate, 'dd-mm-rrrr');

hiredate
01-OCT-19
02-OCT-18
10-OCT-19
20-OCT-18

Compliant Code Example

To order these columns correctly we must remove the TO_CHAR call.

select empno from emp order by empno;

empno
1
5
15
20

select hiredate from emp order by hiredate;

hiredate
02-OCT-18
20-OCT-18
01-OCT-19
10-OCT-19
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/ToDateWithoutFormat.html ================================================

Always specify the date format in TO_DATE calls.

Noncompliant Code Example

begin
  var := to_date('2015-01-01');
end;

Compliant Solution

begin
  var := to_date('2015-01-01', 'YYYY-MM-DD');
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/TooManyRowsHandler.html ================================================

When a SELECT INTO statement causes the predefined exception TOO_MANY_ROWS the values of the variables in the INTO clause are undefined.

Noncompliant Code Example

begin
  select empno
    into var
    from emp;
exception
  when too_many_rows then
    null;
end;

Compliant Solution

begin
  select empno
    into var
    from emp;
exception
  when too_many_rows then
    var := null;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/UnhandledUserDefinedException.html ================================================

When a custom exception is declared and not handled in the code, raising this exception will cause the error "ORA-06510: PL/SQL: unhandled user-defined exception" in the database or the error "User-defined exception" in Oracle Forms.

It is a good practice to handle custom exceptions.

Noncompliant Code Example

DECLARE
  my_exception EXCEPTION;
BEGIN
  ...
  RAISE my_exception; -- this will cause an "user-defined exception"
END;

Compliant Solution

DECLARE
  my_exception EXCEPTION;
BEGIN
  ...
  RAISE my_exception;
EXCEPTION
  WHEN my_exception THEN
    ...
END;

This check will also trigger a violation if the exception is handled by a OTHERS handler and it has a reference to SQLERRM. In this case, the SQLERRM will return "User-defined exception", which is not very useful.

DECLARE
  my_exception EXCEPTION;
BEGIN
  ...
  RAISE my_exception;
EXCEPTION
  WHEN OTHERS THEN
    log(SQLERRM);
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/UnnecessaryAliasInQuery.html ================================================

An alias can be used in tables when you plan to add the same table more than once in the FROM clause (e.g. self join), or you want to shorten the table name to make the SQL statement shorter and easier to read. But when abused, aliases can have the opposite effect: decrease legibility.

Consider using aliases only when the table appears more than once in a query.

Noncompliant Code Example

SELECT a.id,
       b.id,
       b.name
  FROM employee a,
       dept b
 WHERE a.dept_id = b.id;

Compliant Solution

SELECT employee.id,
       dept.id,
       dept.name
  FROM employee,
       dept
 WHERE employee.dept_id = dept.id;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/UnnecessaryElse.html ================================================

When the IF clause of a IF-THEN-ELSE structure does not complete successfully, the ELSE clause is unnecessary.

Noncompliant Code Example

BEGIN
  IF condition THEN
    RETURN value;
  ELSE
    value := NULL;
  END IF;
END;

Compliant Solution

BEGIN
  IF condition THEN
    RETURN value;
  END IF;
  
  value := NULL;
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/UnnecessaryLike.html ================================================

Using a LIKE condition without a wildcard (% or _) is suspicious. A maintainer can suppose whether a wildcard is forgotten or it is meant as equality test.

Noncompliant Code Example

if (last_name like 'Smith') ...

Compliant Solution

if (last_name like 'Smith%') ...

-- or
if (last_name = 'Smith') ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/UnnecessaryNullStatement.html ================================================ A NULL statement at the same level of other statements is useless, so should be removed.

Noncompliant Code Example

BEGIN
  var := 1;
  NULL; -- this NULL statement can be removed
END

Compliant Solution

BEGIN
  var := 1;
END
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/UnusedCursor.html ================================================

If a local cursor is declared but not used, it is dead code and should be removed. Doing so will improve maintainability because developers will not wonder what the cursor is used for.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/UnusedParameter.html ================================================

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

PROCEDURE do_something(a IN NUMBER, b IN NUMBER) IS -- "b" is unused
BEGIN
  compute(a);
END;

Compliant Solution

PROCEDURE do_something(a IN NUMBER) IS
BEGIN
  compute(a);
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/UnusedVariable.html ================================================

If a local variable is declared but not used, it is dead code and should be removed. Doing so will improve maintainability because developers will not wonder what the variable is used for.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/UselessParenthesis.html ================================================

Useless parentheses can sometimes be misleading and so should be removed.

Noncompliant Code Example

if ((a = b)) then ...

Compliant Solution

if (a = b) then ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/VariableHiding.html ================================================

Redeclaring variables in inner scopes is allowed in PL/SQL, but it can cause confusion and should therefore be avoided.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/VariableInCount.html ================================================ Using the COUNT built-in with local variable is misleading and in the most of time it is a coding error.

Noncompliant Code Example

DECLARE
  v_empno emp.empno%TYPE;
  ...
BEGIN
  
  -- Because the v_empno is NULL at this point, this COUNT always returns 0.
  SELECT COUNT(v_empno)
    INTO i
    FROM employee
   WHERE employee.deptno = v_deptno;
END;

Compliant Solution

BEGIN
  SELECT COUNT(*)
    INTO i
    FROM employee
   WHERE employee.deptno = v_deptno;
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/VariableInitializationWithFunctionCall.html ================================================

If your initialization fails you will not be able to handle the error in your exceptions block.

Noncompliant Code Example

DECLARE
  employee_name emp.name%TYPE := get_employee_name(id => 5);
BEGIN
  ...
END;

Compliant Solution

DECLARE
  employee_name emp.name%TYPE;
BEGIN
  employee_name := get_employee_name(id => 5);
  ...
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/VariableInitializationWithNull.html ================================================

By default, new variables and RECORD fields are initialized with NULL. So, you don't need to initialize them with NULL.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/VariableName.html ================================================

This rule checks that all variable names match a provided regular expression.

Example

Considering the default expression:

DECLARE
  dept_name dept.name%type; -- Compliant
  dept_name_ dept.name%type; -- Noncompliant
BEGIN
  ...
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen/rules/plsql/XPath.html ================================================

This rule allows the definition of custom rules using XPath expressions.

Issues are created depending on the return value of the XPath expression. If the XPath expression returns:

  • a single or list of AST nodes, then a line issue with the given message is created for each node
  • a boolean, then a file issue with the given message is created only if the boolean is true
  • anything else, no issue is created
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen.properties ================================================ AddParenthesesInNestedExpression.message=Add parentheses around this AND condition to make the operator precedence explicit. AddParenthesesInNestedExpression.name=Add parentheses in nested expression CharacterDatatypeUsage.message=Use VARCHAR2 instead of {0}. CharacterDatatypeUsage.name=Use VARCHAR2 instead of CHAR and VARCHAR CollapsibleIfStatements.message=This IF statement can be merged with the enclosing one. CollapsibleIfStatements.name=Collapsible "if" statements should be merged ColumnsShouldHaveTableName.message=Specify the table of column "{0}". ColumnsShouldHaveTableName.name=The columns in a SELECT should be prefixed with table name CommitRollback.message=Avoid {0} calls unless it is in an autonomous transaction. CommitRollback.name=Avoid COMMIT/ROLLBACK calls in database objects ComparisonWithBoolean.message=Remove the literal "{0}" of this comparison. ComparisonWithBoolean.name=Avoid superfluous comparation against boolean literals ComparisonWithNull.message=Fix this comparison or change to "{0}". ComparisonWithNull.name=Do not compare values against the NULL literal or an empty string ConcatenationWithNull.message=Review this concatenation with NULL value. ConcatenationWithNull.name=Unnecessary concatenation with NULL value CursorBodyInPackageSpec.message=Move the body of the cursor "{0}" to the package body. CursorBodyInPackageSpec.name=Do not declare cursor bodies in a package specification DbmsOutputPut.message=Avoid direct calls to DBMS_OUTPUT procedures. DbmsOutputPut.name=Avoid direct calls to DBMS_OUTPUT procedures DeadCode.message=This code will never be executed. DeadCode.name=Dead code should be removed DeclareSectionWithoutDeclarations.message=Remove this DECLARE keyword. DeclareSectionWithoutDeclarations.name=Do not add the DECLARE keyword if the block doesn't have any declaration DisabledTest.message=Fix or remove this disabled unit test. DisabledTest.name=Tests should not be disabled DuplicateConditionIfElsif.message=This code can not be reached because the condition duplicates a previous condition in the same sequence of "if/else if" statements. DuplicateConditionIfElsif.name=Related "if/elsif" statements should not have the same condition DuplicatedValueInIn.message=Remove or fix the duplicated value "{0}" in the IN condition. DuplicatedValueInIn.name=Duplicated value in an IN condition EmptyBlock.message=Either remove or fill this block of code. EmptyBlock.name=Empty blocks should be removed EmptyStringAssignment.message=Replace this empty string by NULL. EmptyStringAssignment.name=Avoid using empty strings to represent NULL ExplicitInParameter.message=Explicitly declare this parameter as IN. ExplicitInParameter.name=Parameter mode should be explicitly declared FunctionWithOutParameter.message=Rewrite this function to not depend on OUT parameters. FunctionWithOutParameter.name=Avoid functions with OUT parameters IdenticalExpression.message=Identical expressions on both sides of operator "{0}". IdenticalExpression.name=Identical expressions should not be used on both sides of an operator IfWithExit.message=Replace this IF ... EXIT by a EXIT WHEN statement. IfWithExit.name=Use EXIT WHEN instead of an IF statement to exit from a loop InequalityUsage.message=Replace "{0}" by "<>". InequalityUsage.name=Only "<>" should be used to test inequality InsertWithoutColumns.message=Specify the columns in this INSERT. InsertWithoutColumns.name=Always specify the columns in an INSERT statement InvalidReferenceToObject.message=Invalid reference to the object "{0}" in this {1} call. InvalidReferenceToObject.name=Invalid reference to Oracle Forms object NotASelectedExpression.message=This value does not exists in the SELECT clause. Fix this expression or add this value in the SELECT. NotASelectedExpression.name=ORDER BY items must appear in the select list if SELECT DISTINCT is specified NotFound.message=Use %NOTFOUND instead of NOT ...%FOUND. NotFound.name=Use cursor%NOTFOUND instead of NOT cursor%FOUND NvlWithNullParameter.message=This NVL does not have any effect. Fix the {0} parameter or remove this NVL. NvlWithNullParameter.name=Do not pass a NULL literal or an empty string to NVL ParsingError.message=This code wasn't parsed correctly. No issue will be registered on it. ParsingError.name=Parser failure QueryWithoutExceptionHandling.message=Handle exceptions of this query. QueryWithoutExceptionHandling.name=Avoid queries without an exception handling block QueryWithoutExceptionHandling.param.strictMode=If false, allows inner block without exception handling. RaiseStandardException.message=Avoid raising the standard exception {0}. RaiseStandardException.name=Avoid raising standard exceptions RedundantExpectation.message=This test expectation is redundant. The actual value is the same as the one used in the matcher. RedundantExpectation.name=Test expectations should not be redundant ReturnOfBooleanExpression.message=Replace this if-then-else statement by a single return statement. ReturnOfBooleanExpression.name=Return of boolean expressions should not be wrapped into an "if-then-else" statement SameBranch.message=Either merge this branch with the identical one on line {0} or change one of the implementations. SameBranch.name=Branches in the same conditional structure should not have exactly the same implementation SameCondition.message=This condition duplicates the one on line {0}. SameCondition.name=Identical conditions should not be duplicated SelectAllColumns.message=SELECT * should not be used. SelectAllColumns.name=SELECT * should not be used SelectWithRownumAndOrderBy.message=Move this ROWNUM comparation to a more external level to guarantee the ordering. SelectWithRownumAndOrderBy.name=A SELECT cannot have a comparison with ROWNUM and an ORDER BY at the same level ToCharInOrderBy.message=This TO_CHAR may be causing the records to be fetched in the wrong order. ToCharInOrderBy.name=Avoid TO_CHAR in an ORDER BY clause ToDateWithoutFormat.message=Specify the date format in this TO_DATE. ToDateWithoutFormat.name=TO_DATE without date format TooManyRowsHandler.message=Handle the variables used in the SELECT INTO statements here so their values do not become undefined. TooManyRowsHandler.name=Avoid masking the TOO_MANY_ROWS exception UnhandledUserDefinedException.message=There is no exception handler for "{0}" here. This will cause an "user-defined exception" error. UnhandledUserDefinedException.name=User defined exceptions should be handled UnnecessaryAliasInQuery.message=This statement has only one reference to the table "{0}". Remove the alias "{1}" to improve the readability. UnnecessaryAliasInQuery.name=Unnecessary alias for table reference UnnecessaryAliasInQuery.param.acceptedLength=Ignore alias with size greater than or equals to this UnnecessaryElse.message=This ELSE can be replaced by an END IF. When the corresponding IF is executed, the code execution will be stopped. Either way, the code within this ELSE will always run, regardless of the ELSE block. UnnecessaryElse.name=Unnecessary ELSE clause UnnecessaryLike.message=This LIKE condition is not using any wildcard. Replace with an equality comparator or add a wildcard. UnnecessaryLike.name=Do not use LIKE conditions without wildcards UnnecessaryNullStatement.message=This NULL statement does not have any effect here. UnnecessaryNullStatement.name=Unnecessary NULL statement UnusedCursor.message=Remove this unused "{0}" cursor. UnusedCursor.name=Unused cursors should be removed UnusedParameter.message=Remove this unused "{0}" parameter. UnusedParameter.name=Unused parameters should be removed UnusedParameter.param.ignoreMethods=Regular Expression describing method names that should be ignored for this check UnusedVariable.message=Remove this unused "{0}" local variable. UnusedVariable.name=Unused local variables should be removed UselessParenthesis.message=Remove those useless parenthesis. UselessParenthesis.name=Useless parentheses around expressions should be removed to prevent any misunderstanding VariableHiding.message=This variable "{0}" hides the declaration on line {1}. VariableHiding.name=Do not redeclare variables in inner scope VariableInCount.message=Looks like there is a "{0}" variable in this context. Review if this COUNT is correct. VariableInCount.name=Don't pass variables to COUNT function VariableInitializationWithFunctionCall.message=Move this initialization to the BEGIN...END block. VariableInitializationWithFunctionCall.name=Avoid initializing variables using functions in the declaration section VariableInitializationWithNull.message=Remove this unnecessary initialization to NULL. VariableInitializationWithNull.name=Variables and RECORD fields do not need to be initialized with NULL VariableName.message=Rename {0} to match the regular expression {1}. VariableName.name=Variables should comply with a naming convention XPath.name=Track breaches of an XPath rule ================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/AddParenthesesInNestedExpression.html ================================================

Uma condição AND tem uma precedência maior que uma condição OR, então você deve envolver a condição AND em parênteses por questão de clareza e para garantir que os operadores sejam avaliados na ordem que você deseja.

Considere esse exemplo:

SELECT cachorros.nome
  FROM cachorros
 WHERE cachorros.sexo = 'macho'
   and cachorros.cor = 'branco'
    or cachorros.tamanho = 'grande';

Sem parênteses, alguém poderia pensar que ela equivale a:

SELECT cachorros.nome
  FROM cachorros
 WHERE cachorros.sexo = 'macho'
   and (cachorros.tamanho = 'branco' or cachorros.size = 'grande');

Mas a consulta original é processada como:

SELECT cachorros.nome
  FROM cachorros
 WHERE (cachorros.sexo = 'macho' and cachorros.cor = 'branco')
    or cachorros.tamanho = 'grande';
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/CharacterDatatypeUsage.html ================================================

Atualmente os tipos de dados VARCHAR e VARCHAR2 são idênticos. Mas para acomodar padrões SQL emergentes, o VARCHAR pode se tornar um tipo de dados diferente no futuro.

O tipo de dados CHAR não oferece nenhuma vantagem sobre o VARCHAR2 e faz com que a pesquisa seja mais difícil devido aos valores com espaços à direita.

declare
  var1 varchar(10); -- violação
  var2 char(10); -- violação
  
  var3 varchar2(10); -- ok
begin
  null;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/CollapsibleIfStatements.html ================================================

Una comandos if aninhados para melhorar a legibilidade do código.

Código em desconformidade

if condition1 then
  if condition2 then
    -- code
  end if;
end if;

Código correto

if condition1 and condition2 then
  -- code
end if;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/ColumnsShouldHaveTableName.html ================================================

Especifique o nome da tabela nas colunas de um comando SELECT para melhorar a legibilidade e evitar que o código pare de funcionar quando a tabela for alterada.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/CommitRollback.html ================================================

Geralmente, o contole de uma transação deve ser responsabilidade do "proprietário" dela. Se a transação foi iniciada por um código Java, o commit e rollback devem ser feitos no código Java.

Assim, nessa situação, chamar um COMMIT ou ROLLBACK a partir de um objeto de banco de dados é uma prática ruim e deve ser evitada.

Essa regra ignora procedimentos e funções com PRAGMA AUTONOMOUS_TRANSACTION.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/ComparisonWithBoolean.html ================================================

Remova literais booleanos de comparações para melhorar a legibilidade.

Código em desconformidade

if var = true then ...
if var = false then ...

Código correto

if var then ...
if not var then ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/ComparisonWithNull.html ================================================

Para testar por nulls, use apenas as comparações IS NULL e IS NOT NULL. Qualquer outra comparação com nulls resultará em NULL.

Lembre que uma string vazia é equivalente ao literal NULL.

Código em desconformidade

if var = null then
  -- code
end if;
Ou:
if var = '' then
  -- code
end if;

Código correto

if var is null then
  -- code
end if;
if other_var is null then
  -- code
end if;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/ConcatenationWithNull.html ================================================

Concatenar um valor VARCHAR2 com NULL não causa efeito nenhum. Sendo assim, o valor NULL deve ser removido.

Uma concatenação de qualquer outro tipo de dado com NULL causará uma conversão implícita para VARCHAR2. Se esse for o comportamento desejado, substitua a concatenação por uma chamada para TO_CHAR para tornar isso explícito. Veja esse exemplo:

var := NVL(''||id, 'Vazio');

Você deveria usar:

var := NVL(TO_CHAR(id), 'Vazio');
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/CursorBodyInPackageSpec.html ================================================

Declarações de cursores podem ser separadas em duas partes: especificação e corpo. Ao declarar um cursor em uma especificação de pacote, a especificação do pacote deveria conter apenas a especificação do cursor e o corpo do cursor deve ser incluído no corpo do pacote.

Em versões mais novas do Oracle Forms, o uso de cursores declarados com corpo em especificação de pacote também causa o erro de compilação "internal error [Unexpected fragile external reference.]".

Código em desconformidade

create or replace package pkg is
  cursor cur is
    select dummy from dual;
end;

Código correto

create or replace package pkg is
  type cur_type is record(dummy varchar2(1));
  cursor cur return cur_type;
end;
/
create or replace package body pkg is
  cursor cur return cur_type is
    select dummy from dual;
end;
/
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/DbmsOutputPut.html ================================================

A saída da chamada DBMS_OUTPUT.PUT/DBMS_OUTPUT.PUT_LINE não será visível quando SERVEROUTPUT estiver definido como OFF. Além disso, a menos que essa chamada seja explicitamente necessária, é melhor usar um mecanismo de logging em vez disso.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/DeadCode.html ================================================

Comandos como return, exit, continue, e raise alteram o fluxo para fora do bloco atual. Geralmente, qualquer comando em um bloco que estiver depois de um desses comandos é código desnecessário esperando para confundir alguém desavisado.

Código em desconformidade

begin
  raise my_error;
  log('finished'); -- esse código nunca será executado
end;

Código correto

begin
  raise my_error;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/DeclareSectionWithoutDeclarations.html ================================================

Você não precisa adicionar a palavra-chave DECLARE em um bloco se não há nenhuma declaração.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/DisabledTest.html ================================================

Quando um teste falha, por exemplo, devido a problemas de infraestrutura, você pode querer ignorá-lo temporariamente. Mas sem nenhum tipo de explicação do motivo do teste ter sido ignorado, talvez ele nunca seja reativado.

Essa regra registra um problema em cada teste desativado que não tem um comentário explicando o motivo disso.

Código em desconformidade

-- %test(my test)
-- %disabled
procedure test;

Código correto

-- %test(my test)
procedure test;

Exceções

A regra não registra um problema se houver um comentário na anotação %disabled.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/DuplicateConditionIfElsif.html ================================================

Uma sequência de instruções if/elsif é avaliada de cima para baixo. Apenas uma branch dessas instruções será executada de cada vez: a primeira que retornar true.

Assim, duplicar uma condição automaticamente leva a código inútil. Geralmente isso acontece por um erro ao copiar/colar. Na melhor situação isso é apenas código inútil e na pior das situações é um bug que provavelmente causará mais problemas na manutenção do código e obviamente pode levar a um comportamento inesperado.

Código em desconformidade

IF (param = 1) THEN
  open();
ELSIF (param = 2) THEN
  close();
ELSIF (param = 1) THEN // Incorreto
  move();
END IF;

Código correto

IF (param = 1) THEN
  open();
ELSIF (param = 2) THEN
  close();
ELSIF (param = 3) THEN
  move();
END IF;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/DuplicatedValueInIn.html ================================================

Valores duplicados em uma condição IN pode ser um erro ao copiar/colar sendo então um bug, ou simplesmente é código inútil e deve ser simplificado.

Código em desconformidade

if value in (a, a, b) then ...

Código correto

if value in (a, b) then ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/EmptyBlock.html ================================================

Na maioria das vezes um bloco de código está vazio quando realmente falta alguma implementação. Então tal bloco deve ser preenchido ou removido.

Código em desconformidade

begin
  null;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/EmptyStringAssignment.html ================================================

Para melhorar a legibilidade, evite usar strings vazias para representar NULL.

Código em desconformidade

var := '';

Código correto

var := null;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/ExplicitInParameter.html ================================================

Se não for informado, o modo padrão dos parâmetros é IN. Porém, definir ele explicitamente faz com que o código seja mais fácil de ler.

CREATE OR REPLACE PROCEDURE myproc(value VARCHAR2) IS -- violação
BEGIN
  NULL;
END;

CREATE OR REPLACE PROCEDURE myproc(value IN VARCHAR2) IS -- correto, o modo do parâmetro está definido
BEGIN
  NULL;
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/FunctionWithOutParameter.html ================================================

Funções com parâmetros OUT são difíceis de entender. É impossível dizer se um parâmetro é de entrada ou saída apenas olhando para a chamada da função Além disso, funções com parâmetros OUT não podem ser chamadas por SQL.

Código em desconformidade

CREATE OR REPLACE FUNCTION get_product_info(id IN NUMBER, value OUT NUMBER) RETURN VARCHAR2 IS
BEGIN
 ...
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/IdenticalExpression.html ================================================

Usar o mesmo valor nos dois lados de um operador é quase sempre um equívoco. Pode ser um erro causado por copiar/colar e então ser um bug ou simplesmente ser código desnecessários que deve ser simplificado.

Código em desconformidade

if a = a then ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/IfWithExit.html ================================================

Para melhorar a legibilidade sempre use EXIT WHEN em vez de um IF para sair de um loop.

Código em desconformidade

if condition1 then
  exit;
end if;

Código correto

exit when condition1;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/InequalityUsage.html ================================================

As formas "<>", "!=", "~=" and "^=" são equivalentes, mas apenas a forma "<>" está definida no padrão ANSI SQL.

Código em desconformidade

if a != b then

Código correto

if a <> b then
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/InsertWithoutColumns.html ================================================

Especifique as colunas em um comando insert para evitar que o código pare de funcionar após adicionar uma nova coluna na tabela.

Código em desconformidade

insert into tab values (1);

Código correto

insert into tab (col) values (1);
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/InvalidReferenceToObject.html ================================================

No Oracle Forms, vários procedimentos e funções precisam de uma refererência a um objeto (blocos, itens, alertas...). Infelizmente, a única forma de passar uma referência a um objeto é usando uma variável VARCHAR2 e essas referências não são verificadas pelo compilador.

Atualmente essa regra verifica os seguintes métodos:

Bultins para alertas:
  • FIND_ALERT
  • SET_ALERT_BUTTON_PROPERTY
  • SET_ALERT_PROPERTY
  • SHOW_ALERT
Bultins para blocos:
  • FIND_BLOCK
  • GET_BLOCK_PROPERTY
  • GO_BLOCK
  • SET_BLOCK_PROPERTY
Bultins para itens:
  • CHECKBOX_CHECKED
  • CONVERT_OTHER_VALUE
  • DISPLAY_ITEM
  • FIND_ITEM
  • GET_ITEM_INSTANCE_PROPERTY
  • GET_ITEM_PROPERTY
  • GET_RADIO_BUTTON_PROPERTY
  • GO_ITEM
  • IMAGE_SCROLL
  • IMAGE_ZOOM
  • IMAGE_ZOOM
  • PLAY_SOUND
  • READ_IMAGE_FILE
  • READ_SOUND_FILE
  • RECALCULATE
  • SET_ITEM_INSTANCE_PROPERTY
  • SET_ITEM_PROPERTY
  • SET_ITEM_PROPERTY
  • SET_RADIO_BUTTON_PROPERTY
  • SET_RADIO_BUTTON_PROPERTY
  • WRITE_IMAGE_FILE
  • WRITE_SOUND_FILE
Bultins para LOVs:
  • FIND_LOV
  • GET_LOV_PROPERTY
  • SET_LOV_COLUMN_PROPERTY
  • SET_LOV_PROPERTY
  • SHOW_LOV

Nota: essa regra é desativada automaticamente quando a propriedade sonar.plsql.forms.metadata do projeto não está definida.

. ================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/NotASelectedExpression.html ================================================

Em um SELECT DISTINCT com uma cláusula ORDER BY, se você especificar um valor no ORDER BY que não existe na cláusula SELECT, o Oracle retornará a exceção ORA-01791: not a SELECTed expression.

Veja esse exemplo:

SELECT DISTINCT item.name
  FROM item
 ORDER BY item.group_id

A coluna item.id não está na cláusula SELECT, então o Oracle causará um ORA-01791. A versão corrigida pode ser:

SELECT DISTINCT item.name, item.group_id
  FROM item
 ORDER BY item.group_id

Se uma coluna na cláusula SELECT tem um alias, você também pode usar o alias na cláusula ORDER BY:

-- consultas válidas
SELECT DISTINCT item.name AS full_name
  FROM item
 ORDER BY item.name;
 
SELECT DISTINCT item.name AS full_name
  FROM item
 ORDER BY full_name;

Esteja ciente de que até a versão 11.2.0.4, o Oracle aceitava alguns valores incorretos em ORDER BY, como:

SELECT DISTINCT UPPER(item.name) AS full_name, item.group_id
  FROM item
 ORDER BY item.name -- deveria ser "UPPER(item.name)" ou "full_name" 

Você deve corrigir as consultas para evitar problemas de compatibilidade com versões mais novas do Oracle.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/NotFound.html ================================================

Use cursor%NOTFOUND em vez de NOT cursor%FOUND.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/NvlWithNullParameter.html ================================================

A função NVL serve para substituir um valor nulo por um valor válido. Então, não especifque o literal NULL ou uma string vazia como parâmetro de uma chamada para NVL.

Código em desconformidade

var := nvl(x, '');
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/ParsingError.html ================================================

Quando o parser PL/SQL falha é possível registrar essa falha como uma violação no arquivo. Dessa forma, é possível registrar o número de arquivos que não foram processados pelo parser e também identificar facilmente porque eles não foram entendidos.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/QueryWithoutExceptionHandling.html ================================================

Geralmente você deve adicionar um bloco de tratamento de exceptions para comandos SELECT, para evitar exceções inesperadas.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/RaiseStandardException.html ================================================

Você deve revisar todos os comandos RAISE que causam exceções pré-definidas, porque normalmente esse é um sinal de lógica ruim. Considere esse exemplo:

CREATE OR REPLACE FUNCTION grupo_tem_usuario(id IN NUMBER) RETURN BOOLEAN IS
  tem_usuario BOOLEAN;
  usuario_id  usuario_grupo.usuario_id%TYPE;
BEGIN
  BEGIN
    SELECT usuario_grupo.usuario_id
      INTO grupo_id
      FROM usuario_grupo
     WHERE usuario_grupo.grupo_id = id;
     
    RAISE TOO_MANY_ROWS;
  EXCEPTION
    WHEN NO_DATA_FOUND THEN
      tem_usuario := FALSE;
    WHEN TOO_MANY_ROWS THEN
      tem_usuario := TRUE;
  END;
  
  RETURN tem_usuario;
END;

Nesse caso, a exceção TOO_MANY_ROWS está sendo usada como mecanismo de controle de fluxo. Essa função poderia ser reescrita para evitar o comando RAISE:

CREATE OR REPLACE FUNCTION grupo_tem_usuario(id IN NUMBER) RETURN BOOLEAN IS
  numero_de_usuarios NUMBER;
BEGIN
  BEGIN
    SELECT COUNT(*)
      INTO numero_de_usuarios
      FROM usuario_grupo
     WHERE usuario_grupo.grupo_id = id;
  EXCEPTION
    WHEN OTHERS THEN
      numero_de_usuarios := 0;
  END;
  
  RETURN numero_de_usuarios > 0;
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/RedundantExpectation.html ================================================

De acordo com a documentação do utPLSQL:

A validação do código sob teste (a lógica testada do procedimento/função/etc.) é executada comparando os dados reais com os dados esperados. O utPLSQL usa uma combinação de expectativa e um comparador para executar a validação nos dados.

Algumas validações são escritas no formato ut.expect(valor_real).matcher(valor_esperado). Essa regra verifica se o valor_real e o valor_esperado são a mesma coisa. Exemplo:

...
begin
  v_expected := '2345';
  v_actual := betwnstr('1234567', 2, 5);
  ut.expect(v_actual).to_equal(v_actual); -- Essa expectativa está errada, ela é sempre verdadeira
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/ReturnOfBooleanExpression.html ================================================

O retorno de literais boolean envolvidos em um IF-THEN-ELSE devem ser simplificados.

Código em desconformidade

IF expression THEN
  RETURN TRUE;
ELSE
  RETURN FALSE;
END IF;

Código correto

RETURN expression;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/SameBranch.html ================================================

Ter duas branches na mesma estrutura if com a mesma implementação é código duplicado na melhor das hipóteses, na pior é um erro de programação. Se a mesma lógica é realmente necessária para as duas situações, então as condições devem ser combinadas.

Código em desconformidade

IF var BETWEEN 0 AND 10 THEN
  do_the_thing();
ELSIF var BETWEEN 10 AND 20 THEN
  do_the_thing(); -- Noncompliant; duplicates first condition
ELSIF var BETWEEN 20 AND 50 THEN
  do_the_another_thing();
ELSE
  do_the_rest()
END IF;

Código correto

IF var BETWEEN 0 AND 10 THEN
  do_the_thing();
ELSIF var BETWEEN 10 AND 20 THEN
  do_the_second_thing();
ELSIF var BETWEEN 20 AND 50 THEN
  do_the_another_thing();
ELSE
  do_the_rest()
END IF;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/SameCondition.html ================================================

Duplicar uma condição em uma comparação é quase sempre um equívoco. Pode ser um erro causado por copiar/colar e então ser um bug ou simplesmente ser código desnecessários que deve ser simplificado.

Código em desconformidade

IF (x = 1) AND (x = 1) THEN ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/SelectAllColumns.html ================================================

SELECT * retorna todas as colunas disponíveis. Você deve listar explicitamente as colunas necessárias. Ao usar *, você deve considerar a possibilidade de novas colunas serem adicionadas à tabela no futuro.

Código em desconformidade

begin
  select *
    into var
    from emp;
  
  select emp.*
    into var
    from emp;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/SelectWithRownumAndOrderBy.html ================================================

Em uma expressão SELECT, a cláusula WHERE é executada antes da cláusula ORDER BY. Considere esse exemplo:

DECLARE
  CURSOR usuarios_recentes IS
    SELECT usuario.nome,
           usuario.data_de_criacao
      FROM usuario
     WHERE ROWNUM <= 5
     ORDER BY usuario.data_de_criacao DESC;
BEGIN
  ...

Essa consulta não retornará os últimos 5 usuários criados. O banco de dados filtrará os usuários sem nenhuma ordenação e só então aplicará a cláusula ORDER BY. A consulta corrigida é:

DECLARE
  CURSOR usuarios_recentes IS
    SELECT nome,
           data_de_criacao
      FROM (SELECT usuario.nome,
                   usuario.data_de_criacao
              FROM usuario
             ORDER BY user.data_de_criacao DESC)
     WHERE ROWNUM <= 5;
BEGIN
  ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/ToCharInOrderBy.html ================================================

O uso da função TO_CHAR em um ORDER BY quase sempre é um erro. O valor da coluna será ordenado alfabeticamente em vez de ser ordenado de acordo com o tipo de dados da coluna.

Código em desconformidade

Supondo que temos os dados abaixo na tabela EMP:

empno hiredate
1 2019-10-01
5 2019-10-10
15 2018-10-02
20 2018-10-20
As consultas abaixo retornam um resultado indesejado:

select empno from emp order by to_char(empno);

empno
1
15
20
5

select hiredate from emp order by to_char(hiredate, 'dd-mm-rrrr');

hiredate
01-OCT-19
02-OCT-18
10-OCT-19
20-OCT-18

Código correto

Para ordernar essa colunas corretamente precisamos remover a chamada para TO_CHAR.

select empno from emp order by empno;

empno
1
5
15
20

select hiredate from emp order by hiredate;

hiredate
02-OCT-18
20-OCT-18
01-OCT-19
10-OCT-19
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/ToDateWithoutFormat.html ================================================

Sempre especifique o formato da data nas chamadas para TO_DATE.

Código em desconformidade

begin
  var := to_date('2015-01-01');
end;

Código correto

begin
  var := to_date('2015-01-01', 'YYYY-MM-DD');
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/TooManyRowsHandler.html ================================================

Quando um comando SELECT INTO causa a exceção pré-definida TOO_MANY_ROWS os valores das variáveis na cláusula INTO ficam indefinidos.

Código em desconformidade

begin
  select empno
    into var
    from emp;
exception
  when too_many_rows then
    null;
end;

Código correto

begin
  select empno
    into var
    from emp;
exception
  when too_many_rows then
    var := null;
end;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/UnhandledUserDefinedException.html ================================================

Quando uma exceção é declarada e não é tratada no código, lançar essa exceção causa o erro "ORA-06510: PL/SQL: unhandled user-defined exception" no banco de dados ou o erro "User-defined exception" no Oracle Forms.

É uma boa prática sempre tratar exceções personalizadas.

Código em desconformidade

DECLARE
  my_exception EXCEPTION;
BEGIN
  ...
  RAISE my_exception; -- isso causará um "user-defined exception"
END;

Código correto

DECLARE
  my_exception EXCEPTION;
BEGIN
  ...
  RAISE my_exception;
EXCEPTION
  WHEN my_exception THEN
    ...
END;

Essa verificação também registrará uma violação se a exceção é tratada por um OTHERS e que tem uma referência a SQLERRM. Nessa situação, a variável SQLERRM retornará "User-defined exception", o que não é muito útil.

DECLARE
  my_exception EXCEPTION;
BEGIN
  ...
  RAISE my_exception;
EXCEPTION
  WHEN OTHERS THEN
    log(SQLERRM);
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/UnnecessaryAliasInQuery.html ================================================

Um alias pode ser usado em tabelas quando você pretende adicionar a mesma tabela mais que uma vez na cláusula FROM (por exemplo, em self join) ou para reduzir o nome da tabela para tornar a instrução SQL menor e mais fácil de ler. Mas se forem abusados, os aliases podem ter o efeito oposto: diminuir a legibilidade.

Prefira usar aliases apenas quando a tabela aparece mais de uma vez em uma consulta.

Código em desconformidade

SELECT a.id,
       b.id,
       b.name
  FROM employee a,
       dept b
 WHERE a.dept_id = b.id;

Código correto

SELECT employee.id,
       dept.id,
       dept.name
  FROM employee,
       dept
 WHERE employee.dept_id = dept.id;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/UnnecessaryElse.html ================================================

Quando a cláusula IF de uma estrutura IF-THEN-ELSE não completa normalmente, a cláusa ELSE é desnecessária.

Código em desconformidade

BEGIN
  IF condition THEN
    RETURN value;
  ELSE
    value := NULL;
  END IF;
END;

Código correto

BEGIN
  IF condition THEN
    RETURN value;
  END IF;
  
  value := NULL;
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/UnnecessaryLike.html ================================================

Usar uma condição LIKE sem um curinga (% ou _) é suspeito. Um desenvolvedor pode supor que o curinha foi esquecido ou se deveria ser um teste de igualdade.

Código em desconformidade

if (last_name like 'Smith') ...

Código correto

if (last_name like 'Smith%') ...

-- or
if (last_name = 'Smith') ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/UnnecessaryNullStatement.html ================================================ Uma instrução NULL no mesmo nível de outras instruções é inútil, portanto deve ser removida.

Código em desconformidade

BEGIN
  var := 1;
  NULL; -- essa instrução NULL pode ser removida
END

Código correto

BEGIN
  var := 1;
END
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/UnusedCursor.html ================================================

Se um cursor é declarado mas não é usado, é código inútil e deve ser removido. Fazer isso melhorará a manutenibilidade porque os desenvolvedores não terão que se preocupar com qual seria a utilidade do cursor.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/UnusedParameter.html ================================================

Parâmetros não usados causam confusão. Não importa quais valores sejam passados para tais parâmetros, o comportamento do método será o mesmo.

Código em desconformidade

PROCEDURE do_something(a IN NUMBER, b IN NUMBER) IS -- "b" is unused
BEGIN
  compute(a);
END;

Código correto

PROCEDURE do_something(a IN NUMBER) IS
BEGIN
  compute(a);
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/UnusedVariable.html ================================================

Se uma variável local é declarada mas não é usada, é código inútil e deve ser removida. Fazer isso melhorará a manutenibilidade porque os desenvolvedores não terão que se preocupar com qual seria a utilidade da variável.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/UselessParenthesis.html ================================================

Parênteses desnecessários podem às vezes ser confusos e por isso devem ser removidos.

Código em desconformidade

if ((a = b)) then ...

Código correto

if (a = b) then ...
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/VariableHiding.html ================================================

Redeclarar variáveis em um escopo mais interno é permitido no PL/SQL, mas pode causar confusão e por isso deve ser evitado.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/VariableInCount.html ================================================ Usar a built-in COUNT com variáveis locais é confuso e na maioria das vezes é um erro de programação.

Código em desconformidade

DECLARE
  v_empno emp.empno%TYPE;
  ...
BEGIN
  
  -- Como a variável v_empno é NULL nesse ponto, esse COUNT sempre retornará 0.
  SELECT COUNT(v_empno)
    INTO i
    FROM employee
   WHERE employee.deptno = v_deptno;
END;

Código correto

BEGIN
  SELECT COUNT(*)
    INTO i
    FROM employee
   WHERE employee.deptno = v_deptno;
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/VariableInitializationWithFunctionCall.html ================================================

Se a inicialização falhar você não será capaz de tratar o erro no bloco de exceções.

Código em desconformidade

DECLARE
  employee_name emp.name%TYPE := get_employee_name(id => 5);
BEGIN
  ...
END;

Código correto

DECLARE
  employee_name emp.name%TYPE;
BEGIN
  employee_name := get_employee_name(id => 5);
  ...
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/VariableInitializationWithNull.html ================================================

Por padrão, novas variáveis e campos de um RECORD são inicializados com NULL. Então você não precisa inicializá-las com NULL.

================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/VariableName.html ================================================

Essa regra verifica se os nomes de todas as variáveis são aceitos na expressão regular fornecida.

Examplo

Considerando a expressão regular padrão:

DECLARE
  dept_name dept.name%type; -- Correto
  dept_name_ dept.name%type; -- Em desconformidade
BEGIN
  ...
END;
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR/rules/plsql/XPath.html ================================================

Essa regra permite a definição de regras personalizadas usando expressões XPath.

Os problemas são criados dependendo do retorno da expressão XPath. Se a expressão XPath retornar:

  • um único nó ou uma lista de nós AST, então um problema é criado para cada nó com a mensagem definida
  • um boolean, então um problema a nível de arquivo é criado com a mensagem definida se o boolean for verdadeiro
  • qualquer outra situação, nenhum problema é criado
================================================ FILE: zpa-checks/src/main/resources/org/sonar/l10n/plsqlopen_pt_BR.properties ================================================ AddParenthesesInNestedExpression.message=Adicione parnteses em volta dessa condio AND para tornar a precedncia dos operadores mais explcita. AddParenthesesInNestedExpression.name=Adicione parnteses em expresses aninhadas CharacterDatatypeUsage.message=Use VARCHAR2 em vez de {0}. CharacterDatatypeUsage.name=Use VARCHAR2 em vez de CHAR ou VARCHAR CollapsibleIfStatements.message=Esse comando IF pode ser unido com o IF do nvel acima. CollapsibleIfStatements.name=Comandos "if" aninhados devem ser unificados ColumnsShouldHaveTableName.message=Especifique a tabela da coluna "{0}". ColumnsShouldHaveTableName.name=As colunas em um SELECT devem ter o nome da tabela CommitRollback.message=Evite {0} a menos que esteja em uma transao autnoma. CommitRollback.name=Evite COMMIT/ROLLBACK em objetos do banco de dados ComparisonWithBoolean.message=Remova o literal "{0}" dessa comparao. ComparisonWithBoolean.name=Evite comparaes desnecessrias com literais booleanos ComparisonWithNull.message=Corrija essa comparao ou altere para "{0}". ComparisonWithNull.name=No compare valores com o literal NULL ou uma string vazia ConcatenationWithNull.message=Revise essa concatenao com valor NULL. ConcatenationWithNull.name=Concatenao desnecessria com valor NULL CursorBodyInPackageSpec.message=Mova o corpo do cursor "{0}" para o corpo do pacote. CursorBodyInPackageSpec.name=No declare corpos de cursores em uma especificao de pacote DbmsOutputPut.message=Evite chamadas diretas aos procedimentos DBMS_OUTPUT. DbmsOutputPut.name=Evite chamadas diretas aos procedimentos DBMS_OUTPUT DeadCode.message=Esse cdigo nunca ser executado. DeadCode.name=Cdigo morto deve ser removido DeclareSectionWithoutDeclarations.message=Remova essa palavra-chave DECLARE. DeclareSectionWithoutDeclarations.name=No adicione a palavra-chave DECLARE quando o bloco no conter nenhuma declarao DisabledTest.message=Corrija ou remova esse teste unitrio desativado. DisabledTest.name=Testes no devem ser desativados DuplicateConditionIfElsif.message=Esse cdigo no ser executado porque a condio duplica uma condio anterior desse mesmo comando "if/elsif". DuplicateConditionIfElsif.name=Instrues "if/elsif" relacionadas no podem ter a mesma condio DuplicatedValueInIn.message=Remova ou corrija o valor duplicado "{0}" nessa condio IN. DuplicatedValueInIn.name=Valor duplicado em uma condio IN EmptyBlock.message=Remova ou preencha esse bloco de cdigo. EmptyBlock.name=Blocos vazios devem ser removidos EmptyStringAssignment.message=Substitua essa string vazia por NULL. EmptyStringAssignment.name=Evite usar strings vazias para representar NULL ExplicitInParameter.message=Declare explicitamente esse parmetro como IN. ExplicitInParameter.name=O modo do parmetro deve estar definido explicitamente FunctionWithOutParameter.message=Reescreva essa funo para no depender de parmetros OUT. FunctionWithOutParameter.name=Evite funes com parmetros OUT IdenticalExpression.message=Expresses idnticas nos dois lados do operador "{0}". IdenticalExpression.name=Expresses idnticas no devem ser usadas nos dois lados de um operador IfWithExit.message=Substitua esse IF ... EXIT por um comando EXIT WHEN. IfWithExit.name=Use EXIT WHEN em vez de um comando IF para sair de um loop InequalityUsage.message=Substitua "{0}" por "<>". InequalityUsage.name=Apenas o operador "<>" deve ser usado para testar diferena InsertWithoutColumns.message=Especifique as colunas nesse INSERT. InsertWithoutColumns.name=Sempre especifique as colunas em um comando INSERT InvalidReferenceToObject.message=Referncia invlida para o objeto "{0}" nessa chamada para {1}. InvalidReferenceToObject.name=Referncia invlida para objeto do Oracle Forms NotASelectedExpression.message=Esse valor no existe na clusula SELECT. Corrija essa expresso ou adicione esse valor no SELECT. NotASelectedExpression.name=Os itens de um ORDER BY devem existir na consulta caso ela seja um SELECT DISTINCT NotFound.message=Use %NOTFOUND em vez de NOT ...%FOUND. NotFound.name=Use cursor%NOTFOUND em vez de NOT cursor%FOUND NvlWithNullParameter.message=Esse NVL no tem nenhum efeito. Corrija o parmetro {0} ou remova esse NVL. NvlWithNullParameter.name=No passe o literal NULL ou uma string vazia para o NVL ParsingError.message=Esse trecho de cdigo no foi identificado corretamente pelo parser. Nenhum problema ser reportado nele. ParsingError.name=Falha no parser QueryWithoutExceptionHandling.message=Trate as excees dessa consulta. QueryWithoutExceptionHandling.name=Evite consultas sem um bloco de tratamento de excees QueryWithoutExceptionHandling.param.strictMode=Se falso, permite que blocos internos fiquem sem tratamento de exceo. RaiseStandardException.message=Evite lanar a exceo padro {0}. RaiseStandardException.name=Evite lanar excees pr-definidas RedundantExpectation.message=Essa expectativa de teste redundante. O valor testado o mesmo que usado no comparador. RedundantExpectation.name=Expectativas de teste no devem ser redundantes ReturnOfBooleanExpression.message=Substitua esse if-then-else por um nico comando RETURN. ReturnOfBooleanExpression.name=O retorno de expresses boolean no deve estar dentro de um comando "if-then-else" SameBranch.message=Una essa branch com o cdigo idntico na linha {0} or altere uma das implementaes. SameBranch.name=Branches da mesma estrutura condicional no devem ter exatamente a mesma implementao SameCondition.message=Essa condio duplica a que est na linha {0}. SameCondition.name=Condies idnticas no devem estar duplicadas SelectAllColumns.message=SELECT * no deve ser usado. SelectAllColumns.name=SELECT * no deve ser usado SelectWithRownumAndOrderBy.message=Mova essa comparao com ROWNUM para um nvel mais externo para garantir a ordenao. SelectWithRownumAndOrderBy.name=Um SELECT no pode ter uma comparao com ROWNUM e um ORDER BY no mesmo nvel ToCharInOrderBy.message=Esse TO_CHAR pode estar fazendo com que os registros sejam retornados na ordem incorreta. ToCharInOrderBy.name=Evite TO_CHAR em uma clusula ORDER BY ToDateWithoutFormat.message=Especifique o formato da data nesse TO_DATE. ToDateWithoutFormat.name=TO_DATE sem formato da data TooManyRowsHandler.message=Trate as variveis utilizadas em comandos SELECT INTO aqui para que elas no fiquem com valores indefinidos. TooManyRowsHandler.name=Evite mascarar a exceo TOO_MANY_ROWS UnhandledUserDefinedException.message=No h um tratamento para a exceo "{0}" aqui. Isso causar o erro "user-defined exception". UnhandledUserDefinedException.name=Excees definidas pelo usurio devem ser tratadas UnnecessaryAliasInQuery.message=Esse comando tem apenas uma referncia para a tabela "{0}". Remova o alias "{1}" para tornar o cdigo mais legvel. UnnecessaryAliasInQuery.name=Alias desnecessrio em tabela UnnecessaryAliasInQuery.param.acceptedLength=Ignorar alias com tamanho maior ou igual a esse UnnecessaryElse.message=Esse ELSE pode ser substitudo por um END IF. Se IF correspondente for executado, a execuo do cdigo ser interrompida. Caso contrrio, o cdigo dentro desse ELSE ser sempre executado, estando dentro de um ELSE ou no. UnnecessaryElse.name=Clusula ELSE desnecessria UnnecessaryLike.message=Essa condio LIKE no est utilizando nenhum curinga. Substituia por um comparador de igualdade ou adicione um curinga. UnnecessaryLike.name=No use condies LIKE sem curingas UnnecessaryNullStatement.message=Essa instruo NULL no tem nenhum efeito aqui. UnnecessaryNullStatement.name=Instruo NULL desnecessria UnusedCursor.message=Remova esse cursor "{0}" no utilizado. UnusedCursor.name=Cursores no utilizados devem ser removidos UnusedParameter.message=Remova esse parmetro "{0}" no utilizado. UnusedParameter.name=Parmetros no utilizados devem ser removidos UnusedParameter.param.ignoreMethods=Expresso regular que identifica os nomes de mtodos que devem ser ignorados nessa validao UnusedVariable.message=Remova essa varivel local "{0}" no utilizada. UnusedVariable.name=Variveis no utilizadas devem ser removidas UselessParenthesis.message=Remova esses parnteses desnecessrios. UselessParenthesis.name=Parnteses desnecessrios em expresses devem ser removidos para evitar qualquer mal entendido VariableHiding.message=Essa varivel "{0}" oculta a declarao da linha {1}. VariableHiding.name=No redeclare variveis em um escopo mais interno VariableInCount.message=Parece que h uma varivel "{0}" nesse contexto. Revise se esse COUNT est correto. VariableInCount.name=No passe variveis para a funo COUNT VariableInitializationWithFunctionCall.message=Mova essa inicializao para o bloco BEGIN...END. VariableInitializationWithFunctionCall.name=Evite inicializar variveis com chamadas de funes na seo de declaraes VariableInitializationWithNull.message=Remova essa inicializao desnecessria para NULL. VariableInitializationWithNull.name=Variveis e campos de um RECORD no precisam ser inicializados com NULL VariableName.message=Renomeie {0} para corresponder expresso regular {1}. VariableName.name=As variveis devem seguir o padro de nomenclatura XPath.name=Controle violaes a partir de uma expresso XPath ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/AddParenthesesInNestedExpressionCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class AddParenthesesInNestedExpressionCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("add_parentheses_in_nested_expression.sql"), AddParenthesesInNestedExpressionCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/BaseCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.BeforeEach import java.util.* abstract class BaseCheckTest { @BeforeEach fun setUp() { Locale.setDefault(Locale.ENGLISH) } protected fun getPath(filename: String) = defaultResourceFolder + filename companion object { private const val defaultResourceFolder = "src/test/resources/checks/" } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/CharacterDatatypeUsageCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class CharacterDatatypeUsageCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("character_datatype_usage.sql"), CharacterDatatypeUsageCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/CheckListTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import java.io.File class CheckListTest { /** * Enforces that each check declared in list. */ @Test fun count() { val files = File("src/main/kotlin/com/felipebz/zpa/checks/") .list { _, name -> name.contains("Check.") && !name.startsWith("Abstract") } .map { File(it).nameWithoutExtension } .toTypedArray() assertThat(CheckList.checks.map { it.simpleName }).containsExactlyInAnyOrder(*files) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/CollapsibleIfStatementsCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class CollapsibleIfStatementsCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("collapsible_if_statements.sql"), CollapsibleIfStatementsCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/ColumnsShouldHaveTableNameCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class ColumnsShouldHaveTableNameCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("columns_should_have_table_name.sql"), ColumnsShouldHaveTableNameCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/CommitRollbackCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class CommitRollbackCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("commit_rollback.sql"), CommitRollbackCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/ComparisonWithBooleanCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class ComparisonWithBooleanCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("comparison_with_boolean.sql"), ComparisonWithBooleanCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/ComparisonWithNullCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class ComparisonWithNullCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("comparison_with_null.sql"), ComparisonWithNullCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/ConcatenationWithNullCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class ConcatenationWithNullCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("concatenation_with_null.sql"), ConcatenationWithNullCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/CursorBodyInPackageSpecCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class CursorBodyInPackageSpecCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("cursor_body_in_package_spec.sql"), CursorBodyInPackageSpecCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/DbmsOutputPutCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class DbmsOutputPutCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("dbms_output_put.sql"), DbmsOutputPutCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/DeadCodeCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class DeadCodeCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("dead_code.sql"), DeadCodeCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/DeclareSectionWithoutDeclarationsCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class DeclareSectionWithoutDeclarationsCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("declare_section_without_declarations.sql"), DeclareSectionWithoutDeclarationsCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/DisabledTestCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class DisabledTestCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("disabled_test.sql"), DisabledTestCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/DuplicateConditionIfElsifCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class DuplicateConditionIfElsifCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("duplicate_condition_if_elsif.sql"), DuplicateConditionIfElsifCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/DuplicatedValueInInCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class DuplicatedValueInInCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("duplicated_value_in_in.sql"), DuplicatedValueInInCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/EmptyBlockCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class EmptyBlockCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("empty_block.sql"), EmptyBlockCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/EmptyStringAssignmentCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class EmptyStringAssignmentCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("empty_string_assignment.sql"), EmptyStringAssignmentCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/ExplicitInParameterCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class ExplicitInParameterCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("explicit_in_parameter.sql"), ExplicitInParameterCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/FunctionWithOutParameterCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class FunctionWithOutParameterCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("function_with_out_parameter.sql"), FunctionWithOutParameterCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/IdenticalExpressionCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class IdenticalExpressionCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("identical_expression.sql"), IdenticalExpressionCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/IfWithExitCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class IfWithExitCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("if_with_exit.sql"), IfWithExitCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/InequalityUsageCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class InequalityUsageCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("inequality_usage_check.sql"), InequalityUsageCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/InsertWithoutColumnsCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class InsertWithoutColumnsCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("insert_without_columns.sql"), InsertWithoutColumnsCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/InvalidReferenceToObjectCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier import com.felipebz.zpa.metadata.Block import com.felipebz.zpa.metadata.FormsMetadata class InvalidReferenceToObjectCheckTest : BaseCheckTest() { @Test fun test() { val metadata = FormsMetadata() metadata.alerts = listOf("foo") metadata.blocks = listOf(Block("foo", arrayOf("item1"))) metadata.lovs = listOf("foo") PlSqlCheckVerifier.verify(getPath("invalid_reference_to_object.sql"), InvalidReferenceToObjectCheck(), metadata) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/NotASelectedExpressionCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class NotASelectedExpressionCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("not_a_selected_expression.sql"), NotASelectedExpressionCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/NotFoundCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class NotFoundCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("not_found.sql"), NotFoundCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/NvlWithNullParameterCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class NvlWithNullParameterCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("nvl_with_null_parameter.sql"), NvlWithNullParameterCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/ParsingErrorCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.RecognitionException import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import com.felipebz.zpa.parser.PlSqlParser import com.felipebz.zpa.squid.PlSqlConfiguration import com.felipebz.zpa.api.PlSqlVisitorContext import java.io.File import java.nio.charset.StandardCharsets class ParsingErrorCheckTest : BaseCheckTest() { @Test fun test() { val file = File("src/test/resources/checks/parsing_error.sql") val parser = PlSqlParser.create(PlSqlConfiguration(StandardCharsets.UTF_8)) val context: PlSqlVisitorContext try { parser.parse(file) throw IllegalStateException("Expected RecognitionException") } catch (e: RecognitionException) { context = PlSqlVisitorContext(null, e, null) } val check = ParsingErrorCheck() val issues = check.scanFileForIssues(context) assertThat(issues).hasSize(1) assertThat(issues[0].primaryLocation().startLine()).isEqualTo(1) } @Test fun testTolerantParsing() { val file = File("src/test/resources/checks/parsing_error.sql") val parser = PlSqlParser.create(PlSqlConfiguration(StandardCharsets.UTF_8, isErrorRecoveryEnabled = true)) val rootTree = parser.parse(file) val context = PlSqlVisitorContext(rootTree, null, null) val check = ParsingErrorCheck() val issues = check.scanFileForIssues(context) assertThat(issues).hasSize(1) assertThat(issues[0].primaryLocation().startLine()).isEqualTo(1) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/QueryWithoutExceptionHandlingCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class QueryWithoutExceptionHandlingCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("query_without_exception_handling.sql"), QueryWithoutExceptionHandlingCheck()) } @Test fun testNoStrict() { val check = QueryWithoutExceptionHandlingCheck() check.strictMode = false PlSqlCheckVerifier.verify(getPath("query_without_exception_handling_no_strict.sql"), check) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/RaiseStandardExceptionCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class RaiseStandardExceptionCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("raise_standard_exception.sql"), RaiseStandardExceptionCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/RedundantExpectationCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class RedundantExpectationCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("redundant_expectation.sql"), RedundantExpectationCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/ReturnOfBooleanExpressionCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class ReturnOfBooleanExpressionCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("return_of_boolean_expression.sql"), ReturnOfBooleanExpressionCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/SameBranchCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class SameBranchCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("same_branch.sql"), SameBranchCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/SameConditionCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class SameConditionCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("same_condition.sql"), SameConditionCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/SelectAllColumnsCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class SelectAllColumnsCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("select_all_columns.sql"), SelectAllColumnsCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/SelectWithRownumAndOrderByCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class SelectWithRownumAndOrderByCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("select_with_rownum_and_order_by.sql"), SelectWithRownumAndOrderByCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/ToCharInOrderByCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class ToCharInOrderByCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("to_char_in_order_by.sql"), ToCharInOrderByCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/ToDateWithoutFormatCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class ToDateWithoutFormatCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("to_date_without_format.sql"), ToDateWithoutFormatCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/TooManyRowsHandlerCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class TooManyRowsHandlerCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("too_many_rows_handler.sql"), TooManyRowsHandlerCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/UnhandledUserDefinedExceptionCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class UnhandledUserDefinedExceptionCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("unhandled_user_defined_exception.sql"), UnhandledUserDefinedExceptionCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/UnnecessaryAliasInQueryCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class UnnecessaryAliasInQueryCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("unnecessary_alias_in_query.sql"), UnnecessaryAliasInQueryCheck()) } @Test fun test2() { val check = UnnecessaryAliasInQueryCheck() check.acceptedLength = 4 PlSqlCheckVerifier.verify(getPath("unnecessary_alias_in_query_custom_length.sql"), check) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/UnnecessaryElseCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class UnnecessaryElseCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("unnecessary_else.sql"), UnnecessaryElseCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/UnnecessaryLikeCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class UnnecessaryLikeCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("unnecessary_like.sql"), UnnecessaryLikeCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/UnnecessaryNullStatementCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class UnnecessaryNullStatementCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("unnecessary_null_statement.sql"), UnnecessaryNullStatementCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/UnusedCursorCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class UnusedCursorCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("unused_cursor.sql"), UnusedCursorCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/UnusedParameterCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class UnusedParameterCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("unused_parameter.sql"), UnusedParameterCheck()) } @Test fun testIgnoreMethodsByName() { val check = UnusedParameterCheck() check.ignoreMethods = "(on_.*|fullmatch)" PlSqlCheckVerifier.verify(getPath("unused_parameter_ignore_methods.sql"), check) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/UnusedVariableCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class UnusedVariableCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("unused_variable.sql"), UnusedVariableCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/UselessParenthesisCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class UselessParenthesisCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("useless_parenthesis.sql"), UselessParenthesisCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/VariableHidingCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class VariableHidingCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("variable_hiding.sql"), VariableHidingCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/VariableInCountCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class VariableInCountCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("variable_in_count.sql"), VariableInCountCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/VariableInitializationWithFunctionCallCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class VariableInitializationWithFunctionCallCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("variable_initialization_with_function_call.sql"), VariableInitializationWithFunctionCallCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/VariableInitializationWithNullCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class VariableInitializationWithNullCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("variable_initialization_with_null.sql"), VariableInitializationWithNullCheck()) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/VariableNameCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier class VariableNameCheckTest : BaseCheckTest() { @Test fun test() { PlSqlCheckVerifier.verify(getPath("variable_name.sql"), VariableNameCheck()) } @Test fun testIgnoreMethodsByName() { val check = VariableNameCheck() check.regexp = "\\w{3,}" PlSqlCheckVerifier.verify(getPath("variable_name_alternative.sql"), check) } } ================================================ FILE: zpa-checks/src/test/kotlin/com/felipebz/zpa/checks/XPathCheckTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import com.felipebz.zpa.checks.verifier.PlSqlCheckVerifier import com.felipebz.zpa.squid.AnalysisException class XPathCheckTest : BaseCheckTest() { @Test fun line_level_issue() { analyze("xpath_statement.sql", "//STATEMENT") } @Test fun boolean_true_result() { analyze("xpath_count_statement.sql", "count(//STATEMENT) > 0") } @Test fun boolean_false_result() { analyze("xpath.sql", "count(//STATEMENT) < 0") } @Test fun integer_xpath_result() { analyze("xpath.sql", "count(//STATEMENT)") } @Test fun empty_query() { analyze("xpath.sql", "") } @Test fun invalid_query() { assertThrows { analyze("xpath.sql", "+++") } } private fun analyze(fileName: String, xpathQuery: String) { val check = XPathCheck() check.xpathQuery = xpathQuery check.message = MESSAGE PlSqlCheckVerifier.verify("src/test/resources/checks/$fileName", check) } companion object { private const val MESSAGE = "Avoid statements" } } ================================================ FILE: zpa-checks/src/test/resources/checks/add_parentheses_in_nested_expression.sql ================================================ begin var := (x = 1 or x = 2 and y = 3); -- Noncompliant {{Add parentheses around this AND condition to make the operator precedence explicit.}} -- ^^^^^^^^^^^^^^^ var := (x = 1 or x = 2 and y = 3 or -- Noncompliant -- ^^^^^^^^^^^^^^^ x = 4 and y = 5); -- Noncompliant -- ^^^^^^^^^^^^^^^ select 1 into var from dual where x = 1 or x = 2 -- Noncompliant [[sc=10;el=+1;ec=15]] and y = 3; -- correct var := (x = 1 or (x = 2 and y = 3)); var := (x = 1 or (x = 2 and y = 3) or (x = 4 and y = 5)); select 1 into var from dual where x = 1 or (x = 2 and y = 3); end; ================================================ FILE: zpa-checks/src/test/resources/checks/character_datatype_usage.sql ================================================ declare var1 varchar(10); -- Noncompliant {{Use VARCHAR2 instead of VARCHAR.}} var2 char(10); -- Noncompliant {{Use VARCHAR2 instead of CHAR.}} var3 varchar2(10); -- compliant begin null; end; ================================================ FILE: zpa-checks/src/test/resources/checks/collapsible_if_statements.sql ================================================ begin -- can be collapsed if x = 1 then if y = 2 then -- Noncompliant {{This IF statement can be merged with the enclosing one.}} null; end if; end if; if x = 1 then if y = 2 then -- Noncompliant if z = 3 then -- Noncompliant null; end if; end if; end if; -- cannot be collapsed -- if with elsif if x = 1 then if y = 2 then null; end if; elsif x = 2 then null; end if; -- if with else if x = 1 then if y = 2 then null; end if; else null; end if; -- if with more than 1 statement if x = 1 then null; if y = 2 then null; end if; end if; if x = 1 then if y = 2 then null; end if; null; end if; -- internal if has elsif/else if x = 1 then if y = 2 then null; elsif y = 3 then null; else null; end if; elsif x = 2 then null; end if; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/columns_should_have_table_name.sql ================================================ declare my_var number; begin select col, -- Noncompliant {{Specify the table of column "col".}} -- ^^^ tab.col, func(col), 'text' from tab, tab2; -- do not create issue when the select has one table select col, tab.col, func(col), 'text' from tab; -- do not report error in rownum select rownum from tab, tab2; -- do not report error when the column is a known variable insert into tab (foo, bar, baz) (select other.foo, my_var, -- compliant other.baz from other, other2); select my_var; -- do not report error in queries without tables end; -- DML in scripts should be checked too select col, -- Noncompliant {{Specify the table of column "col".}} -- ^^^ tab.col, func(col), 'text' from tab, tab2 / ================================================ FILE: zpa-checks/src/test/resources/checks/commit_rollback.sql ================================================ create procedure test is procedure test2 is pragma autonomous_transaction; begin commit; -- no violation here, it is in an autonomous transaction end; begin commit; -- Noncompliant {{Avoid COMMIT calls unless it is in an autonomous transaction.}} begin rollback; -- Noncompliant {{Avoid ROLLBACK calls unless it is in an autonomous transaction.}} -- should ignore rollback to savepoint rollback to savepoint s1; rollback to s1; end; end; / begin commit; -- correct, it isn't a database object end; / ================================================ FILE: zpa-checks/src/test/resources/checks/comparison_with_boolean.sql ================================================ begin var := (x = true); -- Noncompliant {{Remove the literal "TRUE" of this comparison.}} var := (x != true); -- Noncompliant var := (x = false); -- Noncompliant {{Remove the literal "FALSE" of this comparison.}} var := (x != false); -- Noncompliant var := (true = true); -- Noncompliant var := (x = y); end; ================================================ FILE: zpa-checks/src/test/resources/checks/comparison_with_null.sql ================================================ begin -- noncompliant code var := (foo = null); -- Noncompliant {{Fix this comparison or change to "IS NULL".}} -- ^^^^^^^^^^ var := (foo = ''); -- Noncompliant -- ^^^^^^^^ var := (foo <> null); -- Noncompliant {{Fix this comparison or change to "IS NOT NULL".}} -- ^^^^^^^^^^^ var := (foo <> ''); -- Noncompliant -- ^^^^^^^^^ -- valid code var := (foo is null); var := (foo is not null); var := (foo = 'x'); var := (foo <> 'x'); var := (foo = 1); end; ================================================ FILE: zpa-checks/src/test/resources/checks/concatenation_with_null.sql ================================================ begin var := 'a'||null; -- Noncompliant {{Review this concatenation with NULL value.}} -- ^^^^ var := 'a'||''; -- Noncompliant -- ^^ var := 'a'||'1'; end; ================================================ FILE: zpa-checks/src/test/resources/checks/cursor_body_in_package_spec.sql ================================================ create package pkg is cursor cur is -- Noncompliant {{Move the body of the cursor "CUR" to the package body.}} select dummy from dual; end; / create package pkg is type cur_type is record(dummy varchar2(1)); cursor cur return cur_type; -- Compliant end; / create package body pkg is cursor cur is -- Compliant select dummy from dual; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/dbms_output_put.sql ================================================ begin dbms_output.put('x'); -- Noncompliant {{Avoid direct calls to DBMS_OUTPUT procedures.}} dbms_output.put_line('x'); -- Noncompliant sys.dbms_output.put_line('x'); -- Noncompliant my_output.put_line('x'); dbms_output.other('x'); put_line('x'); x.exists(); end; ================================================ FILE: zpa-checks/src/test/resources/checks/dead_code.sql ================================================ begin return; var := 1; -- Noncompliant {{This code will never be executed.}} end; / begin raise_application_error(-20999, 'Custom error message'); var := 1; -- Noncompliant end; / begin raise; var := 1; -- Noncompliant end; / begin for i in 1..10 loop continue; var := 1; -- Noncompliant end loop; end; / begin for i in 1..10 loop exit; var := 1; -- Noncompliant end loop; end; / begin begin return; end; var := 1; -- Noncompliant end; / begin begin begin return; end; end; var := 1; -- Noncompliant end; / -- correct begin return; end; / begin raise; end; / begin raise_application_error(-20999, 'Custom error message'); end; / begin for i in 1..10 loop continue when i = 5; var := 1; end loop; end; / begin for i in 1..10 loop exit when i = 5; var := 1; end loop; end; / begin begin return; exception when others then null; end; var := 1; end; / begin begin begin return; end; exception when others then null; end; var := 1; -- violation end; / ================================================ FILE: zpa-checks/src/test/resources/checks/declare_section_without_declarations.sql ================================================ begin declare -- Noncompliant {{Remove this DECLARE keyword.}} begin null; end; declare var number; begin null; end; end; ================================================ FILE: zpa-checks/src/test/resources/checks/disabled_test.sql ================================================ create or replace package testpkg is -- %suite -- Noncompliant@+2 {{Fix or remove this disabled unit test.}} -- %test -- %disabled procedure test; -- %test -- %disabled with some reason procedure test2; end testpkg; ================================================ FILE: zpa-checks/src/test/resources/checks/duplicate_condition_if_elsif.sql ================================================ begin if foo then null; elsif foo then -- Noncompliant {{This code can not be reached because the condition duplicates a previous condition in the same sequence of "if/else if" statements.}} null; end if; if foo then null; elsif bar then null; elsif bar then -- Noncompliant null; elsif (bar) then -- Noncompliant null; end if; -- correct if foo then null; end if; if foo then null; elsif bar then null; elsif baz then null; end if; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/duplicated_value_in_in.sql ================================================ begin var := (x in (1, 1, 2)); -- Noncompliant {{Remove or fix the duplicated value "1" in the IN condition.}} [[secondary=2]] -- ^ select col into var from tab where col in (x, y, x); -- Noncompliant {{Remove or fix the duplicated value "x" in the IN condition.}} [[secondary=8]] -- ^ -- correct var := (x in (1, 2, 3)); end; ================================================ FILE: zpa-checks/src/test/resources/checks/empty_block.sql ================================================ begin null; -- Noncompliant {{Either remove or fill this block of code.}} end; / create type body t as not overriding member procedure foo as begin null; -- Noncompliant end; overriding member procedure foo as begin null; -- Compliant, don't report violation on overriding member end; overriding member procedure foo as begin begin null; -- Noncompliant end; end; end; / declare var number; begin null; var := 1; end; / declare var number; begin var := 1; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/empty_string_assignment.sql ================================================ begin var := ''; -- Noncompliant {{Replace this empty string by NULL.}} -- correct var := ' '; var := 'x'; var := null; end; ================================================ FILE: zpa-checks/src/test/resources/checks/explicit_in_parameter.sql ================================================ create or replace procedure foo(bar number) is -- Noncompliant {{Explicitly declare this parameter as IN.}} -- ^^^^^^^^^^ begin null; end; / create or replace procedure foo(p1 in number, p2 out number, p3 in out number) is cursor cur(pcur number) is -- cursor parameters cannot raise a violation select 1 from dual; begin null; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/function_with_out_parameter.sql ================================================ create function foo(x in number, y out number) -- Noncompliant {{Rewrite this function to not depend on OUT parameters.}} return number is begin null; end; / create function foo(x in number, y in out number) -- Noncompliant return number is begin null; end; / create package pck is function foo(x in number, y out number) -- Noncompliant return number is begin null; end; function foo(x in number, y in out number) -- Noncompliant return number is begin null; end; end; / -- correct create function foo return number is begin null; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/identical_expression.sql ================================================ begin var := (a = a); -- Noncompliant {{Identical expressions on both sides of operator "=".}} [[secondary=2]] -- ^ select 1 into var from tab where tab.col = tab.col; -- Noncompliant [[secondary=8]] -- ^^^^^^^ var := not a = a; -- Noncompliant [[secondary=11]] -- ^ var := (a) = a; -- Noncompliant [[secondary=14]] -- ^^^ var := (a + b + (c)) = a + (b) + c; -- Noncompliant [[secondary=17]] -- ^^^^^^^^^^^^^ -- valid var := (a = b); end; ================================================ FILE: zpa-checks/src/test/resources/checks/if_with_exit.sql ================================================ begin if (x = y) then -- Noncompliant {{Replace this IF ... EXIT by a EXIT WHEN statement.}} [[sc=3;el=+2;ec=10]] exit; end if; if (x = y) then foo := bar; exit; -- ok end if; if (x = y) then exit; -- ok foo := bar; end if; if (x = y) then exit; -- ok elsif (x = z) then null; end if; if (x = y) then exit; -- ok else null; end if; loop exit; -- ok end loop; end; ================================================ FILE: zpa-checks/src/test/resources/checks/inequality_usage_check.sql ================================================ begin foo := (x != a); -- Noncompliant {{Replace "!=" by "<>".}} foo := (x ^= a); -- Noncompliant {{Replace "^=" by "<>".}} foo := (x ~= a); -- Noncompliant {{Replace "~=" by "<>".}} -- valid usage foo := (x <> a); end; ================================================ FILE: zpa-checks/src/test/resources/checks/insert_without_columns.sql ================================================ declare var tab%rowtype; subtype my_type is tab%rowtype; v_my_type my_type; type t_tab is table of tab%rowtype index by binary_integer; v_tab t_tab; begin insert into tab values (1); -- Noncompliant {{Specify the columns in this INSERT.}} insert into tab (col) values (1); insert into tab values var; insert into tab values var returning id into v_id; for r_t in (select * from mytable) loop insert into mytable values r_t; end loop; forall idx in v_tab.first .. v_tab.last insert into tab values v_tab(idx); insert into tab values v_tab(idx); insert into tab values v_my_type; end; ================================================ FILE: zpa-checks/src/test/resources/checks/invalid_reference_to_object.sql ================================================ begin --------------- -- ALERT --------------- find_alert(var); -- ignore variables find_alert('foo'); find_alert('invalid'); -- Noncompliant {{Invalid reference to the object "invalid" in this FIND_ALERT call.}} -- ^^^^^^^^^ set_alert_button_property('foo', alert_button1, label, 'label'); set_alert_button_property('invalid', alert_button1, label, 'label'); -- Noncompliant -- ^^^^^^^^^ set_alert_property('foo', title, 'title'); set_alert_property('invalid', title, 'title'); -- Noncompliant -- ^^^^^^^^^ show_alert('foo'); show_alert('invalid'); -- Noncompliant -- ^^^^^^^^^ --------------- -- BLOCK --------------- find_block('foo'); find_block('invalid'); -- Noncompliant -- ^^^^^^^^^ get_block_property('foo', order_by); get_block_property('invalid', order_by); -- Noncompliant -- ^^^^^^^^^ go_block('foo'); go_block('invalid'); -- Noncompliant -- ^^^^^^^^^ set_block_property('foo', order_by, 'col'); set_block_property('invalid', order_by, 'col'); -- Noncompliant -- ^^^^^^^^^ set_block_property('foo', blockscrollbar_position, x, y); set_block_property('invalid', blockscrollbar_position, x, y); -- Noncompliant -- ^^^^^^^^^ --------------- -- ITEM --------------- checkbox_checked('foo.item1'); checkbox_checked('foo.invalid'); -- Noncompliant -- ^^^^^^^^^^^^^ convert_other_value('foo.item1'); convert_other_value('foo.invalid'); -- Noncompliant -- ^^^^^^^^^^^^^ display_item('foo.item1', 'bar'); display_item('foo.invalid', 'bar'); -- Noncompliant -- ^^^^^^^^^^^^^ find_item('foo.item1'); find_item('foo.invalid'); -- Noncompliant -- ^^^^^^^^^^^^^ get_item_instance_property('foo.item1', current_record, visual_attribute); get_item_instance_property('foo.invalid', current_record, visual_attribute); -- Noncompliant -- ^^^^^^^^^^^^^ get_item_property('foo.item1', enabled); get_item_property('foo.invalid', enabled); -- Noncompliant -- ^^^^^^^^^^^^^ get_radio_button_property('foo.item1', 'bar', label); get_radio_button_property('foo.invalid', 'bar', label); -- Noncompliant -- ^^^^^^^^^^^^^ go_item('foo.item1'); go_item('foo.invalid'); -- Noncompliant -- ^^^^^^^^^^^^^ image_scroll('foo.item1', x, y); image_scroll('foo.invalid', x, y); -- Noncompliant -- ^^^^^^^^^^^^^ image_zoom('foo.item1', adjust_to_fit); image_zoom('foo.invalid', adjust_to_fit); -- Noncompliant -- ^^^^^^^^^^^^^ image_zoom('foo.item1', zoom_in_factor, 10); image_zoom('foo.invalid', zoom_in_factor, 10); -- Noncompliant -- ^^^^^^^^^^^^^ play_sound('foo.item1'); play_sound('foo.invalid'); -- Noncompliant -- ^^^^^^^^^^^^^ read_image_file('file.jpg', 'jpg', 'foo.item1'); read_image_file('file.jpg', 'jpg', 'foo.invalid'); -- Noncompliant -- ^^^^^^^^^^^^^ read_sound_file('file.wav', 'wave', 'foo.item1'); read_sound_file('file.wav', 'wave', 'foo.invalid'); -- Noncompliant -- ^^^^^^^^^^^^^ recalculate('foo.item1'); recalculate('foo.invalid'); -- Noncompliant -- ^^^^^^^^^^^^^ set_item_instance_property('foo.item1', currrent_record, visual_attribute, 'bar'); set_item_instance_property('foo.invalid', currrent_record, visual_attribute, 'bar'); -- Noncompliant -- ^^^^^^^^^^^^^ set_item_property('foo.item1', enabled, property_false); set_item_property('foo.invalid', enabled, property_false); -- Noncompliant -- ^^^^^^^^^^^^^ set_item_property('foo.item1', position, x, y); set_item_property('foo.invalid', position, x, y); -- Noncompliant -- ^^^^^^^^^^^^^ set_radio_button_property('foo.item1', 'bar', enabled, property_false); set_radio_button_property('foo.invalid', 'bar', enabled, property_false); -- Noncompliant -- ^^^^^^^^^^^^^ set_radio_button_property('foo.item1', 'bar', position, x, y); set_radio_button_property('foo.invalid', 'bar', position, x, y); -- Noncompliant -- ^^^^^^^^^^^^^ write_image_file('file.jpg', 'jpg', 'foo.item1', maximize_compression, original_depth); write_image_file('file.jpg', 'jpg', 'foo.invalid', maximize_compression, original_depth); -- Noncompliant -- ^^^^^^^^^^^^^ write_sound_file('file.wav', 'wave', 'foo.item1', original_quality, original_setting); write_sound_file('file.wav', 'wave', 'foo.invalid', original_quality, original_setting); -- Noncompliant -- ^^^^^^^^^^^^^ --------------- -- LOV --------------- find_lov('foo'); find_lov('invalid'); -- Noncompliant -- ^^^^^^^^^ get_lov_property('foo', title); get_lov_property('invalid', title); -- Noncompliant -- ^^^^^^^^^ set_lov_column_property('foo', 1, title, 'title'); set_lov_column_property('invalid', 1, title, 'title'); -- Noncompliant -- ^^^^^^^^^ set_lov_property('foo', title, 'title'); set_lov_property('invalid', title, 'title'); -- Noncompliant -- ^^^^^^^^^ set_lov_property('foo', position, x, y); set_lov_property('invalid', position, x, y); -- Noncompliant -- ^^^^^^^^^ show_lov('foo'); show_lov('invalid'); -- Noncompliant -- ^^^^^^^^^ end; ================================================ FILE: zpa-checks/src/test/resources/checks/not_a_selected_expression.sql ================================================ select distinct emp.name from emp order by emp.id; -- Noncompliant {{This value does not exists in the SELECT clause. Fix this expression or add this value in the SELECT.}} -- ^^^^^^ select distinct substr(emp.name, 0, 10) emp_name from emp order by emp.name; -- Noncompliant -- ^^^^^^^^ -- Compliant queries select distinct substr(emp.name, 0, 10) emp_name from emp order by substr(emp.name, 0, 10); select distinct substr(emp.name, 0, 10) emp_name from emp order by emp_name; select distinct substr(emp.name, 0, 10) emp_name from emp order by 1; select distinct emp.name from emp order by emp.name; select distinct name from emp order by name; select distinct emp.name from emp order by name; select emp.name from emp order by emp.id; select distinct emp.name from emp; select distinct emp.name emp_name from emp order by name; select distinct name from emp order by emp.name; select distinct emp.name from emp order by length(emp.name); select distinct (name) from emp order by substr(name, 2); ================================================ FILE: zpa-checks/src/test/resources/checks/not_found.sql ================================================ begin var := not cur%found; -- Noncompliant {{Use %NOTFOUND instead of NOT ...%FOUND.}} var := cur%notfound; var := not cur.found; var := cur.found; var := cur%found; end; ================================================ FILE: zpa-checks/src/test/resources/checks/nvl_with_null_parameter.sql ================================================ begin var := nvl(x, null); -- Noncompliant {{This NVL does not have any effect. Fix the NULL parameter or remove this NVL.}} -- ^^^^^^^^^^^^ var := nvl(null, x); -- Noncompliant -- ^^^^^^^^^^^^ var := nvl(x, ''); -- Noncompliant {{This NVL does not have any effect. Fix the '' parameter or remove this NVL.}} -- ^^^^^^^^^^ var := nvl('', x); -- Noncompliant -- ^^^^^^^^^^ var := nvl(x, y); var := nvl(x, 'y'); var := func(x, null); var := pack.func(x, null); end; ================================================ FILE: zpa-checks/src/test/resources/checks/parsing_error.sql ================================================ ; invalid ================================================ FILE: zpa-checks/src/test/resources/checks/query_without_exception_handling.sql ================================================ begin select 1 -- Noncompliant {{Handle exceptions of this query.}} into var from dual; end; / begin -- This is not valid code as it causes "PLS-00428: an INTO clause is expected in this SELECT statement" when compiling on -- the database, but I'll keep this example here because the file is being parser correctly and the check shouldn't crash. select 1 -- Noncompliant {{Handle exceptions of this query.}} from dual; end; / begin if (true) then select 1 -- Noncompliant into var from dual; end if; end; / begin begin select 1 -- Noncompliant, inner block without exception handling into var from dual; end; exception when others then null; end; / create procedure foo is begin select 1 -- Noncompliant into var from dual; end; / create function foo return number is begin select 1 -- Noncompliant into var from dual; end; / create package body pack is procedure foo is begin select 1 -- Noncompliant into var from dual; end; function foo return number is begin select 1 -- Noncompliant into var from dual; end; end; / -- correct code begin select 1 into var from dual; exception when others then null; end; / begin -- outer block doesn't require an exception handling block begin select 1 into var from dual; exception when others then null; end; end; / create trigger foo before insert on tab begin select 1 into var from dual; exception when others then null; end; / -- queries with bulk collect should be ignored because they don't throw no_data_found/too_many_rows begin select 1 bulk collect into var from dual; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/query_without_exception_handling_no_strict.sql ================================================ begin select 1 -- Noncompliant {{Handle exceptions of this query.}} into var from dual; end; / begin if (true) then select 1 -- Noncompliant into var from dual; end if; end; / begin begin select 1 -- Compliant, because strict mode is disabled into var from dual; end; exception when others then null; end; / create procedure foo is begin select 1 -- Noncompliant into var from dual; end; / create function foo return number is begin select 1 -- Noncompliant into var from dual; end; / create package body pack is procedure foo is begin select 1 -- Noncompliant into var from dual; end; function foo return number is begin select 1 -- Noncompliant into var from dual; end; end; / -- correct code begin select 1 into var from dual; exception when others then null; end; / begin -- outer block doesn't require an exception handling block begin select 1 into var from dual; exception when others then null; end; end; / create trigger foo before insert on tab begin select 1 into var from dual; exception when others then null; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/raise_standard_exception.sql ================================================ declare e_custom exception; begin raise no_data_found; -- Noncompliant {{Avoid raising the standard exception NO_DATA_FOUND.}} raise too_many_rows; -- Noncompliant {{Avoid raising the standard exception TOO_MANY_ROWS.}} raise e_custom; raise; end; ================================================ FILE: zpa-checks/src/test/resources/checks/redundant_expectation.sql ================================================ declare x number; y number; begin ut.expect(x).to_be_equal(x); -- Noncompliant -- ^ ut.expect(x).to_be_equal(y); ut.expect(x).to_be_null(); end; ================================================ FILE: zpa-checks/src/test/resources/checks/return_of_boolean_expression.sql ================================================ begin if (a = b) then -- Noncompliant {{Replace this if-then-else statement by a single return statement.}} return true; else return false; end if; if (a = b) then -- Noncompliant return false; else return true; end if; -- correct if (a = b) then return true; elsif (a = c) then return false; else return true; end if; if (a = b) then return true; else return true; end if; if (a = b) then return foo; else return false; end if; if (a = b) then a := 1; return true; else return false; end if; if (a = b) then return true; else a := 1; return false; end if; end; ================================================ FILE: zpa-checks/src/test/resources/checks/same_branch.sql ================================================ begin if x then var := 1; elsif y then var := 1; -- Noncompliant {{Either merge this branch with the identical one on line 3 or change one of the implementations.}} [[secondary=3]] -- ^^^^^^^^^ end if; if x then var := 1; else var := 1; -- Noncompliant [[secondary=10]] -- ^^^^^^^^^ end if; if x then var := 1; else var := (1); -- Noncompliant [[secondary=17]] -- ^^^^^^^^^^^ end if; -- compliant if x then var := 1; elsif y then var := 2; elsif z then var := 1; end if; end; ================================================ FILE: zpa-checks/src/test/resources/checks/same_condition.sql ================================================ begin -- violations var := (x = 1 and x = 1); -- Noncompliant {{This condition duplicates the one on line 3.}} [[secondary=3]] -- ^^^^^ var := (x = 1 or x = 1); -- Noncompliant [[secondary=6]] -- ^^^^^ var := (x = 1 or (x = 1)); -- Noncompliant [[secondary=9]] -- ^^^^^^^ var := (x or nvl(x, null)); -- Noncompliant [[secondary=12]] -- ^^^^^^^^^^^^ select tab.col into var from tab where tab.col = 1 and tab.col = 1; -- Noncompliant [[secondary=18]] -- ^^^^^^^^^^^ select tab.col into var from tab where (tab.col = 1 and tab.col2 = 2) or (tab.col = 1 and tab.col2 = 2); -- Noncompliant [[secondary=25]] -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- correct var := (x = 1 and y = 2); var := (x = 1 or y = 2); -- no violation because it is equivalent to ((x = 1 or y = 2) and x = 1) -- but we could report a violation someday var := (x = 1 or y = 2 and x = 1); -- we could report a violation someday in this case too var := (x = 1 and 1 = x); end; ================================================ FILE: zpa-checks/src/test/resources/checks/select_all_columns.sql ================================================ declare cursor cur is select * -- Noncompliant {{SELECT * should not be used.}} from emp; row emp%rowtype; type my_array is table of emp%rowtype; row_table my_array; begin -- violations select * -- Noncompliant {{SELECT * should not be used.}} into var from emp; select emp.* -- Noncompliant into var from emp; select distinct emp.* -- Noncompliant into var from emp; select user.emp.* -- Noncompliant into var from user.emp; select * -- Noncompliant into pkg.var from emp; select * into row_table(1) from emp; -- valid code select emp.empno into var from emp; select emp.sal * 2 -- does not match the multiplication operator into var from emp; select count(*) -- count is acceptable into var from emp; select emp.sal into var from emp where exists (select * from e); -- in a exists expression is acceptable too select * into row from emp; select * bulk collect into row_table from emp; end; / declare v_foo emp%rowtype; cursor cur is select * -- Compliant from emp; begin open cur; fetch cur into v_foo; close cur; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/select_with_rownum_and_order_by.sql ================================================ begin select name into var from user where rownum <= 1 -- Noncompliant {{Move this ROWNUM comparation to a more external level to guarantee the ordering.}} order by date; select name into var from user where (rownum <= 1) -- Noncompliant order by date; -- valid code select name into var from user where func(rownum) = filter order by date; select name into var from user where rownum = 1; select name into var from user order by date; select name into var from user where foo = (select foo from bar where rownum = 1) order by date; end; ================================================ FILE: zpa-checks/src/test/resources/checks/to_char_in_order_by.sql ================================================ select * from emp order by to_char(empno); -- Noncompliant -- ^^^^^^^^^^^^^^ select to_char(empno) from emp order by 1; -- Noncompliant -- ^ select * from emp order by empno; -- Compliant select empno from emp order by 1; -- Compliant select empno, row_number() over (order by 0) -- Compliant from emp order by empno; /* Actually this code causes the error "ORA-01785: ORDER BY item must be the number of a SELECT-list expression". * It's still compliant as this is not the purpose of this rule. */ select empno from emp order by 0; -- Compliant declare my_empno number; begin select * into foo from emp order by my_empno; -- Compliant end; ================================================ FILE: zpa-checks/src/test/resources/checks/to_date_without_format.sql ================================================ begin mydate := to_date('2015-01-01'); -- Noncompliant {{Specify the date format in this TO_DATE.}} -- ^^^^^^^^^^^^^^^^^^^^^ to_date(null); to_date(''); mydate := to_date('2015-01-01', 'rrrr-mm-dd'); mydate := my_to_date('2015-01-01'); mydate := pkg.to_date('2015-01-01'); end; ================================================ FILE: zpa-checks/src/test/resources/checks/too_many_rows_handler.sql ================================================ begin select empno into var from emp; exception when too_many_rows then -- Noncompliant {{Handle the variables used in the SELECT INTO statements here so their values do not become undefined.}} null; end; begin select empno into var from emp; exception when no_data_found or too_many_rows then -- Noncompliant null; end; -- compliant begin select empno into var from emp; exception when too_many_rows then var := null; end; begin select empno into var from emp; exception when too_many_rows then log(sqlerrm); raise myexception; end; begin select empno into var from emp; exception when no_data_found then null; when pkg.error then var := null; when others then null; end; ================================================ FILE: zpa-checks/src/test/resources/checks/unhandled_user_defined_exception.sql ================================================ declare ex exception; ex_handled exception; begin raise ex; -- Noncompliant {{There is no exception handler for "EX" here. This will cause an "user-defined exception" error.}} raise ex_handled; -- ok raise ex_unknown; -- ok, we don't have any information about the excepton raise pkg.ex; -- ok exception when ex_handled then null; end; / declare ex exception; begin raise ex; -- Noncompliant, there is an "others" handler for this but we will report a violation becase there is a reference to sqlerrm in others exception when others then log(sqlerrm); end; / declare ex exception; begin begin raise ex; -- Noncompliant exception when others then log(sqlerrm); end; end; / declare ex exception; begin begin raise ex; exception when ex then null; end; if (x) then raise ex; -- Noncompliant end if; end; / create package body pack is ex exception; procedure test is begin raise ex; -- we won't report a violation here because we don't have enough information to know if another method in this package handles this exception end; end; / declare ex exception; begin raise ex; exception when others then null; end; / declare ex exception; begin begin raise ex; end; exception when ex then null; when others then log(sqlerrm); end; / ================================================ FILE: zpa-checks/src/test/resources/checks/unnecessary_alias_in_query.sql ================================================ begin select * from tab x; -- Noncompliant {{This statement has only one reference to the table "tab". Remove the alias "x" to improve the readability.}} -- ^ select * from tab x, tab2; -- Noncompliant -- ^ select * from tab x where exists (select 1 from tab2); -- Noncompliant -- ^ select (select 1 from tab x) from tab2; -- Noncompliant -- ^ update tab x set foo = bar where exists (select 1 from tab2); -- Noncompliant -- ^ delete tab x where exists (select 1 from tab2); -- Noncompliant -- ^ select * from tab x -- Noncompliant -- ^ union select * from tab x; -- Noncompliant -- correct select * from tab x, tab; select * from tab x, tab y; select * from tab, tab2; select * from tab where exists (select 1 from tab x); update tab set foo = bar where exists (select 1 from tab x); delete tab where exists (select 1 from tab x); end; / ================================================ FILE: zpa-checks/src/test/resources/checks/unnecessary_alias_in_query_custom_length.sql ================================================ begin select * from tab x; -- Noncompliant {{This statement has only one reference to the table "tab". Remove the alias "x" to improve the readability.}} -- ^ select * from tab xxxx, -- should be ignored because the accepted length is 4 tab2; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/unnecessary_else.sql ================================================ begin if (foo = bar) then return; else -- Noncompliant {{This ELSE can be replaced by an END IF. When the corresponding IF is executed, the code execution will be stopped. Either way, the code within this ELSE will always run, regardless of the ELSE block.}} foo := null; end if; if (foo = bar) then exit; else -- Noncompliant foo := null; end if; if (foo = bar) then continue; else -- Noncompliant foo := null; end if; if (foo = bar) then raise; else -- Noncompliant foo := null; end if; if (foo = bar) then raise_application_error(-20999, 'Custom error message'); else -- Noncompliant foo := null; end if; end; -- correct begin if (foo = bar) then get_data; else foo := null; end if; if (foo = bar) then exit when baz; else foo := null; end if; if (foo = bar) then continue when baz; else foo := null; end if; if (foo = bar) then return; elsif baz then null; else foo := null; end if; end; ================================================ FILE: zpa-checks/src/test/resources/checks/unnecessary_like.sql ================================================ begin var := x like 'a'; -- Noncompliant -- ^^^^^^^^^^ var := x like 'a\%' escape '\'; -- Noncompliant var := x like 'a\_' escape '\'; -- Noncompliant var := x like '%a'; var := x like 'a_'; var := x like '%a\%' escape '\'; var := x like '%a\_' escape '\'; var := x like y; var := x like y escape z; var := x like x escape '\'; end; ================================================ FILE: zpa-checks/src/test/resources/checks/unnecessary_null_statement.sql ================================================ begin v := 0; null; -- Noncompliant {{This NULL statement does not have any effect here.}} end; / begin null; -- Noncompliant v := 0; end; / -- correct begin null; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/unused_cursor.sql ================================================ declare cursor cur is -- Noncompliant {{Remove this unused "CUR" cursor.}} select 1 from dual; cursor "cur2" is select 1 from dual; begin open "cur2"; end; create package pkg is cursor cur is -- compliant, this is a package specification, we don't know if there are any usages select 1 from dual; end; create package body pkg is cursor cur return custom_type is -- compliant, let's assume that cursors with return type are declared in package spec select 1 from dual; end; ================================================ FILE: zpa-checks/src/test/resources/checks/unused_parameter.sql ================================================ create procedure foo(a number, b number, "c" number) is -- Noncompliant {{Remove this unused "B" parameter.}} -- ^^^^^^^^ begin print(a); print("c"); end; / create function bar(a number, b number) return number is -- Noncompliant -- ^^^^^^^^ begin return a; end; / create package test is procedure foo(a number, b number); -- don't report violation on declaration cursor bar(a number) return my_type; -- don't report violation on declaration procedure foo(a number, b number) is -- Noncompliant -- ^^^^^^^^ cursor cur(x number) is -- Noncompliant {{Remove this unused "X" parameter.}} -- ^^^^^^^^ select 1 from dual; begin print(a); end; end; / create type foo as object ( -- don't report violation on declarations constructor function foo(x number) return self as result, member procedure foo(a number, b number); ) / create type t under super_t ( overriding member procedure foo(a number, b number); -- don't report violation on declaration ) / create type body t as not overriding member procedure foo(a number) as -- Noncompliant -- ^^^^^^^^ begin null; end; overriding member procedure foo(a number, b number) as -- don't report violation on overriding member begin null; end; member procedure print(self in out nocopy t) is -- don't report violation on SELF parameter begin null; end; end; / procedure foo is cursor cur(x number) is select 1 from dual where cur.x = 1; -- don't report violation because "cur.x" refers to the cursor parameter begin null; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/unused_parameter_ignore_methods.sql ================================================ create procedure on_event(a number, b number) is -- begin print(a); end; / create procedure fullmatch(a number, b number) is -- begin print(a); end; / create function on_event(p_event in integer) return integer as begin return 1; end; / create function bar(a number, b number) return number is -- Noncompliant -- ^^^^^^^^ begin return a; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/unused_variable.sql ================================================ declare var number; -- Noncompliant {{Remove this unused "VAR" local variable.}} i number; -- Noncompliant {{Remove this unused "I" local variable.}} procedure proc is proc_var number; -- Noncompliant {{Remove this unused "PROC_VAR" local variable.}} begin null; end; function func return number is func_var number; -- Noncompliant {{Remove this unused "FUNC_VAR" local variable.}} begin null; end; begin null; declare var2 number; -- Noncompliant {{Remove this unused "VAR2" local variable.}} begin null; end; for i in 1..2 loop -- this "i" variable is not the same as the one in declaration section func(i); end loop; end; / create or replace package body test is package_body_var number; -- Noncompliant {{Remove this unused "PACKAGE_BODY_VAR" local variable.}} hidden_var number; -- Noncompliant {{Remove this unused "HIDDEN_VAR" local variable.}} "VAR" number; -- Noncompliant {{Remove this unused "VAR" local variable.}} "var" number; procedure proc is hidden_var number; -- this declaration hides the previous one var number; -- this declaration hides the previous "VAR" begin hidden_var := 0; var := 0; "var" := 0; end; end; / -- correct declare simple_var number; into_var number; insert_var number; comparision_var number; case_insensitive_test number; record_variable rectype; error exception; begin simple_var := 0; CASE_INSENSITIVE_TEST := 0; record_variable.field := 0; select 1 into into_var from dual; insert into tab (x) values (insert_var); if (comparision_var = 1) then null; end if; for i in 1..2 loop -- "i" variable is not used, but it is required here null; end loop; raise error; end; / create or replace package test is package_body_var number; -- do not report error on package specifications end; / create or replace package body test is package_body_var number; qualified_var number; procedure proc is begin package_body_var := 0; test.qualified_var := 0; test.var := 0; end; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/useless_parenthesis.sql ================================================ begin var := ((x = 1)); -- Noncompliant {{Remove those useless parenthesis.}} -- ^^^^^^^ -- valid var := (x = 1); var := ((x = 1) or (y = 2)); end; ================================================ FILE: zpa-checks/src/test/resources/checks/variable_hiding.sql ================================================ declare var number; var2 number; var3 number; exc exception; "QUOTEDVAR" number; procedure test is var number; -- Noncompliant {{This variable "VAR" hides the declaration on line 2.}} [[secondary=2]] -- ^^^ begin null; end; function test return number is var2 number; -- Noncompliant {{This variable "VAR2" hides the declaration on line 3.}} [[secondary=3]] -- ^^^^ begin null; end; procedure test2 is exc exception; -- Noncompliant {{This variable "EXC" hides the declaration on line 5.}} [[secondary=5]] -- ^^^ begin null; end; begin declare var3 number; -- Noncompliant {{This variable "VAR3" hides the declaration on line 4.}} [[secondary=4]] -- ^^^^ quotedvar number; -- Noncompliant {{This variable "QUOTEDVAR" hides the declaration on line 6.}} [[secondary=6]] "QuotedVar" number; -- this is a different variable begin null; end; end; / create package body test is var number; procedure test is var number; -- Noncompliant {{This variable "VAR" hides the declaration on line 42.}} [[secondary=42]] -- ^^^ begin for i in 1..10 loop declare i number; -- Noncompliant {{This variable "I" hides the declaration on line 48.}} [[secondary=48]] -- ^ begin null; end; end loop; end; end; / create package test2 is var number; exc exception; end; / create package body test2 is var number; -- Noncompliant {{This variable "VAR" hides the declaration on line 61.}} [[secondary=61]] exc exception; -- Noncompliant {{This variable "EXC" hides the declaration on line 62.}} [[secondary=62]] end; / -- correct declare outer_var number; "VAR2" number; --| "Var2" number; --| These variables are not the same "var2" number; --| begin declare var number; begin null; end; declare var number; begin null; end; end; / ================================================ FILE: zpa-checks/src/test/resources/checks/variable_in_count.sql ================================================ declare foo number; begin select count(foo) -- Noncompliant {{Looks like there is a "foo" variable in this context. Review if this COUNT is correct.}} -- ^^^^^^^^^^ from tab; -- don't report an error here, we don't have enough information to know if "bar" is a variable or a column of table "tab" select count(bar) from tab; select count(foo, bar), -- the COUNT function has only 1 parameter, so this isn't the Oracle built-in my_count(foo), pack.count(foo) from tab; bar := count(foo); -- the Oracle built-in can't be used here end; select count(foo) from dual; -- we don't have a scope here ================================================ FILE: zpa-checks/src/test/resources/checks/variable_initialization_with_function_call.sql ================================================ create procedure foo(bar in varchar2 default func(x)) is var1 varchar2(1) default func(x); -- Noncompliant {{Move this initialization to the BEGIN...END block.}} var2 varchar2(1) := func(x); -- Noncompliant var3 json := json(); -- Compliant type rec is record (field varchar2(1) default func(x)); cursor cur(param in varchar2 default func(x)) is select 1 from dual; begin null; end; ================================================ FILE: zpa-checks/src/test/resources/checks/variable_initialization_with_null.sql ================================================ create procedure foo(bar in varchar2 default null) is -- parameter declaration, no issue var1 varchar2(1) default null; -- Noncompliant {{Remove this unnecessary initialization to NULL.}} var2 varchar2(1) default ''; -- Noncompliant var3 varchar2(1) := null; -- Noncompliant var4 varchar2(1) := ''; -- Noncompliant type rec is record (field varchar2(1) default null); -- Noncompliant cursor cur(param in varchar2 default null) is -- cursor parameter, no issue select 1 from dual; begin null; end; ================================================ FILE: zpa-checks/src/test/resources/checks/variable_name.sql ================================================ declare employee_name varchar2(100); employee_name_ varchar2(100); -- Noncompliant --^^^^^^^^^^^^^^ begin null; end; ================================================ FILE: zpa-checks/src/test/resources/checks/variable_name_alternative.sql ================================================ declare employee_name varchar2(100); e varchar2(100); -- Noncompliant --^ begin null; end; ================================================ FILE: zpa-checks/src/test/resources/checks/xpath.sql ================================================ begin null; end; ================================================ FILE: zpa-checks/src/test/resources/checks/xpath_count_statement.sql ================================================ -- Noncompliant@-1 {{Avoid statements}} begin null; end; ================================================ FILE: zpa-checks/src/test/resources/checks/xpath_statement.sql ================================================ begin null; -- Noncompliant {{Avoid statements}} --^^^^^ end; ================================================ FILE: zpa-checks-testkit/build.gradle.kts ================================================ plugins { id("com.felipebz.zpa.build-conventions") } dependencies { compileOnly(project(":zpa-core")) } description = "ZPA Checks TestKit" ================================================ FILE: zpa-checks-testkit/src/main/kotlin/com/felipebz/zpa/checks/verifier/PlSqlCheckVerifier.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks.verifier import com.felipebz.flr.api.Trivia import com.felipebz.zpa.TestPlSqlVisitorRunner import com.felipebz.zpa.metadata.FormsMetadata import com.felipebz.zpa.symbols.DefaultTypeSolver import com.felipebz.zpa.symbols.ScopeImpl import com.felipebz.zpa.symbols.SymbolVisitor import com.felipebz.zpa.api.checks.PlSqlCheck import java.io.File class PlSqlCheckVerifier : PlSqlCheck() { private val expectedIssues = ArrayList() override fun visitComment(trivia: Trivia, content: String) { val text = content.trim { it <= ' ' } val marker = "Noncompliant" if (text.startsWith(marker)) { var issueLine = trivia.token.line var paramsAndMessage = text.substring(marker.length).trim { it <= ' ' } if (paramsAndMessage.startsWith("@")) { val spaceSplit = paramsAndMessage.split("[\\s\\[{]".toRegex(), 2).toTypedArray() val shiftValue = spaceSplit[0] if (shiftValue[1] != '+' && shiftValue[1] != '-') { throw AssertionError("Use only '@+N' or '@-N' to shifts messages.") } issueLine += Integer.valueOf(shiftValue.substring(1)) paramsAndMessage = if (spaceSplit.size > 1) spaceSplit[1] else "" } val issue = TestIssue(null, issueLine) if (paramsAndMessage.startsWith("{{")) { val endIndex = paramsAndMessage.indexOf("}}") val message = paramsAndMessage.substring(2, endIndex) issue.message = message paramsAndMessage = paramsAndMessage.substring(endIndex + 2).trim { it <= ' ' } } if (paramsAndMessage.startsWith("[[")) { val endIndex = paramsAndMessage.indexOf("]]") addParams(issue, paramsAndMessage.substring(2, endIndex)) } expectedIssues.add(issue) } else if (text.startsWith("^")) { addPreciseLocation(trivia) } } private fun addPreciseLocation(trivia: Trivia) { val token = trivia.token val line = token.line val text = token.value if (token.column > 1) { throw IllegalStateException("Line $line: comments asserting a precise location should start at column 1") } val missingAssertionMessage = "Invalid test file: a precise location is provided at line $line but no issue is asserted at line ${line - 1}" if (expectedIssues.isEmpty()) { throw IllegalStateException(missingAssertionMessage) } val issue = expectedIssues[expectedIssues.size - 1] if (issue.line != line - 1) { throw IllegalStateException(missingAssertionMessage) } issue.endLine = issue.line issue.startColumn = text.indexOf('^') + 1 issue.endColumn = text.lastIndexOf('^') + 2 } companion object { @JvmStatic @JvmOverloads fun verify(path: String, check: PlSqlCheck, metadata: FormsMetadata? = null) { val verifier = PlSqlCheckVerifier() val file = File(path) TestPlSqlVisitorRunner.scanFile(file, metadata, SymbolVisitor(DefaultTypeSolver(), ScopeImpl()), verifier, check) val issues = check.issues() val actualIssues = issues.sortedBy { it.primaryLocation().startLine() }.iterator() val expectedIssues = verifier.expectedIssues.sortedBy { it.line } for (expected in expectedIssues) { if (actualIssues.hasNext()) { verifyIssue(expected, actualIssues.next()) } else { throw AssertionError("Missing issue at line ${expected.line}") } } if (actualIssues.hasNext()) { val issue = actualIssues.next() throw AssertionError("Unexpected issue at line ${line(issue)}: \"${issue.primaryLocation().message()}\"") } } private fun verifyIssue(expected: TestIssue, actual: PreciseIssue) { if (line(actual) > expected.line) { throw AssertionError("Missing issue at line ${expected.line}") } if (line(actual) < expected.line) { throw AssertionError("Unexpected issue at line ${line(actual)}: \"${actual.primaryLocation().message()}\"") } assertEquals(expected.message, actual.primaryLocation().message(), "Bad message at line ${expected.line}") assertEquals(expected.effortToFix, actual.cost(), "Bad effortToFix at line ${expected.line}") assertEquals(expected.startColumn, actual.primaryLocation().startLineOffset() + 1, "Bad start column at line ${expected.line}") assertEquals(expected.endColumn, actual.primaryLocation().endLineOffset() + 1, "Bad end column at line ${expected.line}") assertEquals(expected.endLine, actual.primaryLocation().endLine(), "Bad end line at line ${expected.line}") assertEquals(expected.secondaryLines, secondary(actual), "Bad secondary locations at line ${expected.line}") } private fun assertEquals(expected: Any?, actual: Any?, message: String) { if (expected != null && expected != actual) { throw AssertionError("$message ==> expected: \"${expected}\" but was: \"${actual}\"") } } private fun secondary(issue: PreciseIssue): List { val result = ArrayList() for (issueLocation in issue.secondaryLocations()) { result.add(issueLocation.startLine()) } return result.sorted() } private fun line(issue: PreciseIssue): Int { return issue.primaryLocation().startLine() } private fun addParams(issue: TestIssue, params: String) { for (param in params.split(';')) { val equalIndex = param.indexOf('=') if (equalIndex == -1) { throw IllegalStateException("Invalid param at line 1: $param") } val name = param.substring(0, equalIndex) val value = param.substring(equalIndex + 1) when { "effortToFix".equals(name, ignoreCase = true) -> issue.effortToFix = Integer.valueOf(value) "sc".equals(name, ignoreCase = true) -> issue.startColumn = Integer.valueOf(value) "ec".equals(name, ignoreCase = true) -> issue.endColumn = Integer.valueOf(value) "el".equals(name, ignoreCase = true) -> issue.endLine = lineValue(issue.line, value) "secondary".equals(name, ignoreCase = true) -> addSecondaryLines(issue, value) else -> throw IllegalStateException("Invalid param at line 1: $name") } } } private fun addSecondaryLines(issue: TestIssue, value: String) { val secondaryLines = ArrayList() if ("" != value) { for (secondary in value.split(',')) { secondaryLines.add(lineValue(issue.line, secondary)) } } issue.secondaryLines = secondaryLines } private fun lineValue(baseLine: Int, shift: String): Int { if (shift.startsWith("+")) { return baseLine + Integer.valueOf(shift.substring(1)) } return if (shift.startsWith("-")) { baseLine - Integer.valueOf(shift.substring(1)) } else Integer.valueOf(shift) } } } ================================================ FILE: zpa-checks-testkit/src/main/kotlin/com/felipebz/zpa/checks/verifier/TestIssue.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks.verifier internal class TestIssue constructor(var message: String?, val line: Int) { var effortToFix: Int? = null var startColumn: Int? = null var endColumn: Int? = null var endLine: Int? = null var secondaryLines: List? = null override fun toString() = "$message[line=$line]" } ================================================ FILE: zpa-checks-testkit/src/test/kotlin/com/felipebz/zpa/checks/verifier/PlSqlCheckVerifierTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks.verifier import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.GenericTokenType import com.felipebz.flr.api.Token import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.fail import com.felipebz.zpa.checks.IssueLocation import com.felipebz.zpa.squid.AnalysisException import com.felipebz.zpa.api.checks.PlSqlCheck class PlSqlCheckVerifierTest { @Test fun verify_line_issues() { val visitor = FakeCheck().withDefaultIssues() PlSqlCheckVerifier.verify(FILENAME_ISSUES, visitor) } @Test fun verify_unexpected_issue() { val visitor = FakeCheck().withDefaultIssues().withIssue(4, "extra message") try { PlSqlCheckVerifier.verify(FILENAME_ISSUES, visitor) fail("Test should fail") } catch (e: AssertionError) { assertThat(e).hasMessage("Unexpected issue at line 4: \"extra message\"") } } @Test fun verify_combined_missing_expected_and_unexpected_issues() { val visitor = FakeCheck().withDefaultIssues().withIssue(4, "extra message") .withoutIssue(1) try { PlSqlCheckVerifier.verify(FILENAME_ISSUES, visitor) fail("Test should fail") } catch (e: AssertionError) { assertThat(e).hasMessage("Missing issue at line 1") } } @Test fun verify_missing_expected_issue() { val visitor = FakeCheck().withDefaultIssues().withoutIssue(1) try { PlSqlCheckVerifier.verify(FILENAME_ISSUES, visitor) fail("Test should fail") } catch (e: AssertionError) { assertThat(e).hasMessage("Missing issue at line 1") } } @Test fun verify_no_issue() { PlSqlCheckVerifier.verify(FILENAME_NO_ISSUE, noEffectCheck) } @Test fun verify_should_fail_when_using_incorrect_shift() { try { PlSqlCheckVerifier.verify("src/test/resources/check_verifier_incorrect_shift.sql", noEffectCheck) fail("Test should fail") } catch (e: AssertionError) { assertThat(e).hasMessage("Use only '@+N' or '@-N' to shifts messages.") } } @Test fun verify_should_fail_when_using_incorrect_attribute() { try { PlSqlCheckVerifier.verify("src/test/resources/check_verifier_incorrect_attribute.sql", noEffectCheck) fail("Test should fail") } catch (e: AnalysisException) { assertThat(e).hasMessage("Error executing checks on file check_verifier_incorrect_attribute.sql: Invalid param at line 1: invalid") } } @Test fun verify_should_fail_when_using_incorrect_attribute2() { try { PlSqlCheckVerifier.verify("src/test/resources/check_verifier_incorrect_attribute2.sql", noEffectCheck) fail("Test should fail") } catch (e: AnalysisException) { assertThat(e).hasMessage("Error executing checks on file check_verifier_incorrect_attribute2.sql: Invalid param at line 1: invalid") } } @Test fun verify_should_fail_when_using_incorrect_secondaryLocation() { val visitor = FakeCheck().withDefaultIssues() try { PlSqlCheckVerifier.verify("src/test/resources/check_verifier_incorrect_secondary_location.sql", visitor) fail("Test should fail") } catch (e: AssertionError) { assertThat(e).hasMessage("Bad secondary locations at line 8 ==> expected: \"[4]\" but was: \"[3, 4]\"") } } @Test fun verify_should_fail_when_using_incorrect_secondaryLocation2() { val visitor = FakeCheck().withDefaultIssues() try { PlSqlCheckVerifier.verify("src/test/resources/check_verifier_incorrect_secondary_location2.sql", visitor) fail("Test should fail") } catch (e: AssertionError) { assertThat(e).hasMessage("Bad secondary locations at line 8 ==> expected: \"[3, 4, 5]\" but was: \"[3, 4]\"") } } @Test fun verify_should_fail_when_precision_location_comment_is_invalid() { try { PlSqlCheckVerifier.verify("src/test/resources/check_verifier_incorrect_comment.sql", FakeCheck()) fail("Test should fail") } catch (e: AnalysisException) { assertThat(e).hasMessage("Error executing checks on file check_verifier_incorrect_comment.sql: Line 3: comments asserting a precise location should start at column 1") } } @Test fun verify_unexpected_precise_location() { try { PlSqlCheckVerifier.verify("src/test/resources/check_verifier_unexpected_precise_location.sql", FakeCheck()) } catch (e: AnalysisException) { assertThat(e).hasMessage("Error executing checks on file check_verifier_unexpected_precise_location.sql: Invalid test file: a precise location is provided at line 3 but no issue is asserted at line 2") } } @Test fun verify_unexpected_precise_location2() { try { PlSqlCheckVerifier.verify("src/test/resources/check_verifier_unexpected_precise_location2.sql", FakeCheck()) } catch (e: AnalysisException) { assertThat(e).hasMessage("Error executing checks on file check_verifier_unexpected_precise_location2.sql: Invalid test file: a precise location is provided at line 3 but no issue is asserted at line 2") } } private class FakeCheck : PlSqlCheck() { var issues = hashMapOf>() var preciseIssues = linkedMapOf>() fun withDefaultIssues(): FakeCheck { return this.withIssue(1, "message") .withIssue(2, "message1") .withIssue(5, "message2") .withIssue(6, "message3") .withIssue(6, "message3") .withPreciseIssue( IssueLocation.preciseLocation(mockNode(8, 9, 8, 10), "message4"), IssueLocation.atLineLevel("no message", 3), IssueLocation.atLineLevel("no message", 4) ) .withPreciseIssue(IssueLocation.atLineLevel("no message", 9)) .withPreciseIssue(IssueLocation.preciseLocation(mockNode(11, 5, 12, 11), "message12")) .withIssue(14, "message17") .withPreciseIssue(IssueLocation.preciseLocation(mockNode(15, 5, 15, 9), "baseline")) } fun withIssue(line: Int, message: String) = apply { issues.getOrPut(line) { mutableListOf() }.add(message) } fun withPreciseIssue(vararg message: IssueLocation) = apply { preciseIssues.getOrPut(message[0].startLine()) { mutableListOf() }.addAll(message.toList()) } fun withoutIssue(line: Int) = apply { issues.remove(line) preciseIssues.remove(line) } override fun visitFile(node: AstNode) { for ((line, messages) in issues) { for (message in messages) { addLineIssue(message, line) } } for (locations in preciseIssues.values) { var issue: PreciseIssue? = null for (location in locations) { if (issue == null) { issue = addIssue(location).withCost(3) } else { issue.secondary(location) } } } } fun mockNode(startLine: Int, startCharacter: Int, endLine: Int, endCharacter: Int): AstNode { val token = Token.builder() .setLine(startLine) .setColumn(startCharacter - 1) .setValueAndOriginalValue("") .setType(GenericTokenType.IDENTIFIER) .build() val lastToken = Token.builder() .setLine(endLine) .setColumn(endCharacter - 1) .setValueAndOriginalValue("") .setType(GenericTokenType.IDENTIFIER) .build() val node = AstNode(token) node.addChild(AstNode(token)) node.addChild(AstNode(lastToken)) return node } } companion object { private const val FILENAME_ISSUES = "src/test/resources/check_verifier.sql" private const val FILENAME_NO_ISSUE = "src/test/resources/check_verifier_no_issue.sql" private val noEffectCheck: PlSqlCheck get() = object : PlSqlCheck() { } } } ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier.sql ================================================ create procedure a is -- Noncompliant {{message}} i integer; -- Noncompliant {{message1}} begin -- test method -- Noncompliant@+1 {{message2}} null; null; -- Noncompliant@-1 {{message3}} null; -- Noncompliant {{message4}} [[sc=9;ec=10;secondary=3,4]] bla bla bla null; -- Noncompliant -- Noncompliant@-4 func(foo, -- Noncompliant [[sc=5;el=+1;ec=11;effortToFix=3]] bar); -- Noncompliant@+1 blabla null; null; -- Noncompliant {{baseline}} -- ^^^^ end; / ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier_incorrect_attribute.sql ================================================ begin null; -- Noncompliant [[invalid=1]] {{message}} end; / ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier_incorrect_attribute2.sql ================================================ begin null; -- Noncompliant [[invalid=1=2]] {{message}} end; / ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier_incorrect_comment.sql ================================================ begin null; -- Noncompliant -- ^ end; / ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier_incorrect_secondary_location.sql ================================================ create procedure a is -- Noncompliant {{message}} i integer; -- Noncompliant {{message1}} begin -- test method -- Noncompliant@+1 {{message2}} null; null; -- Noncompliant@-1 {{message3}} null; -- Noncompliant {{message4}} [[sc=9;ec=10;secondary=4]] bla bla bla null; -- Noncompliant -- Noncompliant@-4 func(foo, -- Noncompliant [[sc=5;el=+1;ec=11]] bar); -- Noncompliant@+1 blabla null; end; / ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier_incorrect_secondary_location2.sql ================================================ create procedure a is -- Noncompliant {{message}} i integer; -- Noncompliant {{message1}} begin -- test method -- Noncompliant@+1 {{message2}} null; null; -- Noncompliant@-1 {{message3}} null; -- Noncompliant {{message4}} [[sc=9;ec=10;secondary=3,4,5]] bla bla bla null; -- Noncompliant -- Noncompliant@-4 func(foo, -- Noncompliant [[sc=5;el=+1;ec=11]] bar); -- Noncompliant@+1 blabla null; end; / ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier_incorrect_shift.sql ================================================ begin null; -- Noncompliant@#1 {{message}} end; / ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier_no_issue.sql ================================================ begin null; end; / ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier_unexpected_precise_location.sql ================================================ begin null; --^^^^ end; / ================================================ FILE: zpa-checks-testkit/src/test/resources/check_verifier_unexpected_precise_location2.sql ================================================ begin -- Noncompliant null; --^^^^ end; / ================================================ FILE: zpa-core/build.gradle.kts ================================================ plugins { id("com.felipebz.zpa.build-conventions") } dependencies { api(libs.flr.core) implementation(libs.jackson) testImplementation(libs.flr.testing.harness) } description = "ZPA Core" ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/AstNodeExtensions.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.AstNodeType import com.felipebz.zpa.sslr.Tree import com.felipebz.zpa.api.squid.SemanticAstNode fun AstNode?.typeIs(type: AstNodeType): Boolean = this?.type == type fun AstNode?.typeIs(types: Array): Boolean = types.any { it == this?.type } inline fun AstNode.asTree(): T = this.asSemantic().tree as T inline fun AstNode.tryGetAsTree(): T? = this.asSemantic().tree as? T inline fun List.asTree(): List = this.asSemantic().map { it.tree as T } inline fun AstNode.isOf(): Boolean = this.asSemantic().tree is T fun AstNode.asSemantic(): SemanticAstNode = (this as SemanticAstNode) fun List.asSemantic(): List = this.map { it.asSemantic() } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/CustomAnnotationBasedRulesDefinition.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import com.felipebz.zpa.rules.RuleMetadataLoader import com.felipebz.zpa.rules.RulesDefinitionAnnotationLoader import com.felipebz.zpa.rules.ZpaRepository import com.felipebz.zpa.rules.ZpaRule import com.felipebz.zpa.utils.getAnnotation import com.felipebz.zpa.api.annotations.ActivatedByDefault import com.felipebz.zpa.api.annotations.ConstantRemediation import com.felipebz.zpa.api.annotations.RuleInfo import com.felipebz.zpa.api.annotations.RuleTemplate import java.io.IOException import java.net.URL import java.util.* class CustomAnnotationBasedRulesDefinition(private val repository: ZpaRepository, private val languageKey: String, private val ruleMetadataLoader: RuleMetadataLoader) { private val locale: Locale = Locale.getDefault() private val externalDescriptionBasePath: String = String.format("%s/rules/plsql", getLocalizedFolderName(String.format("/org/sonar/l10n/%s", languageKey), locale)) fun addRuleClasses(ruleClasses: Iterable>) { val loader = RulesDefinitionAnnotationLoader(ruleMetadataLoader) for (annotatedClass in ruleClasses) { loader.load(repository, annotatedClass) } val newRules = ArrayList() for (ruleClass in ruleClasses) { val rule = newRule(ruleClass) addHtmlDescription(rule) rule.template = getAnnotation(ruleClass, RuleTemplate::class.java) != null try { val constant = getAnnotation(ruleClass, ConstantRemediation::class.java) if (constant != null) { rule.remediationConstant = constant.value } } catch (e: RuntimeException) { throw IllegalArgumentException("Invalid remediation constant on $ruleClass", e) } val ruleInfo = getAnnotation(ruleClass, RuleInfo::class.java) if (ruleInfo != null) { rule.scope = ruleInfo.scope } val activatedByDefault = getAnnotation(ruleClass, ActivatedByDefault::class.java) if (activatedByDefault != null) { rule.isActivatedByDefault = true } newRules.add(rule) } setupExternalNames(newRules) } private fun addHtmlDescription(rule: ZpaRule) { val resource = CustomAnnotationBasedRulesDefinition::class.java.getResource("$externalDescriptionBasePath/${rule.key}.html") if (resource != null) { addHtmlDescription(rule, resource) } } private fun addHtmlDescription(rule: ZpaRule, resource: URL) { try { rule.htmlDescription = resource.readText() } catch (e: IOException) { throw IllegalStateException("Failed to read: $resource", e) } } private fun newRule(ruleClass: Class<*>): ZpaRule { val ruleKey = getRuleKey(ruleMetadataLoader, ruleClass) return repository.rule(ruleKey) ?: throw IllegalStateException("Rule $ruleKey was not created") } private fun setupExternalNames(rules: Collection) { val bundle: ResourceBundle try { bundle = ResourceBundle.getBundle("org.sonar.l10n.$languageKey", locale) } catch (e: MissingResourceException) { return } for (rule in rules) { val baseKey = rule.key val nameKey = "$baseKey.name" if (bundle.containsKey(nameKey)) { rule.name = bundle.getString(nameKey) } for (param in rule.params) { val paramDescriptionKey = baseKey + ".param." + param.key if (bundle.containsKey(paramDescriptionKey)) { param.description = bundle.getString(paramDescriptionKey) } } } } companion object { /** * Adds annotated rule classes to an instance of NewRepository. Fails if one of * the classes has no SQALE annotation. * @param repository repository of rules * @param languageKey language identifier * @param ruleClasses classes to add */ fun load(repository: ZpaRepository, languageKey: String, ruleClasses: Iterable>, ruleMetadataLoader: RuleMetadataLoader) { CustomAnnotationBasedRulesDefinition(repository, languageKey, ruleMetadataLoader).addRuleClasses(ruleClasses) } fun getLocalizedFolderName(baseName: String, locale: Locale): String { val control = ResourceBundle.Control.getControl(ResourceBundle.Control.FORMAT_DEFAULT) var path = control.toBundleName(baseName, locale) var url: URL? = CustomAnnotationBasedRulesDefinition::class.java.getResource(path) if (url == null) { val localeWithoutCountry = if (locale.country == null) locale else Locale(locale.language) path = control.toBundleName(baseName, localeWithoutCountry) url = CustomAnnotationBasedRulesDefinition::class.java.getResource(path) if (url == null) { path = baseName CustomAnnotationBasedRulesDefinition::class.java.getResource(path) } } return path } fun convertCheckClassName(ruleClass: Class<*>): String { var name = ruleClass.simpleName if (name.endsWith("Check")) { name = name.substring(0, name.length - 5) } return name } fun getRuleKey(ruleMetadataLoader: RuleMetadataLoader, ruleClass: Class<*>): String { val ruleAnnotation = ruleMetadataLoader.getRuleAnnotation(ruleClass) ?: throw IllegalArgumentException("No Rule annotation was found on $ruleClass") return ruleAnnotation.key.ifEmpty { convertCheckClassName(ruleClass) } } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/FormsMetadataAwareCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa // Marker interface to define checks that require Oracle Forms metadata interface FormsMetadataAwareCheck ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/PlSqlChecks.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import com.felipebz.zpa.rules.RuleMetadataLoader import com.felipebz.zpa.rules.ZpaActiveRules import com.felipebz.zpa.rules.ZpaChecks import com.felipebz.zpa.rules.ZpaRuleKey import com.felipebz.zpa.api.ZpaRulesDefinition import com.felipebz.zpa.api.checks.PlSqlVisitor class PlSqlChecks private constructor(private val activeRules: ZpaActiveRules, private val ruleMetadataLoader: RuleMetadataLoader) { private val checksByRepository = hashSetOf() val checks: Set = checksByRepository fun addChecks(repositoryKey: String, checkClass: Iterable>): PlSqlChecks { checksByRepository.add(ZpaChecks(activeRules, repositoryKey, ruleMetadataLoader) .addAnnotatedChecks(checkClass)) return this } fun addCustomChecks(customRulesDefinitions: Array?): PlSqlChecks { if (customRulesDefinitions != null) { for (rulesDefinition in customRulesDefinitions) { addChecks(rulesDefinition.repositoryKey(), rulesDefinition.checkClasses().toList()) } } return this } fun all(): List { val allVisitors = ArrayList() for (checks in checksByRepository) { allVisitors.addAll(checks.all()) } return allVisitors } fun ruleKey(check: PlSqlVisitor): ZpaRuleKey? { var ruleKey: ZpaRuleKey? for (checks in checksByRepository) { ruleKey = checks.ruleKey(check) if (ruleKey != null) { return ruleKey } } return null } companion object { fun createPlSqlCheck(activeRules: ZpaActiveRules, ruleMetadataLoader: RuleMetadataLoader): PlSqlChecks { return PlSqlChecks(activeRules, ruleMetadataLoader) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/TestPlSqlVisitorRunner.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import com.felipebz.zpa.metadata.FormsMetadata import com.felipebz.zpa.parser.PlSqlParser import com.felipebz.zpa.squid.PlSqlAstWalker import com.felipebz.zpa.squid.PlSqlConfiguration import com.felipebz.zpa.api.PlSqlFile import com.felipebz.zpa.api.PlSqlVisitorContext import com.felipebz.zpa.api.checks.PlSqlVisitor import java.io.File import java.io.IOException import java.nio.charset.StandardCharsets import java.nio.file.Path object TestPlSqlVisitorRunner { fun scanFile(file: File, metadata: FormsMetadata?, vararg visitors: PlSqlVisitor) { val context = createContext(TestPlSqlFile(file), metadata) val walker = PlSqlAstWalker(visitors.toList()) walker.walk(context) } private fun createContext(plSqlFile: PlSqlFile, metadata: FormsMetadata?): PlSqlVisitorContext { val parser = PlSqlParser.create(PlSqlConfiguration(StandardCharsets.UTF_8)) val rootTree = parser.parse(plSqlFile.contents()) return PlSqlVisitorContext(rootTree, plSqlFile, metadata) } private class TestPlSqlFile(private val file: File) : PlSqlFile { override fun contents(): String = try { file.readText() } catch (e: IOException) { throw IllegalStateException("Cannot read $file", e) } override fun fileName(): String = file.name override fun path(): Path = file.toPath() override fun type(): PlSqlFile.Type = PlSqlFile.Type.MAIN } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/AggregateSqlFunctionsGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.api.DmlGrammar.ORDER_BY_CLAUSE import com.felipebz.zpa.api.PlSqlGrammar.EXPRESSION import com.felipebz.zpa.api.PlSqlKeyword.* import com.felipebz.zpa.api.PlSqlPunctuator.* enum class AggregateSqlFunctionsGrammar : GrammarRuleKey { LISTAGG_EXPRESSION, XMLAGG_EXPRESSION, COLLECT_EXPRESSION, JSON_ARRAYAGG_EXPRESSION, JSON_OBJECTAGG_EXPRESSION, AGGREGATE_SQL_FUNCTION; companion object { fun buildOn(b: PlSqlGrammarBuilder) { b.rule(LISTAGG_EXPRESSION).define( LISTAGG, LPARENTHESIS, b.optional(b.firstOf(ALL, DISTINCT)), EXPRESSION, b.optional(COMMA, EXPRESSION), b.optional(ON, OVERFLOW, b.firstOf( ERROR, b.sequence(TRUNCATE, b.optional(EXPRESSION), b.optional(b.firstOf(WITH, WITHOUT), COUNT)))), RPARENTHESIS, WITHIN, GROUP, LPARENTHESIS, DmlGrammar.ORDER_BY_CLAUSE, RPARENTHESIS) b.rule(XMLAGG_EXPRESSION).define( XMLAGG, LPARENTHESIS, EXPRESSION, b.optional(ORDER_BY_CLAUSE), RPARENTHESIS ) b.rule(COLLECT_EXPRESSION).define( COLLECT, LPARENTHESIS, b.optional(b.firstOf(DISTINCT, UNIQUE)), EXPRESSION, b.optional(ORDER, BY, EXPRESSION), RPARENTHESIS ) b.rule(JSON_ARRAYAGG_EXPRESSION).define( JSON_ARRAYAGG, LPARENTHESIS, EXPRESSION, b.optional(FORMAT, JSON), b.optional(ORDER_BY_CLAUSE), b.optional(SingleRowSqlFunctionsGrammar.JSON_ON_NULL_CLAUSE), b.optional(SingleRowSqlFunctionsGrammar.JSON_RETURNING_CLAUSE), b.optional(STRICT), RPARENTHESIS ) b.rule(JSON_OBJECTAGG_EXPRESSION).define( JSON_OBJECTAGG, LPARENTHESIS, b.optional(KEY), EXPRESSION, VALUE, EXPRESSION, b.optional(FORMAT, JSON), b.optional(SingleRowSqlFunctionsGrammar.JSON_ON_NULL_CLAUSE), b.optional(SingleRowSqlFunctionsGrammar.JSON_RETURNING_CLAUSE), b.optional(STRICT), b.optional(WITH, UNIQUE, KEYS), RPARENTHESIS ) b.rule(AGGREGATE_SQL_FUNCTION).define( b.firstOf( LISTAGG_EXPRESSION, XMLAGG_EXPRESSION, COLLECT_EXPRESSION, JSON_ARRAYAGG_EXPRESSION, JSON_OBJECTAGG_EXPRESSION ) ) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/ConditionsGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.api.PlSqlGrammar.* import com.felipebz.zpa.api.PlSqlKeyword.* enum class ConditionsGrammar : GrammarRuleKey { // internal RELATIONAL_OPERATOR, IS_JSON_ARGS, JSON_MODIFIER_LIST, JSON_COLUMN_MODIFIER, JSON_SCALAR_MODIFIER, JSON_EQUAL_ON_ERROR_CLAUSE, JSON_EXISTS_ON_EMPTY_CLAUSE, JSON_EXISTS_ON_ERROR_CLAUSE, // conditions RELATIONAL_CONDITION, BOOLEAN_TEST_CONDITION, LIKE_CONDITION, BETWEEN_CONDITION, MULTISET_CONDITION, IS_A_SET_CONDITION, IS_EMPTY_CONDITION, MEMBER_CONDITION, SUBMULTISET_CONDITION, IS_OF_CONDITION, IS_JSON_CONDITION, JSON_EQUAL_CONDITION, JSON_EXISTS_CONDITION, JSON_TEXTCONTAINS_CONDITION, CONDITION; companion object { fun buildOn(b: PlSqlGrammarBuilder) { b.rule(RELATIONAL_OPERATOR).define( b.firstOf( PlSqlGrammar.EQUALS_OPERATOR, PlSqlGrammar.NOTEQUALS_OPERATOR, PlSqlGrammar.LESSTHANOREQUALS_OPERATOR, PlSqlGrammar.LESSTHAN_OPERATOR, PlSqlGrammar.GREATERTHANOREQUALS_OPERATOR, PlSqlGrammar.GREATERTHAN_OPERATOR ), b.optional(b.firstOf(ANY, SOME, ALL)) ) b.rule(RELATIONAL_CONDITION).define( CONCATENATION_EXPRESSION, RELATIONAL_OPERATOR, CONCATENATION_EXPRESSION ).skip() b.rule(BOOLEAN_TEST_CONDITION).define( CONCATENATION_EXPRESSION, IS, b.optional(NOT), b.firstOf(NULL_LITERAL, PlSqlGrammar.BOOLEAN_LITERAL) ) b.rule(LIKE_CONDITION).define( CONCATENATION_EXPRESSION, b.optional(NOT), LIKE, CONCATENATION_EXPRESSION, b.optional(ESCAPE, CONCATENATION_EXPRESSION) ) b.rule(BETWEEN_CONDITION).define( CONCATENATION_EXPRESSION, b.optional(NOT), BETWEEN, CONCATENATION_EXPRESSION, AND, CONCATENATION_EXPRESSION ).skip() b.rule(IS_A_SET_CONDITION).define(CONCATENATION_EXPRESSION, IS, b.optional(NOT), A, SET) b.rule(IS_EMPTY_CONDITION).define(CONCATENATION_EXPRESSION, IS, b.optional(NOT), EMPTY) b.rule(MEMBER_CONDITION) .define(CONCATENATION_EXPRESSION, b.optional(NOT), MEMBER, b.optional(OF), CONCATENATION_EXPRESSION) .skip() b.rule(SUBMULTISET_CONDITION).define( CONCATENATION_EXPRESSION, b.optional(NOT), SUBMULTISET, b.optional(OF), CONCATENATION_EXPRESSION ) //https://docs.oracle.com/cloud/latest/db112/SQLRF/conditions006.htm#SQLRF52128 b.rule(MULTISET_CONDITION).define( b.firstOf( IS_A_SET_CONDITION, IS_EMPTY_CONDITION, MEMBER_CONDITION, SUBMULTISET_CONDITION ) ) b.rule(IS_OF_CONDITION).define( CONCATENATION_EXPRESSION, IS, b.optional(NOT), OF, b.optional(TYPE), PlSqlPunctuator.LPARENTHESIS, b.optional(ONLY), OBJECT_REFERENCE, b.zeroOrMore(PlSqlPunctuator.COMMA, b.optional(ONLY), OBJECT_REFERENCE), PlSqlPunctuator.RPARENTHESIS ) b.rule(IS_JSON_CONDITION).define( CONCATENATION_EXPRESSION, IS, b.optional(NOT), JSON, b.optional(JSON_MODIFIER_LIST), IS_JSON_ARGS ) b.rule(IS_JSON_ARGS).define( b.firstOf( b.sequence( VALIDATE, b.optional(CAST), b.optional(USING), PlSqlTokenType.STRING_LITERAL ), b.sequence( b.optional(FORMAT, JSON), b.optional(b.firstOf(STRICT, LAX)), b.optional(b.firstOf(ALLOW, DISALLOW), SCALARS), b.optional(b.firstOf(WITH, WITHOUT), UNIQUE, KEYS) ) ) ).skip() b.rule(JSON_MODIFIER_LIST).define( b.firstOf( b.sequence( PlSqlPunctuator.LPARENTHESIS, JSON_COLUMN_MODIFIER, b.zeroOrMore(PlSqlPunctuator.COMMA, JSON_COLUMN_MODIFIER), PlSqlPunctuator.RPARENTHESIS ), JSON_COLUMN_MODIFIER ) ) b.rule(JSON_COLUMN_MODIFIER).define( b.firstOf( VALUE, ARRAY, OBJECT, b.sequence(SCALAR, b.optional(JSON_SCALAR_MODIFIER)) ) ) b.rule(JSON_SCALAR_MODIFIER).define( b.firstOf( NUMBER, STRING, BINARY_DOUBLE, BINARY_FLOAT, DATE, b.sequence(TIMESTAMP, b.optional(WITH, TIME, ZONE)), NULL, BOOLEAN, BINARY, b.sequence(INTERVAL, b.firstOf(b.sequence(YEAR, TO, MONTH), b.sequence(DAY, TO, SECOND))) ) ) b.rule(JSON_EQUAL_CONDITION).define( JSON_EQUAL, PlSqlPunctuator.LPARENTHESIS, PlSqlGrammar.EXPRESSION, PlSqlPunctuator.COMMA, PlSqlGrammar.EXPRESSION, b.optional(JSON_EQUAL_ON_ERROR_CLAUSE), PlSqlPunctuator.RPARENTHESIS ) b.rule(JSON_EQUAL_ON_ERROR_CLAUSE).define( b.firstOf( ERROR, TRUE, FALSE ), ON, ERROR ) b.rule(JSON_EXISTS_CONDITION).define( JSON_EXISTS, PlSqlPunctuator.LPARENTHESIS, PlSqlGrammar.EXPRESSION, b.optional(FORMAT, JSON), PlSqlPunctuator.COMMA, SingleRowSqlFunctionsGrammar.JSON_BASIC_PATH_EXPRESSION, b.optional(SingleRowSqlFunctionsGrammar.JSON_PASSING_CLAUSE), b.optional(JSON_EXISTS_ON_ERROR_CLAUSE), b.optional(TYPE, b.firstOf(STRICT, LAX)), b.optional(JSON_EXISTS_ON_EMPTY_CLAUSE), PlSqlPunctuator.RPARENTHESIS ) b.rule(JSON_EXISTS_ON_ERROR_CLAUSE).define( b.firstOf( ERROR, TRUE, FALSE ), ON, ERROR ) b.rule(JSON_EXISTS_ON_EMPTY_CLAUSE).define( b.firstOf( ERROR, TRUE, FALSE ), ON, EMPTY ) b.rule(JSON_TEXTCONTAINS_CONDITION).define( JSON_TEXTCONTAINS, PlSqlPunctuator.LPARENTHESIS, PlSqlGrammar.EXPRESSION, PlSqlPunctuator.COMMA, SingleRowSqlFunctionsGrammar.JSON_BASIC_PATH_EXPRESSION, PlSqlPunctuator.COMMA, PlSqlGrammar.EXPRESSION, PlSqlPunctuator.RPARENTHESIS ) b.rule(CONDITION).define( b.firstOf( RELATIONAL_CONDITION, BOOLEAN_TEST_CONDITION, LIKE_CONDITION, BETWEEN_CONDITION, MULTISET_CONDITION, IS_JSON_CONDITION, IS_OF_CONDITION, JSON_EQUAL_CONDITION, JSON_EXISTS_CONDITION, JSON_TEXTCONTAINS_CONDITION ) ).skip() } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/DclGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.GenericTokenType import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.api.PlSqlGrammar.IDENTIFIER_NAME import com.felipebz.zpa.api.PlSqlGrammar.UNIT_NAME import com.felipebz.zpa.api.PlSqlKeyword.* import com.felipebz.zpa.api.PlSqlPunctuator.* enum class DclGrammar : GrammarRuleKey { IDENTIFIER_OR_KEYWORD, GRANT_STATEMENT, PRIVILEGE_PART, PRIVILEGE_COLUMNS, GRANT_SYSTEM_PRIVILEGES, GRANT_OBJECT_PRIVILEGES, GRANT_ROLES_TO_PROGRAMS, DCL_COMMAND; companion object { fun buildOn(b: PlSqlGrammarBuilder) { createDclCommands(b) } private fun createDclCommands(b: PlSqlGrammarBuilder) { val keywords = PlSqlKeyword.entries val rest = keywords.subList(1, keywords.size).toTypedArray() b.rule(IDENTIFIER_OR_KEYWORD).define(b.firstOf(GenericTokenType.IDENTIFIER, keywords[0], *rest)) b.rule(PRIVILEGE_PART).define(b.nextNot(b.firstOf(COMMA, ON, TO, LPARENTHESIS)), IDENTIFIER_OR_KEYWORD) b.rule(PRIVILEGE_COLUMNS).define(LPARENTHESIS, IDENTIFIER_NAME, b.zeroOrMore(COMMA, IDENTIFIER_NAME), RPARENTHESIS) b.rule(GRANT_SYSTEM_PRIVILEGES).define( b.oneOrMore(PRIVILEGE_PART), b.zeroOrMore(COMMA, b.oneOrMore(PRIVILEGE_PART)), TO, IDENTIFIER_OR_KEYWORD, b.zeroOrMore(COMMA, IDENTIFIER_OR_KEYWORD), b.optional(IDENTIFIED, BY, b.anyToken(), b.zeroOrMore(COMMA, b.anyToken())), b.optional(WITH, b.firstOf(ADMIN, DELEGATE), OPTION), b.optional(CONTAINER, EQUALS, b.firstOf(CURRENT, ALL))) b.rule(GRANT_OBJECT_PRIVILEGES).define( b.oneOrMore(PRIVILEGE_PART), b.optional(PRIVILEGE_COLUMNS), b.zeroOrMore(COMMA, b.oneOrMore(PRIVILEGE_PART, b.optional(PRIVILEGE_COLUMNS))), b.optional(ON, b.oneOrMore(b.anyTokenButNot(TO))), TO, IDENTIFIER_OR_KEYWORD, b.zeroOrMore(COMMA, IDENTIFIER_OR_KEYWORD), b.optional(WITH, HIERARCHY, OPTION), b.optional(WITH, GRANT, OPTION)) b.rule(GRANT_ROLES_TO_PROGRAMS).define( b.oneOrMore(PRIVILEGE_PART), b.zeroOrMore(COMMA, b.oneOrMore(PRIVILEGE_PART)), TO, b.firstOf(FUNCTION, PROCEDURE, PACKAGE), UNIT_NAME, b.zeroOrMore(COMMA, b.firstOf(FUNCTION, PROCEDURE, PACKAGE), UNIT_NAME) ) b.rule(GRANT_STATEMENT).define(GRANT, b.firstOf(GRANT_ROLES_TO_PROGRAMS, GRANT_SYSTEM_PRIVILEGES, GRANT_OBJECT_PRIVILEGES), b.optional(SEMICOLON)) b.rule(DCL_COMMAND).define(GRANT_STATEMENT) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/DdlGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.GenericTokenType.EOF import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.api.PlSqlGrammar.* import com.felipebz.zpa.api.PlSqlKeyword.* import com.felipebz.zpa.api.PlSqlPunctuator.* import com.felipebz.zpa.api.PlSqlTokenType.INTEGER_LITERAL enum class DdlGrammar : GrammarRuleKey { DDL_COMMENT, DDL_COMMAND, ONE_OR_MORE_IDENTIFIERS, REFERENCES_CLAUSE, INLINE_CONSTRAINT, OUT_OF_LINE_CONSTRAINT, TABLE_COLUMN_DEFINITION, TABLE_RELATIONAL_PROPERTIES, CREATE_TABLE, ALTER_TABLE, COMPILE_CLAUSE, COMPILER_PARAMETERS_CLAUSE, ALTER_PROCEDURE, ALTER_FUNCTION, ALTER_TRIGGER, ALTER_PACKAGE, PACKAGE_COMPILE_CLAUSE, DROP_COMMAND, CREATE_SYNONYM, CREATE_SEQUENCE, PARTITION_BY_RANGE, PARTITION_BY_HASH, RANGE_VALUES_CLAUSE, TABLE_PARTITION_DESCRIPTION, SEGMENT_ATTRIBUTES_CLAUSE, PHISICAL_ATRIBUTES_CLAUSE, TABLE_COMPRESSION, KEY_COMPRESSION, LOB_STORAGE_CLAUSE, VARRAY_COL_PROPERTIES, PARTITION_LEVEL_SUBPARTITION, // HASH_SUBPARTITION_QUANTITY, SUBPARTITION_SPEC, LIST_VALUES_CLAUSE, PARTITIONING_STORAGE_CLAUSE, SUBSTITUTABLE_COLUMN_CLAUSE, LOB_PARAMETERS, STORAGE_CLAUSE, LOGGING_CLAUSE, SIZE_CLAUSE, INDIVIDUAL_HASH_PARTITIONS, HASH_PARTITIONS_BY_QUANTITY, PARTITION_BY_LIST, PARTITION_COMPOSITE, SUBPARTITION_BY_LIST, SUBPARTITION_BY_HASH, SUBPARTITION_TEMPLATE, CREATE_DIRECTORY, DROP_DIRECTORY, TRUNCATE_TABLE, CONSTRAINT_STATE, PRECHECK_STATE, EXCEPTIONS_CLAUSE; companion object { fun buildOn(b: PlSqlGrammarBuilder) { createDdlCommands(b) } private fun createDdlCommands(b: PlSqlGrammarBuilder) { b.rule(DDL_COMMENT).define( COMMENT, ON, b.firstOf( b.sequence( COLUMN, IDENTIFIER_NAME, b.optional(DOT, IDENTIFIER_NAME), b.optional(DOT, IDENTIFIER_NAME)), b.sequence( b.firstOf( TABLE, COLUMN, OPERATOR, INDEXTYPE, b.sequence(MATERIALIZED, VIEW), b.sequence(MINING, MODEL)), IDENTIFIER_NAME, b.optional(DOT, IDENTIFIER_NAME)) ), IS, CHARACTER_LITERAL, b.optional(SEMICOLON)) b.rule(ONE_OR_MORE_IDENTIFIERS).define(LPARENTHESIS, IDENTIFIER_NAME, b.zeroOrMore(COMMA, IDENTIFIER_NAME), RPARENTHESIS).skip() b.rule(REFERENCES_CLAUSE).define( REFERENCES, MEMBER_EXPRESSION, b.optional(ONE_OR_MORE_IDENTIFIERS), b.optional(ON, DELETE, b.firstOf(CASCADE, b.sequence(SET, NULL))) ) b.rule(INLINE_CONSTRAINT).define( b.optional(b.firstOf(CONSTRAINT, CONSTRAINTS), IDENTIFIER_NAME), b.firstOf( b.sequence( b.firstOf( b.sequence(b.optional(NOT), NULL), UNIQUE, b.sequence(PRIMARY, KEY), REFERENCES_CLAUSE ), b.optional(CONSTRAINT_STATE) ), b.sequence( CHECK, LPARENTHESIS, EXPRESSION, RPARENTHESIS, b.optional(CONSTRAINT_STATE), b.optional(PRECHECK_STATE) ) ) ) b.rule(CONSTRAINT_STATE).define( b.optional(b.firstOf( b.sequence(INITIALLY, b.firstOf(DEFERRED, IMMEDIATE), b.optional(b.optional(NOT), DEFERRABLE)), b.sequence(b.optional(NOT), DEFERRABLE, b.optional(INITIALLY, b.firstOf(DEFERRED, IMMEDIATE))), )), b.optional(b.firstOf(RELY, NORELY)), // TODO b.optional(USING_INDEX_CLAUSE), b.optional(b.firstOf(ENABLE, DISABLE)), b.optional(b.firstOf(VALIDATE, NOVALIDATE)), b.optional(EXCEPTIONS_CLAUSE) ) b.rule(PRECHECK_STATE).define(b.firstOf(PRECHECK, NOPRECHECK)) b.rule(EXCEPTIONS_CLAUSE).define(EXCEPTIONS, INTO, UNIT_NAME) b.rule(TABLE_COLUMN_DEFINITION).define( IDENTIFIER_NAME, DATATYPE, b.optional(SORT), b.optional(DEFAULT, b.optional( b.sequence(ON, NULL, b.optional(FOR, INSERT, b.firstOf(ONLY, b.sequence(AND, UPDATE))))), EXPRESSION), b.optional(ENCRYPT), b.zeroOrMore(INLINE_CONSTRAINT)) b.rule(OUT_OF_LINE_CONSTRAINT).define( b.optional(b.firstOf(CONSTRAINT, CONSTRAINTS), IDENTIFIER_NAME), b.firstOf( b.sequence( b.firstOf( b.sequence(UNIQUE, ONE_OR_MORE_IDENTIFIERS), b.sequence(PRIMARY, KEY, ONE_OR_MORE_IDENTIFIERS, b.optional(b.sequence(USING, INDEX))), b.sequence(FOREIGN, KEY, ONE_OR_MORE_IDENTIFIERS, REFERENCES_CLAUSE) ), b.optional(CONSTRAINT_STATE) ), b.sequence( CHECK, LPARENTHESIS, EXPRESSION, RPARENTHESIS, b.optional(CONSTRAINT_STATE), b.optional(PRECHECK_STATE) ) ) ) b.rule(TABLE_RELATIONAL_PROPERTIES).define( b.oneOrMore(b.firstOf(OUT_OF_LINE_CONSTRAINT, TABLE_COLUMN_DEFINITION), b.optional(COMMA))) b.rule(PHISICAL_ATRIBUTES_CLAUSE).define( b.oneOrMore(b.firstOf( b.sequence(PCTFREE, INTEGER_LITERAL), b.sequence(PCTUSED, INTEGER_LITERAL), b.sequence(INITRANS, INTEGER_LITERAL), STORAGE_CLAUSE))) b.rule(SEGMENT_ATTRIBUTES_CLAUSE).define( b.oneOrMore(b.firstOf( PHISICAL_ATRIBUTES_CLAUSE, b.sequence(TABLESPACE, IDENTIFIER_NAME), LOGGING_CLAUSE))) b.rule(TABLE_COMPRESSION).define( b.firstOf(COMPRESS, NOCOMPRESS)) b.rule(KEY_COMPRESSION).define( b.firstOf( b.sequence(MAPPING, TABLE), NOMAPPING)) b.rule(LOB_STORAGE_CLAUSE).define( b.sequence(LOB, b.firstOf( b.sequence( LPARENTHESIS, b.oneOrMore( IDENTIFIER_NAME, b.optional(COMMA)), RPARENTHESIS, STORE, AS, LPARENTHESIS, LOB_PARAMETERS, RPARENTHESIS), b.sequence( LPARENTHESIS, IDENTIFIER_NAME, RPARENTHESIS, STORE, AS, IDENTIFIER_NAME, b.optional(b.sequence( LPARENTHESIS, LOB_PARAMETERS, RPARENTHESIS)))))) b.rule(SUBSTITUTABLE_COLUMN_CLAUSE).define( b.firstOf( b.sequence( b.optional(ELEMENT), IS, OF, b.optional(TYPE), LPARENTHESIS, ONLY, DATATYPE, RPARENTHESIS), b.sequence( b.optional(NOT), SUBSTITUTABLE, AT, ALL, LEVELS))) b.rule(SIZE_CLAUSE).define( b.sequence(INTEGER_LITERAL, b.firstOf("K", "M", "G", "T", "P", "E"))) b.rule(STORAGE_CLAUSE).define( b.sequence(STORAGE, LPARENTHESIS, b.firstOf( b.sequence(INITIAL, SIZE_CLAUSE), b.sequence(NEXT, SIZE_CLAUSE), b.sequence(MINEXTENTS, INTEGER_LITERAL), b.sequence(MAXEXTENTS, b.firstOf(INTEGER_LITERAL, UNLIMITED)), b.sequence(PCTINCREASE, INTEGER_LITERAL), b.sequence(FREELISTS, INTEGER_LITERAL), b.sequence(FREELIST, GROUPS, INTEGER_LITERAL), b.sequence(OPTIMAL, b.optional(b.firstOf(SIZE_CLAUSE, NULL))), b.sequence(BUFFER_POOL, b.firstOf(KEEP, RECYCLE, DEFAULT))), RPARENTHESIS)) b.rule(LOGGING_CLAUSE).define( b.firstOf(LOGGING, NOLOGGING)) b.rule(LOB_PARAMETERS).define( b.oneOrMore(b.firstOf( b.sequence( TABLESPACE, IDENTIFIER_NAME), b.sequence( b.firstOf( ENABLE, DISABLE), STORAGE, IN, NOW), STORAGE_CLAUSE, b.sequence( CHUNK, INTEGER_LITERAL), b.sequence( PCTVERSION, INTEGER_LITERAL), RETENTION, b.sequence( FREEPOOLS, INTEGER_LITERAL), b.firstOf( b.sequence(CACHE, b.optional(b.sequence( READS, b.optional(LOGGING_CLAUSE)))), b.sequence( NOCACHE, b.optional(LOGGING_CLAUSE)))))) b.rule(VARRAY_COL_PROPERTIES).define( b.sequence(VARRAY, IDENTIFIER_NAME, b.firstOf(b.sequence( b.optional(SUBSTITUTABLE_COLUMN_CLAUSE), STORE, AS, LOB, b.firstOf(b.sequence( b.optional(IDENTIFIER_NAME), LPARENTHESIS, LOB_PARAMETERS, RPARENTHESIS), IDENTIFIER_NAME)), SUBSTITUTABLE_COLUMN_CLAUSE))) b.rule(LIST_VALUES_CLAUSE).define( b.sequence( VALUES, LPARENTHESIS, b.firstOf( b.oneOrMore( b.firstOf( LITERAL, NULL), b.optional(COMMA)), DEFAULT), RPARENTHESIS)) b.rule(PARTITIONING_STORAGE_CLAUSE).define( b.optional( b.oneOrMore( b.firstOf( b.sequence( TABLESPACE, IDENTIFIER_NAME), b.sequence( OVERFLOW, b.optional( b.sequence( TABLESPACE, IDENTIFIER_NAME))), // b.sequence( // LOB, // LPARENTHESIS, // IDENTIFIER_NAME, // RPARENTHESIS, // STORE, // AS, // b.firstOf( // b.sequence( // IDENTIFIER_NAME, // b.optional( // b.sequence( // LPARENTHESIS, // TABLESPACE, // IDENTIFIER_NAME, // RPARENTHESIS))), // b.sequence( // LPARENTHESIS, // TABLESPACE, // IDENTIFIER_NAME, // RPARENTHESIS))), LOB_STORAGE_CLAUSE, // b.sequence( // VARRAY, // IDENTIFIER_NAME, // STORE, // AS, // LOB, // IDENTIFIER_NAME))))); VARRAY_COL_PROPERTIES)))) b.rule(SUBPARTITION_SPEC).define( b.sequence(SUBPARTITION, b.optional(IDENTIFIER_NAME), b.optional(LIST_VALUES_CLAUSE), b.optional(PARTITIONING_STORAGE_CLAUSE))) b.rule(PARTITION_LEVEL_SUBPARTITION).define( b.firstOf( b.sequence( SUBPARTITIONS, INTEGER_LITERAL, b.optional( b.sequence( STORE, IN, b.sequence( LPARENTHESIS, b.oneOrMore( IDENTIFIER_NAME, b.optional(COMMA)), RPARENTHESIS)))), b.sequence( LPARENTHESIS, b.oneOrMore( SUBPARTITION_SPEC, b.optional(COMMA)), RPARENTHESIS))) b.rule(RANGE_VALUES_CLAUSE).define( b.sequence(VALUES, LESS, THAN, b.sequence( LPARENTHESIS, b.oneOrMore( b.firstOf( METHOD_CALL, IDENTIFIER_NAME, MAXVALUE), b.optional(COMMA)), RPARENTHESIS))) b.rule(TABLE_PARTITION_DESCRIPTION).define( b.sequence( b.optional(SEGMENT_ATTRIBUTES_CLAUSE), b.optional( b.firstOf( TABLE_COMPRESSION, KEY_COMPRESSION)), b.optional( b.sequence( OVERFLOW, b.optional(SEGMENT_ATTRIBUTES_CLAUSE))), b.optional( b.oneOrMore( b.firstOf( LOB_STORAGE_CLAUSE, VARRAY_COL_PROPERTIES))), b.optional(PARTITION_LEVEL_SUBPARTITION))) b.rule(INDIVIDUAL_HASH_PARTITIONS).define( b.sequence( LPARENTHESIS, b.oneOrMore( b.sequence( PARTITION, b.optional( b.sequence( IDENTIFIER_NAME, PARTITIONING_STORAGE_CLAUSE)), b.optional(COMMA))), RPARENTHESIS)) b.rule(HASH_PARTITIONS_BY_QUANTITY).define( b.sequence( PARTITIONS, INTEGER_LITERAL, b.optional( b.sequence( STORE, IN, LPARENTHESIS, b.oneOrMore(b.sequence( IDENTIFIER_NAME, b.optional(COMMA))), RPARENTHESIS)), b.optional( b.sequence( OVERFLOW, STORE, IN, LPARENTHESIS, b.oneOrMore(b.sequence( IDENTIFIER_NAME, b.optional(COMMA))), RPARENTHESIS)))) b.rule(SUBPARTITION_TEMPLATE).define( b.sequence( SUBPARTITION, TEMPLATE, b.firstOf( b.sequence( LPARENTHESIS, b.oneOrMore( b.sequence( SUBPARTITION, IDENTIFIER_NAME, b.optional(LIST_VALUES_CLAUSE), b.optional(PARTITIONING_STORAGE_CLAUSE), b.optional(COMMA))), RPARENTHESIS), INTEGER_LITERAL))) b.rule(SUBPARTITION_BY_LIST).define( b.sequence(SUBPARTITION, BY, LIST, LPARENTHESIS, IDENTIFIER_NAME, RPARENTHESIS, b.optional(SUBPARTITION_TEMPLATE))) b.rule(SUBPARTITION_BY_HASH).define( b.sequence( SUBPARTITION, BY, HASH, LPARENTHESIS, b.oneOrMore( IDENTIFIER_NAME, b.optional(COMMA)), RPARENTHESIS, b.optional( b.firstOf( b.sequence( SUBPARTITIONS, INTEGER_LITERAL, b.optional( b.sequence( STORE, IN, LPARENTHESIS, b.oneOrMore( IDENTIFIER_NAME, b.optional(COMMA)), RPARENTHESIS))), SUBPARTITION_TEMPLATE)))) b.rule(PARTITION_BY_RANGE).define( b.sequence( PARTITION, BY, RANGE_KEYWORD, LPARENTHESIS, b.oneOrMore( IDENTIFIER_NAME, b.optional(COMMA)), RPARENTHESIS, LPARENTHESIS, b.oneOrMore( PARTITION, b.optional(IDENTIFIER_NAME), RANGE_VALUES_CLAUSE, TABLE_PARTITION_DESCRIPTION, b.optional(COMMA)), RPARENTHESIS)) b.rule(PARTITION_BY_HASH).define( b.sequence( PARTITION, BY, HASH, LPARENTHESIS, b.oneOrMore( b.sequence( IDENTIFIER_NAME, b.optional(COMMA))), RPARENTHESIS, b.firstOf( INDIVIDUAL_HASH_PARTITIONS, HASH_PARTITIONS_BY_QUANTITY))) b.rule(PARTITION_BY_LIST).define( b.sequence( PARTITION, BY, LIST, LPARENTHESIS, IDENTIFIER_NAME, RPARENTHESIS, LPARENTHESIS, b.oneOrMore( b.sequence( PARTITION, b.optional(IDENTIFIER_NAME), LIST_VALUES_CLAUSE, TABLE_PARTITION_DESCRIPTION, b.optional(COMMA))), RPARENTHESIS)) b.rule(PARTITION_COMPOSITE).define( b.sequence( PARTITION, BY, RANGE_KEYWORD, b.oneOrMore( LPARENTHESIS, IDENTIFIER_NAME, b.optional(COMMA), RPARENTHESIS), b.firstOf( SUBPARTITION_BY_LIST, SUBPARTITION_BY_HASH), LPARENTHESIS, b.oneOrMore( b.sequence( PARTITION, b.optional(IDENTIFIER_NAME), RANGE_VALUES_CLAUSE, TABLE_PARTITION_DESCRIPTION, b.optional(COMMA))), RPARENTHESIS)) b.rule(CREATE_TABLE).define( CREATE, b.optional( GLOBAL, TEMPORARY), TABLE, UNIT_NAME, b.optional( LPARENTHESIS, TABLE_RELATIONAL_PROPERTIES, RPARENTHESIS), b.optional(b.firstOf( PARTITION_BY_RANGE, PARTITION_BY_HASH, PARTITION_BY_LIST, PARTITION_COMPOSITE)), b.optional( TABLESPACE, IDENTIFIER_NAME), b.optional( ON, COMMIT, b.firstOf( DELETE, PRESERVE), ROWS), b.optional(SEMICOLON)) b.rule(ALTER_TABLE).define( ALTER, TABLE, UNIT_NAME, b.firstOf(ADD, DROP), TABLE_RELATIONAL_PROPERTIES, b.optional(SEMICOLON)) b.rule(COMPILE_CLAUSE).define( COMPILE, b.optional(DEBUG), b.zeroOrMore(COMPILER_PARAMETERS_CLAUSE), b.optional(REUSE, SETTINGS)) b.rule(COMPILER_PARAMETERS_CLAUSE).define( IDENTIFIER_NAME, EQUALS_OPERATOR, CHARACTER_LITERAL) b.rule(ALTER_TRIGGER).define( ALTER, TRIGGER, b.optional(IF, EXISTS), UNIT_NAME, b.firstOf( ENABLE, DISABLE, b.sequence(RENAME, TO, IDENTIFIER_NAME), EDITIONABLE, NONEDITIONABLE, COMPILE_CLAUSE), b.optional(SEMICOLON)) b.rule(ALTER_PROCEDURE).define( ALTER, PROCEDURE, b.optional(IF, EXISTS), UNIT_NAME, b.firstOf( EDITIONABLE, NONEDITIONABLE, COMPILE_CLAUSE), b.optional(SEMICOLON)) b.rule(ALTER_FUNCTION).define( ALTER, FUNCTION, b.optional(IF, EXISTS), UNIT_NAME, b.firstOf( EDITIONABLE, NONEDITIONABLE, COMPILE_CLAUSE), b.optional(SEMICOLON)) b.rule(ALTER_PACKAGE).define( ALTER, PACKAGE, b.optional(IF, EXISTS), UNIT_NAME, b.firstOf( EDITIONABLE, NONEDITIONABLE, PACKAGE_COMPILE_CLAUSE), b.optional(SEMICOLON)) b.rule(PACKAGE_COMPILE_CLAUSE).define( COMPILE, b.optional(DEBUG), b.optional(b.firstOf(PACKAGE, SPECIFICATION, BODY)), b.zeroOrMore(COMPILER_PARAMETERS_CLAUSE), b.optional(REUSE, SETTINGS)) b.rule(DROP_COMMAND).define(DROP, b.oneOrMore(b.anyTokenButNot(b.firstOf(SEMICOLON, DIVISION, EOF))), b.optional(SEMICOLON)) b.rule(CREATE_SYNONYM).define( CREATE, b.optional(OR, REPLACE), b.optional(b.firstOf(EDITIONABLE, NONEDITIONABLE)), b.optional(PUBLIC), SYNONYM, UNIT_NAME, b.optional(SHARING, EQUALS, b.firstOf(METADATA, NONE)), FOR, DmlGrammar.TABLE_REFERENCE, b.optional(SEMICOLON)) b.rule(CREATE_SEQUENCE).define( CREATE, SEQUENCE, UNIT_NAME, b.optional(START, WITH, NUMERIC_LITERAL), b.optional(MAXVALUE, NUMERIC_LITERAL), b.optional(MINVALUE, NUMERIC_LITERAL), b.optional(INCREMENT, BY, NUMERIC_LITERAL), b.optional(b.firstOf(CYCLE, NOCYCLE)), b.optional(b.firstOf(NOCACHE, b.sequence(CACHE, NUMERIC_LITERAL)), b.optional(b.firstOf(ORDER, NOORDER))), b.optional(SEMICOLON)) b.rule(CREATE_DIRECTORY).define( CREATE, b.optional(OR, REPLACE), DIRECTORY, b.optional(IF, NOT, EXISTS), IDENTIFIER_NAME, b.optional(SHARING, EQUALS_OPERATOR, b.firstOf(METADATA, NONE)), AS, CHARACTER_LITERAL, b.optional(SEMICOLON)) b.rule(DROP_DIRECTORY).define( DROP, DIRECTORY, b.optional(IF, EXISTS), IDENTIFIER_NAME, b.optional(SEMICOLON)) b.rule(TRUNCATE_TABLE).define( TRUNCATE, TABLE, UNIT_NAME, b.optional( b.firstOf( PRESERVE, PURGE ), MATERIALIZED, VIEW, LOG ), b.optional( b.firstOf( b.sequence( DROP, b.optional(ALL) ), REUSE ), STORAGE ), b.optional(CASCADE), b.optional(SEMICOLON) ) b.rule(DDL_COMMAND).define(b.firstOf( DDL_COMMENT, CREATE_TABLE, ALTER_TABLE, ALTER_TRIGGER, ALTER_PROCEDURE, ALTER_FUNCTION, ALTER_PACKAGE, CREATE_SYNONYM, CREATE_SEQUENCE, CREATE_DIRECTORY, DROP_DIRECTORY, DROP_COMMAND, TRUNCATE_TABLE)) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/DmlGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.api.PlSqlGrammar.* import com.felipebz.zpa.api.PlSqlKeyword.* import com.felipebz.zpa.api.PlSqlPunctuator.* import com.felipebz.zpa.api.PlSqlTokenType.INTEGER_LITERAL import com.felipebz.zpa.api.SingleRowSqlFunctionsGrammar.* enum class DmlGrammar : GrammarRuleKey { TABLE_REFERENCE, DML_TABLE_EXPRESSION_CLAUSE, ALIAS, VALUES_EXPRESSION_CLAUSE, PARTITION_BY_CLAUSE, WINDOWING_LIMIT, WINDOWING_CLAUSE, KEEP_CLAUSE, ANALYTIC_CLAUSE, ON_OR_USING_EXPRESSION, INNER_CROSS_JOIN_CLAUSE, OUTER_JOIN_TYPE, QUERY_PARTITION_CLAUSE, OUTER_JOIN_CLAUSE, NESTED_CLAUSE, JOIN_CLAUSE, SELECT_COLUMN, FROM_CLAUSE, WHERE_CLAUSE, INTO_CLAUSE, GROUP_BY_CLAUSE, HAVING_CLAUSE, ORDER_BY_ITEM, ORDER_BY_CLAUSE, OFFSET_CLAUSE, FETCH_ROW_CLAUSE, ROW_LIMITING_CLAUSE, FOR_UPDATE_CLAUSE, CONNECT_BY_CLAUSE, START_WITH_CLAUSE, HIERARCHICAL_QUERY_CLAUSE, WITH_CLAUSE, SUBQUERY_FACTORING_CLAUSE, SEARCH_CLAUSE, CYCLE_CLAUSE, RETURNING_INTO_CLAUSE, QUERY_BLOCK, SELECT_EXPRESSION, DELETE_EXPRESSION, UPDATE_COLUMN, UPDATE_EXPRESSION, INSERT_COLUMNS, INSERT_EXPRESSION, SINGLE_TABLE_INSERT, INSERT_INTO_CLAUSE, VALUES_CLAUSE, MULTI_TABLE_INSERT, CONDITIONAL_INSERT_CLAUSE, MERGE_EXPRESSION, MERGE_UPDATE_CLAUSE, MERGE_INSERT_CLAUSE, ERROR_LOGGING_CLAUSE, DML_COMMAND, GROUPING_EXPRESSION_LIST, ROLLUP_CUBE_CLAUSE, GROUPING_SETS_CLAUSE, BACKED_LIST, PIVOT_CLAUSE, UNPIVOT_CLAUSE, PIVOT_FOR_CLAUSE, PIVOT_IN_CLAUSE, UNPIVOT_IN_CLAUSE; companion object { fun buildOn(b: PlSqlGrammarBuilder) { createSelectExpression(b) createDeleteExpression(b) createUpdateExpression(b) createInsertExpression(b) createMergeExpression(b) b.rule(DML_COMMAND).define( b.firstOf( SELECT_EXPRESSION, DELETE_EXPRESSION, UPDATE_EXPRESSION, INSERT_EXPRESSION, MERGE_EXPRESSION), b.optional(SEMICOLON)) } private fun createSelectExpression(b: PlSqlGrammarBuilder) { b.rule(TABLE_REFERENCE).define( b.optional(IDENTIFIER_NAME, DOT), IDENTIFIER_NAME, b.optional(REMOTE, IDENTIFIER_NAME, b.zeroOrMore(DOT, IDENTIFIER_NAME))) b.rule(ALIAS).define(IDENTIFIER_NAME) b.rule(PARTITION_BY_CLAUSE).define(PARTITION, BY, EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION)) b.rule(WINDOWING_LIMIT).define(b.firstOf( b.sequence(UNBOUNDED, b.firstOf(PRECEDING, FOLLOWING)), b.sequence(CURRENT, ROW), b.sequence(EXPRESSION, b.firstOf(PRECEDING, FOLLOWING)))) b.rule(WINDOWING_CLAUSE).define( b.firstOf(ROWS, RANGE_KEYWORD), b.firstOf( b.sequence(BETWEEN, WINDOWING_LIMIT, AND, WINDOWING_LIMIT), WINDOWING_LIMIT)) b.rule(KEEP_CLAUSE).define( KEEP, LPARENTHESIS, DENSE_RANK, b.firstOf(FIRST, LAST), ORDER_BY_CLAUSE, RPARENTHESIS) b.rule(ANALYTIC_CLAUSE).define( OVER, LPARENTHESIS, b.optional(PARTITION_BY_CLAUSE), b.optional(ORDER_BY_CLAUSE, b.optional(WINDOWING_CLAUSE)), RPARENTHESIS) b.rule(ON_OR_USING_EXPRESSION).define( b.firstOf( b.sequence(ON, EXPRESSION), b.sequence(USING, LPARENTHESIS, IDENTIFIER_NAME, b.zeroOrMore(COMMA, IDENTIFIER_NAME), RPARENTHESIS))) b.rule(OUTER_JOIN_TYPE).define(b.firstOf(FULL, LEFT, RIGHT), b.optional(OUTER)) b.rule(QUERY_PARTITION_CLAUSE).define( PARTITION, BY, b.firstOf( b.sequence(EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION)), b.sequence(LPARENTHESIS, EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION), RPARENTHESIS))) b.rule(INNER_CROSS_JOIN_CLAUSE).define(b.firstOf( b.sequence(b.optional(INNER), JOIN, DML_TABLE_EXPRESSION_CLAUSE, ON_OR_USING_EXPRESSION), b.sequence( b.firstOf( CROSS, b.sequence(NATURAL, b.optional(INNER))), JOIN, DML_TABLE_EXPRESSION_CLAUSE) )) b.rule(OUTER_JOIN_CLAUSE).define( b.optional(QUERY_PARTITION_CLAUSE), b.firstOf( b.sequence(OUTER_JOIN_TYPE, JOIN), b.sequence(NATURAL, b.optional(OUTER_JOIN_TYPE), JOIN)), b.sequence(DML_TABLE_EXPRESSION_CLAUSE, b.optional(QUERY_PARTITION_CLAUSE), b.optional(ON_OR_USING_EXPRESSION))) b.rule(NESTED_CLAUSE).define( NESTED, b.optional(PATH), IDENTIFIER_NAME, b.optional(b.firstOf( b.sequence(DOT, JSON_RELATIVE_OBJECT_ACCESS), b.sequence(COMMA, JSON_BASIC_PATH_EXPRESSION) )), b.optional(JSON_TABLE_ON_ERROR_CLAUSE), b.optional(JSON_TABLE_ON_EMPTY_CLAUSE), JSON_COLUMNS_CLAUSE ) b.rule(JOIN_CLAUSE).define( b.firstOf( b.sequence( b.firstOf( b.sequence(LPARENTHESIS, JOIN_CLAUSE, RPARENTHESIS), DML_TABLE_EXPRESSION_CLAUSE), b.oneOrMore(b.firstOf(INNER_CROSS_JOIN_CLAUSE, OUTER_JOIN_CLAUSE))), b.sequence(LPARENTHESIS, JOIN_CLAUSE, RPARENTHESIS) )) b.rule(SELECT_COLUMN).define(EXPRESSION, b.optional(b.optional(AS), IDENTIFIER_NAME, b.nextNot(COLLECT))) b.rule(DML_TABLE_EXPRESSION_CLAUSE).define( b.firstOf( b.sequence( b.firstOf( b.sequence(LPARENTHESIS, SELECT_EXPRESSION, b.optional( b.firstOf( PIVOT_CLAUSE, UNPIVOT_CLAUSE ) ), RPARENTHESIS), b.sequence(TABLE_REFERENCE, b.nextNot(LPARENTHESIS)), OBJECT_REFERENCE ), b.optional(NESTED_CLAUSE), b.optional( b.oneOrMore( b.firstOf( PIVOT_CLAUSE, UNPIVOT_CLAUSE ) ) ), b.optional( b.nextNot( b.firstOf( PARTITION, CROSS, USING, FULL, NATURAL, INNER, LEFT, RIGHT, OUTER, JOIN, RETURN, RETURNING, LOG, EXCEPT, SET ) ), b.optional(AS), ALIAS ) ), VALUES_EXPRESSION_CLAUSE ) ) b.rule(VALUES_EXPRESSION_CLAUSE).define( LPARENTHESIS, VALUES, b.oneOrMore(LPARENTHESIS, EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION), RPARENTHESIS, b.optional(COMMA)), RPARENTHESIS, b.optional(AS), IDENTIFIER_NAME, b.optional(LPARENTHESIS, IDENTIFIER_NAME, b.zeroOrMore(COMMA, IDENTIFIER_NAME), RPARENTHESIS) ) b.rule(FROM_CLAUSE).define( FROM, b.firstOf(JOIN_CLAUSE, DML_TABLE_EXPRESSION_CLAUSE), b.optional( b.firstOf( PIVOT_CLAUSE, UNPIVOT_CLAUSE ) ), b.zeroOrMore(COMMA, b.firstOf(JOIN_CLAUSE, DML_TABLE_EXPRESSION_CLAUSE), b.optional( b.firstOf( PIVOT_CLAUSE, UNPIVOT_CLAUSE ) ) ) ) b.rule(WHERE_CLAUSE).define(WHERE, EXPRESSION) b.rule(INTO_CLAUSE).define( b.optional(BULK, COLLECT), INTO, OBJECT_REFERENCE, b.zeroOrMore(COMMA, OBJECT_REFERENCE)) b.rule(GROUPING_EXPRESSION_LIST).define( b.firstOf( b.sequence(LPARENTHESIS, b.optional(EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION)), RPARENTHESIS), EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION)) ) b.rule(ROLLUP_CUBE_CLAUSE).define( b.firstOf(ROLLUP, CUBE), LPARENTHESIS, GROUPING_EXPRESSION_LIST, RPARENTHESIS) b.rule(GROUPING_SETS_CLAUSE).define( GROUPING, SETS, LPARENTHESIS, b.firstOf(ROLLUP_CUBE_CLAUSE, GROUPING_EXPRESSION_LIST), b.zeroOrMore(COMMA, b.firstOf(ROLLUP_CUBE_CLAUSE, GROUPING_EXPRESSION_LIST)), RPARENTHESIS) b.rule(GROUP_BY_CLAUSE).define( GROUP, BY, b.firstOf(ROLLUP_CUBE_CLAUSE, GROUPING_SETS_CLAUSE, EXPRESSION), b.zeroOrMore(COMMA, b.firstOf(ROLLUP_CUBE_CLAUSE, GROUPING_SETS_CLAUSE, EXPRESSION))) b.rule(HAVING_CLAUSE).define(HAVING, EXPRESSION) b.rule(BACKED_LIST).define( b.firstOf( b.oneOrMore(EXPRESSION, b.optional(b.optional(AS), b.firstOf(ALIAS,LITERAL)), b.optional(COMMA)), b.oneOrMore( LPARENTHESIS, b.oneOrMore(b.firstOf(LITERAL, IDENTIFIER_NAME), b.optional(COMMA)), RPARENTHESIS, b.optional(AS, b.oneOrMore(b.firstOf(LITERAL, IDENTIFIER_NAME), b.optional(COMMA))), b.optional(COMMA) )) ) b.rule(PIVOT_FOR_CLAUSE).define( FOR, b.firstOf( b.sequence(LPARENTHESIS, b.oneOrMore(VARIABLE_NAME, b.optional(COMMA)), RPARENTHESIS), VARIABLE_NAME ) ) b.rule(PIVOT_IN_CLAUSE).define( IN, LPARENTHESIS, b.firstOf( b.oneOrMore( b.firstOf( EXPRESSION, b.sequence(LPARENTHESIS, b.oneOrMore(EXPRESSION, b.optional(COMMA)), RPARENTHESIS) ), b.optional(b.optional(AS), b.firstOf(ALIAS,LITERAL)), b.optional(COMMA)), SELECT_EXPRESSION, b.oneOrMore(ANY, b.optional(COMMA))), RPARENTHESIS ) b.rule(UNPIVOT_IN_CLAUSE).define( IN, LPARENTHESIS, b.oneOrMore( b.firstOf( b.sequence(LPARENTHESIS, b.oneOrMore(VARIABLE_NAME, b.optional(COMMA)), RPARENTHESIS), VARIABLE_NAME ), b.optional( b.optional(AS), b.firstOf( b.sequence(LPARENTHESIS, b.oneOrMore(b.firstOf(ALIAS, LITERAL), b.optional(COMMA)), RPARENTHESIS), b.firstOf(ALIAS, LITERAL) ) ), b.optional(COMMA) ), RPARENTHESIS ) b.rule(PIVOT_CLAUSE).define( b.sequence( PIVOT, b.optional(XML), LPARENTHESIS, b.oneOrMore( b.firstOf( b.sequence(LPARENTHESIS, b.optional(EXPRESSION), RPARENTHESIS), EXPRESSION ), b.optional(b.optional(AS), b.firstOf(ALIAS,LITERAL)), b.optional(COMMA) ), PIVOT_FOR_CLAUSE, PIVOT_IN_CLAUSE, RPARENTHESIS ) ) b.rule(UNPIVOT_CLAUSE).define( b.sequence( UNPIVOT, b.optional(b.firstOf(INCLUDE, EXCLUDE), NULLS), LPARENTHESIS, b.firstOf( b.sequence(LPARENTHESIS, b.oneOrMore(VARIABLE_NAME, b.optional(COMMA)), RPARENTHESIS), VARIABLE_NAME ), PIVOT_FOR_CLAUSE, UNPIVOT_IN_CLAUSE, RPARENTHESIS ) ) b.rule(ORDER_BY_ITEM).define(EXPRESSION, b.optional(b.firstOf(ASC, DESC)), b.optional(NULLS, b.firstOf(FIRST, LAST))) b.rule(ORDER_BY_CLAUSE).define( ORDER, b.optional(SIBLINGS), BY, ORDER_BY_ITEM, b.zeroOrMore(COMMA, ORDER_BY_ITEM)) b.rule(OFFSET_CLAUSE).define(OFFSET, EXPRESSION, b.firstOf(ROW, ROWS)) b.rule(FETCH_ROW_CLAUSE).define(FETCH, b.firstOf(FIRST, NEXT), b.optional(EXPRESSION, b.optional(PERCENT)), b.firstOf(ROW, ROWS), b.firstOf(ONLY, b.sequence(WITH, TIES))) b.rule(ROW_LIMITING_CLAUSE).define(b.firstOf( b.sequence(OFFSET_CLAUSE, b.optional(FETCH_ROW_CLAUSE)), FETCH_ROW_CLAUSE)) b.rule(FOR_UPDATE_CLAUSE).define( FOR, UPDATE, b.optional(OF, OBJECT_REFERENCE, b.zeroOrMore(COMMA, OBJECT_REFERENCE)), b.optional(b.firstOf(NOWAIT, b.sequence(WAIT, INTEGER_LITERAL), b.sequence(SKIP, LOCKED)))) b.rule(CONNECT_BY_CLAUSE).define(CONNECT, BY, b.optional(NOCYCLE), EXPRESSION) b.rule(START_WITH_CLAUSE).define(START, WITH, EXPRESSION) b.rule(HIERARCHICAL_QUERY_CLAUSE).define(b.firstOf( b.sequence(CONNECT_BY_CLAUSE, b.optional(START_WITH_CLAUSE)), b.sequence(START_WITH_CLAUSE, CONNECT_BY_CLAUSE))) b.rule(WITH_CLAUSE).define( WITH, b.firstOf( b.sequence( b.oneOrMore(b.firstOf(FUNCTION_DECLARATION, PROCEDURE_DECLARATION)), b.zeroOrMore(SUBQUERY_FACTORING_CLAUSE, b.zeroOrMore(COMMA, SUBQUERY_FACTORING_CLAUSE)) ), b.oneOrMore(SUBQUERY_FACTORING_CLAUSE, b.zeroOrMore(COMMA, SUBQUERY_FACTORING_CLAUSE)) ) ) b.rule(SUBQUERY_FACTORING_CLAUSE).define( IDENTIFIER_NAME, b.optional(LPARENTHESIS, IDENTIFIER_NAME, b.zeroOrMore(COMMA, IDENTIFIER_NAME), RPARENTHESIS), AS, b.firstOf( b.sequence(LPARENTHESIS, SELECT_EXPRESSION, RPARENTHESIS), VALUES_EXPRESSION_CLAUSE), b.optional(SEARCH_CLAUSE), b.optional(CYCLE_CLAUSE) ) b.rule(SEARCH_CLAUSE).define( SEARCH, b.firstOf(BREADTH, DEPTH), FIRST, BY, ORDER_BY_ITEM, b.zeroOrMore(COMMA, ORDER_BY_ITEM), SET, IDENTIFIER_NAME ) b.rule(CYCLE_CLAUSE).define( CYCLE, IDENTIFIER_NAME, b.zeroOrMore(COMMA, IDENTIFIER_NAME), SET, IDENTIFIER_NAME, TO, EXPRESSION, DEFAULT, EXPRESSION ) b.rule(QUERY_BLOCK).define( b.firstOf( b.sequence( SELECT, b.optional(b.firstOf(ALL, DISTINCT, UNIQUE)), SELECT_COLUMN, b.zeroOrMore(COMMA, SELECT_COLUMN), b.optional(INTO_CLAUSE), b.optional(FROM_CLAUSE), b.optional(WHERE_CLAUSE), b.optional(b.firstOf( b.sequence(GROUP_BY_CLAUSE, b.optional(HAVING_CLAUSE)), b.sequence(HAVING_CLAUSE, b.optional(GROUP_BY_CLAUSE)))), b.optional(HAVING_CLAUSE), b.optional(HIERARCHICAL_QUERY_CLAUSE)), b.sequence(LPARENTHESIS, SELECT_EXPRESSION, RPARENTHESIS))) b.rule(SELECT_EXPRESSION).define( b.optional(WITH_CLAUSE), QUERY_BLOCK, b.zeroOrMore(b.firstOf(MINUS_KEYWORD, INTERSECT, UNION, EXCEPT), b.optional(ALL), QUERY_BLOCK), b.optional(b.firstOf( b.sequence(ORDER_BY_CLAUSE, b.optional(b.firstOf(FOR_UPDATE_CLAUSE, ROW_LIMITING_CLAUSE))), ROW_LIMITING_CLAUSE, b.sequence(FOR_UPDATE_CLAUSE, b.optional(ORDER_BY_CLAUSE))))) } private fun createDeleteExpression(b: PlSqlGrammarBuilder) { b.rule(RETURNING_INTO_CLAUSE).define( b.firstOf(RETURNING, RETURN), b.optional(EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION)), INTO_CLAUSE) b.rule(DELETE_EXPRESSION).define( DELETE, b.optional(FROM), DML_TABLE_EXPRESSION_CLAUSE, b.optional(b.firstOf( b.sequence(WHERE, CURRENT, OF, IDENTIFIER_NAME), WHERE_CLAUSE)), b.optional(RETURNING_INTO_CLAUSE)) } private fun createUpdateExpression(b: PlSqlGrammarBuilder) { b.rule(UPDATE_COLUMN).define(OBJECT_REFERENCE, EQUALS, b.firstOf(EXPRESSION, DEFAULT)) b.rule(UPDATE_EXPRESSION).define( UPDATE, DML_TABLE_EXPRESSION_CLAUSE, SET, UPDATE_COLUMN, b.zeroOrMore(COMMA, UPDATE_COLUMN), b.optional(b.firstOf( b.sequence(WHERE, CURRENT, OF, IDENTIFIER_NAME), WHERE_CLAUSE)), b.optional(RETURNING_INTO_CLAUSE)) } private fun createInsertExpression(b: PlSqlGrammarBuilder) { b.rule(INSERT_COLUMNS).define(LPARENTHESIS, MEMBER_EXPRESSION, b.zeroOrMore(COMMA, MEMBER_EXPRESSION), RPARENTHESIS) b.rule(INSERT_EXPRESSION).define(INSERT, b.firstOf(SINGLE_TABLE_INSERT, MULTI_TABLE_INSERT)) b.rule(SINGLE_TABLE_INSERT).define( INSERT_INTO_CLAUSE, b.firstOf( b.sequence(VALUES_CLAUSE, b.optional(RETURNING_INTO_CLAUSE)), SELECT_EXPRESSION), b.optional(ERROR_LOGGING_CLAUSE)) b.rule(INSERT_INTO_CLAUSE).define(INTO, b.firstOf(b.sequence(LPARENTHESIS, SELECT_EXPRESSION, RPARENTHESIS), b.firstOf( TABLE_EXPRESSION, THE_EXPRESSION, TABLE_REFERENCE)), b.optional(IDENTIFIER_NAME), b.optional(INSERT_COLUMNS)) b.rule(VALUES_CLAUSE).define( VALUES, b.firstOf( b.sequence(LPARENTHESIS, b.firstOf(EXPRESSION, DEFAULT), b.zeroOrMore(b.sequence(COMMA, b.firstOf(EXPRESSION, DEFAULT))), RPARENTHESIS), EXPRESSION)) b.rule(MULTI_TABLE_INSERT).define( b.firstOf( b.sequence(ALL, b.oneOrMore(b.sequence(INSERT_INTO_CLAUSE, b.optional(VALUES_CLAUSE), b.optional(ERROR_LOGGING_CLAUSE)))), CONDITIONAL_INSERT_CLAUSE), SELECT_EXPRESSION) b.rule(CONDITIONAL_INSERT_CLAUSE).define( b.optional(b.firstOf(ALL, FIRST)), WHEN, EXPRESSION, THEN, INSERT_INTO_CLAUSE, b.optional(VALUES_CLAUSE), b.optional(ERROR_LOGGING_CLAUSE), b.zeroOrMore(INSERT_INTO_CLAUSE, b.optional(VALUES_CLAUSE), b.optional(ERROR_LOGGING_CLAUSE)), b.zeroOrMore(WHEN, EXPRESSION, THEN, INSERT_INTO_CLAUSE, b.optional(VALUES_CLAUSE), b.optional(ERROR_LOGGING_CLAUSE), b.zeroOrMore(INSERT_INTO_CLAUSE, b.optional(VALUES_CLAUSE), b.optional(ERROR_LOGGING_CLAUSE))), b.optional(ELSE, INSERT_INTO_CLAUSE, b.optional(VALUES_CLAUSE), b.optional(ERROR_LOGGING_CLAUSE), b.zeroOrMore(INSERT_INTO_CLAUSE, b.optional(VALUES_CLAUSE), b.optional(ERROR_LOGGING_CLAUSE)))) } private fun createMergeExpression(b: PlSqlGrammarBuilder) { b.rule(MERGE_UPDATE_CLAUSE).define(WHEN, MATCHED, THEN, UPDATE, SET, UPDATE_COLUMN, b.zeroOrMore(COMMA, UPDATE_COLUMN), b.optional(WHERE_CLAUSE), b.optional(DELETE, WHERE_CLAUSE)) b.rule(MERGE_INSERT_CLAUSE).define(WHEN, NOT, MATCHED, THEN, INSERT, b.optional(LPARENTHESIS, OBJECT_REFERENCE, b.zeroOrMore(COMMA, OBJECT_REFERENCE), RPARENTHESIS), VALUES, b.firstOf( b.sequence(LPARENTHESIS, b.firstOf(EXPRESSION, DEFAULT), b.zeroOrMore(COMMA, b.firstOf(EXPRESSION, DEFAULT)), RPARENTHESIS), IDENTIFIER_NAME), b.optional(WHERE_CLAUSE)) b.rule(ERROR_LOGGING_CLAUSE).define( LOG, ERRORS, b.optional(INTO, TABLE_REFERENCE), b.optional(LPARENTHESIS, EXPRESSION, RPARENTHESIS), b.optional(REJECT, LIMIT, b.firstOf(EXPRESSION, UNLIMITED))) //https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_9016.htm#SQLRF01606 b.rule(MERGE_EXPRESSION).define( MERGE, INTO, TABLE_REFERENCE, b.optional(b.nextNot(USING), IDENTIFIER_NAME), USING, DML_TABLE_EXPRESSION_CLAUSE, ON, LPARENTHESIS, BOOLEAN_EXPRESSION, RPARENTHESIS, b.firstOf( b.sequence(MERGE_UPDATE_CLAUSE, b.optional(MERGE_INSERT_CLAUSE), b.optional(ERROR_LOGGING_CLAUSE)), b.sequence(MERGE_INSERT_CLAUSE, b.optional(MERGE_UPDATE_CLAUSE), b.optional(ERROR_LOGGING_CLAUSE)))) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/GrammarRuleBuilderExtensions.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.grammar.GrammarRuleBuilder internal fun GrammarRuleBuilder.define(e: Any): GrammarRuleBuilder = this.`is`(e) internal fun GrammarRuleBuilder.define(e: Any, vararg rest: Any): GrammarRuleBuilder = this.`is`(e, *rest) ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/PlSqlFile.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import java.nio.file.Path interface PlSqlFile { fun contents(): String fun fileName(): String fun path(): Path fun type(): Type enum class Type { MAIN, TEST } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/PlSqlGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.GenericTokenType.EOF import com.felipebz.flr.api.GenericTokenType.IDENTIFIER import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.flr.grammar.LexerfulGrammarBuilder import com.felipebz.zpa.grammar.ExecuteBufferExpression import com.felipebz.zpa.sslr.ElseClause import com.felipebz.zpa.sslr.ElsifClause import com.felipebz.zpa.sslr.IfStatement import com.felipebz.zpa.sslr.NullStatement import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.sslr.RaiseStatement import com.felipebz.zpa.sslr.Statements import com.felipebz.zpa.squid.PlSqlConfiguration import com.felipebz.zpa.api.DclGrammar.DCL_COMMAND import com.felipebz.zpa.api.DdlGrammar.DDL_COMMAND import com.felipebz.zpa.api.DmlGrammar.* import com.felipebz.zpa.api.PlSqlKeyword.* import com.felipebz.zpa.api.PlSqlPunctuator.* import com.felipebz.zpa.api.PlSqlTokenType.* import com.felipebz.zpa.api.SessionControlGrammar.SESSION_CONTROL_COMMAND import com.felipebz.zpa.api.SqlPlusGrammar.SQLPLUS_COMMAND import com.felipebz.zpa.api.TclGrammar.* enum class PlSqlGrammar : GrammarRuleKey { // Data types DATATYPE, DATATYPE_LENGTH, CHARACTER_SET_CLAUSE, NUMERIC_PRECISION, NUMERIC_SCALE, NUMERIC_DATATYPE_CONSTRAINT, NUMERIC_DATATYPE, LOB_DATATYPE, CHARACTER_DATATYPE_CONSTRAINT, CHARACTER_DATAYPE, BOOLEAN_DATATYPE, DATE_DATATYPE, CUSTOM_SUBTYPE, ANCHORED_DATATYPE, CUSTOM_DATATYPE, REF_DATATYPE, JSON_DATATYPE, DATATYPE_NULL_CONSTRAINT, // Literals LITERAL, BOOLEAN_LITERAL, NULL_LITERAL, NUMERIC_LITERAL, FLOATING_POINT_LITERAL, CHARACTER_LITERAL, INTERVAL_YEAR_TO_MONTH_LITERAL, INTERVAL_DAY_TO_SECOND_LITERAL, INTERVAL_LITERAL, INQUIRY_DIRECTIVE, // Operators CONCATENATION_OPERATOR, EQUALS_OPERATOR, NOTEQUALS_STANDARD_OPERATOR, NOTEQUALS_NONSTANDARD_OPERATOR, NOTEQUALS_OPERATOR, LESSTHAN_OPERATOR, LESSTHANOREQUALS_OPERATOR, GREATERTHAN_OPERATOR, GREATERTHANOREQUALS_OPERATOR, // Expressions EXPRESSION, AND_EXPRESSION, OR_EXPRESSION, NOT_EXPRESSION, BOOLEAN_EXPRESSION, PRIMARY_EXPRESSION, BRACKED_EXPRESSION, MULTIPLE_VALUE_EXPRESSION, MEMBER_EXPRESSION, OUTER_JOIN_PLUS_SIGN, OBJECT_REFERENCE, POSTFIX_EXPRESSION, IN_EXPRESSION, EXISTS_EXPRESSION, UNARY_EXPRESSION, MULTIPLICATIVE_EXPRESSION, ADDITIVE_EXPRESSION, CONCATENATION_EXPRESSION, COMPARISON_EXPRESSION, EXPONENTIATION_EXPRESSION, ARGUMENT, ARGUMENTS, METHOD_CALL, SEQUENCE_ITERATOR_CHOICE, POSITIONAL_CHOICE_OPTION, POSITIONAL_CHOICE_LIST, NAMED_CHOICE_LIST, INDEXED_CHOICE_LIST, BASIC_ITERATOR_CHOICE, INDEX_ITERATOR_CHOICE, EXPLICIT_CHOICE_OPTION, EXPLICIT_CHOICE_LIST, QUALIFIED_EXPRESSION, CALL_EXPRESSION, CASE_EXPRESSION, AT_TIME_ZONE_EXPRESSION, VARIABLE_NAME, NEW_OBJECT_EXPRESSION, MULTISET_EXPRESSION, // Statements LABEL, STATEMENTS_SECTION, BLOCK_STATEMENT, NULL_STATEMENT, ASSIGNMENT_STATEMENT, ELSIF_CLAUSE, ELSE_CLAUSE, IF_STATEMENT, LOOP_STATEMENT, EXIT_STATEMENT, CONTINUE_STATEMENT, GOTO_STATEMENT, ITERATOR, ITERAND_DECLARATION, ITERATION_CTL_SEQ, QUAL_ITERATION_CTL, PRED_CLAUSE_SEQ, ITERATION_CONTROL, STEPPED_CONTROL, SINGLE_EXPRESSION_CONTROL, VALUES_OF_CONTROL, INDICES_OF_CONTROL, PAIRS_OF_CONTROL, DYNAMIC_SQL, FOR_STATEMENT, WHILE_STATEMENT, RETURN_STATEMENT, COMMIT_STATEMENT, ROLLBACK_STATEMENT, SAVEPOINT_STATEMENT, RAISE_STATEMENT, SELECT_STATEMENT, INSERT_STATEMENT, UPDATE_STATEMENT, DELETE_STATEMENT, CALL_STATEMENT, UNNAMED_ACTUAL_PAMETER, EXECUTE_IMMEDIATE_STATEMENT, OPEN_STATEMENT, OPEN_FOR_STATEMENT, FETCH_STATEMENT, CLOSE_STATEMENT, PIPE_ROW_STATEMENT, CASE_STATEMENT, STATEMENT, STATEMENTS, FORALL_STATEMENT, SET_TRANSACTION_STATEMENT, MERGE_STATEMENT, INLINE_PRAGMA_STATEMENT, // Declarations DEFAULT_VALUE_ASSIGNMENT, VARIABLE_DECLARATION, EXCEPTION_DECLARATION, PARAMETER_DECLARATIONS, PARAMETER_DECLARATION, CURSOR_PARAMETER_DECLARATIONS, CURSOR_PARAMETER_DECLARATION, CURSOR_DECLARATION, RECORD_FIELD_DECLARATION, RECORD_DECLARATION, NESTED_TABLE_DEFINITION, TABLE_OF_DECLARATION, VARRAY_TYPE_DEFINITION, VARRAY_DECLARATION, REF_CURSOR_DECLARATION, AUTONOMOUS_TRANSACTION_PRAGMA, EXCEPTION_INIT_PRAGMA, SERIALLY_REUSABLE_PRAGMA, INTERFACE_PRAGMA, RESTRICT_REFERENCES_PRAGMA, UDF_PRAGMA, DEPRECATE_PRAGMA, SUPPRESSES_WARNING_6009_PRAGMA, COVERAGE_PRAGMA, PRAGMA_DECLARATION, HOST_AND_INDICATOR_VARIABLE, JAVA_DECLARATION, C_DECLARATION, EXTERNAL_PARAMETER_PROPERTY, EXTERNAL_PARAMETER, CALL_SPECIFICATION, DECLARE_SECTION, EXCEPTION_HANDLERS, EXCEPTION_HANDLER, IDENTIFIER_NAME, NON_RESERVED_KEYWORD, EXECUTE_PLSQL_BUFFER, // Triggers SIMPLE_DML_TRIGGER, INSTEAD_OF_DML_TRIGGER, COMPOUND_DML_TRIGGER, SYSTEM_TRIGGER, DML_EVENT_CLAUSE, REFERENCING_CLAUSE, TRIGGER_EDITION_CLAUSE, TRIGGER_ORDERING_CLAUSE, COMPOUND_TRIGGER_BLOCK, TIMING_POINT_SECTION, TIMING_POINT, TPS_BODY, DDL_EVENT, DATABASE_EVENT, // Program units COMPILATION_UNIT, UNIT_NAME, ANONYMOUS_BLOCK, PROCEDURE_DECLARATION, FUNCTION_DECLARATION, CREATE_PROCEDURE, CREATE_FUNCTION, CREATE_PACKAGE, CREATE_PACKAGE_BODY, VIEW_RESTRICTION_CLAUSE, CREATE_VIEW, TYPE_ATTRIBUTE, INHERITANCE_CLAUSE, TYPE_SUBPROGRAM, TYPE_CONSTRUCTOR, MAP_ORDER_FUNCTION, TYPE_ELEMENT_SPEC, OBJECT_TYPE_DEFINITION, CREATE_TRIGGER, CREATE_TYPE, CREATE_TYPE_BODY, // Top-level components VALID_INPUT, RECOVERY, FILE_INPUT; companion object { fun create(conf: PlSqlConfiguration): PlSqlGrammarBuilder { val b = PlSqlGrammarBuilder(LexerfulGrammarBuilder.create()) val keywords = PlSqlKeyword.nonReservedKeywords val rest = keywords.subList(2, keywords.size).toTypedArray() b.rule(NON_RESERVED_KEYWORD).define(b.firstOf(keywords[0], keywords[1], *rest)) b.rule(IDENTIFIER_NAME).define(b.firstOf(IDENTIFIER, NON_RESERVED_KEYWORD)) b.rule(VALID_INPUT).define(b.firstOf( COMPILATION_UNIT, DCL_COMMAND, DDL_COMMAND, DML_COMMAND, TCL_COMMAND, SQLPLUS_COMMAND, SESSION_CONTROL_COMMAND, EXECUTE_PLSQL_BUFFER)).skip() if (conf.isErrorRecoveryEnabled) { b.rule(RECOVERY).define(b.oneOrMore( b.nextNot(b.firstOf(VALID_INPUT, EOF)), b.anyToken())) b.rule(FILE_INPUT).define(b.zeroOrMore(b.firstOf( VALID_INPUT, RECOVERY)), EOF) } else { b.rule(RECOVERY).define(b.nothing()) b.rule(FILE_INPUT).define(b.zeroOrMore(VALID_INPUT), EOF) } createLiterals(b) createOperators(b) createDatatypes(b) createStatements(b) createExpressions(b) createDeclarations(b) createTrigger(b) createProgramUnits(b) DdlGrammar.buildOn(b) DmlGrammar.buildOn(b) DclGrammar.buildOn(b) TclGrammar.buildOn(b) SqlPlusGrammar.buildOn(b) SessionControlGrammar.buildOn(b) SingleRowSqlFunctionsGrammar.buildOn(b) AggregateSqlFunctionsGrammar.buildOn(b) ConditionsGrammar.buildOn(b) b.setRootRule(FILE_INPUT) b.buildWithMemoizationOfMatchesForAllRules() return b } private fun createLiterals(b: PlSqlGrammarBuilder) { b.rule(INTERVAL_YEAR_TO_MONTH_LITERAL).define( INTERVAL, CHARACTER_LITERAL, b.firstOf(YEAR, MONTH), b.optional(LPARENTHESIS, INTEGER_LITERAL, RPARENTHESIS), b.optional(TO, b.firstOf(YEAR, MONTH))) b.rule(INTERVAL_DAY_TO_SECOND_LITERAL).define( INTERVAL, CHARACTER_LITERAL, b.firstOf( b.sequence(b.firstOf(DAY, HOUR, MINUTE), b.optional(LPARENTHESIS, INTEGER_LITERAL, RPARENTHESIS)), b.sequence(SECOND, b.optional(LPARENTHESIS, INTEGER_LITERAL, b.optional(COMMA, INTEGER_LITERAL), RPARENTHESIS)) ), b.optional(TO, b.firstOf( DAY, HOUR, MINUTE, b.sequence(SECOND, b.optional(LPARENTHESIS, INTEGER_LITERAL, RPARENTHESIS)) ))) b.rule(NULL_LITERAL).define(NULL) b.rule(BOOLEAN_LITERAL).define(b.firstOf(TRUE, FALSE)) b.rule(NUMERIC_LITERAL).define(b.firstOf(INTEGER_LITERAL, NUMBER_LITERAL)) b.rule(FLOATING_POINT_LITERAL).define(b.firstOf(BINARY_DOUBLE_INFINITY, BINARY_DOUBLE_NAN, BINARY_FLOAT_INFINITY, BINARY_FLOAT_NAN)) b.rule(CHARACTER_LITERAL).define(STRING_LITERAL) b.rule(INTERVAL_LITERAL).define(b.firstOf(INTERVAL_YEAR_TO_MONTH_LITERAL, INTERVAL_DAY_TO_SECOND_LITERAL)) b.rule(INQUIRY_DIRECTIVE).define(DOUBLEDOLLAR, IDENTIFIER_NAME) b.rule(LITERAL).define(b.firstOf(NULL_LITERAL, BOOLEAN_LITERAL, NUMERIC_LITERAL, FLOATING_POINT_LITERAL, CHARACTER_LITERAL, DATE_LITERAL, TIMESTAMP_LITERAL, INTERVAL_LITERAL, INQUIRY_DIRECTIVE)) } private fun createOperators(b: PlSqlGrammarBuilder) { b.rule(CONCATENATION_OPERATOR).define(SINGLE_PIPE, SINGLE_PIPE) b.rule(EQUALS_OPERATOR).define(EQUALS) b.rule(NOTEQUALS_STANDARD_OPERATOR).define(LESSTHAN, GREATERTHAN) b.rule(NOTEQUALS_NONSTANDARD_OPERATOR).define(b.firstOf(EXCLAMATION, CARET, TILDE), EQUALS) b.rule(NOTEQUALS_OPERATOR).define(b.firstOf(NOTEQUALS_STANDARD_OPERATOR, NOTEQUALS_NONSTANDARD_OPERATOR)) b.rule(LESSTHAN_OPERATOR).define(LESSTHAN) b.rule(LESSTHANOREQUALS_OPERATOR).define(LESSTHAN, EQUALS) b.rule(GREATERTHAN_OPERATOR).define(GREATERTHAN) b.rule(GREATERTHANOREQUALS_OPERATOR).define(GREATERTHAN, EQUALS) } private fun createDatatypes(b: PlSqlGrammarBuilder) { b.rule(DATATYPE_LENGTH).define(b.firstOf(EXPRESSION, INQUIRY_DIRECTIVE)).skip() b.rule(NUMERIC_PRECISION).define(b.firstOf(MULTIPLICATION, DATATYPE_LENGTH)) b.rule(NUMERIC_SCALE).define(DATATYPE_LENGTH) b.rule(NUMERIC_DATATYPE_CONSTRAINT).define( LPARENTHESIS, NUMERIC_PRECISION, b.optional(COMMA, NUMERIC_SCALE), RPARENTHESIS ) b.rule(NUMERIC_DATATYPE).define( b.firstOf( BINARY_DOUBLE, BINARY_FLOAT, BINARY_INTEGER, DEC, DECIMAL, b.sequence(DOUBLE, PRECISION), FLOAT, INT, INTEGER, NATURAL, NATURALN, NUMBER, NUMERIC, PLS_INTEGER, POSITIVE, POSITIVEN, REAL, SIGNTYPE, SMALLINT), b.optional(NUMERIC_DATATYPE_CONSTRAINT)) b.rule(CHARACTER_SET_CLAUSE).define(CHARACTER, SET, b.firstOf(ANY_CS, b.sequence(IDENTIFIER_NAME, MOD, CHARSET))) b.rule(LOB_DATATYPE).define(b.firstOf(BFILE, BLOB, CLOB, NCLOB), b.optional(CHARACTER_SET_CLAUSE)) b.rule(CHARACTER_DATATYPE_CONSTRAINT).define( b.firstOf( b.sequence(LPARENTHESIS, DATATYPE_LENGTH, b.optional(b.firstOf(BYTE, CHAR)), RPARENTHESIS, b.optional(CHARACTER_SET_CLAUSE)), CHARACTER_SET_CLAUSE)) b.rule(CHARACTER_DATAYPE).define( b.firstOf( CHAR, CHARACTER, b.sequence(LONG, b.optional(RAW)), NCHAR, NVARCHAR2, RAW, ROWID, STRING, UROWID, VARCHAR, VARCHAR2), b.optional(CHARACTER_DATATYPE_CONSTRAINT)) b.rule(BOOLEAN_DATATYPE).define(BOOLEAN) b.rule(DATE_DATATYPE).define(b.firstOf( DATE, b.sequence(TIMESTAMP, b.optional(LPARENTHESIS, DATATYPE_LENGTH, RPARENTHESIS), b.optional(WITH, b.optional(LOCAL), TIME, ZONE)), b.sequence(INTERVAL, YEAR, b.optional(LPARENTHESIS, DATATYPE_LENGTH, RPARENTHESIS), TO, MONTH), b.sequence(INTERVAL, DAY, b.optional(LPARENTHESIS, DATATYPE_LENGTH, RPARENTHESIS), TO, SECOND, b.optional(LPARENTHESIS, DATATYPE_LENGTH, RPARENTHESIS)))) b.rule(ANCHORED_DATATYPE).define(MEMBER_EXPRESSION, MOD, b.firstOf(TYPE, ROWTYPE)) b.rule(CUSTOM_DATATYPE).define( MEMBER_EXPRESSION, b.optional(b.firstOf(NUMERIC_DATATYPE_CONSTRAINT, CHARACTER_DATATYPE_CONSTRAINT))) b.rule(REF_DATATYPE).define(REF, MEMBER_EXPRESSION) b.rule(JSON_DATATYPE).define(JSON) b.rule(DATATYPE).define(b.firstOf( NUMERIC_DATATYPE, LOB_DATATYPE, CHARACTER_DATAYPE, BOOLEAN_DATATYPE, DATE_DATATYPE, ANCHORED_DATATYPE, REF_DATATYPE, JSON_DATATYPE, CUSTOM_DATATYPE)) b.rule(DATATYPE_NULL_CONSTRAINT).define( b.firstOf( b.sequence(NOT, NULL), NULL ) ) } private fun createStatements(b: PlSqlGrammarBuilder) { b.rule(HOST_AND_INDICATOR_VARIABLE).define( b.firstOf( b.sequence( COLON, b.firstOf( b.sequence(IDENTIFIER_NAME, b.optional(INDICATOR), b.optional(COLON, IDENTIFIER_NAME)), INTEGER_LITERAL ) ), QUESTION_MARK ) ) b.rule(NULL_STATEMENT, NullStatement::class).define(NULL, SEMICOLON) b.rule(EXCEPTION_HANDLER).define( WHEN, b.firstOf(OTHERS, OBJECT_REFERENCE), b.zeroOrMore(OR, b.firstOf(OTHERS, OBJECT_REFERENCE)), THEN, STATEMENTS) b.rule(EXCEPTION_HANDLERS).define(EXCEPTION, b.oneOrMore(EXCEPTION_HANDLER)) b.rule(LABEL).define(LLABEL, IDENTIFIER_NAME, RLABEL) b.rule(STATEMENTS_SECTION).define( BEGIN, STATEMENTS, b.optional(EXCEPTION_HANDLERS), END, b.optional(IDENTIFIER_NAME), SEMICOLON) b.rule(BLOCK_STATEMENT).define( b.optional(LABEL), b.optional(DECLARE, b.optional(DECLARE_SECTION)), STATEMENTS_SECTION) b.rule(ASSIGNMENT_STATEMENT).define(b.optional(LABEL), OBJECT_REFERENCE, ASSIGNMENT, EXPRESSION, SEMICOLON) b.rule(ELSIF_CLAUSE, ElsifClause::class).define(ELSIF, EXPRESSION, THEN, STATEMENTS) b.rule(ELSE_CLAUSE, ElseClause::class).define(ELSE, STATEMENTS) b.rule(IF_STATEMENT, IfStatement::class).define( b.optional(LABEL), IF, EXPRESSION, THEN, STATEMENTS, b.zeroOrMore(ELSIF_CLAUSE), b.optional(ELSE_CLAUSE), END, IF, b.optional(IDENTIFIER_NAME), SEMICOLON) b.rule(LOOP_STATEMENT).define(b.optional(LABEL), LOOP, STATEMENTS, END, LOOP, b.optional(IDENTIFIER_NAME), SEMICOLON) b.rule(EXIT_STATEMENT).define(b.optional(LABEL), EXIT, b.optional(IDENTIFIER_NAME), b.optional(WHEN, EXPRESSION), SEMICOLON) b.rule(CONTINUE_STATEMENT).define(b.optional(LABEL), CONTINUE, b.optional(IDENTIFIER_NAME), b.optional(WHEN, EXPRESSION), SEMICOLON) b.rule(GOTO_STATEMENT).define(b.optional(LABEL), GOTO, b.optional(IDENTIFIER_NAME), SEMICOLON) b.rule(ITERATOR).define( ITERAND_DECLARATION, b.optional(COMMA, ITERAND_DECLARATION), IN, ITERATION_CTL_SEQ) b.rule(ITERAND_DECLARATION).define( IDENTIFIER_NAME, b.optional(b.firstOf(MUTABLE, IMMUTABLE)), b.optional(DATATYPE), b.optional(DATATYPE_NULL_CONSTRAINT)) b.rule(ITERATION_CTL_SEQ).define(QUAL_ITERATION_CTL, b.zeroOrMore(COMMA, QUAL_ITERATION_CTL)).skip() b.rule(QUAL_ITERATION_CTL).define(b.optional(REVERSE), ITERATION_CONTROL, PRED_CLAUSE_SEQ) b.rule(PRED_CLAUSE_SEQ).define(b.optional(WHILE, EXPRESSION), b.optional(WHEN, EXPRESSION)).skip() b.rule(ITERATION_CONTROL).define(b.firstOf( STEPPED_CONTROL, VALUES_OF_CONTROL, INDICES_OF_CONTROL, PAIRS_OF_CONTROL, SINGLE_EXPRESSION_CONTROL, DYNAMIC_SQL)).skip() b.rule(STEPPED_CONTROL).define(EXPRESSION, RANGE, EXPRESSION, b.optional(BY, OBJECT_REFERENCE)) b.rule(SINGLE_EXPRESSION_CONTROL).define(b.optional(REPEAT), CONCATENATION_EXPRESSION) b.rule(VALUES_OF_CONTROL).define(VALUES, OF, b.firstOf(OBJECT_REFERENCE, DYNAMIC_SQL)) b.rule(INDICES_OF_CONTROL).define(INDICES, OF, b.firstOf(OBJECT_REFERENCE, DYNAMIC_SQL)) b.rule(PAIRS_OF_CONTROL).define(PAIRS, OF, b.firstOf(OBJECT_REFERENCE, DYNAMIC_SQL)) b.rule(DYNAMIC_SQL).define( LPARENTHESIS, EXECUTE, IMMEDIATE, CONCATENATION_EXPRESSION, b.optional(USING, UNNAMED_ACTUAL_PAMETER, b.zeroOrMore(COMMA, UNNAMED_ACTUAL_PAMETER)), RPARENTHESIS) b.rule(FOR_STATEMENT).define( b.optional(LABEL), FOR, ITERATOR, LOOP, STATEMENTS, END, LOOP, b.optional(IDENTIFIER_NAME), SEMICOLON) b.rule(WHILE_STATEMENT).define( b.optional(LABEL), WHILE, EXPRESSION, LOOP, STATEMENTS, END, LOOP, b.optional(IDENTIFIER_NAME), SEMICOLON) b.rule(FORALL_STATEMENT).define( b.optional(LABEL), FORALL, IDENTIFIER_NAME, IN, b.firstOf(b.sequence(EXPRESSION, RANGE, EXPRESSION), b.sequence(VALUES, OF, IDENTIFIER_NAME), b.sequence(INDICES, OF, IDENTIFIER_NAME, b.optional(BETWEEN, AND_EXPRESSION))), b.optional(SAVE, EXCEPTIONS), b.firstOf( INSERT_STATEMENT, UPDATE_STATEMENT, DELETE_STATEMENT, MERGE_STATEMENT, EXECUTE_IMMEDIATE_STATEMENT)) b.rule(RETURN_STATEMENT).define(b.optional(LABEL), RETURN, b.optional(EXPRESSION), SEMICOLON) b.rule(COMMIT_STATEMENT).define(b.optional(LABEL), COMMIT_EXPRESSION, SEMICOLON) b.rule(ROLLBACK_STATEMENT).define(b.optional(LABEL), ROLLBACK_EXPRESSION, SEMICOLON) b.rule(SAVEPOINT_STATEMENT).define(b.optional(LABEL), SAVEPOINT_EXPRESSION, SEMICOLON) b.rule(RAISE_STATEMENT, RaiseStatement::class).define(b.optional(LABEL), RAISE, b.optional(MEMBER_EXPRESSION), SEMICOLON) b.rule(SELECT_STATEMENT).define(b.optional(LABEL), SELECT_EXPRESSION, SEMICOLON) b.rule(INSERT_STATEMENT).define(b.optional(LABEL), INSERT_EXPRESSION, SEMICOLON) b.rule(UPDATE_STATEMENT).define(b.optional(LABEL), UPDATE_EXPRESSION, SEMICOLON) b.rule(DELETE_STATEMENT).define(b.optional(LABEL), DELETE_EXPRESSION, SEMICOLON) b.rule(MERGE_STATEMENT).define(b.optional(LABEL), MERGE_EXPRESSION, SEMICOLON) b.rule(CALL_STATEMENT).define(b.optional(LABEL), OBJECT_REFERENCE, SEMICOLON) b.rule(UNNAMED_ACTUAL_PAMETER).define( b.optional(b.firstOf(b.sequence(IN, b.optional(OUT)), OUT)), EXPRESSION) b.rule(EXECUTE_IMMEDIATE_STATEMENT).define( b.optional(LABEL), b.optional(FORALL_STATEMENT), EXECUTE, IMMEDIATE, CONCATENATION_EXPRESSION, b.optional(INTO_CLAUSE), b.optional(USING, UNNAMED_ACTUAL_PAMETER, b.zeroOrMore(COMMA, UNNAMED_ACTUAL_PAMETER)), b.optional(RETURNING_INTO_CLAUSE), SEMICOLON) b.rule(OPEN_STATEMENT).define( b.optional(LABEL), OPEN, MEMBER_EXPRESSION, b.optional(ARGUMENTS), SEMICOLON) b.rule(OPEN_FOR_STATEMENT).define( b.optional(LABEL), OPEN, MEMBER_EXPRESSION, FOR, b.firstOf(SELECT_EXPRESSION, EXPRESSION), b.optional(USING, UNNAMED_ACTUAL_PAMETER, b.zeroOrMore(COMMA, UNNAMED_ACTUAL_PAMETER)), SEMICOLON) b.rule(FETCH_STATEMENT).define( b.optional(LABEL), FETCH, MEMBER_EXPRESSION, INTO_CLAUSE, b.optional(LIMIT, EXPRESSION), SEMICOLON) b.rule(CLOSE_STATEMENT).define(b.optional(LABEL), CLOSE, MEMBER_EXPRESSION, SEMICOLON) b.rule(PIPE_ROW_STATEMENT).define(b.optional(LABEL), PIPE, ROW, LPARENTHESIS, EXPRESSION, RPARENTHESIS, SEMICOLON) b.rule(CASE_STATEMENT).define( b.optional(LABEL), CASE, b.optional(EXPRESSION), b.oneOrMore(WHEN, EXPRESSION, THEN, STATEMENTS), b.optional(ELSE, STATEMENTS), END, CASE, b.optional(IDENTIFIER_NAME), SEMICOLON) //https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_10005.htm#SQLRF01705 b.rule(SET_TRANSACTION_STATEMENT).define(b.optional(LABEL), SET_TRANSACTION_EXPRESSION, SEMICOLON) b.rule(INLINE_PRAGMA_STATEMENT).define(PRAGMA, INLINE, LPARENTHESIS, MEMBER_EXPRESSION, COMMA, STRING_LITERAL, RPARENTHESIS, SEMICOLON) b.rule(STATEMENT).define(b.firstOf(NULL_STATEMENT, BLOCK_STATEMENT, ASSIGNMENT_STATEMENT, IF_STATEMENT, LOOP_STATEMENT, EXIT_STATEMENT, CONTINUE_STATEMENT, GOTO_STATEMENT, FOR_STATEMENT, WHILE_STATEMENT, RETURN_STATEMENT, COMMIT_STATEMENT, ROLLBACK_STATEMENT, SAVEPOINT_STATEMENT, RAISE_STATEMENT, FORALL_STATEMENT, SELECT_STATEMENT, INSERT_STATEMENT, UPDATE_STATEMENT, DELETE_STATEMENT, CALL_STATEMENT, EXECUTE_IMMEDIATE_STATEMENT, OPEN_STATEMENT, OPEN_FOR_STATEMENT, FETCH_STATEMENT, CLOSE_STATEMENT, PIPE_ROW_STATEMENT, CASE_STATEMENT, SET_TRANSACTION_STATEMENT, MERGE_STATEMENT, INLINE_PRAGMA_STATEMENT, COVERAGE_PRAGMA)) b.rule(STATEMENTS, Statements::class).define(b.oneOrMore(STATEMENT)) } private fun createExpressions(b: PlSqlGrammarBuilder) { // Reference: http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/expression.htm b.rule(VARIABLE_NAME).define(b.firstOf(IDENTIFIER_NAME, HOST_AND_INDICATOR_VARIABLE)) b.rule(PRIMARY_EXPRESSION).define( b.firstOf(LITERAL, VARIABLE_NAME, SQL, MULTIPLICATION)).skip() b.rule(BRACKED_EXPRESSION).define(b.firstOf( PRIMARY_EXPRESSION, b.sequence(LPARENTHESIS, EXPRESSION, RPARENTHESIS))).skipIfOneChild() b.rule(MULTIPLE_VALUE_EXPRESSION).define(b.firstOf( BRACKED_EXPRESSION, b.sequence(LPARENTHESIS, EXPRESSION, b.oneOrMore(COMMA, EXPRESSION), RPARENTHESIS))).skipIfOneChild() b.rule(MEMBER_EXPRESSION).define( MULTIPLE_VALUE_EXPRESSION, b.zeroOrMore( b.firstOf(DOT, REMOTE, b.sequence(MOD, b.nextNot(ROWTYPE), b.nextNot(TYPE))), b.firstOf( IDENTIFIER_NAME, COUNT, ROWCOUNT, BULK_ROWCOUNT, FIRST, LAST, LIMIT, NEXT, PRIOR, EXISTS, FOUND, NOTFOUND, ISOPEN, DELETE, TRIM, EXTEND, NEXTVAL, CURRVAL) )).skipIfOneChild() b.rule(ARGUMENT).define(b.optional(IDENTIFIER_NAME, ASSOCIATION), b.optional(DISTINCT), EXPRESSION) b.rule(ARGUMENTS).define(LPARENTHESIS, b.optional(ARGUMENT, b.zeroOrMore(COMMA, ARGUMENT)), RPARENTHESIS) b.rule(METHOD_CALL).define(MEMBER_EXPRESSION, b.oneOrMore(ARGUMENTS)) b.rule(SEQUENCE_ITERATOR_CHOICE).define(FOR, ITERATOR, SEQUENCE, ASSOCIATION, EXPRESSION) b.rule(POSITIONAL_CHOICE_OPTION).define(b.firstOf( SEQUENCE_ITERATOR_CHOICE, b.sequence(EXPRESSION, b.nextNot(b.firstOf(SINGLE_PIPE, ASSOCIATION))))).skip() b.rule(POSITIONAL_CHOICE_LIST).define( POSITIONAL_CHOICE_OPTION, b.zeroOrMore(COMMA, POSITIONAL_CHOICE_OPTION) ) b.rule(NAMED_CHOICE_LIST).define( IDENTIFIER_NAME, b.zeroOrMore(SINGLE_PIPE, IDENTIFIER_NAME), ASSOCIATION, EXPRESSION) b.rule(INDEXED_CHOICE_LIST).define( EXPRESSION, b.zeroOrMore(SINGLE_PIPE, EXPRESSION), ASSOCIATION, EXPRESSION) b.rule(BASIC_ITERATOR_CHOICE).define( FOR, ITERATOR, ASSOCIATION, EXPRESSION) b.rule(INDEX_ITERATOR_CHOICE).define( FOR, ITERATOR, INDEX, EXPRESSION, ASSOCIATION, EXPRESSION) b.rule(EXPLICIT_CHOICE_OPTION).define( b.firstOf(NAMED_CHOICE_LIST, INDEXED_CHOICE_LIST, BASIC_ITERATOR_CHOICE, INDEX_ITERATOR_CHOICE)).skip() b.rule(EXPLICIT_CHOICE_LIST).define( EXPLICIT_CHOICE_OPTION, b.zeroOrMore(COMMA, EXPLICIT_CHOICE_OPTION)) b.rule(QUALIFIED_EXPRESSION).define( MEMBER_EXPRESSION, LPARENTHESIS, b.optional(POSITIONAL_CHOICE_LIST), b.optional(EXPLICIT_CHOICE_LIST), RPARENTHESIS) b.rule(CALL_EXPRESSION).define(b.firstOf( SingleRowSqlFunctionsGrammar.SINGLE_ROW_SQL_FUNCTION, AggregateSqlFunctionsGrammar.AGGREGATE_SQL_FUNCTION, METHOD_CALL, QUALIFIED_EXPRESSION)).skipIfOneChild() b.rule(OUTER_JOIN_PLUS_SIGN).define(LPARENTHESIS, PLUS, RPARENTHESIS) b.rule(OBJECT_REFERENCE).define( b.firstOf(CALL_EXPRESSION, MEMBER_EXPRESSION), b.zeroOrMore(DOT, b.firstOf(CALL_EXPRESSION, MEMBER_EXPRESSION)), b.optional(OUTER_JOIN_PLUS_SIGN)).skipIfOneChild() b.rule(POSTFIX_EXPRESSION).define(OBJECT_REFERENCE, b.optional(b.firstOf( ANALYTIC_CLAUSE, b.sequence(KEEP_CLAUSE, b.optional(ANALYTIC_CLAUSE))))).skipIfOneChild() b.rule(IN_EXPRESSION).define(CONCATENATION_EXPRESSION, b.optional(b.sequence( b.optional(NOT), IN, b.firstOf( b.sequence( LPARENTHESIS, b.firstOf( SELECT_EXPRESSION, b.sequence(EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION)), ), RPARENTHESIS), EXPRESSION)))).skipIfOneChild() b.rule(EXISTS_EXPRESSION).define(EXISTS, LPARENTHESIS, SELECT_EXPRESSION, RPARENTHESIS).skipIfOneChild() b.rule(CASE_EXPRESSION).define( CASE, b.optional(EXPRESSION), b.oneOrMore(WHEN, EXPRESSION, THEN, EXPRESSION), b.optional(ELSE, EXPRESSION), END) b.rule(AT_TIME_ZONE_EXPRESSION).define(AT, b.firstOf(LOCAL, b.sequence(TIME, ZONE, EXPRESSION))) b.rule(NEW_OBJECT_EXPRESSION).define(NEW, OBJECT_REFERENCE, b.optional(ARGUMENTS)) //https://docs.oracle.com/cd/E11882_01/server.112/e41084/operators006.htm#SQLRF0032 b.rule(MULTISET_EXPRESSION).define( OBJECT_REFERENCE, b.oneOrMore( MULTISET, b.firstOf(EXCEPT, INTERSECT, UNION), b.optional(b.firstOf(ALL, DISTINCT)), OBJECT_REFERENCE)) b.rule(UNARY_EXPRESSION).define(b.firstOf( b.sequence(PLUS, UNARY_EXPRESSION), b.sequence(MINUS, UNARY_EXPRESSION), b.sequence(PRIOR, UNARY_EXPRESSION), b.sequence(CONNECT_BY_ROOT, UNARY_EXPRESSION), EXISTS_EXPRESSION, MULTISET_EXPRESSION, NEW_OBJECT_EXPRESSION, CASE_EXPRESSION, POSTFIX_EXPRESSION, b.sequence(LPARENTHESIS, SELECT_EXPRESSION, RPARENTHESIS)), b.optional(AT_TIME_ZONE_EXPRESSION)).skipIfOneChild() b.rule(EXPONENTIATION_EXPRESSION).define(UNARY_EXPRESSION, b.zeroOrMore(EXPONENTIATION, UNARY_EXPRESSION)).skipIfOneChild() b.rule(MULTIPLICATIVE_EXPRESSION).define( EXPONENTIATION_EXPRESSION, b.zeroOrMore( b.firstOf( MULTIPLICATION, b.sequence(b.nextNot(EXECUTE_PLSQL_BUFFER), DIVISION), MOD_KEYWORD ), EXPONENTIATION_EXPRESSION ) ).skipIfOneChild() b.rule(ADDITIVE_EXPRESSION).define(MULTIPLICATIVE_EXPRESSION, b.zeroOrMore(b.firstOf(PLUS, MINUS), MULTIPLICATIVE_EXPRESSION)).skipIfOneChild() b.rule(CONCATENATION_EXPRESSION).define(ADDITIVE_EXPRESSION, b.zeroOrMore(CONCATENATION_OPERATOR, ADDITIVE_EXPRESSION)).skipIfOneChild() b.rule(COMPARISON_EXPRESSION).define(b.firstOf( ConditionsGrammar.CONDITION, IN_EXPRESSION)).skipIfOneChild() b.rule(NOT_EXPRESSION).define(b.optional(NOT), COMPARISON_EXPRESSION).skipIfOneChild() b.rule(AND_EXPRESSION).define(NOT_EXPRESSION, b.zeroOrMore(AND, NOT_EXPRESSION)).skipIfOneChild() b.rule(OR_EXPRESSION).define(AND_EXPRESSION, b.zeroOrMore(OR, AND_EXPRESSION)).skipIfOneChild() b.rule(BOOLEAN_EXPRESSION).define(OR_EXPRESSION).skip() b.rule(EXPRESSION).define(BOOLEAN_EXPRESSION).skipIfOneChild() } private fun createDeclarations(b: PlSqlGrammarBuilder) { b.rule(DEFAULT_VALUE_ASSIGNMENT).define(b.firstOf(ASSIGNMENT, DEFAULT), EXPRESSION) b.rule(PARAMETER_DECLARATION).define( IDENTIFIER_NAME, b.optional(IN), b.firstOf( b.sequence(DATATYPE, b.optional(DEFAULT_VALUE_ASSIGNMENT)), b.sequence(OUT, b.optional(NOCOPY), DATATYPE)) ) b.rule(PARAMETER_DECLARATIONS).define(LPARENTHESIS, b.oneOrMore(PARAMETER_DECLARATION, b.optional(COMMA)), RPARENTHESIS) b.rule(JAVA_DECLARATION).define(LANGUAGE, JAVA, NAME, STRING_LITERAL) b.rule(C_DECLARATION).define( b.firstOf(b.sequence(LANGUAGE, "C"), EXTERNAL), b.optional(NAME, IDENTIFIER_NAME), LIBRARY, IDENTIFIER_NAME, b.optional(NAME, IDENTIFIER_NAME), b.optional(AGENT, IN, LPARENTHESIS, b.oneOrMore(IDENTIFIER_NAME, b.optional(COMMA)), RPARENTHESIS), b.optional(WITH, CONTEXT), b.optional(PARAMETERS, LPARENTHESIS, b.oneOrMore(EXTERNAL_PARAMETER, b.optional(COMMA)), RPARENTHESIS)) b.rule(EXTERNAL_PARAMETER_PROPERTY).define( b.sequence(INDICATOR, b.optional(b.firstOf(STRUCT, TDO))), LENGTH, DURATION, MAXLEN, CHARSETID, CHARSETFORM) b.rule(EXTERNAL_PARAMETER).define(b.firstOf( CONTEXT, b.sequence(SELF, b.firstOf(TDO, EXTERNAL_PARAMETER_PROPERTY)), b.sequence( b.firstOf(RETURN, IDENTIFIER_NAME), b.optional(EXTERNAL_PARAMETER_PROPERTY), b.optional(BY, REFERENCE), b.optional(DATATYPE)))) b.rule(CALL_SPECIFICATION).define(b.firstOf(JAVA_DECLARATION, C_DECLARATION), SEMICOLON) // http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/procedure.htm b.rule(PROCEDURE_DECLARATION).define( PROCEDURE, IDENTIFIER_NAME, b.optional(PARAMETER_DECLARATIONS), b.optional(b.firstOf( SEMICOLON, b.sequence(b.firstOf(IS, AS), b.firstOf( b.sequence(b.optional(DECLARE_SECTION), STATEMENTS_SECTION), CALL_SPECIFICATION))) )) // http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/function.htm b.rule(FUNCTION_DECLARATION).define( FUNCTION, IDENTIFIER_NAME, b.optional(PARAMETER_DECLARATIONS), RETURN, DATATYPE, b.zeroOrMore(b.firstOf(DETERMINISTIC, PIPELINED, PARALLEL_ENABLE)), b.optional(RESULT_CACHE, b.optional(RELIES_ON, LPARENTHESIS, b.oneOrMore(OBJECT_REFERENCE, b.optional(COMMA)), RPARENTHESIS)), b.optional(b.firstOf( SEMICOLON, b.sequence(b.firstOf(IS, AS), b.firstOf( b.sequence(b.optional(DECLARE_SECTION), STATEMENTS_SECTION), CALL_SPECIFICATION))) )) b.rule(VARIABLE_DECLARATION).define(IDENTIFIER_NAME, b.optional(CONSTANT), b.firstOf( b.sequence( DATATYPE, b.optional(DATATYPE_NULL_CONSTRAINT), b.optional(DEFAULT_VALUE_ASSIGNMENT)), EXCEPTION), SEMICOLON) b.rule(EXCEPTION_DECLARATION).define(IDENTIFIER_NAME, EXCEPTION, SEMICOLON) b.rule(CUSTOM_SUBTYPE).define( SUBTYPE, IDENTIFIER_NAME, IS, DATATYPE, b.optional(DATATYPE_NULL_CONSTRAINT), b.optional(RANGE_KEYWORD, NUMERIC_LITERAL, RANGE, NUMERIC_LITERAL), SEMICOLON ) b.rule(CURSOR_PARAMETER_DECLARATION).define( IDENTIFIER_NAME, b.optional(IN), DATATYPE, b.optional(DEFAULT_VALUE_ASSIGNMENT)) b.rule(CURSOR_PARAMETER_DECLARATIONS).define( LPARENTHESIS, b.oneOrMore(CURSOR_PARAMETER_DECLARATION, b.optional(COMMA)), RPARENTHESIS) b.rule(CURSOR_DECLARATION).define( CURSOR, IDENTIFIER_NAME, b.optional(CURSOR_PARAMETER_DECLARATIONS), b.optional(RETURN, DATATYPE), b.optional(IS, SELECT_EXPRESSION), SEMICOLON) b.rule(RECORD_FIELD_DECLARATION).define( IDENTIFIER_NAME, DATATYPE, b.optional(DATATYPE_NULL_CONSTRAINT), b.optional(DEFAULT_VALUE_ASSIGNMENT) ) b.rule(RECORD_DECLARATION).define( TYPE, IDENTIFIER_NAME, IS, RECORD, LPARENTHESIS, RECORD_FIELD_DECLARATION, b.zeroOrMore(COMMA, RECORD_FIELD_DECLARATION), RPARENTHESIS, SEMICOLON) b.rule(NESTED_TABLE_DEFINITION).define(TABLE, OF, DATATYPE, b.optional(DATATYPE_NULL_CONSTRAINT)) b.rule(TABLE_OF_DECLARATION).define( TYPE, IDENTIFIER_NAME, IS, NESTED_TABLE_DEFINITION, b.optional(INDEX, BY, DATATYPE, b.optional(DATATYPE_NULL_CONSTRAINT)), SEMICOLON) b.rule(VARRAY_TYPE_DEFINITION).define( b.firstOf(VARRAY, b.sequence(b.optional(VARYING), ARRAY)), LPARENTHESIS, INTEGER_LITERAL, RPARENTHESIS, OF, DATATYPE, b.optional(DATATYPE_NULL_CONSTRAINT) ) b.rule(VARRAY_DECLARATION).define( TYPE, IDENTIFIER_NAME, IS, VARRAY_TYPE_DEFINITION, SEMICOLON) b.rule(REF_CURSOR_DECLARATION).define(TYPE, IDENTIFIER_NAME, IS, REF, CURSOR, b.optional(RETURN, DATATYPE), SEMICOLON) b.rule(AUTONOMOUS_TRANSACTION_PRAGMA).define(PRAGMA, AUTONOMOUS_TRANSACTION, SEMICOLON) b.rule(EXCEPTION_INIT_PRAGMA).define(PRAGMA, EXCEPTION_INIT, LPARENTHESIS, EXPRESSION, COMMA, EXPRESSION, RPARENTHESIS, SEMICOLON) b.rule(SERIALLY_REUSABLE_PRAGMA).define(PRAGMA, SERIALLY_REUSABLE, SEMICOLON) b.rule(INTERFACE_PRAGMA).define( PRAGMA, INTERFACE, LPARENTHESIS, IDENTIFIER_NAME, COMMA, IDENTIFIER_NAME, COMMA, INTEGER_LITERAL, RPARENTHESIS, SEMICOLON) b.rule(RESTRICT_REFERENCES_PRAGMA).define( PRAGMA, RESTRICT_REFERENCES, LPARENTHESIS, b.oneOrMore(b.anyTokenButNot(RPARENTHESIS)), RPARENTHESIS, SEMICOLON) b.rule(UDF_PRAGMA).define(PRAGMA, UDF, SEMICOLON) b.rule(DEPRECATE_PRAGMA).define(PRAGMA, DEPRECATE, LPARENTHESIS, EXPRESSION, b.optional(COMMA, STRING_LITERAL), RPARENTHESIS) b.rule(SUPPRESSES_WARNING_6009_PRAGMA) .define(PRAGMA, SUPPRESSES_WARNING_6009, LPARENTHESIS, IDENTIFIER_NAME, RPARENTHESIS) b.rule(COVERAGE_PRAGMA) .define(PRAGMA, COVERAGE, LPARENTHESIS, STRING_LITERAL, RPARENTHESIS, SEMICOLON) b.rule(PRAGMA_DECLARATION).define( b.firstOf( EXCEPTION_INIT_PRAGMA, AUTONOMOUS_TRANSACTION_PRAGMA, SERIALLY_REUSABLE_PRAGMA, INTERFACE_PRAGMA, RESTRICT_REFERENCES_PRAGMA, UDF_PRAGMA, b.sequence(DEPRECATE_PRAGMA, SEMICOLON), b.sequence(SUPPRESSES_WARNING_6009_PRAGMA, SEMICOLON), COVERAGE_PRAGMA ) ) b.rule(DECLARE_SECTION).define(b.oneOrMore(b.firstOf( PRAGMA_DECLARATION, EXCEPTION_DECLARATION, VARIABLE_DECLARATION, PROCEDURE_DECLARATION, FUNCTION_DECLARATION, CUSTOM_SUBTYPE, CURSOR_DECLARATION, RECORD_DECLARATION, TABLE_OF_DECLARATION, VARRAY_DECLARATION, REF_CURSOR_DECLARATION))) } private fun createTrigger(b: PlSqlGrammarBuilder) { b.rule(CREATE_TRIGGER).define( CREATE, b.optional(OR, REPLACE), b.optional(b.firstOf(EDITIONABLE, NONEDITIONABLE)), TRIGGER, UNIT_NAME, b.firstOf(SIMPLE_DML_TRIGGER, INSTEAD_OF_DML_TRIGGER, COMPOUND_DML_TRIGGER, SYSTEM_TRIGGER) ) b.rule(SIMPLE_DML_TRIGGER).define( b.firstOf(BEFORE, AFTER), DML_EVENT_CLAUSE, b.zeroOrMore(OR, DML_EVENT_CLAUSE), ON, UNIT_NAME, b.optional(REFERENCING_CLAUSE), b.optional(FOR, EACH, ROW), b.optional(TRIGGER_EDITION_CLAUSE), b.optional(TRIGGER_ORDERING_CLAUSE), b.optional(b.firstOf(ENABLE, DISABLE)), b.optional(WHEN, LPARENTHESIS, EXPRESSION, RPARENTHESIS), b.optional(DECLARE, b.optional(DECLARE_SECTION)), STATEMENTS_SECTION ) b.rule(INSTEAD_OF_DML_TRIGGER).define( INSTEAD, OF, b.firstOf( DELETE, INSERT, UPDATE), b.zeroOrMore(OR, b.firstOf( DELETE, INSERT, UPDATE)), ON, b.optional(NESTED, TABLE, IDENTIFIER_NAME, OF), UNIT_NAME, b.optional(REFERENCING_CLAUSE), b.optional(FOR, EACH, ROW), b.optional(TRIGGER_EDITION_CLAUSE), b.optional(TRIGGER_ORDERING_CLAUSE), b.optional(b.firstOf(ENABLE, DISABLE)), b.optional(DECLARE, b.optional(DECLARE_SECTION)), STATEMENTS_SECTION ) b.rule(COMPOUND_DML_TRIGGER).define( FOR, DML_EVENT_CLAUSE, b.zeroOrMore(OR, DML_EVENT_CLAUSE), ON, UNIT_NAME, b.optional(REFERENCING_CLAUSE), b.optional(TRIGGER_EDITION_CLAUSE), b.optional(TRIGGER_ORDERING_CLAUSE), b.optional(b.firstOf(ENABLE, DISABLE)), b.optional(WHEN, LPARENTHESIS, EXPRESSION, RPARENTHESIS), COMPOUND_TRIGGER_BLOCK ) b.rule(SYSTEM_TRIGGER).define( b.firstOf( b.sequence(b.firstOf(BEFORE, AFTER, b.sequence(INSTEAD, OF)), DDL_EVENT, b.zeroOrMore(OR, DDL_EVENT)), b.sequence(DATABASE_EVENT, b.zeroOrMore(OR, DATABASE_EVENT))), ON, b.firstOf( b.sequence(b.optional(IDENTIFIER_NAME, DOT), SCHEMA), b.sequence(b.optional(PLUGGABLE), DATABASE)), b.optional(TRIGGER_ORDERING_CLAUSE), b.optional(b.firstOf(ENABLE, DISABLE)), b.optional(DECLARE, b.optional(DECLARE_SECTION)), STATEMENTS_SECTION ) b.rule(DML_EVENT_CLAUSE).define( b.firstOf( DELETE, INSERT, UPDATE), b.optional(OF, IDENTIFIER_NAME, b.zeroOrMore(COMMA, IDENTIFIER_NAME)) ) b.rule(REFERENCING_CLAUSE).define( REFERENCING, b.zeroOrMore( b.firstOf( b.sequence(OLD, b.optional(AS), IDENTIFIER_NAME), b.sequence(NEW, b.optional(AS), IDENTIFIER_NAME), b.sequence(PARENT, b.optional(AS), IDENTIFIER_NAME) ))) b.rule(TRIGGER_EDITION_CLAUSE).define( b.optional(b.firstOf(FORWARD, REVERSE)), CROSSEDITION) b.rule(TRIGGER_ORDERING_CLAUSE).define( b.firstOf(FOLLOWS, PRECEDES), UNIT_NAME, b.zeroOrMore(COMMA, UNIT_NAME)) b.rule(COMPOUND_TRIGGER_BLOCK).define( COMPOUND, TRIGGER, b.optional(DECLARE_SECTION), b.oneOrMore(TIMING_POINT_SECTION), END, UNIT_NAME, SEMICOLON) b.rule(TIMING_POINT_SECTION).define( TIMING_POINT, IS, BEGIN, TPS_BODY, END, TIMING_POINT, SEMICOLON) b.rule(TIMING_POINT).define( b.firstOf( b.sequence(BEFORE, STATEMENT_KEYWORD), b.sequence(BEFORE, EACH, ROW), b.sequence(AFTER, STATEMENT_KEYWORD), b.sequence(AFTER, EACH, ROW), b.sequence(INSTEAD, OF, EACH, ROW) )) b.rule(TPS_BODY).define( b.oneOrMore(STATEMENT), b.optional(EXCEPTION_HANDLERS)) b.rule(DDL_EVENT).define( b.firstOf( ALTER, ANALYZE, b.sequence(ASSOCIATE, STATISTICS), AUDIT, COMMENT, CREATE, b.sequence(DISASSOCIATE, STATISTICS), DROP, GRANT, NOAUDIT, RENAME, REVOKE, TRUNCATE, DDL) ) b.rule(DATABASE_EVENT).define( b.firstOf( b.sequence(AFTER, STARTUP), b.sequence(BEFORE, SHUTDOWN), b.sequence(AFTER, DB_ROLE_CHANGE), b.sequence(AFTER, SERVERERROR), b.sequence(AFTER, LOGON), b.sequence(BEFORE, LOGOFF), b.sequence(AFTER, SUSPEND), b.sequence(AFTER, CLONE), b.sequence(BEFORE, UNPLUG), b.sequence(b.firstOf(BEFORE, AFTER), SET, CONTAINER)) ) } private fun createProgramUnits(b: PlSqlGrammarBuilder) { b.rule(EXECUTE_PLSQL_BUFFER).define(ExecuteBufferExpression, b.next(b.firstOf(VALID_INPUT, EOF))) b.rule(UNIT_NAME).define(b.optional(IDENTIFIER_NAME, DOT), IDENTIFIER_NAME) // https://docs.oracle.com/en/database/oracle/oracle-database/18/lnpls/CREATE-PROCEDURE-statement.html b.rule(CREATE_PROCEDURE).define( CREATE, b.optional(OR, REPLACE), b.optional(b.firstOf(EDITIONABLE, NONEDITIONABLE)), PROCEDURE, UNIT_NAME, b.optional(TIMESTAMP, STRING_LITERAL), b.optional(PARAMETER_DECLARATIONS), b.optional(SHARING, EQUALS, b.firstOf(METADATA, NONE)), b.zeroOrMore(b.firstOf( b.sequence(AUTHID, b.firstOf(CURRENT_USER, DEFINER)), b.sequence(DEFAULT, COLLATION, USING_NLS_COMP), b.sequence(ACCESSIBLE, BY, LPARENTHESIS, b.firstOf(FUNCTION, PROCEDURE, PACKAGE, TRIGGER, TYPE), UNIT_NAME, RPARENTHESIS)) ), b.firstOf(IS, AS), b.firstOf( b.sequence(b.optional(DECLARE_SECTION), STATEMENTS_SECTION), CALL_SPECIFICATION) ) // https://docs.oracle.com/en/database/oracle/oracle-database/18/lnpls/CREATE-FUNCTION-statement.html b.rule(CREATE_FUNCTION).define( CREATE, b.optional(OR, REPLACE), b.optional(b.firstOf(EDITIONABLE, NONEDITIONABLE)), FUNCTION, UNIT_NAME, b.optional(TIMESTAMP, STRING_LITERAL), b.optional(PARAMETER_DECLARATIONS), RETURN, DATATYPE, b.optional(SHARING, EQUALS, b.firstOf(METADATA, NONE)), b.zeroOrMore(b.firstOf( DETERMINISTIC, PIPELINED, PARALLEL_ENABLE, b.sequence( RESULT_CACHE, b.optional(RELIES_ON, LPARENTHESIS, b.oneOrMore(OBJECT_REFERENCE, b.optional(COMMA)), RPARENTHESIS)), b.sequence(AUTHID, b.firstOf(CURRENT_USER, DEFINER)), b.sequence(DEFAULT, COLLATION, USING_NLS_COMP), b.sequence(ACCESSIBLE, BY, LPARENTHESIS, b.firstOf(FUNCTION, PROCEDURE, PACKAGE, TRIGGER, TYPE), UNIT_NAME, RPARENTHESIS))), b.firstOf( b.sequence( b.firstOf(IS, AS), b.firstOf( b.sequence(b.optional(DECLARE_SECTION), STATEMENTS_SECTION), CALL_SPECIFICATION)), b.sequence(AGGREGATE, USING, OBJECT_REFERENCE, SEMICOLON)) ) // https://docs.oracle.com/en/database/oracle/oracle-database/18/lnpls/CREATE-PACKAGE-statement.html b.rule(CREATE_PACKAGE).define( b.optional(CREATE), b.optional(OR, REPLACE), b.optional(b.firstOf(EDITIONABLE, NONEDITIONABLE)), PACKAGE, UNIT_NAME, b.optional(TIMESTAMP, STRING_LITERAL), b.optional(SHARING, EQUALS, b.firstOf(METADATA, NONE)), b.zeroOrMore(b.firstOf( b.sequence(AUTHID, b.firstOf(CURRENT_USER, DEFINER)), b.sequence(DEFAULT, COLLATION, USING_NLS_COMP), b.sequence(ACCESSIBLE, BY, LPARENTHESIS, b.firstOf(FUNCTION, PROCEDURE, PACKAGE, TRIGGER, TYPE), UNIT_NAME, RPARENTHESIS))), b.firstOf(IS, AS), b.optional(DECLARE_SECTION), END, b.optional(IDENTIFIER_NAME), SEMICOLON) // https://docs.oracle.com/en/database/oracle/oracle-database/18/lnpls/CREATE-PACKAGE-BODY-statement.html b.rule(CREATE_PACKAGE_BODY).define( b.optional(CREATE), b.optional(OR, REPLACE), b.optional(b.firstOf(EDITIONABLE, NONEDITIONABLE)), PACKAGE, BODY, UNIT_NAME, b.optional(TIMESTAMP, STRING_LITERAL), b.firstOf(IS, AS), b.optional(DECLARE_SECTION), b.firstOf( STATEMENTS_SECTION, b.sequence(END, b.optional(IDENTIFIER_NAME), SEMICOLON))) b.rule(VIEW_RESTRICTION_CLAUSE).define( WITH, b.firstOf( b.sequence(READ, ONLY), b.sequence(CHECK, OPTION, b.optional(CONSTRAINT, IDENTIFIER_NAME)) ) ) // https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/CREATE-VIEW.html b.rule(CREATE_VIEW).define( CREATE, b.optional( b.firstOf( b.sequence(MATERIALIZED, VIEW, UNIT_NAME, b.zeroOrMore( b.firstOf( b.sequence(PCTFREE, INTEGER_LITERAL), b.sequence(PCTUSED, INTEGER_LITERAL), b.sequence(INITRANS, INTEGER_LITERAL), b.sequence(TABLESPACE, IDENTIFIER_NAME) )), b.optional(b.sequence(b.optional(NO), REFRESH, COMPLETE, b.optional(START, WITH, EXPRESSION, NEXT, EXPRESSION)))), b.sequence(b.optional(b.sequence(OR, REPLACE)), b.optional(b.firstOf(EDITIONABLE, NONEDITIONABLE)), b.optional(b.optional(NO), FORCE), VIEW, UNIT_NAME))), b.optional(LPARENTHESIS, IDENTIFIER_NAME, b.zeroOrMore(COMMA, IDENTIFIER_NAME), RPARENTHESIS), AS, SELECT_EXPRESSION, b.optional(VIEW_RESTRICTION_CLAUSE), b.optional(ORDER_BY_CLAUSE), b.optional(SEMICOLON)) b.rule(TYPE_ATTRIBUTE).define(IDENTIFIER_NAME, DATATYPE, b.optional(DATATYPE_NULL_CONSTRAINT)) b.rule(INHERITANCE_CLAUSE).define(b.oneOrMore(b.optional(NOT), b.firstOf(OVERRIDING, FINAL, INSTANTIABLE))) b.rule(TYPE_SUBPROGRAM).define( b.optional(INHERITANCE_CLAUSE), b.firstOf(MEMBER, STATIC), b.firstOf(PROCEDURE_DECLARATION, FUNCTION_DECLARATION)) b.rule(TYPE_CONSTRUCTOR).define( b.optional(FINAL), b.optional(INSTANTIABLE), CONSTRUCTOR, FUNCTION, IDENTIFIER_NAME, b.optional( LPARENTHESIS, b.optional(SELF, IN, OUT, DATATYPE, COMMA), b.oneOrMore(PARAMETER_DECLARATION, b.optional(COMMA)), RPARENTHESIS), RETURN, SELF, AS, RESULT, b.optional(b.firstOf(IS, AS), b.optional(DECLARE_SECTION), STATEMENTS_SECTION)) b.rule(MAP_ORDER_FUNCTION).define( b.firstOf(MAP, ORDER), MEMBER, FUNCTION_DECLARATION) b.rule(TYPE_ELEMENT_SPEC).define( b.optional(INHERITANCE_CLAUSE), b.firstOf(TYPE_SUBPROGRAM, TYPE_CONSTRUCTOR, MAP_ORDER_FUNCTION)) b.rule(OBJECT_TYPE_DEFINITION).define( b.firstOf( b.sequence(b.firstOf(IS, AS), OBJECT), b.sequence(UNDER, UNIT_NAME) ), LPARENTHESIS, b.optional(b.firstOf(DEPRECATE_PRAGMA, SUPPRESSES_WARNING_6009_PRAGMA), COMMA), b.oneOrMore( b.firstOf(TYPE_ELEMENT_SPEC, TYPE_ATTRIBUTE), b.optional(COMMA), b.optional(b.firstOf(DEPRECATE_PRAGMA, SUPPRESSES_WARNING_6009_PRAGMA), b.optional(COMMA)) ), RPARENTHESIS, b.zeroOrMore(b.optional(NOT), b.firstOf(FINAL, INSTANTIABLE)) ) b.rule(CREATE_TYPE).define( CREATE, b.optional(OR, REPLACE), b.optional(b.firstOf(EDITIONABLE, NONEDITIONABLE)), TYPE, UNIT_NAME, b.optional(FORCE), b.optional(SHARING, EQUALS, b.firstOf(METADATA, NONE)), b.zeroOrMore(b.firstOf( b.sequence(AUTHID, b.firstOf(CURRENT_USER, DEFINER)), b.sequence(DEFAULT, COLLATION, USING_NLS_COMP), b.sequence(ACCESSIBLE, BY, LPARENTHESIS, b.firstOf(FUNCTION, PROCEDURE, PACKAGE, TRIGGER, TYPE), UNIT_NAME, RPARENTHESIS))), b.optional(b.firstOf( OBJECT_TYPE_DEFINITION, b.sequence( b.firstOf(IS, AS), b.firstOf( VARRAY_TYPE_DEFINITION, NESTED_TABLE_DEFINITION)))), b.optional(SEMICOLON)) b.rule(CREATE_TYPE_BODY).define( CREATE, b.optional(OR, REPLACE), b.optional(b.firstOf(EDITIONABLE, NONEDITIONABLE)), TYPE, BODY, UNIT_NAME, b.firstOf(IS, AS), b.oneOrMore(b.firstOf(TYPE_SUBPROGRAM, TYPE_CONSTRUCTOR, MAP_ORDER_FUNCTION), b.optional(COMMA)), END, b.optional(SEMICOLON)) b.rule(ANONYMOUS_BLOCK).define(BLOCK_STATEMENT) b.rule(COMPILATION_UNIT).define(b.firstOf( ANONYMOUS_BLOCK, CREATE_PROCEDURE, CREATE_FUNCTION, CREATE_PACKAGE, CREATE_PACKAGE_BODY, CREATE_VIEW, CREATE_TRIGGER, CREATE_TYPE_BODY, CREATE_TYPE, PROCEDURE_DECLARATION, FUNCTION_DECLARATION)) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/PlSqlKeyword.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.TokenType enum class PlSqlKeyword(override val value: String, val isReserved: Boolean = false) : TokenType { ALL("all", true), ALTER("alter", true), AND("and", true), ANY("any", true), AS("as", true), ASC("asc", true), BEGIN("begin", true), BETWEEN("between", true), BY("by", true), CHAR("char"), CHECK("check", true), CLUSTER("cluster", true), COMPRESS("compress", true), CONNECT("connect", true), CREATE("create", true), DECLARE("declare", true), DEFAULT("default", true), DESC("desc", true), DISTINCT("distinct", true), DROP("drop", true), ELSE("else", true), END("end", true), EXCEPT("except"), EXCLUSIVE("exclusive", true), FETCH("fetch", true), FLOAT("float"), FOR("for", true), FROM("from", true), GRANT("grant", true), GROUP("group", true), HAVING("having", true), IDENTIFIED("identified", true), IN("in", true), INDEX("index", true), INSERT("insert", true), INTEGER("integer"), INTERSECT("intersect", true), INTO("into", true), IS("is", true), LIKE("like", true), LOCK("lock", true), LONG("long"), MINUS_KEYWORD("minus", true), NOCOMPRESS("nocompress", true), NOT("not", true), NOWAIT("nowait", true), NULL("null", true), OF("of", true), ON("on", true), OPTION("option", true), OR("or", true), ORDER("order", true), OUT("out", true), PCTFREE("pctfree"), PRIOR("prior"), PROCEDURE("procedure", true), PUBLIC("public", true), RAW("raw"), RESOURCE("resource", true), REVOKE("revoke", true), SELECT("select", true), SHARE("share", true), SIZE("size", true), SMALLINT("smallint"), START("start", true), SYNONYM("synonym"), TABLE("table", true), THEN("then", true), TO("to", true), TRIGGER("trigger", true), UNION("union", true), UNIQUE("unique", true), UPDATE("update", true), VALUES("values", true), VIEW("view", true), WHEN("when", true), WHERE("where", true), WITH("with", true), A("a"), ABSENT("absent"), ACCESSIBLE("accessible"), ADD("add"), ADMIN("admin"), AFTER("after"), AGENT("agent"), AGGREGATE("aggregate"), ALLOW("allow"), ANALYZE("analyze"), ANY_CS("any_cs"), APPEND("append"), ARRAY("array"), ARROW("arrow"), ASCII("ascii"), ASSOCIATE("associate"), AT("at"), AUDIT("audit"), AUTHID("authid"), AUTONOMOUS_TRANSACTION("autonomous_transaction"), BATCH("batch"), BEFORE("before"), BFILE("bfile"), BINARY("binary"), BINARY_DOUBLE("binary_double"), BINARY_DOUBLE_INFINITY("binary_double_infinity"), BINARY_DOUBLE_NAN("binary_double_nan"), BINARY_FLOAT("binary_float"), BINARY_FLOAT_INFINITY("binary_float_infinity"), BINARY_FLOAT_NAN("binary_float_nan"), BINARY_INTEGER("binary_integer"), BLOB("blob"), BODY("body"), BOOLEAN("boolean"), BOTH("both"), BREADTH("breadth"), BUFFER_POOL("buffer_pool"), BULK("bulk"), BULK_ROWCOUNT("bulk_rowcount"), BYTE("byte"), CACHE("cache"), CASCADE("cascade"), CASE("case"), CASE_SENSITIVE("case_sensitive"), CAST("cast"), CHARACTER("character"), CHARSET("charset"), CHARSETFORM("charsetform"), CHARSETID("charsetid"), CHUNK("chunk"), CLOB("clob"), CLONE("clone"), CLOSE("close"), CLUSTERS("clusters"), COLAUTH("colauth"), COLLATION("collation"), COLLECT("collect"), COLUMN("column"), COLUMNS("columns"), COMMENT("comment"), COMMIT("commit"), COMMITTED("committed"), COMPILE("compile"), COMPLETE("complete"), COMPOUND("compound"), CONDITIONAL("conditional"), CONNECT_BY_ROOT("connect_by_root"), CONSTANT("constant"), CONSTRAINT("constraint"), CONSTRAINTS("constraints"), CONSTRUCTOR("constructor"), CONTAINER("container"), CONTENT("content"), CONTEXT("context"), CONTINUE("continue"), CONVERSION("conversion"), COPY("copy"), COUNT("count"), COVERAGE("coverage"), CRASH("crash"), CROSS("cross"), CROSSEDITION("crossedition"), CUBE("cube"), CURRENT("current"), CURRENT_USER("current_user"), CURRVAL("currval"), CURSOR("cursor"), CYCLE("cycle"), DATA("data"), DATABASE("database"), DATE("date"), DAY("day"), DB_ROLE_CHANGE("db_role_change"), DDL("ddl"), DEBUG("debug"), DEC("dec"), DECIMAL("decimal"), DEFAULTS("defaults"), DEFERRABLE("deferrable"), DEFERRED("deferred"), DEFINER("definer"), DELEGATE("delegate"), DELETE("delete"), DENSE_RANK("dense_rank"), DEPRECATE("deprecate"), DEPTH("depth"), DETERMINISTIC("deterministic"), DIRECTORY("directory"), DISABLE("disable"), DISALLOW("disallow"), DISASSOCIATE("disassociate"), DOCUMENT("document"), DOMAIN("domain"), DOUBLE("double"), DURATION("duration"), EACH("each"), EDITIONABLE("editionable"), ELEMENT("element"), ELSIF("elsif"), EMPTY("empty"), ENABLE("enable"), ENCODING("encoding"), ENCRYPT("encrypt"), ENTITYESCAPING("entityescaping"), ERROR("error"), ERRORS("errors"), ESCAPE("escape"), EVALNAME("evalname"), EXCEPTION("exception"), EXCEPTIONS("exceptions"), EXCEPTION_INIT("exception_init"), EXCLUDE("exclude"), EXECUTE("execute"), EXISTING("existing"), EXISTS("exists"), EXIT("exit"), EXTEND("extend"), EXTERNAL("external"), EXTRA("extra"), EXTRACT("extract"), FALSE("false"), FINAL("final"), FIRST("first"), FOLLOWING("following"), FOLLOWS("follows"), FORALL("forall"), FORCE("force"), FOREIGN("foreign"), FORM("form"), FORMAT("format"), FORWARD("forward"), FOUND("found"), FREELIST("freelist"), FREELISTS("freelists"), FREEPOOLS("freepools"), FULL("full"), FUNCTION("function"), GLOBAL("global"), GOTO("goto"), GROUPING("grouping"), GROUPS("groups"), HASH("hash"), HIDE("hide"), HIERARCHY("hierarchy"), HOUR("hour"), IF("if"), IGNORE("ignore"), IMMEDIATE("immediate"), IMMUTABLE("immutable"), INCREMENT("increment"), INDENT("indent"), INDEXES("indexes"), INDEXTYPE("indextype"), INDICATOR("indicator"), INDICES("indices"), INCLUDE("include"), INITIAL("initial"), INITIALLY("initially"), INITRANS("initrans"), INLINE("inline"), INNER("inner"), INSTANTIABLE("instantiable"), INSTEAD("instead"), INT("int"), INTERFACE("interface"), INTERVAL("interval"), ISOLATION("isolation"), ISOPEN("isopen"), JAVA("java"), JOIN("join"), JSON("json"), JSON_ARRAY("json_array"), JSON_ARRAYAGG("json_arrayagg"), JSON_DATAGUIDE("json_dataguide"), JSON_EQUAL("json_equal"), JSON_EXISTS("json_exists"), JSON_MERGEPATCH("json_mergepatch"), JSON_OBJECT("json_object"), JSON_OBJECTAGG("json_objectagg"), JSON_QUERY("json_query"), JSON_SCALAR("json_scalar"), JSON_SERIALIZE("json_serialize"), JSON_TABLE("json_table"), JSON_TEXTCONTAINS("json_textcontains"), JSON_TRANSFORM("json_transform"), JSON_VALUE("json_value"), KEEP("keep"), KEY("key"), KEYS("keys"), LANGUAGE("language"), LAST("last"), LAX("lax"), LEADING("leading"), LEFT("left"), LENGTH("length"), LESS("less"), LEVEL("level"), LEVELS("levels"), LIBRARY("library"), LIMIT("limit"), LIST("list"), LISTAGG("listagg"), LOB("lob"), LOCAL("local"), LOCKED("locked"), LOG("log"), LOGGING("logging"), LOGOFF("logoff"), LOGON("logon"), LOOP("loop"), MAP("map"), MAPPING("mapping"), MATCHED("matched"), MATERIALIZED("materialized"), MAXEXTENTS("maxextents"), MAXLEN("maxlen"), MAXVALUE("maxvalue"), MEMBER("member"), MERGE("merge"), METADATA("metadata"), MINEXTENTS("minextents"), MINING("mining"), MINUTE("minute"), MINVALUE("minvalue"), MISMATCH("mismatch"), MISSING("missing"), MODE("mode"), MODEL("model"), MOD_KEYWORD("mod"), MONTH("month"), MORE("more"), MULTISET("multiset"), MUTABLE("mutable"), NAME("name"), NATURAL("natural"), NATURALN("naturaln"), NCHAR("nchar"), NCLOB("nclob"), NESTED("nested"), NEW("new"), NEXT("next"), NEXTVAL("nextval"), NO("no"), NOAUDIT("noaudit"), NOCACHE("nocache"), NOCOPY("nocopy"), NOCYCLE("nocycle"), NOENTITYESCAPING("noentityescaping"), NOLOGGING("nologging"), NOMAPPING("nomapping"), NONE("none"), NONEDITIONABLE("noneditionable"), NOORDER("noorder"), NOPRECHECK("noprecheck"), NORELY("norely"), NOSCHEMACHECK("noschemacheck"), NOTFOUND("notfound"), NOVALIDATE("novalidate"), NOW("now"), NULLS("nulls"), NUMBER("number"), NUMERIC("numeric"), NVARCHAR2("nvarchar2"), OBJECT("object"), OFFSET("offset"), OLD("old"), OMIT("omit"), ONLY("only"), OPEN("open"), OPERATOR("operator"), OPTIMAL("optimal"), ORDERED("ordered"), ORDINALITY("ordinality"), OTHERS("others"), OUTER("outer"), OVER("over"), OVERFLOW("overflow"), OVERLAPS("overlaps"), OVERRIDING("overriding"), PACKAGE("package"), PAIRS("pairs"), PARALLEL_ENABLE("parallel_enable"), PARAMETERS("parameters"), PARENT("parent"), PARTITION("partition"), PARTITIONS("partitions"), PASSING("passing"), PATH("path"), PCTINCREASE("pctincrease"), PCTUSED("pctused"), PCTVERSION("pctversion"), PERCENT("percent"), PIPE("pipe"), PIPELINED("pipelined"), PIVOT("pivot"), PLS_INTEGER("pls_integer"), PLUGGABLE("pluggable"), POSITIVE("positive"), POSITIVEN("positiven"), PRAGMA("pragma"), PRECEDES("precedes"), PRECEDING("preceding"), PRECHECK("precheck"), PRECISION("precision"), PREPEND("prepend"), PRESERVE("preserve"), PRETTY("pretty"), PRIMARY("primary"), PURGE("purge"), QUOTES("quotes"), RAISE("raise"), RANGE_KEYWORD("range"), READ("read"), READS("reads"), REAL("real"), RECORD("record"), RECYCLE("recycle"), REF("ref"), REFERENCE("reference"), REFERENCES("references"), REFERENCING("referencing"), REFRESH("refresh"), REJECT("reject"), RELIES_ON("relies_on"), RELY("rely"), REMOVE("remove"), RENAME("rename"), REPEAT("repeat"), REPLACE("replace"), RESTRICT_REFERENCES("restrict_references"), RESULT("result"), RESULT_CACHE("result_cache"), RETENTION("retention"), RETURN("return"), RETURNING("returning"), REUSE("reuse"), REVERSE("reverse"), RIGHT("right"), ROLE("role"), ROLLBACK("rollback"), ROLLUP("rollup"), ROW("row"), ROWCOUNT("rowcount"), ROWID("rowid"), ROWNUM("rownum"), ROWS("rows"), ROWTYPE("rowtype"), SAVE("save"), SAVEPOINT("savepoint"), SCALAR("scalar"), SCALARS("scalars"), SCHEMA("schema"), SCHEMACHECK("schemacheck"), SDO_GEOMETRY("sdo_geometry"), SEARCH("search"), SECOND("second"), SEGMENT("segment"), SELF("self"), SEQUENCE("sequence"), SERIALIZABLE("serializable"), SERIALLY_REUSABLE("serially_reusable"), SERVERERROR("servererror"), SESSION("session"), SET("set"), SETS("sets"), SETTINGS("settings"), SHARING("sharing"), SHOW("show"), SHUTDOWN("shutdown"), SIBLINGS("siblings"), SIGNTYPE("signtype"), SKIP("skip"), SOME("some"), SORT("sort"), SPECIFICATION("specification"), SQL("sql"), SQLERRM("sqlerrm"), STANDALONE("standalone"), STARTUP("startup"), STATEMENT_KEYWORD("statement"), STATIC("static"), STATISTICS("statistics"), STORAGE("storage"), STORE("store"), STRICT("strict"), STRING("string"), STRUCT("struct"), SUBMULTISET("submultiset"), SUBPARTITION("subpartition"), SUBPARTITIONS("subpartitions"), SUBSTITUTABLE("substitutable"), SUBTYPE("subtype"), SUPPRESSES_WARNING_6009("suppresses_warning_6009"), SUSPEND("suspend"), SYSDATE("sysdate"), TABAUTH("tabauth"), TABLESPACE("tablespace"), TDO("tdo"), TEMPLATE("template"), TEMPORARY("temporary"), THAN("than"), THE("the"), TIES("ties"), TIME("time"), TIMESTAMP("timestamp"), TO_BINARY_DOUBLE("to_binary_double"), TO_BINARY_FLOAT("to_binary_float"), TO_BOOLEAN("to_boolean"), TO_DATE("to_date"), TO_DSINTERVAL("to_dsinterval"), TO_NUMBER("to_number"), TO_TIMESTAMP("to_timestamp"), TO_TIMESTAMP_TZ("to_timestamp_tz"), TO_YMINTERVAL("to_yminterval"), TRAILING("trailing"), TRANSACTION("transaction"), TREAT("treat"), TRIM("trim"), TRUE("true"), TRUNCATE("truncate"), TYPE("type"), TYPENAME("typename"), UDF("udf"), UNBOUNDED("unbounded"), UNCONDITIONAL("unconditional"), UNDER("under"), UNLIMITED("unlimited"), UNPIVOT("unpivot"), UNPLUG("unplug"), UROWID("urowid"), USE("use"), USING("using"), USING_NLS_COMP("using_nls_comp"), VALIDATE("validate"), VALUE("value"), VARCHAR("varchar"), VARCHAR2("varchar2"), VARRAY("varray"), VARYING("varying"), VECTOR("vector"), VERSION("version"), VIEWS("views"), WAIT("wait"), WELLFORMED("wellformed"), WHILE("while"), WITHIN("within"), WITHOUT("without"), WORK("work"), WRAPPER("wrapper"), WRITE("write"), XML("xml"), XMLAGG("xmlagg"), XMLATTRIBUTES("xmlattributes"), XMLCAST("xmlcast"), XMLCDATA("xmlcdata"), XMLCOLATTVAL("xmlcolattval"), XMLCOMMENT("xmlcomment"), XMLCONCAT("xmlconcat"), XMLDIFF("xmldiff"), XMLELEMENT("xmlelement"), XMLEXISTS("xmlexists"), XMLFOREST("xmlforest"), XMLISVALID("xmlisvalid"), XMLNAMESPACES("xmlnamespaces"), XMLPARSE("xmlparse"), XMLPATCH("xmlpatch"), XMLPI("xmlpi"), XMLQUERY("xmlquery"), XMLROOT("xmlroot"), XMLSEQUENCE("xmlsequence"), XMLSERIALIZE("xmlserialize"), XMLTABLE("xmltable"), XMLTRANSFORM("xmltransform"), XMLTYPE("xmltype"), YEAR("year"), YES("yes"), ZONE("zone"); override fun hasToBeSkippedFromAst(node: AstNode?) = false companion object { val keywordValues: List = entries.map { it.value } val nonReservedKeywords: List = entries.filter { !it.isReserved } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/PlSqlPunctuator.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.TokenType enum class PlSqlPunctuator(override val value: String) : TokenType { // Based on http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/fundamentals.htm#sthref297 COMMA(","), PLUS("+"), MINUS("-"), MOD("%"), DOT("."), DIVISION("/"), LPARENTHESIS("("), RPARENTHESIS(")"), COLON(":"), SEMICOLON(";"), MULTIPLICATION("*"), EQUALS("="), LESSTHAN("<"), GREATERTHAN(">"), REMOTE("@"), SUBTRACTION("-"), ASSIGNMENT(":="), SINGLE_PIPE("|"), EXPONENTIATION("**"), LLABEL("<<"), RLABEL(">>"), RANGE(".."), DOUBLEDOLLAR("$$"), ASSOCIATION("=>"), EXCLAMATION("!"), TILDE("~"), CARET("^"), LBRACKET("["), RBRACKET("]"), LBRACE("{"), RBRACE("}"), QUESTION_MARK("?"); override fun hasToBeSkippedFromAst(node: AstNode?) = false } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/PlSqlTokenType.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.TokenType enum class PlSqlTokenType : TokenType { STRING_LITERAL, INTEGER_LITERAL, NUMBER_LITERAL, DATE_LITERAL, TIMESTAMP_LITERAL; override val value = name override fun hasToBeSkippedFromAst(node: AstNode?) = false } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/PlSqlVisitorContext.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.RecognitionException import com.felipebz.zpa.metadata.FormsMetadata import com.felipebz.zpa.symbols.SymbolTableImpl import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.SymbolTable open class PlSqlVisitorContext private constructor(private val rootTree: AstNode?, private val plSqlFile: PlSqlFile?, private val parsingException: RecognitionException?, var formsMetadata: FormsMetadata?) { var symbolTable: SymbolTable = SymbolTableImpl() var currentScope: Scope? = null constructor(rootTree: AstNode, plsqlFile: PlSqlFile?, metadata: FormsMetadata?) : this(rootTree, plsqlFile, null, metadata) constructor(plsqlFile: PlSqlFile?, parsingException: RecognitionException, metadata: FormsMetadata?) : this(null, plsqlFile, parsingException, metadata) fun rootTree() = rootTree fun plSqlFile() = plSqlFile fun parsingException() = parsingException } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/SessionControlGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.GenericTokenType.EOF import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.api.PlSqlGrammar.IDENTIFIER_NAME import com.felipebz.zpa.api.PlSqlKeyword.* import com.felipebz.zpa.api.PlSqlPunctuator.* enum class SessionControlGrammar : GrammarRuleKey { ALTER_SESSION, SET_ROLE, SESSION_CONTROL_COMMAND; companion object { fun buildOn(b: PlSqlGrammarBuilder) { b.rule(ALTER_SESSION).define(ALTER, SESSION, b.oneOrMore(b.anyTokenButNot(b.firstOf(SEMICOLON, DIVISION, EOF)))) b.rule(SET_ROLE).define(SET, ROLE, b.firstOf( NONE, b.sequence(ALL, b.optional(EXCEPT, b.oneOrMore(IDENTIFIER_NAME, b.optional(COMMA)))), b.oneOrMore(IDENTIFIER_NAME, b.optional(IDENTIFIED, BY, b.anyToken()), b.optional(COMMA)) )) b.rule(SESSION_CONTROL_COMMAND).define(b.firstOf(ALTER_SESSION, SET_ROLE), b.optional(SEMICOLON)) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/SingleRowSqlFunctionsGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.api.PlSqlGrammar.* import com.felipebz.zpa.api.PlSqlKeyword.* import com.felipebz.zpa.api.PlSqlPunctuator.* import com.felipebz.zpa.api.PlSqlTokenType.STRING_LITERAL enum class SingleRowSqlFunctionsGrammar : GrammarRuleKey { // internals JSON_PASSING_CLAUSE, JSON_ON_NULL_CLAUSE, JSON_ON_ERROR_CLAUSE, JSON_RETURNING_CLAUSE, JSON_ARRAY_ENUMERATION_CONTENT, JSON_ARRAY_QUERY_CONTENT, JSON_ARRAY_ELEMENT, JSON_ARRAY_OPTIONS, JSON_OBJECT_ENTRY, JSON_QUERY_RETURNING_CLAUSE, JSON_QUERY_WRAPPER_CLAUSE, JSON_QUERY_QUOTES_CLAUSE, JSON_QUERY_ON_ERROR_CLAUSE, JSON_QUERY_ON_EMPTY_CLAUSE, JSON_QUERY_ON_MISMATCH_CLAUSE, JSON_BASIC_PATH_EXPRESSION, JSON_PATH_EXPRESSION, JSON_RELATIVE_OBJECT_ACCESS, JSON_TABLE_ON_ERROR_CLAUSE, JSON_TABLE_ON_EMPTY_CLAUSE, JSON_TABLE_COLUMNS_CLAUSE, JSON_COLUMNS_CLAUSE, JSON_COLUMN_DEFINITION, JSON_EXISTS_COLUMN, JSON_QUERY_COLUMN, JSON_VALUE_COLUMN, JSON_NESTED_PATH, JSON_ORDINALITY_COLUMN, JSON_PATH, JSON_ARRAY_STEP, JSON_VALUE_RETURN_TYPE, JSON_VALUE_ON_ERROR_CLAUSE, JSON_VALUE_ON_EMPTY_CLAUSE, JSON_VALUE_ON_MISMATCH_CLAUSE, JSON_VALUE_RETURN_OBJECT_INSTANCE, JSON_TRANSFORM_OPERATION, JSON_TRANSFORM_RETURNING_CLAUSE, JSON_RHS_EXPRESSION, JSON_APPEND_OPERATION, JSON_CASE_OPERATION, JSON_COPY_OPERATION, JSON_INSERT_OPERATION, JSON_INTERSECT_OPERATION, JSON_KEEP_OPERATION, JSON_MERGE_OPERATION, JSON_MINUS_OPERATION, JSON_NESTED_PATH_OPERATION, JSON_OBJECT_OPTIONS, JSON_PREPEND_OPERATION, JSON_REMOVE_OPERATION, JSON_RENAME_OPERATION, JSON_REPLACE_OPERATION, JSON_SET_OPERATION, JSON_SORT_OPERATION, JSON_UNION_OPERATION, JSON_VALUE_RETURNING_CLAUSE, XML_COLUMN, XML_NAMESPACE, XMLNAMESPACES_CLAUSE, XMLTABLE_OPTIONS, XML_PASSING_CLAUSE, XML_TABLE_COLUMN, // functions EXTRACT_DATETIME_EXPRESSION, JSON_CONSTRUCTOR, JSON_ARRAY_EXPRESSION, JSON_DATAGUIDE_EXPRESSION, JSON_MERGEPATCH_EXPRESSION, JSON_OBJECT_EXPRESSION, JSON_SCALAR_EXPRESSION, JSON_SERIALIZE_EXPRESSION, JSON_QUERY_EXPRESSION, JSON_TABLE_EXPRESSION, JSON_TRANSFORM_EXPRESSION, JSON_VALUE_EXPRESSION, XMLATTRIBUTES_EXPRESSION, XMLCAST_EXPRESSION, XMLCDATA_EXPRESSION, XMLCOLATTVAL_EXPRESSION, XMLCOMMENT_EXPRESSION, XMLCONCAT_EXPRESSION, XMLDIFF_EXPRESSION, XMLELEMENT_EXPRESSION, XMLEXISTS_EXPRESSION, XMLFOREST_EXPRESSION, XMLISVALID_EXPRESSION, XMLPARSE_EXPRESSION, XMLPATCH_EXPRESSION, XMLPI_EXPRESSION, XMLQUERY_EXPRESSION, XMLROOT_EXPRESSION, XMLSEQUENCE_EXPRESSION, XMLSERIALIZE_EXPRESSION, XMLTABLE_EXPRESSION, XMLTRANSFORM_EXPRESSION, DEFAULT_ON_ERROR_CLAUSE, TREAT_AS_EXPRESSION, SET_EXPRESSION, CAST_EXPRESSION, TO_BINARY_DOUBLE_EXPRESSION, TO_BINARY_FLOAT_EXPRESSION, TO_BOOLEAN_EXPRESSION, TO_DATE_EXPRESSION, TO_DSINTERVAL_EXPRESSION, TO_NUMBER_EXPRESSION, TO_TIMESTAMP_EXPRESSION, TO_TIMESTAMP_TZ_EXPRESSION, TO_YMINTERVAL_EXPRESSION, TRIM_EXPRESSION, TABLE_EXPRESSION, THE_EXPRESSION, CURSOR_EXPRESSION, SINGLE_ROW_SQL_FUNCTION; companion object { fun buildOn(b: PlSqlGrammarBuilder) { createCharacterFunctions(b) createConversionFunctions(b) createDateFunctions(b) createXmlFunctions(b) createJsonFunctions(b) b.rule(SINGLE_ROW_SQL_FUNCTION).define( b.firstOf( EXTRACT_DATETIME_EXPRESSION, JSON_CONSTRUCTOR, JSON_ARRAY_EXPRESSION, JSON_DATAGUIDE_EXPRESSION, JSON_MERGEPATCH_EXPRESSION, JSON_OBJECT_EXPRESSION, JSON_SCALAR_EXPRESSION, JSON_SERIALIZE_EXPRESSION, JSON_QUERY_EXPRESSION, JSON_TABLE_EXPRESSION, JSON_TRANSFORM_EXPRESSION, JSON_VALUE_EXPRESSION, XMLATTRIBUTES_EXPRESSION, XMLCAST_EXPRESSION, XMLCDATA_EXPRESSION, XMLCOLATTVAL_EXPRESSION, XMLCOMMENT_EXPRESSION, XMLCONCAT_EXPRESSION, XMLDIFF_EXPRESSION, XMLELEMENT_EXPRESSION, XMLEXISTS_EXPRESSION, XMLFOREST_EXPRESSION, XMLISVALID_EXPRESSION, XMLPARSE_EXPRESSION, XMLPATCH_EXPRESSION, XMLPI_EXPRESSION, XMLQUERY_EXPRESSION, XMLROOT_EXPRESSION, XMLSEQUENCE_EXPRESSION, XMLSERIALIZE_EXPRESSION, XMLTABLE_EXPRESSION, XMLTRANSFORM_EXPRESSION, TREAT_AS_EXPRESSION, SET_EXPRESSION, CAST_EXPRESSION, TO_BINARY_DOUBLE_EXPRESSION, TO_BINARY_FLOAT_EXPRESSION, TO_BOOLEAN_EXPRESSION, TO_DATE_EXPRESSION, TO_DSINTERVAL_EXPRESSION, TO_NUMBER_EXPRESSION, TO_TIMESTAMP_EXPRESSION, TO_TIMESTAMP_TZ_EXPRESSION, TO_YMINTERVAL_EXPRESSION, TRIM_EXPRESSION, TABLE_EXPRESSION, THE_EXPRESSION, CURSOR_EXPRESSION ) ) } private fun createCharacterFunctions(b: PlSqlGrammarBuilder) { b.rule(TRIM_EXPRESSION).define( TRIM, LPARENTHESIS, b.optional(b.optional(b.firstOf(LEADING, TRAILING, BOTH)), EXPRESSION, FROM), EXPRESSION, RPARENTHESIS) } private fun createConversionFunctions(b: PlSqlGrammarBuilder) { b.rule(DEFAULT_ON_ERROR_CLAUSE).define(DEFAULT, EXPRESSION, ON, CONVERSION, ERROR) b.rule(TREAT_AS_EXPRESSION).define( b.optional(TREAT), LPARENTHESIS, EXPRESSION, AS, b.optional(REF), OBJECT_REFERENCE, RPARENTHESIS ) b.rule(SET_EXPRESSION).define(SET, LPARENTHESIS, EXPRESSION, RPARENTHESIS) b.rule(CAST_EXPRESSION).define( CAST, LPARENTHESIS, b.firstOf(b.sequence(MULTISET, EXPRESSION), EXPRESSION), AS, b.optional(DOMAIN), DATATYPE, b.optional(b.firstOf(VALIDATE, NOVALIDATE)), b.optional(DEFAULT_ON_ERROR_CLAUSE), b.optional(COMMA, EXPRESSION, b.optional(COMMA, EXPRESSION)), RPARENTHESIS ) b.rule(TO_BINARY_DOUBLE_EXPRESSION).define( TO_BINARY_DOUBLE, LPARENTHESIS, ARGUMENT, b.optional(DEFAULT_ON_ERROR_CLAUSE), b.optional(COMMA, ARGUMENT, b.optional(COMMA, ARGUMENT)), RPARENTHESIS ) b.rule(TO_BINARY_FLOAT_EXPRESSION).define( TO_BINARY_FLOAT, LPARENTHESIS, ARGUMENT, b.optional(DEFAULT_ON_ERROR_CLAUSE), b.optional(COMMA, ARGUMENT, b.optional(COMMA, ARGUMENT)), RPARENTHESIS ) b.rule(TO_BOOLEAN_EXPRESSION).define( TO_BOOLEAN, LPARENTHESIS, ARGUMENT, b.optional(DEFAULT_ON_ERROR_CLAUSE), RPARENTHESIS ) b.rule(TO_DATE_EXPRESSION).define( TO_DATE, LPARENTHESIS, ARGUMENT, b.optional(DEFAULT_ON_ERROR_CLAUSE), b.optional(COMMA, ARGUMENT, b.optional(COMMA, ARGUMENT)), RPARENTHESIS ) b.rule(TO_DSINTERVAL_EXPRESSION).define( TO_DSINTERVAL, LPARENTHESIS, ARGUMENT, b.optional(DEFAULT_ON_ERROR_CLAUSE), RPARENTHESIS ) b.rule(TO_NUMBER_EXPRESSION).define( TO_NUMBER, LPARENTHESIS, ARGUMENT, b.optional(DEFAULT_ON_ERROR_CLAUSE), b.optional(COMMA, ARGUMENT, b.optional(COMMA, ARGUMENT)), RPARENTHESIS ) b.rule(TO_TIMESTAMP_EXPRESSION).define( TO_TIMESTAMP, LPARENTHESIS, ARGUMENT, b.optional(DEFAULT_ON_ERROR_CLAUSE), b.optional(COMMA, ARGUMENT, b.optional(COMMA, ARGUMENT)), RPARENTHESIS ) b.rule(TO_TIMESTAMP_TZ_EXPRESSION).define( TO_TIMESTAMP_TZ, LPARENTHESIS, ARGUMENT, b.optional(DEFAULT_ON_ERROR_CLAUSE), b.optional(COMMA, ARGUMENT, b.optional(COMMA, ARGUMENT)), RPARENTHESIS ) b.rule(TO_YMINTERVAL_EXPRESSION).define( TO_YMINTERVAL, LPARENTHESIS, ARGUMENT, b.optional(DEFAULT_ON_ERROR_CLAUSE), RPARENTHESIS ) b.rule(TABLE_EXPRESSION).define( TABLE, LPARENTHESIS, b.firstOf(DmlGrammar.SELECT_EXPRESSION, EXPRESSION), RPARENTHESIS ) b.rule(THE_EXPRESSION).define( THE, LPARENTHESIS, b.firstOf(DmlGrammar.SELECT_EXPRESSION, EXPRESSION), RPARENTHESIS ) b.rule(CURSOR_EXPRESSION).define(CURSOR, LPARENTHESIS, DmlGrammar.SELECT_EXPRESSION, RPARENTHESIS) } private fun createDateFunctions(b: PlSqlGrammarBuilder) { b.rule(EXTRACT_DATETIME_EXPRESSION).define(EXTRACT, LPARENTHESIS, IDENTIFIER_NAME, FROM, EXPRESSION, RPARENTHESIS) } private fun createXmlFunctions(b: PlSqlGrammarBuilder) { b.rule(XMLCDATA_EXPRESSION).define(XMLCDATA, LPARENTHESIS, EXPRESSION, RPARENTHESIS) b.rule(XMLCOMMENT_EXPRESSION).define(XMLCOMMENT, LPARENTHESIS, EXPRESSION, RPARENTHESIS) b.rule(XMLCONCAT_EXPRESSION).define(XMLCONCAT, LPARENTHESIS, EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION), RPARENTHESIS) b.rule(XMLDIFF_EXPRESSION).define( XMLDIFF, LPARENTHESIS, EXPRESSION, COMMA, EXPRESSION, b.optional(COMMA, EXPRESSION, COMMA, EXPRESSION), RPARENTHESIS) b.rule(XMLISVALID_EXPRESSION).define( XMLISVALID, LPARENTHESIS, EXPRESSION, b.optional(COMMA, EXPRESSION, b.optional(COMMA, EXPRESSION)), RPARENTHESIS) b.rule(XMLPATCH_EXPRESSION).define( XMLPATCH, LPARENTHESIS, EXPRESSION, COMMA, EXPRESSION, RPARENTHESIS ) b.rule(XMLSEQUENCE_EXPRESSION).define( XMLSEQUENCE, LPARENTHESIS, EXPRESSION, b.zeroOrMore(COMMA, EXPRESSION), RPARENTHESIS ) b.rule(XMLTRANSFORM_EXPRESSION).define( XMLTRANSFORM, LPARENTHESIS, EXPRESSION, COMMA, EXPRESSION, RPARENTHESIS ) b.rule(XMLSERIALIZE_EXPRESSION).define( XMLSERIALIZE, LPARENTHESIS, b.firstOf(DOCUMENT, CONTENT), EXPRESSION, b.optional(AS, DATATYPE), b.optional(ENCODING, EXPRESSION), b.optional(VERSION, STRING_LITERAL), b.optional(b.firstOf(b.sequence(NO, INDENT), b.sequence(INDENT, b.optional(SIZE, EQUALS, EXPRESSION)))), b.optional(b.firstOf(HIDE, SHOW), DEFAULTS), RPARENTHESIS) b.rule(XML_COLUMN).define( EXPRESSION, b.optional(b.optional(AS), b.firstOf(b.sequence(EVALNAME, EXPRESSION), IDENTIFIER_NAME))) b.rule(XMLATTRIBUTES_EXPRESSION).define( XMLATTRIBUTES, LPARENTHESIS, b.optional(b.firstOf(ENTITYESCAPING, NOENTITYESCAPING)), b.optional(b.firstOf(SCHEMACHECK, NOSCHEMACHECK)), XML_COLUMN, b.zeroOrMore(COMMA, XML_COLUMN), RPARENTHESIS) b.rule(XMLELEMENT_EXPRESSION).define( XMLELEMENT, LPARENTHESIS, b.optional(b.firstOf(ENTITYESCAPING, NOENTITYESCAPING)), b.firstOf( b.sequence(EVALNAME, EXPRESSION), b.sequence(b.optional(NAME), IDENTIFIER_NAME) ), b.optional(COMMA, XMLATTRIBUTES_EXPRESSION), b.zeroOrMore(COMMA, EXPRESSION, b.optional(b.optional(AS), IDENTIFIER_NAME)), RPARENTHESIS) b.rule(XMLFOREST_EXPRESSION).define( XMLFOREST, LPARENTHESIS, XML_COLUMN, b.zeroOrMore(COMMA, XML_COLUMN), RPARENTHESIS) b.rule(XML_PASSING_CLAUSE).define( PASSING, b.optional(BY, VALUE), EXPRESSION, b.optional(AS, IDENTIFIER_NAME), b.zeroOrMore(COMMA, IDENTIFIER_NAME, b.optional(AS, IDENTIFIER_NAME))) b.rule(XMLEXISTS_EXPRESSION).define( XMLEXISTS, LPARENTHESIS, STRING_LITERAL, b.optional(XML_PASSING_CLAUSE), RPARENTHESIS) b.rule(XMLQUERY_EXPRESSION).define( XMLQUERY, LPARENTHESIS, STRING_LITERAL, b.optional(XML_PASSING_CLAUSE), RETURNING, CONTENT, b.optional(NULL, ON, EMPTY), RPARENTHESIS) b.rule(XMLROOT_EXPRESSION).define( XMLROOT, LPARENTHESIS, EXPRESSION, COMMA, VERSION, b.firstOf(b.sequence(NO, VALUE), EXPRESSION), b.optional(COMMA, STANDALONE, b.firstOf(YES, b.sequence(NO, b.optional(VALUE)))), RPARENTHESIS) b.rule(XMLCAST_EXPRESSION).define( XMLCAST, LPARENTHESIS, EXPRESSION, AS, DATATYPE, RPARENTHESIS) b.rule(XMLCOLATTVAL_EXPRESSION).define( XMLCOLATTVAL, LPARENTHESIS, XML_COLUMN, b.zeroOrMore(COMMA, XML_COLUMN), RPARENTHESIS) b.rule(XMLPARSE_EXPRESSION).define( XMLPARSE, LPARENTHESIS, b.firstOf(DOCUMENT, CONTENT), EXPRESSION, b.optional(WELLFORMED), RPARENTHESIS) b.rule(XMLPI_EXPRESSION).define( XMLPI, LPARENTHESIS, b.firstOf( b.sequence(EVALNAME, EXPRESSION), b.sequence(b.optional(NAME), IDENTIFIER_NAME)), b.optional(COMMA, EXPRESSION), RPARENTHESIS) b.rule(XML_NAMESPACE).define( b.firstOf( b.sequence(DEFAULT, STRING_LITERAL), b.sequence(STRING_LITERAL, AS, IDENTIFIER_NAME))) b.rule(XMLNAMESPACES_CLAUSE).define( XMLNAMESPACES, LPARENTHESIS, XML_NAMESPACE, b.zeroOrMore(COMMA, XML_NAMESPACE), RPARENTHESIS) b.rule(XML_TABLE_COLUMN).define( IDENTIFIER_NAME, b.firstOf( b.sequence(FOR, ORDINALITY), b.sequence( b.firstOf( DATATYPE, b.sequence(XMLTYPE, b.optional(LPARENTHESIS, SEQUENCE, RPARENTHESIS, BY, REF))), b.optional(PATH, STRING_LITERAL), b.optional(DEFAULT, STRING_LITERAL)))) b.rule(XMLTABLE_OPTIONS).define( b.optional(XML_PASSING_CLAUSE), b.optional(RETURNING, SEQUENCE, BY, REF), b.optional(COLUMNS, XML_TABLE_COLUMN, b.zeroOrMore(COMMA, XML_TABLE_COLUMN))).skip() b.rule(XMLTABLE_EXPRESSION).define( XMLTABLE, LPARENTHESIS, b.optional(XMLNAMESPACES_CLAUSE, COMMA), STRING_LITERAL, XMLTABLE_OPTIONS, RPARENTHESIS) } private fun createJsonFunctions(b: PlSqlGrammarBuilder) { b.rule(JSON_CONSTRUCTOR).define(JSON, LPARENTHESIS, EXPRESSION, RPARENTHESIS) b.rule(JSON_ARRAY_OPTIONS).define( b.firstOf(JSON_ARRAY_ENUMERATION_CONTENT, JSON_ARRAY_QUERY_CONTENT) ).skip() b.rule(JSON_ARRAY_EXPRESSION).define( b.firstOf( b.sequence(JSON_ARRAY, LPARENTHESIS, JSON_ARRAY_OPTIONS, RPARENTHESIS), b.sequence(b.optional(JSON), LBRACKET, JSON_ARRAY_OPTIONS, RBRACKET) ) ) b.rule(JSON_ARRAY_ENUMERATION_CONTENT).define( JSON_ARRAY_ELEMENT, b.zeroOrMore(COMMA, JSON_ARRAY_ELEMENT), b.optional(JSON_ON_NULL_CLAUSE), b.optional(JSON_RETURNING_CLAUSE), b.optional(STRICT) ) b.rule(JSON_ARRAY_ELEMENT).define( EXPRESSION, b.optional(FORMAT, JSON) ) b.rule(JSON_ON_NULL_CLAUSE).define(b.firstOf(NULL, ABSENT), ON, NULL) b.rule(JSON_ON_ERROR_CLAUSE).define(b.firstOf(NULL, ERROR), ON, ERROR) b.rule(JSON_RETURNING_CLAUSE).define( RETURNING, b.firstOf( b.sequence( CHARACTER_DATAYPE, b.optional(WITH, TYPENAME) ), b.sequence( b.firstOf(CLOB, BLOB), b.optional(b.firstOf(REFERENCE, VALUE)) ), JSON ) ) b.rule(JSON_DATAGUIDE_EXPRESSION).define( JSON_DATAGUIDE, LPARENTHESIS, EXPRESSION, b.optional(COMMA, EXPRESSION, b.optional(COMMA, EXPRESSION)), RPARENTHESIS ) b.rule(JSON_MERGEPATCH_EXPRESSION).define( JSON_MERGEPATCH, LPARENTHESIS, EXPRESSION, COMMA, EXPRESSION, b.optional(JSON_RETURNING_CLAUSE), b.optional(PRETTY), b.optional(ASCII), b.optional(TRUNCATE), b.optional(JSON_ON_ERROR_CLAUSE), RPARENTHESIS ) b.rule(JSON_ARRAY_QUERY_CONTENT).define( DmlGrammar.SELECT_EXPRESSION, b.optional(JSON_ON_NULL_CLAUSE), b.optional(JSON_RETURNING_CLAUSE), b.optional(STRICT) ) b.rule(JSON_OBJECT_OPTIONS).define( JSON_OBJECT_ENTRY, b.zeroOrMore(COMMA, JSON_OBJECT_ENTRY), b.optional(JSON_ON_NULL_CLAUSE), b.optional(JSON_RETURNING_CLAUSE), b.optional(STRICT), b.optional(WITH, UNIQUE, KEYS) ).skip() b.rule(JSON_OBJECT_EXPRESSION).define( b.firstOf( b.sequence(JSON_OBJECT, LPARENTHESIS, JSON_OBJECT_OPTIONS, RPARENTHESIS), b.sequence(b.optional(JSON), LBRACE, JSON_OBJECT_OPTIONS, RBRACE) ) ) b.rule(JSON_OBJECT_ENTRY).define( b.firstOf( b.sequence(b.optional(KEY), EXPRESSION, VALUE, EXPRESSION), b.sequence(STRING_LITERAL, COLON, EXPRESSION), EXPRESSION ), b.optional(FORMAT, JSON) ) b.rule(JSON_SCALAR_EXPRESSION).define( JSON_SCALAR, LPARENTHESIS, EXPRESSION, b.optional(b.firstOf( b.sequence(b.firstOf(JSON, SQL), NULL), b.sequence(EMPTY, STRING) ), ON, NULL), b.optional(b.firstOf(NULL, ERROR), ON, ERROR), RPARENTHESIS ) b.rule(JSON_SERIALIZE_EXPRESSION).define( JSON_SERIALIZE, LPARENTHESIS, EXPRESSION, b.optional(JSON_RETURNING_CLAUSE), b.optional(PRETTY), b.optional(ASCII), b.optional(ORDERED), b.optional(TRUNCATE), b.optional( b.firstOf( NULL, ERROR, b.sequence(EMPTY, b.optional(b.firstOf(ARRAY, OBJECT))) ), ON, ERROR ), RPARENTHESIS ) b.rule(JSON_QUERY_EXPRESSION).define( JSON_QUERY, LPARENTHESIS, EXPRESSION, b.optional(FORMAT, JSON), COMMA, STRING_LITERAL, b.optional(JSON_PASSING_CLAUSE), b.optional(JSON_QUERY_RETURNING_CLAUSE), b.optional(JSON_QUERY_WRAPPER_CLAUSE), b.optional(JSON_QUERY_QUOTES_CLAUSE), b.optional(JSON_QUERY_ON_ERROR_CLAUSE), b.optional(JSON_QUERY_ON_EMPTY_CLAUSE), b.optional(JSON_QUERY_ON_MISMATCH_CLAUSE), b.optional(TYPE, b.firstOf(STRICT, LAX)), RPARENTHESIS ) b.rule(JSON_PASSING_CLAUSE).define( PASSING, EXPRESSION, AS, IDENTIFIER_NAME, b.zeroOrMore(COMMA, EXPRESSION, AS, IDENTIFIER_NAME) ) b.rule(JSON_QUERY_RETURNING_CLAUSE).define( b.optional(RETURNING, DATATYPE), b.optional(b.firstOf(ALLOW, DISALLOW), SCALARS), b.optional(PRETTY), b.optional(ASCII) ).skip() b.rule(JSON_QUERY_WRAPPER_CLAUSE).define( b.firstOf( WITHOUT, b.sequence(WITH, b.optional(b.firstOf(UNCONDITIONAL, CONDITIONAL))) ), b.optional(ARRAY), WRAPPER ) b.rule(JSON_QUERY_QUOTES_CLAUSE).define( b.firstOf(KEEP, OMIT), QUOTES, b.optional(ON, SCALAR, STRING) ) b.rule(JSON_QUERY_ON_ERROR_CLAUSE).define( b.firstOf( ERROR, NULL, b.sequence(EMPTY, b.optional(b.firstOf(ARRAY, OBJECT))) ), ON, ERROR ) b.rule(JSON_QUERY_ON_EMPTY_CLAUSE).define( b.firstOf( ERROR, NULL, b.sequence(EMPTY, b.optional(b.firstOf(ARRAY, OBJECT))) ), ON, EMPTY ) b.rule(JSON_QUERY_ON_MISMATCH_CLAUSE).define( b.firstOf(ERROR, NULL), ON, MISMATCH ) b.rule(JSON_TABLE_EXPRESSION).define( JSON_TABLE, LPARENTHESIS, EXPRESSION, b.optional(FORMAT, JSON), b.optional(COMMA, JSON_BASIC_PATH_EXPRESSION), b.optional(JSON_TABLE_ON_ERROR_CLAUSE), b.optional(TYPE, b.firstOf(STRICT, LAX)), b.optional(JSON_TABLE_ON_EMPTY_CLAUSE), JSON_TABLE_COLUMNS_CLAUSE, RPARENTHESIS ) b.rule(JSON_TABLE_ON_ERROR_CLAUSE).define( b.firstOf(ERROR, NULL), ON, ERROR ) b.rule(JSON_TABLE_ON_EMPTY_CLAUSE).define( b.firstOf(ERROR, NULL), ON, EMPTY ) b.rule(JSON_TABLE_COLUMNS_CLAUSE).define( COLUMNS, b.firstOf( b.sequence( LPARENTHESIS, JSON_COLUMN_DEFINITION, b.zeroOrMore(COMMA, JSON_COLUMN_DEFINITION), RPARENTHESIS ), b.sequence( JSON_COLUMN_DEFINITION, b.zeroOrMore(COMMA, JSON_COLUMN_DEFINITION), ), ) ) b.rule(JSON_COLUMN_DEFINITION).define( b.firstOf( JSON_NESTED_PATH, JSON_EXISTS_COLUMN, JSON_ORDINALITY_COLUMN, JSON_VALUE_COLUMN, JSON_QUERY_COLUMN ) ) b.rule(JSON_EXISTS_COLUMN).define( IDENTIFIER_NAME, b.optional(JSON_VALUE_RETURN_TYPE), EXISTS, b.optional(PATH, JSON_PATH), b.optional(ConditionsGrammar.JSON_EXISTS_ON_ERROR_CLAUSE), b.optional(ConditionsGrammar.JSON_EXISTS_ON_EMPTY_CLAUSE) ) b.rule(JSON_QUERY_COLUMN).define( IDENTIFIER_NAME, b.optional(JSON_VALUE_RETURN_TYPE), b.optional(FORMAT, JSON), b.optional(b.firstOf(ALLOW, DISALLOW), SCALARS), b.optional(JSON_QUERY_WRAPPER_CLAUSE), b.optional(PATH, JSON_PATH), b.optional(JSON_QUERY_ON_ERROR_CLAUSE) ) b.rule(JSON_VALUE_COLUMN).define( IDENTIFIER_NAME, b.optional(JSON_VALUE_RETURN_TYPE), b.nextNot(FORMAT), b.optional(TRUNCATE), b.optional(PATH, JSON_PATH), b.optional(JSON_VALUE_ON_ERROR_CLAUSE), b.optional(JSON_VALUE_ON_EMPTY_CLAUSE), b.optional(JSON_VALUE_ON_MISMATCH_CLAUSE) ) b.rule(JSON_NESTED_PATH).define( NESTED, b.optional(PATH), JSON_PATH, JSON_COLUMNS_CLAUSE ) b.rule(JSON_COLUMNS_CLAUSE).define( COLUMNS, LPARENTHESIS, JSON_COLUMN_DEFINITION, b.zeroOrMore(COMMA, JSON_COLUMN_DEFINITION), RPARENTHESIS ) b.rule(JSON_ORDINALITY_COLUMN).define(IDENTIFIER_NAME, FOR, ORDINALITY) b.rule(JSON_PATH).define( b.firstOf( JSON_BASIC_PATH_EXPRESSION, JSON_RELATIVE_OBJECT_ACCESS ) ) b.rule(JSON_BASIC_PATH_EXPRESSION).define(STRING_LITERAL).skip() b.rule(JSON_PATH_EXPRESSION).define(STRING_LITERAL).skip() b.rule(JSON_RELATIVE_OBJECT_ACCESS).define( IDENTIFIER_NAME, b.optional(JSON_ARRAY_STEP), b.zeroOrMore(DOT, IDENTIFIER_NAME, b.optional(JSON_ARRAY_STEP)) ) b.rule(JSON_ARRAY_STEP).define( LBRACKET, b.firstOf( b.oneOrMore(PlSqlTokenType.INTEGER_LITERAL, b.optional(TO, PlSqlTokenType.INTEGER_LITERAL), b.optional(COMMA)), MULTIPLICATION ), RBRACKET ) b.rule(JSON_VALUE_RETURN_TYPE).define( b.firstOf( b.sequence( CHARACTER_DATAYPE, b.optional(TRUNCATE) ), CLOB, NUMERIC_DATATYPE, b.sequence(b.firstOf(ALLOW, DISALLOW), b.optional(BOOLEAN), TO, NUMBER, b.optional(CONVERSION)), b.sequence(DATE, b.optional(b.firstOf(TRUNCATE, PRESERVE), TIME)), b.sequence(TIMESTAMP, b.optional(WITH, TIME, ZONE)), BOOLEAN, SDO_GEOMETRY, JSON_VALUE_RETURN_OBJECT_INSTANCE, VECTOR ) ) b.rule(JSON_VALUE_RETURN_OBJECT_INSTANCE).define( b.nextNot(NON_RESERVED_KEYWORD), CUSTOM_DATATYPE, b.optional(USING, CASE_SENSITIVE, MAPPING)) b.rule(JSON_VALUE_ON_ERROR_CLAUSE).define( b.firstOf( ERROR, NULL, b.sequence(DEFAULT, LITERAL) ), ON, ERROR ) b.rule(JSON_VALUE_ON_EMPTY_CLAUSE).define( b.firstOf( ERROR, NULL, b.sequence(DEFAULT, LITERAL) ), ON, EMPTY ) b.rule(JSON_VALUE_ON_MISMATCH_CLAUSE).define( b.firstOf(IGNORE, ERROR, NULL), ON, MISMATCH, b.optional( LPARENTHESIS, b.oneOrMore( b.firstOf( b.sequence(MISSING, DATA), b.sequence(EXTRA, DATA), b.sequence(TYPE, ERROR) ), b.optional(COMMA) ), RPARENTHESIS ) ) b.rule(JSON_VALUE_EXPRESSION).define( JSON_VALUE, LPARENTHESIS, EXPRESSION, b.optional(FORMAT, JSON), COMMA, STRING_LITERAL, b.optional(JSON_PASSING_CLAUSE), b.optional(JSON_VALUE_RETURNING_CLAUSE), b.optional(JSON_VALUE_ON_ERROR_CLAUSE), b.optional(JSON_VALUE_ON_EMPTY_CLAUSE), b.zeroOrMore(JSON_VALUE_ON_MISMATCH_CLAUSE), b.optional(TYPE, b.firstOf(STRICT, LAX)), RPARENTHESIS ) b.rule(JSON_VALUE_RETURNING_CLAUSE).define(RETURNING, JSON_VALUE_RETURN_TYPE, b.optional(ASCII)) b.rule(JSON_TRANSFORM_EXPRESSION).define( JSON_TRANSFORM, LPARENTHESIS, EXPRESSION, COMMA, JSON_TRANSFORM_OPERATION, b.zeroOrMore(COMMA, JSON_TRANSFORM_OPERATION), b.optional(JSON_TRANSFORM_RETURNING_CLAUSE), b.optional(TYPE, b.firstOf(STRICT, LAX)), b.optional(JSON_PASSING_CLAUSE), RPARENTHESIS ) b.rule(JSON_TRANSFORM_RETURNING_CLAUSE).define( RETURNING, b.firstOf( CHARACTER_DATAYPE, b.sequence( b.firstOf(CLOB, BLOB), b.optional(b.firstOf(REFERENCE, VALUE)) ), JSON, BOOLEAN, VECTOR ) ) b.rule(JSON_RHS_EXPRESSION).define( b.firstOf( b.sequence(PATH, JSON_BASIC_PATH_EXPRESSION), b.sequence(EXPRESSION, b.optional(FORMAT, JSON)) ) ) b.rule(JSON_TRANSFORM_OPERATION).define( b.firstOf( JSON_APPEND_OPERATION, JSON_CASE_OPERATION, JSON_COPY_OPERATION, JSON_INSERT_OPERATION, JSON_INTERSECT_OPERATION, JSON_KEEP_OPERATION, JSON_MERGE_OPERATION, JSON_MINUS_OPERATION, JSON_NESTED_PATH_OPERATION, JSON_PREPEND_OPERATION, JSON_REMOVE_OPERATION, JSON_RENAME_OPERATION, JSON_REPLACE_OPERATION, JSON_SET_OPERATION, JSON_SORT_OPERATION, JSON_UNION_OPERATION ) ) b.rule(JSON_APPEND_OPERATION).define( APPEND, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, CREATE, NULL), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR, REPLACE, NULL), ON, MISMATCH), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, NULL), b.optional(b.firstOf(IGNORE, ERROR), ON, EMPTY), ) b.rule(JSON_CASE_OPERATION).define( CASE, WHEN, JSON_PATH_EXPRESSION, THEN, LPARENTHESIS, JSON_TRANSFORM_OPERATION, b.zeroOrMore(COMMA, JSON_TRANSFORM_OPERATION), RPARENTHESIS, b.optional( ELSE, LPARENTHESIS, JSON_TRANSFORM_OPERATION, b.zeroOrMore(COMMA, JSON_TRANSFORM_OPERATION), RPARENTHESIS ), END ) b.rule(JSON_COPY_OPERATION).define( COPY, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, CREATE, NULL), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, NULL), b.optional(b.firstOf(IGNORE, ERROR), ON, EMPTY) ) b.rule(JSON_INSERT_OPERATION).define( INSERT, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, REPLACE, NULL), ON, EXISTING), b.optional(b.firstOf(IGNORE, ERROR, REMOVE, NULL), ON, NULL), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, EMPTY), b.optional(b.firstOf(IGNORE, ERROR), ON, ERROR) ) b.rule(JSON_INTERSECT_OPERATION).define( INTERSECT, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, CREATE, NULL), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, NULL) ) b.rule(JSON_KEEP_OPERATION).define( KEEP, JSON_PATH_EXPRESSION, b.zeroOrMore(COMMA, JSON_PATH_EXPRESSION), b.optional(b.firstOf(IGNORE, ERROR), ON, MISSING) ) b.rule(JSON_MERGE_OPERATION).define( MERGE, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, CREATE, NULL), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR), ON, MISMATCH), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, NULL), b.optional(b.firstOf(IGNORE, ERROR), ON, EMPTY) ) b.rule(JSON_MINUS_OPERATION).define( MINUS_KEYWORD, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, CREATE, NULL), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, NULL) ) b.rule(JSON_NESTED_PATH_OPERATION).define( NESTED, PATH, JSON_PATH_EXPRESSION, LPARENTHESIS, JSON_TRANSFORM_OPERATION, b.zeroOrMore(COMMA, JSON_TRANSFORM_OPERATION), RPARENTHESIS ) b.rule(JSON_PREPEND_OPERATION).define( PREPEND, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, CREATE, NULL), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR, REPLACE, CREATE), ON, MISMATCH), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, NULL), b.optional(b.firstOf(IGNORE, ERROR), ON, EMPTY) ) b.rule(JSON_REMOVE_OPERATION).define( REMOVE, JSON_PATH_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR), ON, MISSING) ) b.rule(JSON_RENAME_OPERATION).define( RENAME, JSON_PATH_EXPRESSION, WITH, STRING_LITERAL, b.optional(b.firstOf(IGNORE, ERROR), ON, MISSING) ) b.rule(JSON_REPLACE_OPERATION).define( REPLACE, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, CREATE, NULL), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR, REMOVE, NULL), ON, NULL), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, EMPTY), b.optional(b.firstOf(IGNORE, ERROR), ON, ERROR) ) b.rule(JSON_SET_OPERATION).define( SET, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, REPLACE), ON, EXISTING), b.optional(b.firstOf(IGNORE, ERROR, CREATE), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR, REMOVE, NULL), ON, NULL), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, EMPTY), b.optional(b.firstOf(IGNORE, ERROR), ON, ERROR) ) b.rule(JSON_SORT_OPERATION).define( SORT, JSON_PATH_EXPRESSION, b.optional( b.firstOf( REVERSE, b.sequence( b.optional(REMOVE, NULLS), ORDER, BY, JSON_PATH_EXPRESSION, b.optional(b.firstOf(ASC, DESC)), b.zeroOrMore( COMMA, JSON_PATH_EXPRESSION, b.optional(b.firstOf(ASC, DESC)) ) ), b.sequence( b.optional(b.firstOf(ASC, DESC)), b.optional(UNIQUE), b.optional(REMOVE, NULLS) ) ) ), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, MISMATCH), b.optional(b.firstOf(IGNORE, ERROR), ON, EMPTY), b.optional(b.firstOf(IGNORE, ERROR), ON, ERROR) ) b.rule(JSON_UNION_OPERATION).define( UNION, JSON_PATH_EXPRESSION, EQUALS, JSON_RHS_EXPRESSION, b.optional(b.firstOf(IGNORE, ERROR, CREATE, NULL), ON, MISSING), b.optional(b.firstOf(IGNORE, ERROR, NULL), ON, NULL) ) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/SqlPlusGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.GenericTokenType import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.zpa.sslr.PlSqlGrammarBuilder enum class SqlPlusGrammar : GrammarRuleKey { SQLPLUS_COMMAND; companion object { fun buildOn(b: PlSqlGrammarBuilder) { createSqlPlusCommands(b) } private fun createSqlPlusCommands(b: PlSqlGrammarBuilder) { b.rule(SQLPLUS_COMMAND).define( b.firstOf( "@", "A", "APPEND", "ACC", "ACCEPT", "ARCHIVE", "ATTR", "ATTRIBUTE", "BRE", "BREAK", "BTI", "BTITLE", "C", "CHANGE", "CL", "CLEAR", "COL", "COLUMN", "COMP", "COMPUTE", "CONN", "CONNECT", "COPY", "DEF", "DEFINE", "DEL", "DESC", "DESCRIBE", "DISC", "DISCONNECT", "ED", "EDIT", "EXEC", "EXECUTE", "EXIT", "QUIT", "GET", "HELP", "?", "HO", "HOST", "I", "INPUT", "L", "LIST", "PASSW", "PASSWORD", "PAU", "PAUSE", "PRINT", "PRO", "PROMPT", "RECOVER", "REM", "REMARK", "REPF", "REPFOOTER", "REPH", "REPHEADER", "R", "RUN", "SAV", "SAVE", "SET", "SHO", "SHOW", "SHUTDOWN", "SPO", "SPOOL", "STA", "START", "STARTUP", "STORE", "TIMI", "TIMING", "TTI", "TTITLE", "UNDEF", "UNDEFINE", "VAR", "VARIABLE", "WHENEVER", "XQUERY"), b.firstOf(b.tillNewLine(), b.till(GenericTokenType.EOF))) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/TclGrammar.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.GenericTokenType.IDENTIFIER import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.api.PlSqlGrammar.IDENTIFIER_NAME import com.felipebz.zpa.api.PlSqlKeyword.* import com.felipebz.zpa.api.PlSqlPunctuator.COMMA import com.felipebz.zpa.api.PlSqlPunctuator.SEMICOLON import com.felipebz.zpa.api.PlSqlTokenType.INTEGER_LITERAL import com.felipebz.zpa.api.PlSqlTokenType.STRING_LITERAL enum class TclGrammar : GrammarRuleKey { TRANSACTION_NAME, COMMIT_EXPRESSION, ROLLBACK_EXPRESSION, SAVEPOINT_EXPRESSION, SET_TRANSACTION_EXPRESSION, TCL_COMMAND; companion object { fun buildOn(b: PlSqlGrammarBuilder) { b.rule(COMMIT_EXPRESSION).define( COMMIT, b.optional(WORK), b.optional(b.firstOf( b.sequence(FORCE, STRING_LITERAL, b.optional(COMMA, INTEGER_LITERAL)), b.sequence( b.optional(COMMENT, STRING_LITERAL), b.optional(WRITE, b.optional(b.firstOf(IMMEDIATE, BATCH)), b.optional(b.firstOf(WAIT, NOWAIT))))))).skip() b.rule(ROLLBACK_EXPRESSION).define( ROLLBACK, b.optional(WORK), b.optional(b.firstOf( b.sequence(FORCE, STRING_LITERAL), b.sequence(TO, b.optional(SAVEPOINT), IDENTIFIER_NAME)))).skip() b.rule(SAVEPOINT_EXPRESSION).define(SAVEPOINT, IDENTIFIER_NAME).skip() b.rule(TRANSACTION_NAME).define(NAME, STRING_LITERAL) //https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_10005.htm#SQLRF01705 b.rule(SET_TRANSACTION_EXPRESSION).define( SET, TRANSACTION, b.firstOf( b.sequence( b.firstOf(b.sequence(READ, b.firstOf(ONLY, WRITE)), b.sequence(ISOLATION, LEVEL, b.firstOf(SERIALIZABLE, b.sequence(READ, COMMITTED))), b.sequence(USE, ROLLBACK, SEGMENT, IDENTIFIER)), b.optional(TRANSACTION_NAME)), TRANSACTION_NAME)) b.rule(TCL_COMMAND).define( b.firstOf( COMMIT_EXPRESSION, ROLLBACK_EXPRESSION, SAVEPOINT_EXPRESSION, SET_TRANSACTION_EXPRESSION), b.optional(SEMICOLON)) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/ZpaRulesDefinition.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api interface ZpaRulesDefinition { fun repositoryName(): String fun repositoryKey(): String fun checkClasses(): Array> } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/annotations/ActivatedByDefault.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.annotations @Retention @Target(AnnotationTarget.CLASS, AnnotationTarget.FILE) annotation class ActivatedByDefault ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/annotations/ConstantRemediation.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.annotations @Retention @Target(AnnotationTarget.CLASS, AnnotationTarget.FILE) annotation class ConstantRemediation( /** * Value of the remediation * @return e.g. "10min" or "2h" */ val value: String) ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/annotations/Priority.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.annotations enum class Priority { INFO, MINOR, MAJOR, CRITICAL, BLOCKER } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/annotations/Rule.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.annotations @Retention @Target(AnnotationTarget.CLASS, AnnotationTarget.FILE) annotation class Rule(val key: String = "", val name: String = "", val description: String = "", val priority: Priority = Priority.MAJOR, val tags: Array = [], val status: String = "READY") ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/annotations/RuleInfo.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.annotations @Retention @Target(AnnotationTarget.CLASS, AnnotationTarget.FILE) annotation class RuleInfo(val scope: Scope = Scope.MAIN) { enum class Scope { ALL, MAIN, TEST } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/annotations/RuleProperty.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.annotations @Retention @Target(AnnotationTarget.FIELD) annotation class RuleProperty(val key: String = "", val description: String = "", val defaultValue: String = "", val type: String = "") ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/annotations/RuleTemplate.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.annotations @Retention @Target(AnnotationTarget.CLASS, AnnotationTarget.FILE) annotation class RuleTemplate ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/checks/PlSqlCheck.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.checks import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.Token import com.felipebz.zpa.checks.IssueLocation import com.felipebz.zpa.sslr.Tree import com.felipebz.zpa.api.PlSqlVisitorContext import com.felipebz.zpa.api.squid.SemanticAstNode import java.text.MessageFormat import java.util.* open class PlSqlCheck : PlSqlVisitor() { private val issues = ArrayList() override fun startScan() { issues.clear() } fun semantic(node: AstNode) = node as SemanticAstNode fun issues(): List = Collections.unmodifiableList(issues) fun scanFileForIssues(context: PlSqlVisitorContext): List { issues.clear() scanFile(context) return issues() } fun addIssue(node: AstNode, message: String): PreciseIssue { val newIssue = PreciseIssue(IssueLocation.preciseLocation(node, message)) issues.add(newIssue) return newIssue } fun addIssue(node: AstNode, message: String, vararg messageParameters: Any): PreciseIssue { return addIssue(node, MessageFormat.format(message, *messageParameters)) } fun addIssue(tree: Tree, message: String): PreciseIssue { val newIssue = PreciseIssue(IssueLocation.preciseLocation(tree.astNode, message)) issues.add(newIssue) return newIssue } fun addIssue(tree: Tree, message: String, vararg messageParameters: Any): PreciseIssue { return addIssue(tree, MessageFormat.format(message, *messageParameters)) } fun addIssue(primaryLocation: IssueLocation): PreciseIssue { val newIssue = PreciseIssue(primaryLocation) issues.add(newIssue) return newIssue } fun addLineIssue(message: String, lineNumber: Int): PreciseIssue { val newIssue = PreciseIssue(IssueLocation.atLineLevel(message, lineNumber)) issues.add(newIssue) return newIssue } fun addLineIssue(message: String, lineNumber: Int, vararg messageParameters: Any): PreciseIssue { return addLineIssue(MessageFormat.format(message, *messageParameters), lineNumber) } fun addFileIssue(message: String): PreciseIssue { val newIssue = PreciseIssue(IssueLocation.atFileLevel(message)) issues.add(newIssue) return newIssue } fun addFileIssue(message: String, vararg messageParameters: Any): PreciseIssue { return addFileIssue(MessageFormat.format(message, *messageParameters)) } fun addIssue(token: Token, message: String): PreciseIssue { return addIssue(AstNode(token), message) } fun addIssue(token: Token, message: String, vararg messageParameters: Any): PreciseIssue { return addIssue(token, MessageFormat.format(message, *messageParameters)) } class PreciseIssue(private val primaryLocation: IssueLocation) { private var cost: Int? = null private val secondaryLocations = mutableListOf() fun cost() = cost fun withCost(cost: Int) = apply { this.cost = cost } fun primaryLocation() = primaryLocation fun secondary(node: AstNode, message: String) = apply { secondaryLocations.add(IssueLocation.preciseLocation(node, message)) } fun secondary(issueLocation: IssueLocation)= apply { secondaryLocations.add(issueLocation) } fun secondaryLocations(): List = secondaryLocations } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/checks/PlSqlVisitor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.checks import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.AstNodeType import com.felipebz.flr.api.Token import com.felipebz.flr.api.Trivia import com.felipebz.zpa.rules.ZpaActiveRule import com.felipebz.zpa.squid.PlSqlAstWalker import com.felipebz.zpa.api.PlSqlVisitorContext open class PlSqlVisitor { lateinit var context: PlSqlVisitorContext lateinit var activeRule: ZpaActiveRule internal set private val astNodeTypesToVisit = mutableSetOf() fun subscribedKinds(): Set = astNodeTypesToVisit open fun startScan() { // default implementation does nothing } open fun init() { // default implementation does nothing } open fun visitFile(node: AstNode) { // default implementation does nothing } open fun leaveFile(node: AstNode) { // default implementation does nothing } open fun visitNode(node: AstNode) { // default implementation does nothing } open fun visitToken(token: Token) { // default implementation does nothing } open fun visitComment(trivia: Trivia, content: String) { // default implementation does nothing } open fun leaveNode(node: AstNode) { // default implementation does nothing } fun subscribeTo(vararg astNodeTypes: AstNodeType) { astNodeTypesToVisit.addAll(astNodeTypes) } fun scanFile(context: PlSqlVisitorContext) { val walker = PlSqlAstWalker(setOf(this)) walker.walk(context) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/matchers/MethodMatcher.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.matchers import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.squid.SemanticAstNode import com.felipebz.zpa.api.symbols.PlSqlType class MethodMatcher private constructor() { private var methodNameCriteria: NameCriteria? = null private var packageNameCriteria: NameCriteria? = null private var schemaNameCriteria: NameCriteria? = null private var shouldCheckParameters = true private var schemaIsOptional = false var methodName: String = "" private set private val expectedArgumentTypes = ArrayList() fun name(methodNameCriteria: String) = name(NameCriteria.`is`(methodNameCriteria)) fun name(methodNameCriteria: NameCriteria) = apply { check(this.methodNameCriteria == null) this.methodNameCriteria = methodNameCriteria } fun packageName(packageNameCriteria: String) = packageName(NameCriteria.`is`(packageNameCriteria)) fun packageName(packageNameCriteria: NameCriteria) = apply { check(this.packageNameCriteria == null) this.packageNameCriteria = packageNameCriteria } fun schema(schemaNameCriteria: String) = schema(NameCriteria.`is`(schemaNameCriteria)) fun schema(schemaNameCriteria: NameCriteria) = apply { check(this.schemaNameCriteria == null) this.schemaNameCriteria = schemaNameCriteria } fun withNoParameterConstraint() = apply { check(this.expectedArgumentTypes.isEmpty()) this.shouldCheckParameters = false } fun schemaIsOptional() = apply { this.schemaIsOptional = true } fun addParameter() = addParameter(PlSqlType.UNKNOWN) fun addParameter(type: PlSqlType) = apply { check(this.shouldCheckParameters) expectedArgumentTypes.add(type) } fun addParameters(quantity: Int) = apply { for (i in 0 until quantity) { addParameter(PlSqlType.UNKNOWN) } } fun addParameters(vararg types: PlSqlType) = apply { check(this.shouldCheckParameters) for (type in types) { addParameter(type) } } fun getArguments(node: AstNode): List { val arguments = node.getFirstChildOrNull(PlSqlGrammar.ARGUMENTS) return arguments?.getChildren(PlSqlGrammar.ARGUMENT) ?: ArrayList() } fun getArgumentsValues(node: AstNode) = getArguments(node).map { it.lastChild }.toList() fun matches(originalNode: AstNode): Boolean { val node = normalize(originalNode) var i = -1 val nodes = arrayOfNulls(3) for (child in node.children) { if (i < 2 && (child.type === PlSqlGrammar.VARIABLE_NAME || child.type === PlSqlGrammar.IDENTIFIER_NAME)) { nodes[++i] = child.tokenValue } } fun hasMoreItensToCheck() = i > -1 fun nextNode() = nodes[i--] if (!hasMoreItensToCheck()) { return false } var matches = methodNameCriteria?.let { nameAcceptable(nextNode(), it) } ?: true packageNameCriteria?.let { matches = matches and (hasMoreItensToCheck() && nameAcceptable(nextNode(), it)) } schemaNameCriteria?.let { matches = matches and (schemaIsOptional && !hasMoreItensToCheck() || hasMoreItensToCheck() && nameAcceptable(nextNode(), it)) } return matches && !hasMoreItensToCheck() && argumentsAcceptable(originalNode) } private fun nameAcceptable(name: String?, criteria: NameCriteria): Boolean { methodName = name ?: "" return criteria.matches(methodName) } private fun argumentsAcceptable(node: AstNode): Boolean { val arguments = getArguments(node) return !shouldCheckParameters || arguments.size == expectedArgumentTypes.size && argumentTypesAreCorrect(arguments) } private fun argumentTypesAreCorrect(arguments: List): Boolean { var result = true for ((i, type) in expectedArgumentTypes.withIndex()) { val actualArgument = arguments[i].firstChild result = result and (type === PlSqlType.UNKNOWN || type === semantic(actualArgument).plSqlType) } return result } private fun normalize(node: AstNode): AstNode { if (node.type === PlSqlGrammar.METHOD_CALL || node.type === PlSqlGrammar.CALL_STATEMENT) { var child = normalize(node.firstChild) if (child.firstChild.type === PlSqlGrammar.HOST_AND_INDICATOR_VARIABLE) { child = child.firstChild } return child } return node } companion object { @JvmStatic fun create(): MethodMatcher { return MethodMatcher() } fun semantic(node: AstNode): SemanticAstNode { return node as SemanticAstNode } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/matchers/NameCriteria.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.matchers import java.util.* fun interface NameCriteria { fun matches(name: String?): Boolean companion object { @JvmStatic fun any(): NameCriteria = NameCriteria { true } @JvmStatic fun `is`(exactName: String): NameCriteria = NameCriteria { name -> exactName.equals(name, ignoreCase = true) } @JvmStatic fun startsWith(prefix: String): NameCriteria = NameCriteria { name -> name != null && name.uppercase(Locale.getDefault()) .startsWith(prefix.uppercase(Locale.getDefault())) } @JvmStatic fun `in`(vararg prefix: String): NameCriteria = NameCriteria { name -> prefix.any { name.equals(it, ignoreCase = true) } } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/squid/PlSqlCommentAnalyzer.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.squid object PlSqlCommentAnalyzer { fun getContents(comment: String) = when (comment[0]) { '-' -> { comment.substring(2) } '/' -> { comment.substring(2, comment.length - 2) } else -> { throw IllegalArgumentException() } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/squid/SemanticAstNode.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.squid import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.AstNodeType import com.felipebz.flr.api.Token import com.felipebz.zpa.sslr.PlSqlGrammarBuilder import com.felipebz.zpa.sslr.Tree import com.felipebz.zpa.sslr.TreeImpl import com.felipebz.zpa.api.symbols.PlSqlType import com.felipebz.zpa.api.symbols.Symbol import com.felipebz.zpa.api.symbols.datatype.PlSqlDatatype import com.felipebz.zpa.api.symbols.datatype.UnknownDatatype class SemanticAstNode(type: AstNodeType, name: String, token: Token?) : AstNode(type, name, token) { constructor(token: Token) : this(token.type, token.type.name, token) private var internalTree: Tree? = null var symbol: Symbol? = null set(symbol) { field = symbol val child = if (children.count() == 1) children[0] else return (child as SemanticAstNode).symbol = symbol } var plSqlDatatype: PlSqlDatatype = UnknownDatatype get() = this.symbol?.datatype ?: field val plSqlType: PlSqlType get() = plSqlDatatype.type val tree: Tree get() { internalTree?.let { return it } var classType = PlSqlGrammarBuilder.classForType(super.type) if (classType == TreeImpl::class.java) { var node = this while (classType == TreeImpl::class.java && node.numberOfChildren == 1) { node = node.firstChild as SemanticAstNode classType = PlSqlGrammarBuilder.classForType(node.type) } } val instance = classType.getDeclaredConstructor(SemanticAstNode::class.java) .newInstance(this) internalTree = instance return instance } val allTokensToString: String get() = tokens.joinToString(" ") { it.originalValue } override fun toString(): String { return buildString { append(name) if (tokenOrNull != null) { append(" value='").append(token.value).append("'") append(" line=").append(token.line) append(" column=").append(token.column) } if (plSqlDatatype !is UnknownDatatype) { append(" datatype=") append(plSqlDatatype) } } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/PlSqlType.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols enum class PlSqlType { UNKNOWN, CHARACTER, NUMERIC, DATE, LOB, BOOLEAN, ROWTYPE, ASSOCIATIVE_ARRAY, NULL, RECORD, JSON, EXCEPTION; val isCharacter: Boolean get() = this == CHARACTER val isNumeric: Boolean get() = this == NUMERIC val isUnknown: Boolean get() = this == UNKNOWN } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/Scope.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.AstNodeType import com.felipebz.flr.api.Token import com.felipebz.zpa.api.PlSqlFile import java.util.* interface Scope { val isAutonomousTransaction: Boolean val isOverridingMember: Boolean val symbols: List val tree: AstNode? val outer: Scope? val identifier: String? val hasExceptionHandler: Boolean val path: List val innerScopes: List val type: AstNodeType? val isGlobal: Boolean val plSqlFile: PlSqlFile? val firstToken: Token? val lastToken: Token? /** * @param kind of the symbols to look for * @return the symbols corresponding to the given kind */ fun getSymbols(kind: Symbol.Kind): List fun getSymbolsAcessibleInScope(name: String, vararg kinds: Symbol.Kind): Deque fun addSymbol(symbol: Symbol) fun getSymbol(name: String, vararg kinds: Symbol.Kind): Symbol? fun getSymbol(name: String, path: List, vararg kinds: Symbol.Kind): Symbol? fun addInnerScope(scope: Scope) } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/Symbol.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.symbols.datatype.PlSqlDatatype import com.felipebz.zpa.api.symbols.datatype.UnknownDatatype import java.util.* open class Symbol(val node: AstNode?, val kind: Kind, val scope: Scope, datatype: PlSqlDatatype?, name: String = "") { private val internalUsages = mutableListOf() private var internalModifiers = mutableListOf() enum class Kind(val value: String) { VARIABLE("variable"), PARAMETER("parameter"), CURSOR("cursor"), TYPE("type"), PACKAGE("package"), PROCEDURE("procedure"), FUNCTION("function"), TRIGGER("trigger"), } val declaration by lazy { node ?: throw IllegalStateException("Symbol must have a declaration") } val name: String = node?.tokenValue ?: name val type: PlSqlType = datatype?.type ?: PlSqlType.UNKNOWN val datatype: PlSqlDatatype = datatype ?: UnknownDatatype val modifiers: List get() = Collections.unmodifiableList(internalModifiers) val usages: List get() = Collections.unmodifiableList(internalUsages) val isGlobal: Boolean = if (kind in arrayOf(Kind.VARIABLE, Kind.CURSOR, Kind.TYPE)) { scope.isGlobal && scope.type == PlSqlGrammar.CREATE_PACKAGE } else { scope.isGlobal } var innerScope: Scope? = null fun hasModifier(modifier: String): Boolean { for (syntaxToken in modifiers) { if (syntaxToken.tokenValue.equals(modifier, ignoreCase = true)) { return true } } return false } fun addModifiers(modifiers: List) { internalModifiers.addAll(modifiers) } fun addUsage(usage: AstNode) { internalUsages.add(usage) } fun `is`(kind: Kind) = kind == this.kind fun called(name: String) = if (name.startsWith('"')) { name == this.name } else { name.equals(this.name, ignoreCase = true) } override fun toString() = "Symbol name=$name kind=$kind datatype=$datatype" } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/SymbolTable.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols import com.felipebz.flr.api.AstNode interface SymbolTable { val symbols: List val scopes: Set fun getScopeFor(symbol: AstNode): Scope? } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/AssociativeArrayDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.symbols.PlSqlType import com.felipebz.zpa.api.symbols.Scope class AssociativeArrayDatatype(node: AstNode? = null, currentScope: Scope?, val nestedType: PlSqlDatatype) : PlSqlDatatype { override val type = PlSqlType.ASSOCIATIVE_ARRAY override val name: String = currentScope?.let { if (it.identifier != null && it.type == PlSqlGrammar.CREATE_PACKAGE) it.identifier + "." else "" } + node?.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME)?.tokenValue override fun toString(): String { return "AssociativeArray{nestedType=$nestedType}" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/BooleanDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.zpa.api.symbols.PlSqlType class BooleanDatatype : PlSqlDatatype { override val type = PlSqlType.BOOLEAN override val name: String = "BOOLEAN" override fun toString(): String { return "Boolean" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/CharacterDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.symbols.PlSqlType class CharacterDatatype : PlSqlDatatype { override val type = PlSqlType.CHARACTER override val name: String get() = if (this.length == null) "VARCHAR2" else "VARCHAR2(${this.length})" val length: Int? constructor() { length = null } constructor(length: Int?) { this.length = if (length != null && length > 0) length else null } constructor(node: AstNode? = null) { val constraint = node?.firstChildOrNull?.getFirstChildOrNull(PlSqlGrammar.CHARACTER_DATATYPE_CONSTRAINT) length = constraint ?.getFirstChildOrNull(PlSqlGrammar.LITERAL) ?.tokenValue?.toInt() } override fun toString(): String { return "Character{length=$length}" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/DateDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.zpa.api.symbols.PlSqlType class DateDatatype : PlSqlDatatype { override val type = PlSqlType.DATE override val name: String = "DATE" override fun toString(): String { return "Date" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/ExceptionDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.zpa.api.symbols.PlSqlType class ExceptionDatatype : PlSqlDatatype { override val type = PlSqlType.EXCEPTION override val name: String = "EXCEPTION" override fun toString(): String { return "Exception" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/JsonDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.zpa.api.symbols.PlSqlType class JsonDatatype : PlSqlDatatype { override val type = PlSqlType.JSON override val name: String = "JSON" override fun toString(): String { return "Json" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/LobDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.zpa.api.symbols.PlSqlType class LobDatatype : PlSqlDatatype { override val type = PlSqlType.LOB override val name: String = "LOB" override fun toString(): String { return "Lob" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/NullDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.zpa.api.symbols.PlSqlType class NullDatatype : PlSqlDatatype { override val type = PlSqlType.NULL override val name: String = "NULL" override fun toString(): String { return "Null" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/NumericDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.symbols.PlSqlType class NumericDatatype : PlSqlDatatype { override val type = PlSqlType.NUMERIC override val name: String get() = if (this.length == null) "NUMBER()" else if (this.scale == null) "NUMBER(${this.length})" else "NUMBER(${this.length}, ${this.scale})" val length: Int? val scale: Int? constructor() { length = null scale = null } constructor(length: Int?, scale: Int?) { this.length = if (length != null && length > 0) length else null this.scale = if (scale != null && scale > 0) scale else null } constructor(node: AstNode? = null) { val constraint = node?.firstChildOrNull?.getFirstChildOrNull(PlSqlGrammar.NUMERIC_DATATYPE_CONSTRAINT) if (constraint != null) { val precisionNode = constraint.getFirstChildOrNull(PlSqlGrammar.NUMERIC_PRECISION) length = if (precisionNode != null && precisionNode.hasDirectChildren(PlSqlGrammar.LITERAL)) { precisionNode.tokenValue.toInt() } else { null } val scaleNode = constraint.getFirstChildOrNull(PlSqlGrammar.NUMERIC_SCALE) scale = if (scaleNode != null && scaleNode.hasDirectChildren(PlSqlGrammar.LITERAL)) { scaleNode.tokenValue.toInt() } else { null } } else { length = null scale = null } } override fun toString(): String { return "Numeric{length=$length, scale=$scale}" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/PlSqlDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.zpa.api.symbols.PlSqlType interface PlSqlDatatype { val type: PlSqlType val name: String? } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/RecordDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.symbols.PlSqlType import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.Symbol class RecordDatatype(node: AstNode? = null, currentScope: Scope?, val fields: List) : PlSqlDatatype { override val type = PlSqlType.RECORD override val name: String = currentScope?.let { if (it.identifier != null && it.type == PlSqlGrammar.CREATE_PACKAGE) it.identifier + "." else "" } + node?.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME)?.tokenValue override fun toString(): String { return "Record" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/RowtypeDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.zpa.api.symbols.PlSqlType class RowtypeDatatype : PlSqlDatatype { override val type = PlSqlType.ROWTYPE override val name: String? = null override fun toString(): String { return "Rowtype" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/api/symbols/datatype/UnknownDatatype.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.symbols.datatype import com.felipebz.zpa.api.symbols.PlSqlType object UnknownDatatype : PlSqlDatatype { override val type = PlSqlType.UNKNOWN override val name: String? = null override fun toString(): String { return "Unknown" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/checks/IssueLocation.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.checks import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.Token abstract class IssueLocation private constructor(private val message: String) { fun message() = message abstract fun startLine(): Int abstract fun startLineOffset(): Int abstract fun endLine(): Int abstract fun endLineOffset(): Int private class PreciseIssueLocation : IssueLocation { private val firstToken: Token private val lastToken: Token constructor(node: AstNode, message: String) : super(message) { this.firstToken = node.token this.lastToken = node.lastToken } constructor(startNode: AstNode, endNode: AstNode, message: String) : super(message) { this.firstToken = startNode.token this.lastToken = endNode.lastToken } override fun startLine() = firstToken.line override fun startLineOffset() = firstToken.column override fun endLine() = lastToken.endLine override fun endLineOffset() = lastToken.endColumn } private class LineLevelIssueLocation(message: String, private val lineNumber: Int) : IssueLocation(message) { override fun startLine() = lineNumber override fun startLineOffset() = UNDEFINED_OFFSET override fun endLine() = lineNumber override fun endLineOffset() = UNDEFINED_OFFSET } private class FileLevelIssueLocation(message: String) : IssueLocation(message) { override fun startLine() = UNDEFINED_LINE override fun startLineOffset() = UNDEFINED_OFFSET override fun endLine() = UNDEFINED_LINE override fun endLineOffset() = UNDEFINED_OFFSET } companion object { const val UNDEFINED_OFFSET = -1 const val UNDEFINED_LINE = 0 fun atFileLevel(message: String): IssueLocation = FileLevelIssueLocation(message) fun atLineLevel(message: String, lineNumber: Int): IssueLocation = LineLevelIssueLocation(message, lineNumber) fun preciseLocation(startNode: AstNode, endNode: AstNode, message: String): IssueLocation = PreciseIssueLocation(startNode, endNode, message) fun preciseLocation(startNode: AstNode, message: String): IssueLocation = PreciseIssueLocation(startNode, message) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/grammar/ExecutePlSqlBufferExpression.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.grammar import com.felipebz.flr.api.GenericTokenType import com.felipebz.flr.internal.matchers.Matcher import com.felipebz.flr.internal.vm.Machine import com.felipebz.flr.internal.vm.NativeExpression import com.felipebz.zpa.api.PlSqlPunctuator public object ExecuteBufferExpression : NativeExpression(), Matcher { override fun execute(machine: Machine) { if (machine.length < 2) { machine.backtrack() return } val previousTokenLine = if (machine.index == 0) 0 else machine.tokenAt(-1).line val token = machine.tokenAt(0) val nextToken = machine.tokenAt(1) if (token.type == PlSqlPunctuator.DIVISION && token.column == 0 && (token.line != previousTokenLine || previousTokenLine == 0) && (token.line != nextToken.line || nextToken.type == GenericTokenType.EOF) ) { machine.createLeafNode(this, 1) machine.jump(1) } else { machine.backtrack() } } override fun toString(): String { return "ExecuteBuffer" } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/lexer/CommentChannel.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.lexer import com.felipebz.flr.channel.Channel import com.felipebz.flr.channel.CodeReader import com.felipebz.flr.impl.LexerOutput import com.felipebz.flr.impl.channel.CommentRegexpChannel private const val inlineComment = "--[^\\n\\r]*+" private const val multiLineComment = "/\\*[\\s\\S]*?\\*/" class CommentChannel private constructor(private val commentRegexpChannel: CommentRegexpChannel) : Channel by commentRegexpChannel { constructor(): this(CommentRegexpChannel("(?:$inlineComment|$multiLineComment)")) override fun consume(code: CodeReader, output: LexerOutput): Boolean { val nextChar = code.peek().toChar() if (nextChar != '-' && nextChar != '/') { return false } return commentRegexpChannel.consume(code, output) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/lexer/DateChannel.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.lexer import com.felipebz.flr.channel.Channel import com.felipebz.flr.channel.CodeReader import com.felipebz.flr.impl.LexerOutput import com.felipebz.flr.impl.channel.RegexpChannel class DateChannel(private val regexpChannel: RegexpChannel) : Channel by regexpChannel { override fun consume(code: CodeReader, output: LexerOutput): Boolean { val nextChar = code.peek().toChar().lowercaseChar() if (nextChar != 'd' && nextChar != 't') { return false } return regexpChannel.consume(code, output) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/lexer/DiscardWhitespaceChannel.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.lexer import com.felipebz.flr.channel.Channel import com.felipebz.flr.channel.CodeReader import com.felipebz.flr.impl.LexerOutput class DiscardWhitespaceChannel : Channel { override fun consume(code: CodeReader, output: LexerOutput): Boolean { if (code[0].isWhitespace() && code[1] != '&') { code.pop() return true } return false } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/lexer/IdentifierChannel.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.lexer import com.felipebz.flr.channel.Channel import com.felipebz.flr.channel.CodeReader import com.felipebz.flr.impl.LexerOutput import com.felipebz.flr.impl.channel.IdentifierAndKeywordChannel class IdentifierChannel(private val channel: IdentifierAndKeywordChannel) : Channel by channel { override fun consume(code: CodeReader, output: LexerOutput): Boolean { val nextChar = code.peek().toChar() if (!nextChar.isLetter()) { return false } return channel.consume(code, output) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/lexer/IntegerChannel.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.lexer import com.felipebz.flr.api.Token import com.felipebz.flr.channel.Channel import com.felipebz.flr.channel.CodeReader import com.felipebz.flr.impl.LexerOutput import com.felipebz.zpa.api.PlSqlTokenType class IntegerChannel : Channel { override fun consume(code: CodeReader, output: LexerOutput): Boolean { var tmpBuilder: StringBuilder? = null var pos = 0 var nextChar = code.intAt(pos++).toChar() while (nextChar.isDigit()) { tmpBuilder = tmpBuilder ?: StringBuilder(5) tmpBuilder.append(nextChar) nextChar = code.intAt(pos++).toChar() } if (tmpBuilder.isNullOrEmpty()) { return false } val value = tmpBuilder.toString() val token = Token.builder() .setType(PlSqlTokenType.INTEGER_LITERAL) .setValueAndOriginalValue(value) .setLine(code.getLinePosition()) .setColumn(code.getColumnPosition()) .build() output.addToken(token) /* Advance the CodeReader stream by the length of the punctuator */ for (j in value.indices) { code.pop() } return true } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/lexer/NumericChannel.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.lexer import com.felipebz.flr.channel.Channel import com.felipebz.flr.channel.CodeReader import com.felipebz.flr.impl.LexerOutput import com.felipebz.flr.impl.channel.RegexpChannel class NumericChannel(private val regexpChannel: RegexpChannel) : Channel by regexpChannel { override fun consume(code: CodeReader, output: LexerOutput): Boolean { val nextChar = code.peek().toChar() if (nextChar !in '0'..'9' && nextChar != '.') { return false } return regexpChannel.consume(code, output) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/lexer/PlSqlLexer.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.lexer import com.felipebz.flr.impl.Lexer import com.felipebz.flr.impl.channel.BlackHoleChannel import com.felipebz.flr.impl.channel.IdentifierAndKeywordChannel import com.felipebz.flr.impl.channel.PunctuatorChannel import com.felipebz.flr.impl.channel.RegexpChannelBuilder.and import com.felipebz.flr.impl.channel.RegexpChannelBuilder.g import com.felipebz.flr.impl.channel.RegexpChannelBuilder.o2n import com.felipebz.flr.impl.channel.RegexpChannelBuilder.or import com.felipebz.flr.impl.channel.RegexpChannelBuilder.regexp import com.felipebz.flr.impl.channel.UnknownCharacterChannel import com.felipebz.zpa.squid.PlSqlConfiguration import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.PlSqlPunctuator import com.felipebz.zpa.api.PlSqlTokenType object PlSqlLexer { private val NUMBER_LITERAL = "(?is)(?:" + or( """(?:(?:\d++(?![.][.])[.]\d*+)|(?![.][.])[.]\d++)(?:e[+-]?\d++)?[fd]?""", // decimal value in floating-point literal """\d++(?:e[+-]?\d++)?[fd]""", // integer value in floating-point literal """\d++(?:e[+-]?\d++)""" // number literal in scientific notation ) + ")" private const val CUSTOM_DELIMITER_START = """[^\s{\[<\(]""" // any except spacing private const val CUSTOM_DELIMITER_END = """\1""" // same as the start private val STRING_LITERAL = ("(?is)(?:" + or("""?:n?'(?:[^']|'')*+'""", // simple text literal "n?q?'" + or("?:" + g("?:" + g(CUSTOM_DELIMITER_START) + ".*?(?:" + CUSTOM_DELIMITER_END + "')"), g("""?:\(.*?\)'"""), g("""?:\[.*?\]'"""), g("""?:<.*?>'"""), g("""?:\{.*?\}'"""))) // text with user-defined delimiter + ")") private const val DATE_LITERAL = """(?i)(?:DATE\s*?'\d{4}-\d{2}-\d{2}')""" private const val TIMESTAMP_LITERAL = """(?i)TIMESTAMP\s*?'\d{4}-\d{2}-\d{2}\s++\d{1,2}:\d{2}:\d{2}(?:.\d{1,9})?(?:\s++[A-Z0-9_/+-:]++(?:\s++[A-Z0-9_/+-]{1,5})?)?'""" private val SIMPLE_IDENTIFIER = and("""[\w\p{L}]""", o2n("""[\w\p{L}#$]""")) private const val QUOTED_IDENTIFIER = """".+?"""" fun create(conf: PlSqlConfiguration): Lexer = Lexer.builder() .withCharset(conf.charset) .withFailIfNoChannelToConsumeOneCharacter(true) .withChannel(DiscardWhitespaceChannel()) .withChannel(CommentChannel()) .withChannel(NumericChannel(regexp(PlSqlTokenType.NUMBER_LITERAL, NUMBER_LITERAL))) .withChannel(IntegerChannel()) .withChannel(StringChannel(regexp(PlSqlTokenType.STRING_LITERAL, STRING_LITERAL))) .withChannel(DateChannel(regexp(PlSqlTokenType.DATE_LITERAL, DATE_LITERAL))) .withChannel(DateChannel(regexp(PlSqlTokenType.TIMESTAMP_LITERAL, TIMESTAMP_LITERAL))) .withChannel(IdentifierChannel(IdentifierAndKeywordChannel(SIMPLE_IDENTIFIER, false, PlSqlKeyword.entries.toTypedArray() ))) .withChannel(QuotedIdentifierChannel(QUOTED_IDENTIFIER, SIMPLE_IDENTIFIER)) .withChannel(PunctuatorChannel(*PlSqlPunctuator.entries.toTypedArray())) .withChannel(BlackHoleChannel("(?is)" + or( "\\s&&?$SIMPLE_IDENTIFIER", "\\\$if.*?\\\$then", "\\\$else.*?\\\$end", "\\\$error.*?\\\$end", "\\\$end" ))) .withChannel(UnknownCharacterChannel()) .build() } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/lexer/QuotedIdentifierChannel.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.lexer import com.felipebz.flr.api.GenericTokenType import com.felipebz.flr.api.Token import com.felipebz.flr.channel.Channel import com.felipebz.flr.channel.CodeReader import com.felipebz.flr.impl.LexerOutput import java.util.regex.Pattern class QuotedIdentifierChannel(quotedIdentifierRegexp: String, simpleIdentifierRegexp: String) : Channel { private val quotedPattern = Pattern.compile(quotedIdentifierRegexp) private val quotedSimplePattern = Pattern.compile(""""$simpleIdentifierRegexp"""") override fun consume(code: CodeReader, output: LexerOutput): Boolean { val nextChar = code.peek().toChar() if (nextChar != '"') { return false } val tmpBuilder = StringBuilder() val matcher = quotedPattern.matcher("") if (code.popTo(matcher, tmpBuilder) > 0) { var word = tmpBuilder.toString() val wordOriginal = word if (quotedSimplePattern.matcher(word).matches() && word == word.uppercase()) { word = word.substring(1, word.length - 1) } val token = Token.builder() .setType(GenericTokenType.IDENTIFIER) .setValueAndOriginalValue(word, wordOriginal) .setLine(code.previousCursor.line) .setColumn(code.previousCursor.column) .build() output.addToken(token) return true } return false } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/lexer/StringChannel.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.lexer import com.felipebz.flr.channel.Channel import com.felipebz.flr.channel.CodeReader import com.felipebz.flr.impl.LexerOutput import com.felipebz.flr.impl.channel.RegexpChannel class StringChannel(private val regexpChannel: RegexpChannel) : Channel by regexpChannel { override fun consume(code: CodeReader, output: LexerOutput): Boolean { val nextChar = code.peek().toChar().lowercaseChar() if (nextChar != '\'' && nextChar != 'n' && nextChar != 'q') { return false } return regexpChannel.consume(code, output) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/metadata/FormsMetadata.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.metadata import com.fasterxml.jackson.databind.ObjectMapper import com.felipebz.zpa.utils.log.Loggers import java.io.File import java.io.FileNotFoundException import java.io.IOException class Block @JvmOverloads constructor(val name: String = "", val items: Array = emptyArray()) class FormsMetadata { var alerts = listOf() var blocks = listOf() var lovs = listOf() companion object { private val LOG = Loggers.getLogger(FormsMetadata::class.java) fun loadFromFile(path: String?): FormsMetadata? { if (!path.isNullOrEmpty()) { try { val mapper = ObjectMapper() val formsMetadata: FormsMetadata = mapper.readValue(File(path), FormsMetadata::class.java) LOG.info("Loaded Oracle Forms metadata from {}.", path) return formsMetadata } catch (e: FileNotFoundException) { LOG.warn("The metadata file {} was not found.", path, e) } catch (e: IOException) { LOG.error("Error reading the metadata file at {}.", path, e) } } return null } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/metrics/ComplexityVisitor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.metrics import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.checks.PlSqlCheck open class ComplexityVisitor : PlSqlCheck() { var complexity: Int = 0 private set override fun init() { subscribeTo( PlSqlGrammar.CREATE_PROCEDURE, PlSqlGrammar.CREATE_FUNCTION, PlSqlGrammar.ANONYMOUS_BLOCK, PlSqlGrammar.PROCEDURE_DECLARATION, PlSqlGrammar.FUNCTION_DECLARATION, PlSqlGrammar.LOOP_STATEMENT, PlSqlGrammar.CONTINUE_STATEMENT, PlSqlGrammar.FOR_STATEMENT, PlSqlGrammar.EXIT_STATEMENT, PlSqlGrammar.IF_STATEMENT, PlSqlGrammar.RAISE_STATEMENT, PlSqlGrammar.RETURN_STATEMENT, PlSqlGrammar.WHILE_STATEMENT, // this includes WHEN in exception handlers, exit/continue statements and CASE expressions PlSqlKeyword.WHEN, PlSqlKeyword.ELSIF) } override fun visitFile(node: AstNode) { complexity = 0 } override fun visitNode(node: AstNode) { complexity++ } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/metrics/FunctionComplexityVisitor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.metrics import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.checks.PlSqlCheck class FunctionComplexityVisitor : PlSqlCheck() { var numberOfFunctions: Int = 0 private set override fun init() { subscribeTo(PlSqlGrammar.CREATE_PROCEDURE, PlSqlGrammar.CREATE_FUNCTION, PlSqlGrammar.PROCEDURE_DECLARATION, PlSqlGrammar.FUNCTION_DECLARATION) } override fun visitNode(node: AstNode) { numberOfFunctions++ } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/metrics/MetricsVisitor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.metrics import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.Token import com.felipebz.flr.api.Trivia import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.checks.PlSqlCheck class MetricsVisitor : PlSqlCheck() { var numberOfStatements: Int = 0 private set private val linesOfCode = HashSet() private val linesOfComments = HashSet() private val noSonar = HashSet() private val executableLines = HashSet() val linesWithNoSonar: Set get() = noSonar override fun init() { subscribeTo(PlSqlGrammar.STATEMENT) } override fun visitNode(node: AstNode) { if (node.hasDirectChildren(PlSqlGrammar.BLOCK_STATEMENT)) return numberOfStatements++ executableLines.add(node.tokenLine) } override fun visitToken(token: Token) { for (line in token.line .. token.endLine) { linesOfCode.add(line) } } override fun visitComment(trivia: Trivia, content: String) { val comment = trivia.token.value val line = trivia.token.line val endLine = trivia.token.endLine val firstLineContainsNoSonar = comment.indexOfAny(newlineChars).let { if (it == -1) { comment.contains("NOSONAR") } else { comment.regionMatches(0, "NOSONAR", 0, it) } } for (i in line .. endLine) { linesOfComments.add(i) } if (firstLineContainsNoSonar) { linesOfComments.remove(line) noSonar.add(line) } } fun getLinesOfCode(): Set = linesOfCode fun getLinesOfComments(): Set = linesOfComments fun getExecutableLines(): Set = executableLines companion object { private val newlineChars = charArrayOf('\n', '\r') } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/parser/PlSqlParser.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.parser import com.felipebz.flr.api.Grammar import com.felipebz.flr.impl.Parser import com.felipebz.zpa.lexer.PlSqlLexer import com.felipebz.zpa.squid.PlSqlConfiguration import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.squid.SemanticAstNode object PlSqlParser { fun create(conf: PlSqlConfiguration): Parser = Parser.builder(PlSqlGrammar.create(conf).build()) .withLexer(PlSqlLexer.create(conf)) .withNonTerminalNodeBuilder(::SemanticAstNode) .withTerminalNodeBuilder(::SemanticAstNode) .build() } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ActiveRule.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules class ActiveRule( private val repository: ZpaRepository, private val rule: ZpaRule, private val configuration: ActiveRuleConfiguration? ) : ZpaActiveRule { override val internalKey: String get() = rule.key override val language: String get() = "plsqlopen" override fun param(key: String): String = configuration?.parameters?.get(key) ?: "" override val params: Map get() = configuration?.parameters ?: emptyMap() override val ruleKey: ZpaRuleKey get() = RuleKey(repository.key, rule.key) override val severity: String get() = configuration?.severity ?: rule.severity override val templateRuleKey: String? get() = null override val tags: Array get() = rule.tags override val remediationConstant: String get() = rule.remediationConstant override val name: String get() = rule.name } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ActiveRuleConfiguration.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules class ActiveRuleConfiguration( val repositoryKey: String, val key: String, var severity: String? = null, var parameters: MutableMap = mutableMapOf() ) { fun keyIs(repositoryKey: String, key: String): Boolean { return this.repositoryKey == repositoryKey && this.key == key } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ActiveRuleConfigurer.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules fun interface ActiveRuleConfigurer { fun apply(repo: Repository, rule: ZpaRule, configuration: ActiveRuleConfiguration): Boolean } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ActiveRules.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules class ActiveRules : ZpaActiveRules { private val repositories = mutableListOf() private val activeRuleConfigurers = mutableListOf() fun addRepository(repository: Repository): ActiveRules = apply { repositories.add(repository) } fun addRuleConfigurer(filter: ActiveRuleConfigurer): ActiveRules = apply { activeRuleConfigurers.add(filter) } override fun findByRepository(repository: String): Collection { val repo = this.repositories.first { it.key == repository } return repo.availableRules .mapNotNull { rule -> val activeRuleConfiguration = ActiveRuleConfiguration(repo.key, rule.key) if (activeRuleConfigurers.all { it.apply(repo, rule, activeRuleConfiguration) }) { ActiveRule(repo, rule, activeRuleConfiguration) } else { null } } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/Repository.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules class Repository(override val key: String) : ZpaRepository { private val rules = mutableMapOf() override fun createRule(ruleKey: String): ZpaRule { val rule = Rule(ruleKey) rules[ruleKey] = rule return rule } override fun rule(ruleKey: String): ZpaRule? = rules[ruleKey] val availableRules: List get() = rules.values.toList() override fun toString(): String = key } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/Rule.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import com.felipebz.zpa.api.annotations.RuleInfo class Rule(override val key: String) : ZpaRule { private val parameters = mutableListOf() override var htmlDescription: String = "" override var name: String = "" override val params: List = parameters override var remediationConstant: String = "" set(value) { if (!REMEDIATION_PATTERN.matches(value)) { throw IllegalArgumentException("Invalid base effort: $value") } field = value } override var scope: RuleInfo.Scope = RuleInfo.Scope.ALL override var severity: String = "" override var status: RuleStatus = RuleStatus.READY override var tags: Array = emptyArray() override var template: Boolean = false override var isActivatedByDefault = false override fun createParam(fieldKey: String): ZpaRuleParam { val param = RuleParam(fieldKey) parameters.add(param) return param } companion object { private const val DAY = "d" private const val HOUR = "h" private const val MINUTE = "min" private val REMEDIATION_PATTERN = Regex("\\s*+(?:(\\d++)\\s*+$DAY)?+\\s*+(?:(\\d++)\\s*+$HOUR)?+\\s*+(?:(\\d++)\\s*+$MINUTE)?+\\s*+") } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/RuleData.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import com.felipebz.zpa.api.annotations.Priority import com.felipebz.zpa.api.annotations.Rule class RuleData(val key: String, val name: String, val description: String, val priority: Priority, val tags: Array, val status: String) { companion object { fun from(rule: Rule?): RuleData? = if (rule == null) null else RuleData(rule.key, rule.name, rule.description, rule.priority, rule.tags, rule.status) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/RuleKey.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules class RuleKey(override val repository: String, private val key: String) : ZpaRuleKey { override val rule: String get() = key override fun toString(): String = "$repository:$key" override fun equals(other: Any?): Boolean { if (this === other) return true if (other?.javaClass != javaClass) return false other as RuleKey return this.key == other.key && this.repository == other.repository } override fun hashCode(): Int { var result = repository.hashCode() result = 31 * result + key.hashCode() return result } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/RuleMetadataLoader.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import com.felipebz.zpa.utils.getAnnotation import com.felipebz.zpa.api.annotations.Rule import com.felipebz.zpa.api.annotations.RuleProperty import java.lang.reflect.Field open class RuleMetadataLoader { open fun getRuleAnnotation(annotatedClassOrObject: Any) : RuleData? = RuleData.from(getAnnotation(annotatedClassOrObject, Rule::class.java)) open fun getRulePropertyAnnotation(field: Field) : RulePropertyData? = RulePropertyData.from(field.getAnnotation(RuleProperty::class.java)) } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/RuleParam.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules class RuleParam(override val key: String) : ZpaRuleParam { override var defaultValue: String = "" override var description: String = "" } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/RulePropertyData.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import com.felipebz.zpa.api.annotations.RuleProperty class RulePropertyData(val key: String, val description: String, val defaultValue: String, val type: String) { companion object { fun from(ruleProperty: RuleProperty?) = if (ruleProperty == null) null else RulePropertyData(ruleProperty.key, ruleProperty.description, ruleProperty.defaultValue, ruleProperty.type) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/RuleStatus.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules enum class RuleStatus { BETA, DEPRECATED, READY, REMOVED; companion object { fun defaultStatus(): RuleStatus { return READY } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/RulesDefinitionAnnotationLoader.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import com.felipebz.zpa.CustomAnnotationBasedRulesDefinition.Companion.convertCheckClassName import com.felipebz.zpa.utils.getFields import com.felipebz.zpa.utils.log.Loggers import java.lang.reflect.Field class RulesDefinitionAnnotationLoader(private val ruleMetadataLoader: RuleMetadataLoader) { fun load(repo: ZpaRepository, vararg annotatedClasses: Class<*>) { for (annotatedClass in annotatedClasses) { loadRule(repo, annotatedClass) } } private fun loadRule(repo: ZpaRepository, clazz: Class<*>): ZpaRule? { val ruleAnnotation = ruleMetadataLoader.getRuleAnnotation(clazz) return if (ruleAnnotation != null) { loadRule(repo, clazz, ruleAnnotation) } else { LOG.warn("The class " + clazz.canonicalName + " should be annotated with @Rule") null } } private fun loadRule(repo: ZpaRepository, clazz: Class<*>, ruleAnnotation: RuleData): ZpaRule { val ruleKey = ruleAnnotation.key.ifEmpty { convertCheckClassName(clazz) } val ruleName = ruleAnnotation.name val description = ruleAnnotation.description val rule = repo.createRule(ruleKey) rule.name = ruleName rule.htmlDescription = description rule.severity = ruleAnnotation.priority.name rule.status = RuleStatus.valueOf(ruleAnnotation.status) rule.tags = ruleAnnotation.tags val fields = getFields(clazz, true) for (field in fields) { loadParameters(rule, field) } return rule } private fun loadParameters(rule: ZpaRule, field: Field) { val propertyAnnotation = ruleMetadataLoader.getRulePropertyAnnotation(field) if (propertyAnnotation != null) { val fieldKey = propertyAnnotation.key.ifEmpty { field.name } val param = rule.createParam(fieldKey) param.description = propertyAnnotation.description param.defaultValue = propertyAnnotation.defaultValue } } companion object { private val LOG = Loggers.getLogger(RulesDefinitionAnnotationLoader::class.java) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ZpaActiveRule.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules interface ZpaActiveRule { val ruleKey: ZpaRuleKey val severity: String val language: String fun param(key: String): String? val params: Map val internalKey: String? val templateRuleKey: String? val tags: Array val remediationConstant: String val name: String } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ZpaActiveRules.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules interface ZpaActiveRules { fun findByRepository(repository: String): Collection } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ZpaChecks.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import com.felipebz.zpa.CustomAnnotationBasedRulesDefinition.Companion.getRuleKey import com.felipebz.zpa.utils.getFields import com.felipebz.zpa.api.checks.PlSqlVisitor import java.lang.reflect.Field import java.util.* open class ZpaChecks constructor(private val activeRules: ZpaActiveRules, private val repository: String, private val ruleMetadataLoader: RuleMetadataLoader) { private val checkByRule = HashMap() private val ruleByCheck = IdentityHashMap() fun of(ruleKey: ZpaRuleKey): PlSqlVisitor? { return checkByRule[ruleKey] } fun all(): Collection { return checkByRule.values } fun ruleKey(check: PlSqlVisitor): ZpaRuleKey? { return ruleByCheck[check] } private fun add(ruleKey: ZpaRuleKey, obj: PlSqlVisitor) { checkByRule[ruleKey] = obj ruleByCheck[obj] = ruleKey } fun addAnnotatedChecks(checkClassesOrObjects: Iterable>): ZpaChecks { val checksByEngineKey = HashMap>() for (checkClassesOrObject in checkClassesOrObjects) { val engineKey = getRuleKey(ruleMetadataLoader, checkClassesOrObject) checksByEngineKey[engineKey] = checkClassesOrObject } for (activeRule in activeRules.findByRepository(repository)) { val engineKey = if (activeRule.templateRuleKey.isNullOrBlank()) activeRule.ruleKey.rule else activeRule.templateRuleKey val checkClassesOrObject = checksByEngineKey[engineKey] if (checkClassesOrObject != null) { val obj = instantiate(activeRule, checkClassesOrObject) obj.activeRule = activeRule add(activeRule.ruleKey, obj) } } return this } private fun instantiate(activeRule: ZpaActiveRule, checkClassOrInstance: Any): PlSqlVisitor { try { var check = checkClassOrInstance if (check is Class<*>) { check = (checkClassOrInstance as Class<*>).getDeclaredConstructor().newInstance() } configureFields(activeRule, check) return check as PlSqlVisitor } catch (e: InstantiationException) { throw failToInstantiateCheck(activeRule, checkClassOrInstance, e) } catch (e: IllegalAccessException) { throw failToInstantiateCheck(activeRule, checkClassOrInstance, e) } } private fun failToInstantiateCheck(activeRule: ZpaActiveRule, checkClassOrInstance: Any, e: Exception): RuntimeException { throw IllegalStateException(String.format("Fail to instantiate class %s for rules %s", checkClassOrInstance, activeRule.ruleKey), e) } private fun configureFields(activeRule: ZpaActiveRule, check: Any) { for ((key, value) in activeRule.params) { val field = getField(check, key) ?: throw IllegalStateException( String.format("The field '%s' does not exist or is not annotated with @RuleProperty in the class %s", key, check.javaClass.name)) if (value.isNotBlank()) { configureField(check, field, value) } } } private fun getField(check: Any, key: String): Field? { val fields = getFields(check.javaClass, true) for (field in fields) { val propertyAnnotation = ruleMetadataLoader.getRulePropertyAnnotation(field) if (propertyAnnotation != null && ((key == field.name) || (key == propertyAnnotation.key))) { return field } } return null } private fun configureField(check: Any, field: Field, value: String) { try { field.isAccessible = true when(field.type) { String::class.java -> field.set(check, value) Int::class.javaPrimitiveType -> field.setInt(check, Integer.parseInt(value)) Short::class.javaPrimitiveType -> field.setShort(check, java.lang.Short.parseShort(value)) Long::class.javaPrimitiveType -> field.setLong(check, java.lang.Long.parseLong(value)) Double::class.javaPrimitiveType -> field.setDouble(check, java.lang.Double.parseDouble(value)) Boolean::class.javaPrimitiveType -> field.setBoolean(check, java.lang.Boolean.parseBoolean(value)) Byte::class.javaPrimitiveType -> field.setByte(check, java.lang.Byte.parseByte(value)) Int::class.java -> field.set(check, Integer.parseInt(value)) Long::class.java -> field.set(check, java.lang.Long.parseLong(value)) Double::class.java -> field.set(check, java.lang.Double.parseDouble(value)) Boolean::class.java -> field.set(check, java.lang.Boolean.parseBoolean(value)) else -> throw IllegalStateException("The type of the field " + field + " is not supported: " + field.type) } } catch (e: IllegalAccessException) { throw IllegalStateException("Can not set the value of the field " + field + " in the class: " + check.javaClass.name, e) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ZpaRepository.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules interface ZpaRepository { val key: String fun createRule(ruleKey: String): ZpaRule fun rule(ruleKey: String): ZpaRule? } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ZpaRule.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules import com.felipebz.zpa.api.annotations.RuleInfo interface ZpaRule { val key: String val params: List var name: String var remediationConstant: String var scope: RuleInfo.Scope var template: Boolean var tags: Array var status: RuleStatus var severity: String var htmlDescription: String var isActivatedByDefault: Boolean fun createParam(fieldKey: String): ZpaRuleParam } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ZpaRuleKey.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules interface ZpaRuleKey { val rule: String val repository: String } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/rules/ZpaRuleParam.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.rules interface ZpaRuleParam { val key: String var description: String var defaultValue: String } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/squid/AnalysisException.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.squid class AnalysisException(string: String, e: Throwable) : RuntimeException(string, e) ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/squid/AstScanner.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.squid import com.felipebz.flr.api.Grammar import com.felipebz.flr.api.RecognitionException import com.felipebz.flr.impl.Parser import com.felipebz.zpa.FormsMetadataAwareCheck import com.felipebz.zpa.metadata.FormsMetadata import com.felipebz.zpa.metrics.ComplexityVisitor import com.felipebz.zpa.metrics.FunctionComplexityVisitor import com.felipebz.zpa.metrics.MetricsVisitor import com.felipebz.zpa.parser.PlSqlParser import com.felipebz.zpa.symbols.DefaultTypeSolver import com.felipebz.zpa.symbols.ScopeImpl import com.felipebz.zpa.symbols.SymbolVisitor import com.felipebz.zpa.utils.getAnnotation import com.felipebz.zpa.utils.log.Loggers import com.felipebz.zpa.api.PlSqlFile import com.felipebz.zpa.api.PlSqlVisitorContext import com.felipebz.zpa.api.annotations.RuleInfo import com.felipebz.zpa.api.checks.PlSqlCheck import com.felipebz.zpa.api.checks.PlSqlVisitor import java.io.InterruptedIOException import java.nio.charset.Charset import java.nio.charset.StandardCharsets import java.util.concurrent.locks.ReentrantLock import kotlin.concurrent.withLock class AstScanner(private val checks: Collection, private val formsMetadata: FormsMetadata?, isErrorRecoveryEnabled: Boolean, charset: Charset = StandardCharsets.UTF_8) { private val parser: Parser = PlSqlParser.create(PlSqlConfiguration(charset, isErrorRecoveryEnabled)) val globalScope = ScopeImpl() fun scanFile(inputFile: PlSqlFile, extraVisitors: List = emptyList()) : AstScannerResult { val newVisitorContext = getPlSqlVisitorContext(inputFile) val metricsVisitor = MetricsVisitor() val complexityVisitor = ComplexityVisitor() val functionComplexityVisitor = FunctionComplexityVisitor() val symbolVisitor = SymbolVisitor(DefaultTypeSolver(), globalScope) val checksToRun = mutableListOf() checksToRun.add(symbolVisitor) if (inputFile.type() == PlSqlFile.Type.MAIN) { checksToRun.addAll( checks.filter { check -> formsMetadata != null || check !is FormsMetadataAwareCheck } .filterIsInstance() .filter { check -> ruleHasScope(check, RuleInfo.Scope.MAIN) } .toList()) } else { checksToRun.addAll( checks.filterIsInstance() .filter { check -> ruleHasScope(check, RuleInfo.Scope.TEST) } .toList()) } checksToRun.add(metricsVisitor) checksToRun.add(complexityVisitor) checksToRun.add(functionComplexityVisitor) checksToRun.addAll(extraVisitors) val issues = lock.withLock { val newWalker = PlSqlAstWalker(checksToRun) newWalker.walk(newVisitorContext) checksToRun.flatMap { (it as PlSqlCheck).issues().map { issue -> ZpaIssue(inputFile, it, issue) } } } return AstScannerResult( executedChecks = checksToRun, linesWithNoSonar = metricsVisitor.linesWithNoSonar, symbols = symbolVisitor.symbols, numberOfStatements = metricsVisitor.numberOfStatements, linesOfCode = metricsVisitor.getLinesOfCode().size, linesOfComments = metricsVisitor.getLinesOfComments().size, complexity = complexityVisitor.complexity, numberOfFunctions = functionComplexityVisitor.numberOfFunctions, executableLines = metricsVisitor.getExecutableLines(), issues = issues ) } private fun ruleHasScope(check: PlSqlVisitor, scope: RuleInfo.Scope): Boolean { val ruleInfo = getAnnotation(check, RuleInfo::class.java) if (ruleInfo != null) { return ruleInfo.scope === RuleInfo.Scope.ALL || ruleInfo.scope === scope } return scope === RuleInfo.Scope.MAIN } private fun getPlSqlVisitorContext(inputFile: PlSqlFile): PlSqlVisitorContext { var visitorContext: PlSqlVisitorContext try { val root = parser.parse(inputFile.contents()) visitorContext = PlSqlVisitorContext(root, inputFile, formsMetadata) } catch (e: RecognitionException) { visitorContext = PlSqlVisitorContext(inputFile, e, formsMetadata) LOG.error("Unable to parse file: $inputFile\n${e.message}") } catch (e: Exception) { checkInterrupted(e) throw AnalysisException("Unable to analyze file: $inputFile", e) } catch (e: Throwable) { throw AnalysisException("Unable to analyze file: $inputFile", e) } return visitorContext } private fun checkInterrupted(e: Exception) { val cause = getRootCause(e) if (cause is InterruptedException || cause is InterruptedIOException) { throw AnalysisException("Analysis cancelled", e) } } private fun getRootCause(exception: Throwable?): Throwable? { var rootException = exception while (rootException?.cause != null) { rootException = rootException.cause } return rootException } companion object { private val LOG = Loggers.getLogger(AstScanner::class.java) private val lock = ReentrantLock() } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/squid/AstScannerResult.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.squid import com.felipebz.zpa.api.PlSqlFile import com.felipebz.zpa.api.checks.PlSqlCheck import com.felipebz.zpa.api.checks.PlSqlVisitor import com.felipebz.zpa.api.symbols.Symbol data class AstScannerResult internal constructor( val executedChecks: List, val linesWithNoSonar: Set, val symbols: List, val numberOfStatements: Int, val linesOfCode: Int, val linesOfComments: Int, val complexity: Int, val numberOfFunctions: Int, val executableLines: Set, val issues: List ) data class ZpaIssue internal constructor( val file: PlSqlFile, val check: PlSqlCheck, private val issue: PlSqlCheck.PreciseIssue ) { val cost = issue.cost() val primaryLocation = issue.primaryLocation() val secondaryLocations = issue.secondaryLocations() } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/squid/PlSqlAstWalker.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.squid import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.AstNodeType import com.felipebz.flr.api.Token import com.felipebz.zpa.api.PlSqlVisitorContext import com.felipebz.zpa.api.checks.PlSqlVisitor import com.felipebz.zpa.api.squid.PlSqlCommentAnalyzer import java.util.* class PlSqlAstWalker(private val checks: Collection) { private val visitorsByNodeType = IdentityHashMap>() private var lastVisitedToken: Token? = null fun walk(context: PlSqlVisitorContext) { for (check in checks) { check.context = context check.startScan() check.init() for (type in check.subscribedKinds()) { visitorsByNodeType.getOrPut(type) { mutableListOf() }.add(check) } } val tree = context.rootTree() if (tree != null) { try { for (check in checks) { check.visitFile(tree) } visit(tree) for (check in checks) { check.leaveFile(tree) } } catch (e: Exception) { val plsqlFile = context.plSqlFile() if (plsqlFile != null) { throw AnalysisException("Error executing checks on file ${plsqlFile.fileName()}: ${e.message}", e) } else { throw AnalysisException("Error executing checks: ${e.message}", e) } } } } private fun visit(ast: AstNode) { val nodeVisitors = getNodeVisitors(ast) visitNode(ast, nodeVisitors) visitToken(ast) visitChildren(ast) leaveNode(ast, nodeVisitors) } private fun leaveNode(ast: AstNode, nodeVisitors: List) { for (i in nodeVisitors.indices.reversed()) { nodeVisitors[i].leaveNode(ast) } } private fun visitChildren(ast: AstNode) { for (child in ast.children) { visit(child) } } private fun visitToken(ast: AstNode) { if (ast.hasToken() && lastVisitedToken !== ast.token) { lastVisitedToken = ast.token for (astAndTokenVisitor in checks) { astAndTokenVisitor.visitToken(ast.token) for (trivia in ast.token.trivia) { astAndTokenVisitor.visitComment(trivia, PlSqlCommentAnalyzer.getContents(trivia.token.originalValue)) } } } } private fun visitNode(ast: AstNode, nodeVisitors: List) { for (nodeVisitor in nodeVisitors) { nodeVisitor.visitNode(ast) } } private fun getNodeVisitors(ast: AstNode) = visitorsByNodeType[ast.type] ?: emptyList() } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/squid/PlSqlConfiguration.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.squid import java.nio.charset.Charset class PlSqlConfiguration @JvmOverloads constructor(val charset: Charset, val isErrorRecoveryEnabled: Boolean = false) ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/squid/ProgressReport.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.squid import com.felipebz.zpa.utils.log.Logger import com.felipebz.zpa.utils.log.Loggers import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.locks.Condition import java.util.concurrent.locks.ReentrantLock import kotlin.concurrent.withLock class ProgressReport @JvmOverloads constructor(threadName: String, private val period: Long, private val logger: Logger = Loggers.getLogger(ProgressReport::class.java)) : Runnable { internal val lock = ReentrantLock() internal val condition: Condition = lock.newCondition() private var count: Int = 0 private var currentFileNumber = -1 private var currentFile: String? = null private lateinit var iterator: Iterator private val thread: Thread = Thread(this, threadName).apply { isDaemon = true } private var success = false private val interrupted = AtomicBoolean().apply { set(false) } override fun run() { while (!(interrupted.get() || Thread.currentThread().isInterrupted)) { try { Thread.sleep(period) lock.withLock { log("$currentFileNumber/$count files analyzed, current file: $currentFile") } } catch (e: InterruptedException) { interrupted.set(true) thread.interrupt() break } } lock.withLock { if (success) { log("$count/$count source files have been analyzed") } } } @Synchronized fun start(files: Collection) { count = files.size iterator = files.iterator() nextFile() log("$count source files to be analyzed") thread.start() } @Synchronized fun nextFile() { if (iterator.hasNext()) { currentFileNumber++ currentFile = iterator.next() } } @Synchronized fun stop() { interrupted.set(true) success = true thread.interrupt() join() } @Synchronized fun cancel() { interrupted.set(true) thread.interrupt() join() } fun join() { try { thread.join() } catch (e: InterruptedException) { Thread.currentThread().interrupt(); } } private fun log(message: String) { lock.withLock { logger.info(message) condition.signalAll() } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/ElseClause.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.zpa.api.squid.SemanticAstNode class ElseClause(override val astNode: SemanticAstNode) : TreeWithStatements(astNode) ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/ElsifClause.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.zpa.asSemantic import com.felipebz.zpa.api.squid.SemanticAstNode class ElsifClause(override val astNode: SemanticAstNode) : TreeWithStatements(astNode) { val condition : SemanticAstNode by lazy { astNode.children[1].asSemantic() } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/IfStatement.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.zpa.asSemantic import com.felipebz.zpa.asTree import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.squid.SemanticAstNode class IfStatement(override val astNode: SemanticAstNode) : TreeWithStatements(astNode) { val condition : SemanticAstNode by lazy { astNode.children[1].asSemantic() } val elsifClauses : List by lazy { astNode.getChildren(PlSqlGrammar.ELSIF_CLAUSE).asTree() } val elseClause : ElseClause? by lazy { astNode.getFirstChildOrNull(PlSqlGrammar.ELSE_CLAUSE)?.asTree() } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/NullStatement.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.zpa.api.squid.SemanticAstNode class NullStatement(astNode: SemanticAstNode) : TreeImpl(astNode) ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/PlSqlGrammarBuilder.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.flr.api.AstNodeType import com.felipebz.flr.api.Grammar import com.felipebz.flr.api.TokenType import com.felipebz.flr.grammar.GrammarRuleBuilder import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.flr.grammar.LexerfulGrammarBuilder import kotlin.reflect.KClass class PlSqlGrammarBuilder(private val builder: LexerfulGrammarBuilder) { fun build(): Grammar = builder.build() fun rule(ruleKey: GrammarRuleKey): GrammarRuleBuilder = rule(ruleKey, TreeImpl::class) fun rule(ruleKey: GrammarRuleKey, clazz: KClass): GrammarRuleBuilder { typedClasses[ruleKey] = clazz.java return builder.rule(ruleKey) } fun setRootRule(ruleKey: GrammarRuleKey) { builder.setRootRule(ruleKey) } fun sequence(e1: Any, e2: Any): Any = builder.sequence(e1, e2) fun sequence(e1: Any, e2: Any, vararg rest: Any): Any = builder.sequence(e1, e2, *rest) fun firstOf(e1: Any, e2: Any): Any = builder.firstOf(e1, e2) fun firstOf(e1: Any, e2: Any, vararg rest: Any): Any = builder.firstOf(e1, e2, *rest) fun optional(e: Any): Any = builder.optional(e) fun optional(e1: Any, vararg rest: Any): Any = builder.optional(e1, *rest) fun oneOrMore(e: Any): Any = builder.oneOrMore(e) fun oneOrMore(e1: Any, vararg rest: Any): Any = builder.oneOrMore(e1, *rest) fun zeroOrMore(e: Any): Any = builder.zeroOrMore(e) fun zeroOrMore(e1: Any, vararg rest: Any): Any = builder.zeroOrMore(e1, *rest) fun next(e: Any): Any = builder.next(e) fun next(e1: Any, vararg rest: Any): Any = builder.next(e1, *rest) fun nextNot(e: Any): Any = builder.nextNot(e) fun nextNot(e1: Any, vararg rest: Any): Any = builder.nextNot(e1, *rest) fun nothing(): Any = builder.nothing() fun buildWithMemoizationOfMatchesForAllRules(): Grammar = builder.buildWithMemoizationOfMatchesForAllRules() fun adjacent(e: Any): Any = builder.adjacent(e) fun anyTokenButNot(e: Any): Any = builder.anyTokenButNot(e) fun isOneOfThem(t1: TokenType, vararg rest: TokenType): Any = builder.isOneOfThem(t1, *rest) fun bridge(from: TokenType, to: TokenType): Any = builder.bridge(from, to) fun anyToken(): Any = builder.anyToken() fun tillNewLine(): Any = builder.tillNewLine() fun till(e: Any): Any = builder.till(e) fun exclusiveTill(e: Any): Any = builder.exclusiveTill(e) fun exclusiveTill(e1: Any, vararg rest: Any): Any = builder.exclusiveTill(e1, *rest) companion object { private val typedClasses = mutableMapOf>() fun classForType(key: AstNodeType): Class = typedClasses.getOrDefault(key, TreeImpl::class.java) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/RaiseStatement.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.zpa.asSemantic import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.squid.SemanticAstNode class RaiseStatement(override val astNode: SemanticAstNode) : TreeImpl(astNode) { val exception : SemanticAstNode? by lazy { astNode.getFirstChildOrNull(PlSqlKeyword.RAISE)?.nextSibling?.asSemantic() } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/Statements.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.zpa.asSemantic import com.felipebz.zpa.api.squid.SemanticAstNode class Statements(override val astNode: SemanticAstNode) : TreeImpl(astNode), List { private val children by lazy { astNode.children.asSemantic() } override val size: Int = children.size override fun contains(element: SemanticAstNode): Boolean = children.contains(element) override fun containsAll(elements: Collection): Boolean = children.containsAll(elements) override fun get(index: Int): SemanticAstNode = children[index] override fun indexOf(element: SemanticAstNode): Int = children.indexOf(element) override fun isEmpty(): Boolean = children.isEmpty() override fun iterator(): Iterator = children.iterator() override fun lastIndexOf(element: SemanticAstNode): Int = children.lastIndexOf(element) override fun listIterator(): ListIterator = children.listIterator() override fun listIterator(index: Int): ListIterator = children.listIterator(index) override fun subList(fromIndex: Int, toIndex: Int): List = children.subList(fromIndex, toIndex) } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/Tree.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.zpa.api.squid.SemanticAstNode interface Tree { val astNode: SemanticAstNode val parent: Tree? } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/TreeImpl.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.zpa.asSemantic import com.felipebz.zpa.api.squid.SemanticAstNode open class TreeImpl(override val astNode: SemanticAstNode) : Tree { override val parent: Tree? by lazy { astNode.parent.asSemantic().tree } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/sslr/TreeWithStatements.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.sslr import com.felipebz.zpa.asTree import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.squid.SemanticAstNode open class TreeWithStatements(override val astNode: SemanticAstNode) : TreeImpl(astNode) { val statements : Statements by lazy { astNode.getFirstChild(PlSqlGrammar.STATEMENTS).asTree() } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/symbols/DefaultTypeSolver.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.symbols import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.PlSqlTokenType import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.Symbol import com.felipebz.zpa.api.symbols.datatype.* open class DefaultTypeSolver { fun solve(node: AstNode, scope: Scope?): PlSqlDatatype { if (node.type === PlSqlGrammar.DATATYPE) { return solveDatatype(node, scope) } else if (node.type === PlSqlGrammar.LITERAL) { return solveLiteral(node) } return UnknownDatatype } open fun solveDatatype(node: AstNode, scope: Scope?): PlSqlDatatype { var type: PlSqlDatatype = UnknownDatatype if (node.hasDirectChildren(PlSqlGrammar.CHARACTER_DATAYPE)) { type = CharacterDatatype(node) } else if (node.hasDirectChildren(PlSqlGrammar.NUMERIC_DATATYPE)) { type = NumericDatatype(node) } else if (node.hasDirectChildren(PlSqlGrammar.DATE_DATATYPE)) { type = DateDatatype() } else if (node.hasDirectChildren(PlSqlGrammar.LOB_DATATYPE)) { type = LobDatatype() } else if (node.hasDirectChildren(PlSqlGrammar.BOOLEAN_DATATYPE)) { type = BooleanDatatype() } else if (node.hasDirectChildren(PlSqlGrammar.ANCHORED_DATATYPE)) { val anchoredDatatype = node.firstChild if (anchoredDatatype.lastChild.type === PlSqlKeyword.ROWTYPE) { type = RowtypeDatatype() } } else if (node.hasDirectChildren(PlSqlGrammar.JSON_DATATYPE)) { type = JsonDatatype() } else { val datatype = node.firstChild type = scope?.getSymbol(datatype.tokenValue, Symbol.Kind.TYPE)?.datatype ?: UnknownDatatype } return type } open fun solveLiteral(node: AstNode): PlSqlDatatype { var type: PlSqlDatatype = UnknownDatatype if (node.hasDirectChildren(PlSqlGrammar.NULL_LITERAL) || isEmptyString(node)) { type = NullDatatype() } else if (node.hasDirectChildren(PlSqlGrammar.CHARACTER_LITERAL)) { type = CharacterDatatype(node) } else if (node.hasDirectChildren(PlSqlGrammar.NUMERIC_LITERAL)) { type = NumericDatatype(node) } else if (node.hasDirectChildren(PlSqlTokenType.DATE_LITERAL)) { type = DateDatatype() } else if (node.hasDirectChildren(PlSqlGrammar.BOOLEAN_LITERAL)) { type = BooleanDatatype() } return type } private fun isEmptyString(node: AstNode): Boolean { val characterLiteral = node.getFirstChildOrNull(PlSqlGrammar.CHARACTER_LITERAL) ?: return false val value = characterLiteral.tokenValue if (value == "''") { return true } if (value.startsWith('n', ignoreCase = true) || value.startsWith('q', ignoreCase = true)) { val actualStart = value.indexOf('\'') + 2 val actualEnd = value.lastIndexOf('\'') - 1 return actualStart == actualEnd } return false } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/symbols/ScopeImpl.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.symbols import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.AstNodeType import com.felipebz.flr.api.Token import com.felipebz.zpa.api.PlSqlFile import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.Symbol import java.util.* import java.util.concurrent.locks.ReentrantLock import kotlin.concurrent.withLock class ScopeImpl(override val outer: Scope? = null, node: AstNode? = null, override val firstToken: Token? = null, override val lastToken: Token? = null, override val isAutonomousTransaction: Boolean = false, override val hasExceptionHandler: Boolean = false, override val isOverridingMember: Boolean = false, identifier: String? = null, type: AstNodeType? = null, private val globalScope: Scope? = null, override val plSqlFile: PlSqlFile? = null) : Scope { private val mutex = ReentrantLock() init { outer?.addInnerScope(this) } override val tree: AstNode? = node override val type: AstNodeType? = type ?: tree?.type override val symbols = mutableListOf() override val identifier: String? = try { identifier ?: node?.getFirstChildOrNull(PlSqlGrammar.IDENTIFIER_NAME, PlSqlGrammar.UNIT_NAME)?.tokenValue } catch (e: Exception) { "" } override val path: List by lazy { val path = ArrayList() var scope: Scope? = this while (scope != null) { val scopeIdentifier = scope.identifier if (scopeIdentifier != null) { path.add(scopeIdentifier) } scope = scope.outer } path } override val innerScopes = mutableListOf() override val isGlobal: Boolean = globalScope != null || (outer as? ScopeImpl)?.globalScope != null || (outer?.type in arrayOf(PlSqlGrammar.CREATE_PACKAGE, PlSqlGrammar.CREATE_TYPE) && outer?.isGlobal == true) /** * @param kind of the symbols to look for * @return the symbols corresponding to the given kind */ override fun getSymbols(kind: Symbol.Kind) = symbols.filter { it.`is`(kind) }.toList() override fun getSymbolsAcessibleInScope(name: String, vararg kinds: Symbol.Kind): Deque { val result = ArrayDeque() var scope: Scope? = this while (scope != null) { scope.symbols.filterTo(result) { it.called(name) && (kinds.isEmpty() || kinds.contains(it.kind)) } scope = scope.outer } return result } override fun addSymbol(symbol: Symbol) { symbols.add(symbol) } override fun addInnerScope(scope: Scope) { mutex.withLock { innerScopes.add(scope) } } override fun getSymbol(name: String, vararg kinds: Symbol.Kind): Symbol? { return getSymbol(name, emptyList(), *kinds) } override fun getSymbol(name: String, path: List, vararg kinds: Symbol.Kind): Symbol? { var scope: Scope? = this while (scope != null) { for (s in scope.symbols) { if (s.called(name) && (path.isEmpty() || pathContainedIn(path, scope)) && (kinds.isEmpty() || kinds.contains(s.kind))) { return s } } scope = scope.outer } return null } // check if path is a prefix of this scope's path private fun pathContainedIn(path: List, scope: Scope): Boolean { if (path.size > scope.path.size) { return false } for (i in path.indices) { if (!path[i].equals(scope.path[i], ignoreCase = true)) { return false } } return true } override fun toString() = "Scope name=${identifier ?: ""} type=$type path=$path" } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/symbols/SymbolTableImpl.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.symbols import com.felipebz.flr.api.AstNode import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.Symbol import com.felipebz.zpa.api.symbols.SymbolTable import com.felipebz.zpa.api.symbols.datatype.PlSqlDatatype class SymbolTableImpl : SymbolTable { override val symbols = ArrayList() override val scopes = LinkedHashSet() fun addScope(scope: Scope) { scopes.add(scope) } override fun getScopeFor(symbol: AstNode): Scope? { for (scope in scopes) { if (scope.tree == symbol) { return scope } } return null } fun declareSymbol(name: AstNode, kind: Symbol.Kind, scope: Scope, plSqlDatatype: PlSqlDatatype): Symbol { val symbol = Symbol(name, kind, scope, plSqlDatatype) symbols.add(symbol) scope.addSymbol(symbol) return symbol } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/symbols/SymbolVisitor.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.symbols import com.felipebz.flr.api.AstNode import com.felipebz.flr.api.AstNodeType import com.felipebz.zpa.typeIs import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.PlSqlKeyword import com.felipebz.zpa.api.checks.PlSqlCheck import com.felipebz.zpa.api.squid.SemanticAstNode import com.felipebz.zpa.api.symbols.Scope import com.felipebz.zpa.api.symbols.Symbol import com.felipebz.zpa.api.symbols.datatype.* class SymbolVisitor(private val typeSolver: DefaultTypeSolver, private val globalScope: Scope? = null) : PlSqlCheck() { private val scopeHolders = arrayOf( PlSqlGrammar.CREATE_PROCEDURE, PlSqlGrammar.PROCEDURE_DECLARATION, PlSqlGrammar.CREATE_FUNCTION, PlSqlGrammar.FUNCTION_DECLARATION, PlSqlGrammar.CREATE_PACKAGE, PlSqlGrammar.CREATE_PACKAGE_BODY, PlSqlGrammar.SIMPLE_DML_TRIGGER, PlSqlGrammar.INSTEAD_OF_DML_TRIGGER, PlSqlGrammar.COMPOUND_DML_TRIGGER, PlSqlGrammar.SYSTEM_TRIGGER, PlSqlGrammar.TYPE_CONSTRUCTOR, PlSqlGrammar.CREATE_TYPE, PlSqlGrammar.CREATE_TYPE_BODY, PlSqlGrammar.BLOCK_STATEMENT, PlSqlGrammar.FOR_STATEMENT, PlSqlGrammar.CURSOR_DECLARATION, PlSqlGrammar.FORALL_STATEMENT, DmlGrammar.SELECT_EXPRESSION) val symbolTable = SymbolTableImpl() private lateinit var fileScope: Scope private var currentScope: Scope? = null val symbols: List = symbolTable.symbols override fun init() { subscribeTo(*scopeHolders) fileScope = ScopeImpl(globalScope = globalScope) symbolTable.addScope(fileScope) currentScope = fileScope } override fun visitFile(node: AstNode) { visit(node) context.symbolTable = symbolTable if (globalScope != null) { for (innerScope in fileScope.innerScopes) { declareGlobalSymbols(innerScope, globalScope) } } } private fun declareGlobalSymbols(current: Scope, outer: Scope) { val scope = ScopeImpl( outer = outer, firstToken = current.firstToken, lastToken = current.lastToken, isAutonomousTransaction = current.isAutonomousTransaction, hasExceptionHandler = current.hasExceptionHandler, isOverridingMember = current.isOverridingMember, identifier = current.identifier, type = current.type, plSqlFile = context.plSqlFile() ) for (symbol in current.symbols.filter { it.isGlobal }) { val newSymbol = Symbol(null, symbol.kind, scope, symbol.datatype, symbol.name) scope.addSymbol(newSymbol) } for (innerScope in current.innerScopes.filter { it.isGlobal }) { declareGlobalSymbols(innerScope, scope) } } override fun visitNode(node: AstNode) { if (node.typeIs(scopeHolders)) { context.currentScope = symbolTable.getScopeFor(node) } } override fun leaveNode(node: AstNode) { if (node.typeIs(scopeHolders)) { context.currentScope = context.currentScope?.outer } } override fun leaveFile(node: AstNode) { currentScope = null } private fun visit(ast: AstNode) { visitNodeInternal(ast) visitChildren(ast) if (ast.typeIs(scopeHolders)) { leaveScope() } } private fun visitChildren(ast: AstNode) { for (child in ast.children) { visit(child) } } private fun visitNodeInternal(node: AstNode) { if (node.type === PlSqlGrammar.VARIABLE_DECLARATION) { visitVariableDeclaration(node) } else if (node.type === PlSqlGrammar.EXCEPTION_DECLARATION) { visitExceptionDeclaration(node) } else if (node.type === PlSqlGrammar.CUSTOM_SUBTYPE) { visitCustomSubtypeDeclaration(node) } else if (node.type === PlSqlGrammar.TABLE_OF_DECLARATION) { visitAssociativeArrayDeclaration(node) } else if (node.type === PlSqlGrammar.VARRAY_DECLARATION) { visitVarrayDeclaration(node) } else if (node.type === PlSqlGrammar.RECORD_DECLARATION) { visitRecordDeclaration(node) } else if (node.type === PlSqlGrammar.VARIABLE_NAME) { visitVariableName(node) } else if (node.type === PlSqlGrammar.MEMBER_EXPRESSION) { visitMemberExpression(node) } else if (node.type === PlSqlGrammar.CURSOR_DECLARATION) { visitCursor(node) } else if (node.type === PlSqlGrammar.BLOCK_STATEMENT) { visitBlock(node) } else if (node.type === PlSqlGrammar.FOR_STATEMENT) { visitFor(node) } else if (node.type === PlSqlGrammar.FORALL_STATEMENT) { visitForAll(node) } else if (node.type === PlSqlGrammar.PARAMETER_DECLARATION || node.type === PlSqlGrammar.CURSOR_PARAMETER_DECLARATION) { visitParameterDeclaration(node) } else if (node.type === PlSqlGrammar.CREATE_PROCEDURE || node.type === PlSqlGrammar.PROCEDURE_DECLARATION || node.type === PlSqlGrammar.CREATE_FUNCTION || node.type === PlSqlGrammar.FUNCTION_DECLARATION || node.type === PlSqlGrammar.SIMPLE_DML_TRIGGER || node.type === PlSqlGrammar.INSTEAD_OF_DML_TRIGGER || node.type === PlSqlGrammar.COMPOUND_DML_TRIGGER || node.type === PlSqlGrammar.SYSTEM_TRIGGER || node.type === PlSqlGrammar.CREATE_TYPE || node.type === PlSqlGrammar.CREATE_TYPE_BODY || node.type === PlSqlGrammar.TYPE_CONSTRUCTOR) { visitUnit(node) } else if (node.type === PlSqlGrammar.CREATE_PACKAGE || node.type === PlSqlGrammar.CREATE_PACKAGE_BODY) { visitPackage(node) } else if (node.type === PlSqlGrammar.LITERAL) { visitLiteral(node) } else if (node.type === DmlGrammar.SELECT_EXPRESSION) { visitSelectExpression(node) } } private fun visitUnit(node: AstNode) { val autonomousTransaction = node .getFirstChildOrNull(PlSqlGrammar.DECLARE_SECTION) ?.getChildren(PlSqlGrammar.PRAGMA_DECLARATION) ?.any { it.hasDirectChildren(PlSqlGrammar.AUTONOMOUS_TRANSACTION_PRAGMA) } val exceptionHandler = node .getFirstChildOrNull(PlSqlGrammar.STATEMENTS_SECTION) ?.hasDirectChildren(PlSqlGrammar.EXCEPTION_HANDLERS) val inheritanceClause = node.parent.getFirstChildOrNull(PlSqlGrammar.INHERITANCE_CLAUSE) val isOverridingMember = inheritanceClause != null && inheritanceClause.firstChild.type !== PlSqlKeyword.NOT && inheritanceClause.hasDirectChildren(PlSqlKeyword.OVERRIDING) val nodeType: AstNodeType val identifier = if (node.parent.type == PlSqlGrammar.CREATE_TRIGGER) { nodeType = PlSqlGrammar.CREATE_TRIGGER node.parent.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME, PlSqlGrammar.UNIT_NAME) } else { nodeType = node.type node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME, PlSqlGrammar.UNIT_NAME) } val datatype = node.getFirstChildOrNull(PlSqlKeyword.RETURN)?.nextSibling val type = if (datatype != null) solveType(datatype) else UnknownDatatype val symbolKind = when(node.type) { PlSqlGrammar.CREATE_PROCEDURE -> Symbol.Kind.PROCEDURE PlSqlGrammar.PROCEDURE_DECLARATION -> Symbol.Kind.PROCEDURE PlSqlGrammar.CREATE_FUNCTION -> Symbol.Kind.FUNCTION PlSqlGrammar.FUNCTION_DECLARATION -> Symbol.Kind.FUNCTION PlSqlGrammar.SIMPLE_DML_TRIGGER -> Symbol.Kind.TRIGGER PlSqlGrammar.INSTEAD_OF_DML_TRIGGER -> Symbol.Kind.TRIGGER PlSqlGrammar.COMPOUND_DML_TRIGGER -> Symbol.Kind.TRIGGER PlSqlGrammar.SYSTEM_TRIGGER -> Symbol.Kind.TRIGGER PlSqlGrammar.CREATE_TYPE -> Symbol.Kind.TYPE PlSqlGrammar.CREATE_TYPE_BODY -> Symbol.Kind.TYPE PlSqlGrammar.TYPE_CONSTRUCTOR -> Symbol.Kind.TYPE else -> { throw IllegalArgumentException("Unknown unit type: ${node.type}") } } val symbol = createSymbol(identifier, symbolKind, type) enterScope(node, autonomousTransaction, exceptionHandler, isOverridingMember, identifier.tokenValue, nodeType) symbol.innerScope = currentScope } private fun visitPackage(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.UNIT_NAME) val packageScope = symbolTable.scopes.lastOrNull { it.identifier == identifier.tokenValue && it.type == PlSqlGrammar.CREATE_PACKAGE } if (packageScope != null) { currentScope = packageScope val symbol = currentScope?.getSymbol(identifier.tokenValue) if (symbol != null) { symbol.addUsage(identifier) semantic(node).symbol = symbol } enterScope(node, autonomousTransaction = false, exceptionHandler = false) } else { val symbol = createSymbol(identifier, Symbol.Kind.PACKAGE, UnknownDatatype) enterScope(node, autonomousTransaction = false, exceptionHandler = false) symbol.innerScope = currentScope } } private fun visitCursor(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val symbol = createSymbol(identifier, Symbol.Kind.CURSOR, UnknownDatatype) enterScope(node) symbol.innerScope = currentScope } private fun visitBlock(node: AstNode) { val exceptionHandler = node .getFirstChild(PlSqlGrammar.STATEMENTS_SECTION) .hasDirectChildren(PlSqlGrammar.EXCEPTION_HANDLERS) enterScope(node, exceptionHandler = exceptionHandler) } private fun visitFor(node: AstNode) { enterScope(node) val iterator = node.getFirstChild(PlSqlGrammar.ITERATOR) val declarations = iterator.getChildren(PlSqlGrammar.ITERAND_DECLARATION) val control = iterator.getFirstChild(PlSqlGrammar.QUAL_ITERATION_CTL) val iteratorType = if (control.hasDirectChildren(PlSqlGrammar.STEPPED_CONTROL)) { NumericDatatype(node) } else if (control.hasDirectChildren(PlSqlGrammar.SINGLE_EXPRESSION_CONTROL) || control.hasDirectChildren(PlSqlGrammar.DYNAMIC_SQL)) { RowtypeDatatype() } else { UnknownDatatype } for (declaration in declarations) { val identifier = declaration.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val datatype = declaration.getFirstChildOrNull(PlSqlGrammar.DATATYPE) val type = if (datatype != null) solveType(datatype) else iteratorType createSymbol(identifier, Symbol.Kind.VARIABLE, type) } } private fun visitForAll(node: AstNode) { enterScope(node) val identifier = node.getFirstChild(PlSqlKeyword.FORALL).nextSibling createSymbol(identifier, Symbol.Kind.VARIABLE, NumericDatatype(node)) } private fun visitVariableDeclaration(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val datatype = node.getFirstChild(PlSqlGrammar.DATATYPE) val type = solveType(datatype) createSymbol(identifier, Symbol.Kind.VARIABLE, type) } private fun visitExceptionDeclaration(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) createSymbol(identifier, Symbol.Kind.VARIABLE, ExceptionDatatype()) } private fun visitCustomSubtypeDeclaration(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val datatype = node.getFirstChild(PlSqlGrammar.DATATYPE) val type = solveType(datatype) createSymbol(identifier, Symbol.Kind.TYPE, type) } private fun visitAssociativeArrayDeclaration(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val datatype = node.getFirstChild(PlSqlGrammar.NESTED_TABLE_DEFINITION).getFirstChild(PlSqlGrammar.DATATYPE) createSymbol(identifier, Symbol.Kind.TYPE, AssociativeArrayDatatype(node, currentScope, solveType(datatype))) } private fun visitVarrayDeclaration(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val datatype = node.getFirstChild(PlSqlGrammar.VARRAY_TYPE_DEFINITION).getFirstChild(PlSqlGrammar.DATATYPE) createSymbol(identifier, Symbol.Kind.TYPE, AssociativeArrayDatatype(node, currentScope, solveType(datatype))) } private fun visitRecordDeclaration(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val scope = currentScope ?: throw IllegalStateException("Cannot create a symbol without a scope.") val fields = node.getChildren(PlSqlGrammar.RECORD_FIELD_DECLARATION).map { field -> val fieldName = field.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val datatype = field.getFirstChild(PlSqlGrammar.DATATYPE) val type = solveType(datatype) Symbol(fieldName, Symbol.Kind.VARIABLE, scope, type) } createSymbol(identifier, Symbol.Kind.TYPE, RecordDatatype(node, currentScope, fields)) } private fun visitParameterDeclaration(node: AstNode) { val identifier = node.getFirstChild(PlSqlGrammar.IDENTIFIER_NAME) val datatype = node.getFirstChild(PlSqlGrammar.DATATYPE) val type = solveType(datatype) createSymbol(identifier, Symbol.Kind.PARAMETER, type).addModifiers(node.getChildren(PlSqlKeyword.IN, PlSqlKeyword.OUT)) } private fun visitVariableName(node: AstNode) { val identifier = node.getFirstChildOrNull(PlSqlGrammar.IDENTIFIER_NAME) if (identifier != null && currentScope != null) { val symbol = currentScope?.getSymbol(identifier.tokenValue) if (symbol != null) { symbol.addUsage(identifier) semantic(node).symbol = symbol val parent = node.parent if (parent.type == PlSqlGrammar.METHOD_CALL) { val isArrayAccess = symbol.datatype is AssociativeArrayDatatype && symbol.kind != Symbol.Kind.FUNCTION semantic(parent).plSqlDatatype = if (isArrayAccess) symbol.datatype.nestedType else symbol.datatype } } } } private fun visitMemberExpression(node: AstNode) { val parts = node.getChildren(PlSqlGrammar.IDENTIFIER_NAME, PlSqlGrammar.VARIABLE_NAME) val path = parts.dropLast(1).map { it.tokenValue }.reversed() val identifier = parts.last() if (currentScope != null) { val symbol = currentScope?.getSymbol(identifier.tokenValue, path) if (symbol != null) { symbol.addUsage(identifier) semantic(node).symbol = symbol } } } private fun visitLiteral(node: AstNode) { (node as SemanticAstNode).plSqlDatatype = solveType(node) } private fun visitSelectExpression(node: AstNode) { enterScope(node) } private fun createSymbol(identifier: AstNode, kind: Symbol.Kind, plSqlDatatype: PlSqlDatatype): Symbol { val scope = currentScope if (scope == null) { throw IllegalStateException("Cannot create a symbol without a scope.") } else { val symbol = symbolTable.declareSymbol(identifier, kind, scope, plSqlDatatype) semantic(identifier).symbol = symbol return symbol } } private fun enterScope(node: AstNode, autonomousTransaction: Boolean? = null, exceptionHandler: Boolean? = null, overridingMember: Boolean? = null, identifier: String? = null, type: AstNodeType? = null) { var autonomous = false var exception = false val isOverridingMember = overridingMember ?: false with(currentScope) { if (autonomousTransaction != null) { autonomous = autonomousTransaction } else if (this != null) { autonomous = this.isAutonomousTransaction } if (this != null) { exception = this.hasExceptionHandler || (exceptionHandler == true) } else if (exceptionHandler != null) { exception = exceptionHandler } } val scope = ScopeImpl(currentScope, node, node.token, node.lastToken, autonomous, exception, isOverridingMember, identifier, type) symbolTable.addScope(scope) currentScope = scope } private fun leaveScope() { val scope = currentScope requireNotNull(scope) { "Current scope should never be null when calling method \"leaveScope\"" } currentScope = if (scope.type == PlSqlGrammar.CREATE_PACKAGE_BODY && scope.outer?.type == PlSqlGrammar.CREATE_PACKAGE){ scope.outer?.outer } else { scope.outer } } private fun solveType(node: AstNode): PlSqlDatatype { return typeSolver.solve(node, currentScope) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/utils/ReflectionUtils.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utils import java.lang.reflect.Field import java.lang.reflect.Modifier import java.util.* fun getAnnotation(objectOrClass: Any, annotationClass: Class): A? { val initialClass = objectOrClass as? Class<*> ?: objectOrClass.javaClass var aClass: Class<*>? = initialClass while (aClass != null) { val result = aClass.getAnnotation(annotationClass) if (result != null) { return result } aClass = aClass.superclass } for (anInterface in getAllInterfaces(initialClass)) { val result = anInterface.getAnnotation(annotationClass) if (result != null) { return result } } return null } fun getAllInterfaces(cls: Class<*>): Set> { val interfacesFound = LinkedHashSet>() getAllInterfaces(cls, interfacesFound) return interfacesFound } private fun getAllInterfaces(cls: Class<*>, interfacesFound: HashSet>) { var clss: Class<*>? = cls while (clss != null) { val interfaces = clss.interfaces for (i in interfaces) { if (interfacesFound.add(i)) { getAllInterfaces(i, interfacesFound) } } clss = clss.superclass } } fun getFields(clazz: Class<*>, forceAccess: Boolean): List { val result = ArrayList() var c: Class<*>? = clazz while (c != null) { for (declaredField in c.declaredFields) { if (!Modifier.isPublic(declaredField.modifiers)) { if (forceAccess) { declaredField.isAccessible = true } else { continue } } result.add(declaredField) } c = c.superclass } for (anInterface in getAllInterfaces(clazz)) { Collections.addAll(result, *anInterface.declaredFields) } return result } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/utils/log/Logger.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utils.log interface Logger { fun trace(msg: String) fun trace(msg: String, vararg args: Any?) fun debug(msg: String) fun debug(msg: String, vararg args: Any?) fun info(msg: String) fun info(msg: String, vararg args: Any?) fun warn(msg: String) fun warn(msg: String, vararg args: Any?) fun error(msg: String) fun error(msg: String, vararg args: Any?) } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/utils/log/Loggers.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utils.log abstract class Loggers { protected abstract fun getLogger(name: String): Logger companion object { var factory: Loggers = ZpaLoggers() fun getLogger(name: Class<*>): Logger { return factory.getLogger(name.name) } } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/utils/log/ZpaLogger.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utils.log class ZpaLogger(private val logger: java.util.logging.Logger) : Logger { private fun format(msg: String, args: Array): String { var result = msg for (arg in args) { result = result.replaceFirst("{}", arg.toString()) } return result } override fun trace(msg: String) { logger.finest(msg) } override fun trace(msg: String, vararg args: Any?) { logger.finest(format(msg, args)) } override fun debug(msg: String) { logger.fine(msg) } override fun debug(msg: String, vararg args: Any?) { logger.fine(format(msg, args)) } override fun info(msg: String) { logger.info(msg) } override fun info(msg: String, vararg args: Any?) { logger.info(format(msg, args)) } override fun warn(msg: String) { logger.warning(msg) } override fun warn(msg: String, vararg args: Any?) { logger.warning(format(msg, args)) } override fun error(msg: String) { logger.severe(msg) } override fun error(msg: String, vararg args: Any?) { logger.severe(format(msg, args)) } } ================================================ FILE: zpa-core/src/main/kotlin/com/felipebz/zpa/utils/log/ZpaLoggers.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.utils.log class ZpaLoggers : Loggers() { override fun getLogger(name: String): Logger { return ZpaLogger(java.util.logging.Logger.getLogger(name)) } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/CustomAnnotationBasedRulesDefinitionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import com.felipebz.zpa.api.annotations.ConstantRemediation import com.felipebz.zpa.api.annotations.Rule import com.felipebz.zpa.api.annotations.RuleProperty import com.felipebz.zpa.rules.Repository import com.felipebz.zpa.rules.RuleMetadataLoader import com.felipebz.zpa.rules.ZpaRule import com.felipebz.zpa.rules.ZpaRuleParam import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import java.util.* class CustomAnnotationBasedRulesDefinitionTest { @BeforeEach fun setup() { Locale.setDefault(Locale.ROOT) } @Test fun noClassToAdd() { assertThat(buildRepository().availableRules).isEmpty() } @Test fun classWithoutRuleAnnotation() { class NotRuleClass assertThrows { buildSingleRuleRepository(NotRuleClass::class.java) } } @Test fun ruleAnnotationData() { @Rule(key = "key1", name = "name1", description = "description1", tags = ["mytag"]) class RuleClass { @RuleProperty(key = "param1Key", description = "param1 description") var param1 = "x" } val rule = buildSingleRuleRepository(RuleClass::class.java) assertThat(rule.key).isEqualTo("key1") assertThat(rule.name).isEqualTo("name1") assertThat(rule.htmlDescription).isEqualTo("description1") assertThat(rule.tags).containsOnly("mytag") assertThat(rule.template).isFalse assertThat(rule.params).hasSize(1) assertParam(rule.params[0], "param1Key", "param1 description") } @Rule(name = "name1", description = "description1") internal class RuleClassWithoutAnnotationDefinedKey @Test fun ruleWithoutExplicitKeyCanBeAcceptable() { val repository = buildRepository(LANGUAGE_KEY_WITH_RESOURCE_BUNDLE, RuleClassWithoutAnnotationDefinedKey::class.java) val rule = repository.availableRules[0] assertThat(rule.key).isEqualTo(RuleClassWithoutAnnotationDefinedKey::class.java.simpleName) assertThat(rule.name).isEqualTo("name1") } @Test fun externalNamesAndDescriptions() { @Rule(key = "ruleWithExternalInfo") class RuleClass { @RuleProperty(key = "param1Key") var param1 = "x" @RuleProperty var param2 = "x" } val rule = buildSingleRuleRepository(RuleClass::class.java) assertThat(rule.key).isEqualTo("ruleWithExternalInfo") assertThat(rule.name).isEqualTo("external name for ruleWithExternalInfo") assertThat(rule.htmlDescription).isEqualTo("description for ruleWithExternalInfo") assertThat(rule.params).hasSize(2) assertParam(rule.params[0], "param1Key", "description for param1") assertParam(rule.params[1], "param2", "") } @Test fun classWithSqaleConstantRemediation() { @Rule(key = "key1", name = "name1", description = "description1") @ConstantRemediation("10min") class RuleClass val rule = buildSingleRuleRepository(RuleClass::class.java) assertThat(rule.remediationConstant).isEqualTo("10min") } @Test fun invalidSqaleAnnotation() { @Rule(key = "key1", name = "name1", description = "description1") @ConstantRemediation("xxx") class MyInvalidRuleClass assertThrows { buildSingleRuleRepository(MyInvalidRuleClass::class.java) } } @Test fun loadMethodWithClassWithSqaleAnnotations() { @Rule(key = "key1", name = "name1", description = "description1") @ConstantRemediation("10min") class RuleClass val repository = load(RuleClass::class.java) assertThat(repository.availableRules).hasSize(1) } private fun assertParam(param: ZpaRuleParam, expectedKey: String, expectedDescription: String?) { assertThat(param.key).isEqualTo(expectedKey) assertThat(param.description).isEqualTo(expectedDescription) } private fun buildSingleRuleRepository(ruleClass: Class<*>): ZpaRule { val repository = buildRepository(ruleClass) assertThat(repository.availableRules).hasSize(1) return repository.availableRules[0] } private fun buildRepository(vararg classes: Class<*>): Repository { return buildRepository(LANGUAGE_KEY_WITH_RESOURCE_BUNDLE, *classes) } private fun buildRepository(languageKey: String, vararg classes: Class<*>): Repository { val newRepository = createRepository() CustomAnnotationBasedRulesDefinition(newRepository, languageKey, RuleMetadataLoader()) .addRuleClasses(classes.toList()) return newRepository } private fun load(vararg classes: Class<*>): Repository { val languageKey = LANGUAGE_KEY_WITH_RESOURCE_BUNDLE val newRepository = createRepository() CustomAnnotationBasedRulesDefinition.load(newRepository, languageKey, classes.toList(), RuleMetadataLoader()) return newRepository } private fun createRepository(): Repository { return Repository(REPO_KEY) } companion object { private const val REPO_KEY = "plsql" private const val LANGUAGE_KEY_WITH_RESOURCE_BUNDLE = "languageKey" } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/PlSqlChecksTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa import com.felipebz.zpa.api.ZpaRulesDefinition import com.felipebz.zpa.api.annotations.Rule import com.felipebz.zpa.api.checks.PlSqlCheck import com.felipebz.zpa.api.checks.PlSqlVisitor import com.felipebz.zpa.rules.* import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.fail import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test class PlSqlChecksTest { private lateinit var activeRules: ActiveRules private lateinit var customRulesDefinition: MyCustomPlSqlRulesDefinition private val ruleMetadataLoader = RuleMetadataLoader() @BeforeEach fun setUp() { val repository = Repository(DEFAULT_REPOSITORY_KEY) CustomAnnotationBasedRulesDefinition(repository, "plsqlopen", RuleMetadataLoader()) .addRuleClasses(listOf(MyRule::class.java)) val customRepository = Repository(CUSTOM_REPOSITORY_KEY) customRulesDefinition = MyCustomPlSqlRulesDefinition() customRulesDefinition.define(customRepository) activeRules = ActiveRules().addRepository(repository).addRepository(customRepository) } @Test fun shouldReturnDefaultChecks() { val checks = PlSqlChecks.createPlSqlCheck(activeRules, ruleMetadataLoader) checks.addChecks(DEFAULT_REPOSITORY_KEY, listOf(MyRule::class.java)) val defaultVisitor = visitor(checks, DEFAULT_REPOSITORY_KEY, DEFAULT_RULE_KEY) assertThat(checks.all()).hasSize(1) assertThat(checks.ruleKey(defaultVisitor)).isNotNull assertThat(checks.ruleKey(defaultVisitor)?.rule).isEqualTo(DEFAULT_RULE_KEY) assertThat(checks.ruleKey(defaultVisitor)?.repository).isEqualTo(DEFAULT_REPOSITORY_KEY) } @Test fun shouldReturnCustomChecks() { val checks = PlSqlChecks.createPlSqlCheck(activeRules, ruleMetadataLoader) checks.addCustomChecks(arrayOf(customRulesDefinition)) val customVisitor = visitor(checks, CUSTOM_REPOSITORY_KEY, CUSTOM_RULE_KEY) assertThat(checks.all()).hasSize(1) assertThat(checks.ruleKey(customVisitor)).isNotNull assertThat(checks.ruleKey(customVisitor)?.rule).isEqualTo(CUSTOM_RULE_KEY) assertThat(checks.ruleKey(customVisitor)?.repository).isEqualTo(CUSTOM_REPOSITORY_KEY) } @Test fun shouldWorkWithoutCustomChecks() { val checks = PlSqlChecks.createPlSqlCheck(activeRules, ruleMetadataLoader) checks.addCustomChecks(null) assertThat(checks.all()).hasSize(0) } @Test fun shouldNotReturnRuleKeyIfCheckDoesNotExists() { val checks = PlSqlChecks.createPlSqlCheck(activeRules, ruleMetadataLoader) checks.addChecks(DEFAULT_REPOSITORY_KEY, listOf(MyRule::class.java)) assertThat(checks.ruleKey(MyCustomRule())).isNull() } private fun visitor(plSqlChecks: PlSqlChecks, repository: String, rule: String): PlSqlVisitor { val key = RuleKey(repository, rule) var visitor: PlSqlVisitor? = null for (checks in plSqlChecks.checks) { visitor = checks.of(key) if (visitor != null) { return visitor } } return visitor ?: fail("Should return a visitor.") } @Rule(key = DEFAULT_RULE_KEY, name = "This is the default rules", description = "desc") class MyRule : PlSqlCheck() @Rule(key = CUSTOM_RULE_KEY, name = "This is a custom rules", description = "desc") class MyCustomRule : PlSqlCheck() class MyCustomPlSqlRulesDefinition : ZpaRulesDefinition { fun define(repository: ZpaRepository) { CustomAnnotationBasedRulesDefinition(repository, "plsqlopen", RuleMetadataLoader()) .addRuleClasses(checkClasses().toList()) } override fun repositoryName(): String { return "Custom Rule Repository" } override fun repositoryKey(): String { return CUSTOM_REPOSITORY_KEY } override fun checkClasses(): Array> { return arrayOf(MyCustomRule::class.java) } } companion object { private const val DEFAULT_REPOSITORY_KEY = "DefaultRuleRepository" private const val DEFAULT_RULE_KEY = "MyRule" private const val CUSTOM_REPOSITORY_KEY = "CustomRuleRepository" private const val CUSTOM_RULE_KEY = "MyCustomRule" } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/AnchoredDatatypeTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test class AnchoredDatatypeTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.ANCHORED_DATATYPE) } @Test fun matchesSimpleTypeAttribute() { assertThat(p).matches("name%type") } @Test fun matchesTableColumn() { assertThat(p).matches("tab.name%type") } @Test fun matchesTableColumnWithExplicitSchema() { assertThat(p).matches("schema.tab.name%type") } @Test fun matchesSimpleRowtypeAttribute() { assertThat(p).matches("name%rowtype") } @Test fun matchesTypeAsColumnName() { assertThat(p).matches("tab.type%type") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/DatatypeTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test class DatatypeTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.DATATYPE) } @Test fun test() { assertThat(p).matches("number") assertThat(p).matches("number(10)") assertThat(p).matches("number(10, 2)") assertThat(p).matches("number(*, 2)") assertThat(p).matches("number(10, -2)") assertThat(p).matches("number($\$len)") assertThat(p).matches("number(1+2)") assertThat(p).matches("number(const_val)") assertThat(p).matches("number($\$len, $\$decimals)") assertThat(p).matches("clob character set any_cs") assertThat(p).matches("clob character set str%charset") assertThat(p).matches("varchar2(10)") assertThat(p).matches("varchar2(10 char)") assertThat(p).matches("varchar2(10) character set any_cs") assertThat(p).matches("varchar2(10) character set str%charset") assertThat(p).matches("varchar2($\$len)") assertThat(p).matches("varchar2(const_val)") assertThat(p).matches("date") assertThat(p).matches("timestamp") assertThat(p).matches("timestamp(3)") assertThat(p).matches("timestamp with time zone") assertThat(p).matches("timestamp(3) with time zone") assertThat(p).matches("timestamp with local time zone") assertThat(p).matches("interval year to month") assertThat(p).matches("interval year(2) to month") assertThat(p).matches("interval day to second") assertThat(p).matches("interval day(2) to second") assertThat(p).matches("interval day to second(6)") assertThat(p).matches("interval day(2) to second(6)") assertThat(p).matches("my_datatype") assertThat(p).matches("my_char(5)") assertThat(p).matches("my_char(5 char)") assertThat(p).matches("my_char character set any_cs") assertThat(p).matches("my_number(10,2)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/HostAndIndicatorVariableTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test class HostAndIndicatorVariableTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.HOST_AND_INDICATOR_VARIABLE) } @Test fun matchesSimpleBindingVariable() { assertThat(p).matches(":var") } @Test fun matchesSimpleNumericBindingVariable() { assertThat(p).matches(":1") } @Test fun matchesShortIndicatorVariable() { assertThat(p).matches(":var:ind") } @Test fun matchesLongIndicatorVariable() { assertThat(p).matches(":var indicator :ind") } @Test fun matchesQuestionMarkBinding() { assertThat(p).matches("?") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/IdentifierNameTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test class IdentifierNameTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.IDENTIFIER_NAME) } @Test fun matchesSimpleIdentifier() { assertThat(p).matches("x") } @Test fun matchesIdentifierWithNumber() { assertThat(p).matches("t2") } @Test fun matchesIdentifierWithNumberSign() { assertThat(p).matches("phone#") assertThat(p).matches("SN##") } @Test fun matchesIdentifierWithUnderscore() { assertThat(p).matches("credit_limit") assertThat(p).matches("try_again_") } @Test fun matchesIdentifierWithDollarSign() { assertThat(p).matches("oracle\$number") assertThat(p).matches("money$$\$tree") } @Test fun matchesQuotedIdentifier() { assertThat(p).matches("\"X+Y\"") assertThat(p).matches("\"last name\"") assertThat(p).matches("\"on/off switch\"") assertThat(p).matches("\"employee(s)\"") assertThat(p).matches("\"*** header info ***\"") } @Test fun matchesNonReservedKeywords() { assertThat(p).matches("cursor") assertThat(p).matches("rowid") } @Test fun matchesIdentifierWithSpecialCharacters() { assertThat(p).matches("variável") } @Test fun notMatchesIdentifierStartingWithNumber() { assertThat(p).notMatches("2foo") } @Test fun notMatchesIdentifierWithAmpersand() { assertThat(p).notMatches("mine&yours") } @Test fun notMatchesIdentifierWithHyphen() { assertThat(p).notMatches("debit-amount") } @Test fun notMatchesIdentifierWithSlash() { assertThat(p).notMatches("on/off") } @Test fun notMatchesIdentifierWithSpace() { assertThat(p).notMatches("user id") } @Test fun notMatchesQuotedIdentifierCornerCases() { assertThat(p).notMatches("\"\"") assertThat(p).notMatches("\"\"\"\"") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/InquiryDirectiveTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test class InquiryDirectiveTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.INQUIRY_DIRECTIVE) } @Test fun test() { assertThat(p).matches("$\$PLSQL_UNIT") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/IntervalLiteralTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test class IntervalLiteralTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.INTERVAL_LITERAL) } @Test fun intervalYearToMonthLiteral() { assertThat(p).matches("INTERVAL '4' YEAR") assertThat(p).matches("interval '4' year") assertThat(p).matches("INTERVAL '4' MONTH") assertThat(p).matches("INTERVAL '4' YEAR(3)") assertThat(p).matches("INTERVAL '4-2' YEAR TO MONTH") } @Test fun intervalDayToSecondLiteral() { assertThat(p).matches("INTERVAL '4' DAY") assertThat(p).matches("interval '4' day") assertThat(p).matches("INTERVAL '25' HOUR") assertThat(p).matches("INTERVAL '40' MINUTE") assertThat(p).matches("INTERVAL '120' HOUR(3)") assertThat(p).matches("INTERVAL '10' MINUTE") assertThat(p).matches("INTERVAL '10' HOUR") assertThat(p).matches("INTERVAL '10:22' MINUTE TO SECOND") assertThat(p).matches("INTERVAL '30.12345' SECOND(2,4)") assertThat(p).matches("INTERVAL '11:20' HOUR TO MINUTE") assertThat(p).matches("INTERVAL '11:12:10.2222222' HOUR TO SECOND(7)") assertThat(p).matches("INTERVAL '400' DAY(3)") assertThat(p).matches("INTERVAL '400 5' DAY(3) TO HOUR") assertThat(p).matches("INTERVAL '4 5:12' DAY TO MINUTE") assertThat(p).matches("INTERVAL '4 5:12:10.222' DAY TO SECOND(3)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/OperatorsTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.Test class OperatorsTest : RuleTest() { @Test fun concatenation() { setRootRule(PlSqlGrammar.CONCATENATION_OPERATOR) assertThat(p).matches("||") } @Test fun equals() { setRootRule(PlSqlGrammar.EQUALS_OPERATOR) assertThat(p).matches("=") } @Test fun notEquals() { setRootRule(PlSqlGrammar.NOTEQUALS_OPERATOR) assertThat(p).matches("<>") assertThat(p).matches("!=") assertThat(p).matches("^=") assertThat(p).matches("~=") // this operator is supported in Oracle Forms } @Test fun lessThan() { setRootRule(PlSqlGrammar.LESSTHAN_OPERATOR) assertThat(p).matches("<") } @Test fun lessThanOrEquals() { setRootRule(PlSqlGrammar.LESSTHANOREQUALS_OPERATOR) assertThat(p).matches("<=") } @Test fun greaterThan() { setRootRule(PlSqlGrammar.GREATERTHAN_OPERATOR) assertThat(p).matches(">") } @Test fun greaterThanOrEquals() { setRootRule(PlSqlGrammar.GREATERTHANOREQUALS_OPERATOR) assertThat(p).matches(">=") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/RefDatatypeTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test class RefDatatypeTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.REF_DATATYPE) } @Test fun matchesSimpleRef() { assertThat(p).matches("ref custom") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/RuleTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api import com.felipebz.flr.api.Grammar import com.felipebz.flr.grammar.GrammarRuleKey import com.felipebz.flr.impl.Parser import com.felipebz.zpa.parser.PlSqlParser import com.felipebz.zpa.squid.PlSqlConfiguration import java.nio.charset.StandardCharsets abstract class RuleTest { private var errorRecoveryEnabled: Boolean = false lateinit var p: Parser protected fun setRootRule(ruleKey: GrammarRuleKey) { p = PlSqlParser.create(PlSqlConfiguration(StandardCharsets.UTF_8, errorRecoveryEnabled)) p.setRootRule(p.grammar.rule(ruleKey)) } protected fun setErrorRecoveryEnabled(value: Boolean) { errorRecoveryEnabled = value } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/conditions/IsJsonConditionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.conditions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.ConditionsGrammar import com.felipebz.zpa.api.RuleTest class IsJsonConditionTest : RuleTest() { @BeforeEach fun init() { setRootRule(ConditionsGrammar.CONDITION) } @Test fun matchesSimpleIsJson() { assertThat(p).matches("foo is json") } @Test fun matchesSimpleIsNotJson() { assertThat(p).matches("foo is not json") } @Test fun matchesIsJsonFormatJson() { assertThat(p).matches("foo is json format json") } @Test fun matchesIsJsonStrictLax() { assertThat(p).matches("foo is json strict") assertThat(p).matches("foo is json lax") } @Test fun matchesIsJsonStrictAllowDisallowScalars() { assertThat(p).matches("foo is json allow scalars") assertThat(p).matches("foo is json disallow scalars") } @Test fun matchesIsJsonStrictWithWithoutUniqueKeys() { assertThat(p).matches("foo is json with unique keys") assertThat(p).matches("foo is json without unique keys") } @Test fun matchesIsJsonValidate() { assertThat(p).matches("foo is json validate '{}'") } @Test fun matchesIsJsonValidateCast() { assertThat(p).matches("foo is json validate cast '{}'") } @Test fun matchesIsJsonValidateUsing() { assertThat(p).matches("foo is json validate cast '{}'") } @Test fun matchesIsJsonWithColumnModifier() { assertThat(p).matches("foo is json object") } @Test fun matchesIsJsonWithColumnModifierInParenthesis() { assertThat(p).matches("foo is json (object)") } @Test fun matchesIsJsonWithMultipleColumnModifier() { assertThat(p).matches("foo is json (value, array, object, scalar number, scalar timestamp with time zone)") } @Test fun matchesLongIsJson() { assertThat(p).matches(""" foo is json (value, array, object, scalar number, scalar timestamp with time zone) format json strict allow scalars with unique keys """) } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/conditions/IsOfConditionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.conditions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.ConditionsGrammar import com.felipebz.zpa.api.RuleTest class IsOfConditionTest : RuleTest() { @BeforeEach fun init() { setRootRule(ConditionsGrammar.CONDITION) } @Test fun matchesSimpleIsOf() { assertThat(p).matches("foo is of (bar)") } @Test fun matchesSimpleIsNotOf() { assertThat(p).matches("foo is not of (bar)") } @Test fun matchesIsOfType() { assertThat(p).matches("foo is of type (bar)") } @Test fun matchesIsNotOfType() { assertThat(p).matches("foo is not of type (bar)") } @Test fun matchesIsOfMultipleType() { assertThat(p).matches("foo is of type (bar, baz, foobar)") } @Test fun matchesIsOfOnly() { assertThat(p).matches("foo is of type (only bar)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/conditions/JsonEqualConditionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.conditions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.ConditionsGrammar import com.felipebz.zpa.api.RuleTest class JsonEqualConditionTest : RuleTest() { @BeforeEach fun init() { setRootRule(ConditionsGrammar.CONDITION) } @Test fun matchesSimpleJsonEqual() { assertThat(p).matches("json_equal('{}', '{}')") } @Test fun matchesJsonEqualOnErrorClause() { assertThat(p).matches("json_equal('{}', '{}' error on error)") assertThat(p).matches("json_equal('{}', '{}' true on error)") assertThat(p).matches("json_equal('{}', '{}' false on error)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/conditions/JsonExistsConditionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.conditions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.ConditionsGrammar import com.felipebz.zpa.api.RuleTest class JsonExistsConditionTest : RuleTest() { @BeforeEach fun init() { setRootRule(ConditionsGrammar.CONDITION) } @Test fun matchesSimpleJsonExists() { assertThat(p).matches("json_exists(doc, '$.a')") } @Test fun matchesJsonExistsFormatJson() { assertThat(p).matches("json_exists(doc format json, '$.a')") } @Test fun matchesJsonExistsWithPassing() { assertThat(p).matches("json_exists(doc, '$.a' passing var1 as a, var2 as b)") } @Test fun matchesJsonExistsOnError() { assertThat(p).matches("json_exists(doc, '$.a' error on error)") } @Test fun matchesJsonExistsStrict() { assertThat(p).matches("json_exists(doc, '$.a' type strict)") } @Test fun matchesJsonExistsOnEmpty() { assertThat(p).matches("json_exists(doc, '$.a' error on empty)") } @Test fun matchesLongJsonExists() { assertThat(p).matches(""" json_exists(doc format json, '$.a' passing var1 as a, var2 as b false on error type lax true on empty) """) } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/conditions/JsonTextContainsConditionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.conditions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.ConditionsGrammar import com.felipebz.zpa.api.RuleTest class JsonTextContainsConditionTest : RuleTest() { @BeforeEach fun init() { setRootRule(ConditionsGrammar.CONDITION) } @Test fun matchesSimpleJsonTextcontains() { assertThat(p).matches("json_textcontains(doc, '$.a', val)") } @Test fun notMatchesJsonTextcontainsIfPathIsNotString() { assertThat(p).notMatches("json_textcontains(doc, path, val)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/dcl/GrantStatementTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.dcl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DclGrammar import com.felipebz.zpa.api.RuleTest class GrantStatementTest : RuleTest() { @BeforeEach fun init() { setRootRule(DclGrammar.GRANT_STATEMENT) } @Test fun matchesSimpleSystemGrant() { assertThat(p).matches("grant connect to user1;") } @Test fun matchesGrantToPublic() { assertThat(p).matches("grant connect to public;") } @Test fun matchesSystemGrantWithLongPrivilegeName() { assertThat(p).matches("grant execute any procedure to user1;") } @Test fun matchesSimpleSystemGrantAllPrivileges() { assertThat(p).matches("grant all privileges to user1;") } @Test fun matchesMultipleRoleGrantToUser() { assertThat(p).matches("grant connect, resource to user1;") } @Test fun matchesSystemGrantWithGranteeIdentifiedBy() { assertThat(p).matches("grant connect to user1 identified by pass;") } @Test fun matchesSystemGrantWithMultipleGranteeIdentifiedBy() { assertThat(p).matches("grant connect to user1, user2 identified by pass1, pass2;") } @Test fun matchesSystemGrantWithAdminOption() { assertThat(p).matches("grant foo to bar with admin option;") } @Test fun matchesSystemGrantWithDelegateOption() { assertThat(p).matches("grant foo to bar with delegate option;") } @Test fun matchesSystemGrantInCurrentContainer() { assertThat(p).matches("grant foo to bar container = current;") } @Test fun matchesSystemGrantInAllContainers() { assertThat(p).matches("grant foo to bar container = all;") } @Test fun matchesLongSystemGrant() { assertThat(p).matches("grant foo to bar with admin option container = all;") } @Test fun matchesSimpleGrantOnObject() { assertThat(p).matches("grant execute on proc to user1;") } @Test fun matchesGrantOnObjectToPublic() { assertThat(p).matches("grant execute on proc to public;") } @Test fun matchesGrantWithColumnOnObject() { assertThat(p).matches("grant select (col) on tab to user1;") } @Test fun matchesGrantWithMultipleColumnsOnObject() { assertThat(p).matches("grant select (col, col2) on tab to user1;") } @Test fun matchesGrantOnObjectWithHierarchyOption() { assertThat(p).matches("grant execute on proc to user1 with hierarchy option;") } @Test fun matchesGrantOnObjectWithGrantOption() { assertThat(p).matches("grant execute on proc to user1 with grant option;") } @Test fun matchesGrantOnObjectWithHierarchyAndGrantOption() { assertThat(p).matches("grant execute on proc to user1 with hierarchy option with grant option;") } @Test fun matchesGrantRoleToFunction() { assertThat(p).matches("grant foo to function bar;") } @Test fun matchesGrantRoleToProcedure() { assertThat(p).matches("grant foo to procedure bar;") } @Test fun matchesGrantRoleToPackage() { assertThat(p).matches("grant foo to package bar;") } @Test fun matchesGrantRoleToMultiplePrograms() { assertThat(p).matches("grant foo, bar to package foo2, procedure bar2;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/AlterFunctionUnitTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class AlterFunctionUnitTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.ALTER_FUNCTION) } @Test fun matchesAlterFunctionCompile() { assertThat(p).matches("alter function foo compile;") } @Test fun matchesAlterFunctionIfExists() { assertThat(p).matches("alter function if exists foo compile;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/AlterPackageUnitTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class AlterPackageUnitTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.ALTER_PACKAGE) } @Test fun matchesAlterPackageCompile() { assertThat(p).matches("alter package foo compile;") } @Test fun matchesAlterPackageIfExists() { assertThat(p).matches("alter package if exists foo compile;") } @Test fun matchesAlterPackageCompileBody() { assertThat(p).matches("alter package foo compile body;") } @Test fun matchesAlterPackageCompileBodyDebug() { assertThat(p).matches("alter package foo compile debug body;") } @Test fun matchesAlterPackageCompilePackage() { assertThat(p).matches("alter package foo compile package;") } @Test fun matchesAlterPackageCompileSpecification() { assertThat(p).matches("alter package foo compile specification;") } @Test fun matchesAlterPackageCompileSpecificationReuseSettings() { assertThat(p).matches("alter package foo compile debug specification reuse settings;") } @Test fun matchesAlterPackageCompileSpecificationWithOptionAndReuseSettings() { assertThat(p).matches("alter package foo compile debug specification plsql_ccflags='no_op:true' plsql_ccflags='no_op:true' reuse settings;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/AlterProcedureUnitTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class AlterProcedureUnitTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.ALTER_PROCEDURE) } @Test fun matchesAlterProcedureCompile() { assertThat(p).matches("alter procedure foo compile;") } @Test fun matchesAlterProcedureIfExists() { assertThat(p).matches("alter procedure if exists foo compile;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/AlterTableTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class AlterTableTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.ALTER_TABLE) } @Test fun matchesAlterTableWithOutOfLineConstraint() { assertThat(p).matches("alter table tab add constraint c_name foreign key (f_key) references tab.col (name);") } @Test fun matchesAlterTableWithOutOfLineConstraintUsingAndTablespace() { assertThat(p).matches("alter table tab add constraint c_name primary key (col1, col2) using index;") } @Test fun matchesAlterTableAddColumnWithDefaultOnNull() { assertThat(p).matches("alter table tab add col varchar2(100) default on null 'Default String';") } @Test fun matchesAlterTableAddColumnWithDefaultWithoutOnNull() { assertThat(p).matches("alter table tab add col varchar2(100) default 'Default String';") } @Test fun matchesAlterTableAddColumnWithDefaultOnNullForInsertOnly() { assertThat(p).matches("alter table tab add col varchar2(100) default on null for insert only 'Default String';") } @Test fun matchesAlterTableAddColumnWithDefaultOnNullForInsertAndUpdate() { assertThat(p).matches("alter table tab add col varchar2(100) default on null for insert and update 'Default String';") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/AlterTriggerUnitTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class AlterTriggerUnitTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.ALTER_TRIGGER) } @Test fun matchesAlterTriggerDisable() { assertThat(p).matches("alter trigger foo disable;") } @Test fun matchesAlterTriggerEnable() { assertThat(p).matches("alter trigger foo enable;") } @Test fun matchesAlterTriggerDisableWithSchema() { assertThat(p).matches("alter trigger foo.bar disable;") } @Test fun matchesAlterTriggerDisableWithQuotedIdentifier() { assertThat(p).matches("alter trigger \"foo\" rename to \"bar\";") } @Test fun matchesAlterTriggerCompile() { assertThat(p).matches("alter trigger foo compile;") } @Test fun matchesAlterTriggerIfExists() { assertThat(p).matches("alter trigger if exists foo compile;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/CreateDirectoryTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class CreateDirectoryTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.CREATE_DIRECTORY) } @Test fun matchesSimpleCreateDirectory() { assertThat(p).matches("create directory foo as 'path';") } @Test fun matchesSimpleCreateOrReplaceDirectory() { assertThat(p).matches("create or replace directory foo as 'path';") } @Test fun matchesCreateIfNotExistsDirectory() { assertThat(p).matches("create directory if not exists foo as 'path';") } @Test fun matchesLongCreateDirectory() { assertThat(p).matches("create directory if not exists foo sharing = metadata as 'path';") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/CreateSequenceTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class CreateSequenceTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.CREATE_SEQUENCE) } @Test fun matchesSimpleCreateSequence() { assertThat(p).matches("create sequence seq_name;") } @Test fun matchesCreateSequenceStart() { assertThat(p).matches("create sequence seq_name start with 1;") } @Test fun matchesCreateSequenceIncrement() { assertThat(p).matches("create sequence seq_name increment by 1;") } @Test fun matchesCreateSequenceStartIncrement() { assertThat(p).matches("create sequence seq_name start with 1 increment by 1;") } @Test fun matchesCreateSequenceCache() { assertThat(p).matches("create sequence seq_name cache 10;") } @Test fun matchesCreateSequenceNoCache() { assertThat(p).matches("create sequence seq_name nocache;") } @Test fun matchesCreateSequenceXXX() { assertThat(p).matches("create sequence seq_name start with 1 MAXVALUE 9999 MINVALUE 1 NOCYCLE CACHE 20 ORDER;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/CreateSynonymTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class CreateSynonymTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.CREATE_SYNONYM) } @Test fun matchesSimpleCreateSynonym() { assertThat(p).matches("create synonym foo for bar;") } @Test fun matchesCreatePublicSynonym() { assertThat(p).matches("create public synonym foo for bar;") } @Test fun matchesEditionableSynonym() { assertThat(p).matches("create editionable synonym foo for bar;") } @Test fun matchesNonEditionableSynonym() { assertThat(p).matches("create noneditionable synonym foo for bar;") } @Test fun matchesSynonymWithSharingMetada() { assertThat(p).matches("create synonym foo sharing = metadata for bar;") } @Test fun matchesSynonymWithSharingNone() { assertThat(p).matches("create synonym foo sharing = none for bar;") } @Test fun matchesCreateorReplaceSynonym() { assertThat(p).matches("create or replace synonym foo for bar;") } @Test fun matchesLongSynonym() { assertThat(p).matches("create or replace public synonym sch.foo for sch.bar@link;") assertThat(p).matches("create or replace public synonym sch.foo for sch.bar@link.domain.com;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/CreateTableTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class CreateTableTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.CREATE_TABLE) } @Test fun matchesSimpleCreateTable() { assertThat(p).matches("create table tab (id number);") } @Test fun matchesMultipleColumns() { assertThat(p).matches("create table tab (id number, name number);") } @Test fun matchesTableWithSchema() { assertThat(p).matches("create table sch.tab (id number);") } @Test fun matchesTemporaryTable() { assertThat(p).matches("create global temporary table tab (id number);") } @Test fun matchesTemporaryTableWithTablespace() { assertThat(p).matches("create global temporary table tab (id number) tablespace table_space;") } @Test fun matchesTemporaryTableOnCommitDeleteRows() { assertThat(p).matches("create global temporary table tab (id number) on commit delete rows;") } @Test fun matchesTemporaryTableOnCommitPreserveRows() { assertThat(p).matches("create global temporary table tab (id number) on commit preserve rows;") } @Test fun matchesCreateTableWithOutOfLineConstraint() { assertThat(p).matches("create table tab (id number, constraint pk primary key(id));") } @Test fun matchesPartitionByRangeMulti() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id1, column_id2) (partition patition_id values less than (column_id));") } @Test fun matchesPartitionByRange_RVC_I() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (column_id));") } @Test fun matchesPartitionByRange_RVC_IE() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition values less than (column_id));") } @Test fun matchesPartitionByRange_RVC_IM() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (column_id1, column_id2));") } @Test fun matchesPartitionByRange_RV_MV() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_PCTFREE() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) pctfree 100);") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_PCTUSED() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) pctused 100);") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_INITRANS() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) initrans 100);") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_K() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (initial 100 k));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_M() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (initial 100 m));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_G() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (initial 100 g));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_T() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (initial 100 t));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_P() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (initial 100 p));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_NEXT() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (next 100 k));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_MINE() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (minextents 100));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_MAXE() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (maxextents 100));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_MAXE_U() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (maxextents unlimited));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_PCTI() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (pctincrease 100) );") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_FLS() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (freelists 100));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_FL() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (freelist groups 100));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_OP() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (optimal 100 k));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_OP_NULL() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (optimal null));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_BP_K() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (buffer_pool keep));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_BP_R() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (buffer_pool recycle));") } @Test fun matchesPartitionByRange_TPD_SAC_PAC_SC_ISC_BP_D() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) storage (buffer_pool default));") } @Test fun matchesPartitionByRange_TPD_SAC_TB() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) pctfree 100 tablespace tablespace_id1);") } @Test fun matchesPartitionByRange_TPD_SAC_LOG() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) pctfree 100 tablespace tablespace_id1 logging);") } @Test fun matchesPartitionByRange_TPD_TC() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) compress);") } @Test fun matchesPartitionByRange_TPD_TNC() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) nocompress);") } @Test fun matchesPartitionByRange_TPD_KC() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) mapping table);") } @Test fun matchesPartitionByRange_TPD_NP() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) nomapping);") } @Test fun matchesPartitionByRange_TPD_OF() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) overflow pctfree 100 tablespace tablespace_id1 logging);") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_TS() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (tablespace tablespace_id));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_TSM() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (tablespace tablespace_id1 tablespace tablespace_id2));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_SNE() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (enable storage in now));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_SND() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (disable storage in now));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_SC() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (storage (initial 100 k)));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_C() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (chunk 100));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_PCT() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (pctversion 100));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_R() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (retention));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_FP() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (freepools 100));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_CACHE() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (cache));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_NCACHE() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (nocache));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_NCACHE_LOG() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (nocache logging));") } @Test fun matchesPartitionByRange_TPD_LSC_LPAR_CACHE_R() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as (cache reads));") } @Test fun matchesPartitionByRange_TPD_LSC_LPARSL() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as segment_id (tablespace tablespace_id));") } @Test fun matchesPartitionByRange_TPD_LSC_LPARSI() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) lob (lob_id) store as segment_id);") } @Test fun matchesPartitionByRange_TPD_LSC_VARRAY_LPAR() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) varray array_id store as lob segment_id);") } @Test fun matchesPartitionByRange_TPD_LSC_VARRAY_SCCET_DT_LPAR() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) varray array_id element is of type (only number) store as lob segment_id (tablespace tablespace_id));") } @Test fun matchesPartitionByRange_TPD_LSC_VARRAY_SCCET_DT() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) varray array_id element is of type (only number) store as lob segment_id);") } @Test fun matchesPartitionByRange_TPD_LSC_VARRAY_SCCT_DT() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) varray array_id is of type (only number) store as lob segment_id);") } @Test fun matchesPartitionByRange_TPD_LSC_VARRAY_SCC_DT() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) varray array_id is of (only number) store as lob segment_id);") } @Test fun matchesPartitionByRange_TPD_LSC_VARRAY_SCCS_DT() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) varray array_id substitutable at all levels);") } @Test fun matchesPartitionByRange_TPD_LSC_VARRAY_SCCNS_DT() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) varray array_id not substitutable at all levels);") } @Test fun matchesPartitionByRange_TPD_PLS_STORE_TBL() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) subpartitions 1 store in (tablespace_id));") } @Test fun matchesPartitionByRange_TPD_PLS_STORE_TBLS() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) subpartitions 1 store in (tablespace_id1, tablespace_id2));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCL() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value')));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCLM() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value', null)));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCN() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values (null)));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCD() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values (default)));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCL_PSC_TBL() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value') tablespace tablespace_id));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCL_PSC_OVFL_TBL() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value') overflow tablespace tablespace_id));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCL_PSC_OVFL() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value') overflow));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCL_PSC_LOBST() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value') lob (lob_id) store as segment_id (tablespace tablespace_id)));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCL_PSC_LOBS() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value') lob (lob_id) store as segment_id));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCL_PSC_LOBT() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value') lob (lob_id) store as (tablespace tablespace_id)));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCL_PSC_LOBTM() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value') lob (lob_id1) store as (tablespace tablespace_id1) lob (lob_id2) store as (tablespace tablespace_id2)));") } @Test fun matchesPartitionByRange_TPD_PLS_SS_IDENT_LVCL_PSC_VARRAY() { assertThat(p).matches("create global temporary table table_id (id number) partition by range (column_id) (partition patition_id values less than (maxvalue) (subpartition subpartition_id values ('value') varray array_id store as lob segment_id));") } @Test fun matchesPartitionByHash_IHP_PSC() { assertThat(p).matches("create table table_id (id number) partition by hash (column_id) (partition partition_id tablespace tablespace_id);") } @Test fun matchesPartitionByHashM_IHP_PSC() { assertThat(p).matches("create table table_id (id1 number, id2 varchar) partition by hash (column_id) (partition partition_id tablespace tablespace_id);") } @Test fun matchesPartitionByHash_IHPM_PSC() { assertThat(p).matches("create table table_id (id number) partition by hash (column_id) (partition partition_id1 tablespace tablespace_id1, partition partition_id2 tablespace tablespace_id2);") } @Test fun matchesPartitionByHash_HPBQ() { assertThat(p).matches("create table table_id (id number) partition by hash (column_id) partitions 1;") } @Test fun matchesPartitionByHash_HPBQ_STORE() { assertThat(p).matches("create table table_id (id number) partition by hash (column_id) partitions 1 store in (tablespace_id);") } @Test fun matchesPartitionByHash_HPBQ_STOREM() { assertThat(p).matches("create table table_id (id number) partition by hash (column_id) partitions 1 store in (tablespace_id1, tablespace_id2);") } @Test fun matchesPartitionByHash_HPBQ_STORE_OFLW() { assertThat(p).matches("create table table_id (id number) partition by hash (column_id) partitions 1 store in (tablespace_id) overflow store in (tablespace_id);") } @Test fun matchesPartitionByHash_HPBQ_STORE_OFLWM() { assertThat(p).matches("create table table_id (id number) partition by hash (column_id) partitions 1 store in (tablespace_id) overflow store in (tablespace_id1, tablespace_id2);") } @Test fun matchesPartitionByHash_PBL_LVC() { assertThat(p).matches("create table table_id (id number) partition by list (column_id) (partition partition_id values (default) compress);") } @Test fun matchesPartitionByHash_PBLN_LVC() { assertThat(p).matches("create table table_id (id number) partition by list (column_id) (partition values (default) compress);") } @Test fun matchesPartitionByHash_PBLM_LVC() { assertThat(p).matches("create table table_id (id number) partition by list (column_id) (partition partition_id1 values (default) compress, partition partition_id2 values (null) nocompress);") } @Test fun matchesPartitionComposite_SBL_ST_LVC_PSC_IDENT() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by list (column_id) subpartition template (subpartition subpartition_id values (default) tablespace tablespace_id) (partition partition_id values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBL_ST_LVC_PSC() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by list (column_id) subpartition template (subpartition subpartition_id values (default) tablespace tablespace_id) (partition values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBL_ST_LVC() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by list (column_id) subpartition template (subpartition subpartition_id values (default)) (partition values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBL_ST_LVCM() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by list (column_id) subpartition template (subpartition subpartition_id1 values (default), subpartition subpartition_id2 values (null)) (partition values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBL_ST() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by list (column_id) subpartition template 1 (partition values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBL_ST_HSQ() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by list (column_id) subpartition template (subpartition subpartition_id) (partition values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBL_ST_LVC_PSC_MULT() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by list (column_id) subpartition template (subpartition subpartition_id values (default) tablespace tablespace_id) (partition partition_id1 values less than (maxvalue) compress, partition partition_id2 values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBH_SUB_STORE() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by hash (column_id) subpartitions 1 store in (tablespace_id) (partition values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBH_SUB_STOREM() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by hash (column_id) subpartitions 1 store in (tablespace_id1, tablespace_id2) (partition values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBH_ST() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by hash (column_id) subpartition template 1 (partition values less than (maxvalue) compress);") } @Test fun matchesPartitionComposite_SBH() { assertThat(p).matches("create table table_id (id number) partition by range (column_id) subpartition by hash (column_id) (partition values less than (maxvalue) compress);") } @Test fun matchesColumnDefaultOnNull() { assertThat(p).matches("create table table_id (id number, name varchar2(100) default on null 'Default String');") } @Test fun matchesColumnDefaultOnNullWithExpression() { assertThat(p).matches("create table table_id (id number, created_date date default on null sysdate);") } @Test fun matchesColumnDefault() { assertThat(p).matches("create table table_id (id number, name varchar2(100) default 'Default String');") } @Test fun matchesColumnDefaultOnNullForInsertOnly() { assertThat(p).matches("create table table_id (id number, name varchar2(100) default on null for insert only 'Default String');") } @Test fun matchesColumnDefaultOnNullForInsertOnlyWithExpression() { assertThat(p).matches("create table table_id (id number, created_date date default on null for insert only sysdate);") } @Test fun matchesColumnDefaultOnNullForInsertAndUpdate() { assertThat(p).matches("create table table_id (id number, name varchar2(100) default on null for insert and update 'Default String');") } @Test fun matchesColumnDefaultOnNullForInsertAndUpdateWithExpression() { assertThat(p).matches("create table table_id (id number, created_date date default on null for insert and update sysdate);") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/DdlCommentTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class DdlCommentTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.DDL_COMMENT) } @Test fun matchesCommentOnTableWithSemicolon() { assertThat(p).matches("comment on table tab is 'test';") } @Test fun matchesCommentOnTable() { assertThat(p).matches("comment on table tab is 'test'") } @Test fun matchesCommentOnTableWithSchema() { assertThat(p).matches("comment on table sch.tab is 'test'") } @Test fun matchesCommentOnColumn() { assertThat(p).matches("comment on column tab.col is 'test'") } @Test fun matchesCommentOnColumnWithSchema() { assertThat(p).matches("comment on column sch.tab.col is 'test'") } @Test fun matchesCommentOnOperator() { assertThat(p).matches("comment on operator foo is 'test'") } @Test fun matchesCommentOnOperatorWithSchema() { assertThat(p).matches("comment on operator sch.foo is 'test'") } @Test fun matchesCommentOnIndextype() { assertThat(p).matches("comment on indextype foo is 'test'") } @Test fun matchesCommentOnIndextypeWithSchema() { assertThat(p).matches("comment on indextype sch.foo is 'test'") } @Test fun matchesCommentOnMaterializedView() { assertThat(p).matches("comment on materialized view foo is 'test'") } @Test fun matchesCommentOnMaterializedViewWithSchema() { assertThat(p).matches("comment on materialized view sch.foo is 'test'") } @Test fun matchesCommentOnMiningModelView() { assertThat(p).matches("comment on materialized view foo is 'test'") } @Test fun matchesCommentOnMiningModelWithSchema() { assertThat(p).matches("comment on materialized view sch.foo is 'test'") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/DropCommandTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class DropCommandTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.DROP_COMMAND) } @Test fun matchesDropTable() { assertThat(p).matches("drop table x;") assertThat(p).matches("drop table x") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/DropDirectoryTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class DropDirectoryTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.DROP_DIRECTORY) } @Test fun matchesSimpleDropDirectory() { assertThat(p).matches("drop directory foo;") } @Test fun matchesDropDirectoryIfExists() { assertThat(p).matches("drop directory if exists foo;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/InlineConstraintTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class InlineConstraintTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.INLINE_CONSTRAINT) } @Test fun matchesNotNull() { assertThat(p).matches("not null") } @Test fun matchesNull() { assertThat(p).matches("null") } @Test fun matchesUnique() { assertThat(p).matches("unique") } @Test fun matchesPrimaryKey() { assertThat(p).matches("primary key") } @Test fun matchesReferences() { assertThat(p).matches("references tab (col)") } @Test fun matchesReferencesWithSchema() { assertThat(p).matches("references sch.tab (col)") } @Test fun matchesReferencesWithMoreColumns() { assertThat(p).matches("references tab (col, col2, col3)") } @Test fun matchesReferencesOnDeleteCascade() { assertThat(p).matches("references tab (col) on delete cascade") } @Test fun matchesReferencesOnDeleteSetNull() { assertThat(p).matches("references tab (col) on delete set null") } @Test fun matchesCheck() { assertThat(p).matches("check (x > 1)") assertThat(p).matches("check (x > 1) disable precheck") assertThat(p).matches("check (x > 1) precheck") } @Test fun matchesConstraintWithName() { assertThat(p).matches("constraint pk primary key") assertThat(p).matches("constraints pk primary key") } @Test fun matchesUniqueWithMultipleStates() { assertThat(p).matches("unique initially deferred") assertThat(p).matches("unique initially immediate") assertThat(p).matches("unique initially deferred deferrable") assertThat(p).matches("unique initially deferred not deferrable") assertThat(p).matches("unique deferrable") assertThat(p).matches("unique not deferrable") assertThat(p).matches("unique deferrable initially deferred") assertThat(p).matches("unique not deferrable initially deferred") assertThat(p).matches("unique rely") assertThat(p).matches("unique norely") assertThat(p).matches("unique enable") assertThat(p).matches("unique disable") assertThat(p).matches("unique validate") assertThat(p).matches("unique novalidate") assertThat(p).matches("unique exceptions into sch.tab") assertThat(p).matches("unique not deferrable initially deferred rely disable validate exceptions into sch.tab") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/OutOfLineConstraintTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class OutOfLineConstraintTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.OUT_OF_LINE_CONSTRAINT) } @Test fun matchesUnique() { assertThat(p).matches("unique (foo)") } @Test fun matchesUniqueWithMoreColumns() { assertThat(p).matches("unique (foo, bar, baz)") } @Test fun matchesPrimaryKey() { assertThat(p).matches("primary key (foo)") } @Test fun matchesPrimaryKeyWithMoreColumns() { assertThat(p).matches("primary key (foo, bar, baz)") } @Test fun matchesForeignKey() { assertThat(p).matches("foreign key (col) references tab (col)") } @Test fun matchesReferencesWithMoreColumns() { assertThat(p).matches("foreign key (col, col2, col3) references tab (col, col2, col3)") } @Test fun matchesCheck() { assertThat(p).matches("check (x > 1)") assertThat(p).matches("check (x > 1) disable precheck") assertThat(p).matches("check (x > 1) precheck") } @Test fun matchesConstraintWithName() { assertThat(p).matches("constraint pk primary key (foo)") assertThat(p).matches("constraints pk primary key (foo)") } @Test fun matchesUniqueWithMultipleStates() { assertThat(p).matches("unique (foo) initially deferred") assertThat(p).matches("unique (foo) initially immediate") assertThat(p).matches("unique (foo) initially deferred deferrable") assertThat(p).matches("unique (foo) initially deferred not deferrable") assertThat(p).matches("unique (foo) deferrable") assertThat(p).matches("unique (foo) not deferrable") assertThat(p).matches("unique (foo) deferrable initially deferred") assertThat(p).matches("unique (foo) not deferrable initially deferred") assertThat(p).matches("unique (foo) rely") assertThat(p).matches("unique (foo) norely") assertThat(p).matches("unique (foo) enable") assertThat(p).matches("unique (foo) disable") assertThat(p).matches("unique (foo) validate") assertThat(p).matches("unique (foo) novalidate") assertThat(p).matches("unique (foo) exceptions into sch.tab") assertThat(p).matches("unique (foo) not deferrable initially deferred rely disable validate exceptions into sch.tab") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/TableColumnDefinitionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class TableColumnDefinitionTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.TABLE_COLUMN_DEFINITION) } @Test fun matchesSimpleDefinition() { assertThat(p).matches("id number") } @Test fun matchesSort() { assertThat(p).matches("id number sort") } @Test fun matcheseDefault() { assertThat(p).matches("id number default 1") } @Test fun matchesSimpleEncrypt() { assertThat(p).matches("id number encrypt") } @Test fun matchesInlineConstraint() { assertThat(p).matches("id number constraint pktab primary key") } @Test fun matchesMultipleConstraints() { assertThat(p).matches("id number constraint pktab primary key check (id > 0)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/ddl/TruncateTableTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.ddl import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DdlGrammar import com.felipebz.zpa.api.RuleTest class TruncateTableTest : RuleTest() { @BeforeEach fun init() { setRootRule(DdlGrammar.TRUNCATE_TABLE) } @Test fun matchesSimpleTruncate() { assertThat(p).matches("truncate table foo;") } @Test fun matchesTruncatePreserveMaterializedViewLog() { assertThat(p).matches("truncate table foo preserve materialized view log;") } @Test fun matchesTruncatePurgeMaterializedViewLog() { assertThat(p).matches("truncate table foo purge materialized view log;") } @Test fun matchesTruncateDropStorage() { assertThat(p).matches("truncate table foo drop storage;") assertThat(p).matches("truncate table foo drop all storage;") } @Test fun matchesTruncateReuseStorage() { assertThat(p).matches("truncate table foo reuse storage;") } @Test fun matchesTruncateCascade() { assertThat(p).matches("truncate table foo cascade;") } @Test fun matchesLongTruncate() { assertThat(p).matches("truncate table sch.foo purge materialized view log drop all storage cascade;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/CallSpecificationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CallSpecificationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.CALL_SPECIFICATION) } @Test fun matchesJavaCallSpec() { assertThat(p).matches("language java name 'foo';") } @Test fun matchesLanguageCNameLibrary() { assertThat(p).matches("language c name \"foo\" library bar;") } @Test fun matchesLanguageCLibraryName() { assertThat(p).matches("language c library bar name \"foo\";") } @Test fun matchesExternal() { assertThat(p).matches("external name \"foo\" library bar;") } @Test fun matchesAgentIn() { assertThat(p).matches("language c library bar name \"foo\" agent in (agent);") } @Test fun matchesAgentInMultiple() { assertThat(p).matches("language c library bar name \"foo\" agent in (agent, agent2);") } @Test fun matchesWithContext() { assertThat(p).matches("language c library bar name \"foo\" with context;") } @Test fun matchesParameterContext() { assertThat(p).matches("language c library bar name \"foo\" parameters (context);") } @Test fun matchesParameterSelf() { assertThat(p).matches("language c library bar name \"foo\" parameters (self);") assertThat(p).matches("language c library bar name \"foo\" parameters (self tdo);") assertThat(p).matches("language c library bar name \"foo\" parameters (self indicator);") assertThat(p).matches("language c library bar name \"foo\" parameters (self indicator struct);") assertThat(p).matches("language c library bar name \"foo\" parameters (self indicator tdo);") assertThat(p).matches("language c library bar name \"foo\" parameters (self length);") assertThat(p).matches("language c library bar name \"foo\" parameters (self duration);") assertThat(p).matches("language c library bar name \"foo\" parameters (self maxlen);") assertThat(p).matches("language c library bar name \"foo\" parameters (self charsetid);") assertThat(p).matches("language c library bar name \"foo\" parameters (self charsetform);") } @Test fun matchesParameterSimple() { assertThat(p).matches("language c library bar name \"foo\" parameters (x int);") } @Test fun matchesMultipleParameters() { assertThat(p).matches("language c library bar name \"foo\" parameters (x int, y int);") } @Test fun matchesParameterReturn() { assertThat(p).matches("language c library bar name \"foo\" parameters (return int);") } @Test fun matchesParameterWithProperty() { assertThat(p).matches("language c library bar name \"foo\" parameters (x length int);") } @Test fun matchesParameterByReference() { assertThat(p).matches("language c library bar name \"foo\" parameters (x by reference int);") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/CursorDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CursorDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.CURSOR_DECLARATION) } @Test fun matchesSimpleCursor() { assertThat(p).matches("cursor cur is select 1 from dual;") } @Test fun matchesCursorWithParameter() { assertThat(p).matches("cursor cur(x number) is select 1 from dual;") } @Test fun matchesCursorWithMultipleParameters() { assertThat(p).matches("cursor cur(x number, y number) is select 1 from dual;") } @Test fun matchesCursorWithExplicitInParameter() { assertThat(p).matches("cursor cur(x in number) is select 1 from dual;") } @Test fun matchesCursorWithDefaultParameter() { assertThat(p).matches("cursor cur(x number default 1) is select 1 from dual;") } @Test fun matchesCursorWithDefaultParameterAlternative() { assertThat(p).matches("cursor cur(x number := 1) is select 1 from dual;") } @Test fun matchesCursorWithReturnType() { assertThat(p).matches("cursor cur return my_type is select 1 from dual;") } @Test fun matchesCursorSpecification() { assertThat(p).matches("cursor cur return my_type;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/CustomSubtypeTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CustomSubtypeTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.CUSTOM_SUBTYPE) } @Test fun matchesSimpleSubtype() { assertThat(p).matches("subtype sub is char;") } @Test fun matchesSubtypeWithScale() { assertThat(p).matches("subtype sub is number(5);") } @Test fun matchesSubtypeWithScaleAndPrecision() { assertThat(p).matches("subtype sub is number(5,1);") } @Test fun matchesSubtypeWithNotNullConstraint() { assertThat(p).matches("subtype sub is number not null;") } @Test fun matchesSubtypeWithRange() { assertThat(p).matches("subtype sub is number range 1..2;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/FunctionDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class FunctionDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.FUNCTION_DECLARATION) } @Test fun matchesSimpleFunction() { assertThat(p).matches("" + "function test return number is\n" + "begin\n" + "return 0;\n" + "end;") } @Test fun matchesSimpleFunctionAlternative() { assertThat(p).matches("" + "function test return number as\n" + "begin\n" + "return 0;\n" + "end;") } @Test fun matchesFunctionWithParameter() { assertThat(p).matches("" + "function test(parameter in number) return number is\n" + "begin\n" + "return 0;\n" + "end;") } @Test fun matchesFunctionWithMultipleParameters() { assertThat(p).matches("" + "function test(parameter1 in number, parameter2 in number) return number is\n" + "begin\n" + "return 0;\n" + "end;") } @Test fun matchesFunctionWithVariableDeclaration() { assertThat(p).matches("" + "function test return number is\n" + "var number;" + "begin\n" + "return 0;\n" + "end;") } @Test fun matchesFunctionWithMultipleVariableDeclaration() { assertThat(p).matches("" + "function test return number is\n" + "var number;" + "var2 number;" + "begin\n" + "return 0;\n" + "end;") } @Test fun matchesDeterministicFunction() { assertThat(p).matches("" + "function test return number deterministic is\n" + "begin\n" + "return 0;\n" + "end;") } @Test fun matchesPipelinedFunction() { assertThat(p).matches("" + "function test return number pipelined is\n" + "begin\n" + "return 0;\n" + "end;") } @Test fun matchesParallelEnableFunction() { assertThat(p).matches("" + "function test return number parallel_enable is\n" + "begin\n" + "return 0;\n" + "end;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/ParameterDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ParameterDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.PARAMETER_DECLARATION) } @Test fun matchesSimpleParameter() { assertThat(p).matches("parameter number") } @Test fun matchesExplicitInParameter() { assertThat(p).matches("parameter in number") } @Test fun matchesExplicitInParameterWithDefaultValue() { assertThat(p).matches("parameter in number := 1") } @Test fun matchesExplicitInParameterWithDefaultValueAlternative() { assertThat(p).matches("parameter in number default 1") } @Test fun matchesOutParameter() { assertThat(p).matches("parameter out number") } @Test fun matchesInOutParameter() { assertThat(p).matches("parameter in out number") } @Test fun matchesOutParameterWithNocopy() { assertThat(p).matches("parameter out nocopy number") } @Test fun matchesInOutParameterWithNocopy() { assertThat(p).matches("parameter in out nocopy number") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/PragmaDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class PragmaDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.PRAGMA_DECLARATION) } @Test fun matchesAutonomousTransaction() { assertThat(p).matches("pragma autonomous_transaction;") } @Test fun matchesExceptionInit() { assertThat(p).matches("pragma exception_init(1, 1);") } @Test fun matchesSeriallyReusable() { assertThat(p).matches("pragma serially_reusable;") } @Test fun matchesInterface() { assertThat(p).matches("pragma interface(c, func, 1);") } @Test fun matchesRestrictReferencesPragma() { assertThat(p).matches("pragma restrict_references(foo, rnds, wnds);") } @Test fun matchesUdfPragma() { assertThat(p).matches("pragma udf;") } @Test fun matchesDeprecatePragma() { assertThat(p).matches("pragma deprecate(object);") assertThat(p).matches("pragma deprecate(object, 'object is deprecated');") } @Test fun matchesCoveragePragma() { assertThat(p).matches("pragma coverage('NOT_FEASIBLE_START');") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/ProcedureDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ProcedureDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.PROCEDURE_DECLARATION) } @Test fun matchesSimpleProcedure() { assertThat(p).matches("" + "procedure test is\n" + "begin\n" + "null;\n" + "end;") } @Test fun matchesSimpleProcedureAlternative() { assertThat(p).matches("" + "procedure test as\n" + "begin\n" + "null;\n" + "end;") } @Test fun matchesProcedureWithParameter() { assertThat(p).matches("" + "procedure test(parameter in number) is\n" + "begin\n" + "null;\n" + "end;") } @Test fun matchesProcedureWithMultipleParameters() { assertThat(p).matches("" + "procedure test(parameter1 in number, parameter2 in number) is\n" + "begin\n" + "null;\n" + "end;") } @Test fun matchesProcedureWithVariableDeclaration() { assertThat(p).matches("" + "procedure test is\n" + "var number;" + "begin\n" + "null;\n" + "end;") } @Test fun matchesProcedureWithMultipleVariableDeclaration() { assertThat(p).matches("" + "procedure test is\n" + "var number;" + "var2 number;" + "begin\n" + "null;\n" + "end;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/RecordDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class RecordDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.RECORD_DECLARATION) } @Test fun matchesSimpleRecord() { assertThat(p).matches("type foo is record(x number);") } @Test fun matchesRecordWithMultipleFields() { assertThat(p).matches("type foo is record(x number, y number);") } @Test fun matchesRecordWithDefaultField() { assertThat(p).matches("type foo is record(x number default 1);") } @Test fun matchesRecordWithDefaultFieldAlternative() { assertThat(p).matches("type foo is record(x number := 1);") } @Test fun matchesRecordWithNotNullField() { assertThat(p).matches("type foo is record(x number not null default 1);") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/RefCursorDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class RefCursorDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.REF_CURSOR_DECLARATION) } @Test fun matchesSimpleRefCursor() { assertThat(p).matches("type myref is ref cursor;") } @Test fun matchesSimpleRefCursorWithReturn() { assertThat(p).matches("type myref is ref cursor return number;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/TableOfDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class TableOfDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.TABLE_OF_DECLARATION) } @Test fun matchesSimpleDeclaration() { assertThat(p).matches("type foo is table of bar;") } @Test fun matchesSimpleDeclarationNotNull() { assertThat(p).matches("type foo is table of bar not null;") } @Test fun matchesIndexedDeclaration() { assertThat(p).matches("type foo is table of bar index by binary_integer;") } @Test fun matchesDeclarationWithBuiltinDatatypes() { assertThat(p).matches("type foo is table of varchar2(10) index by number(5);") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/VariableDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class VariableDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.VARIABLE_DECLARATION) } @Test fun matchesSimpleDeclaration() { assertThat(p).matches("var number;") } @Test fun matchesDeclarationWithPrecision() { assertThat(p).matches("var number(1);") } @Test fun matchesDeclarationWithPrecisionAndScale() { assertThat(p).matches("var number(1,1);") } @Test fun matchesDeclarationWithInitialization() { assertThat(p).matches("var number := 1;") assertThat(p).matches("var varchar2(1) := 'a';") assertThat(p).matches("var boolean := true;") assertThat(p).matches("var boolean := var2;") } @Test fun matchesDeclarationWithDefaultValue() { assertThat(p).matches("var number default 1;") assertThat(p).matches("var varchar2(1) default 'a';") assertThat(p).matches("var boolean default true;") assertThat(p).matches("var boolean default var2;") } @Test fun matchesDeclarationWithNotNullConstraint() { assertThat(p).matches("var number not null := 1;") assertThat(p).matches("var number not null default 1;") } @Test fun matchesDeclarationExplicitNullable() { assertThat(p).matches("var number null := 1;") assertThat(p).matches("var number null default 1;") } @Test fun matchesTypeAnchoredDeclaration() { assertThat(p).matches("var custom%type;") } @Test fun matchesObjectDeclaration() { assertThat(p).matches("var custom;") } @Test fun matchesObjectDeclarationWithPackage() { assertThat(p).matches("var pack.custom;") } @Test fun matchesObjectDeclarationWithPackageAndSchema() { assertThat(p).matches("var sch.pack.custom;") } @Test fun matchesTableAnchoredDeclaration() { assertThat(p).matches("var tab%rowtype;") } @Test fun matchesTableColumnAnchoredDeclaration() { assertThat(p).matches("var tab.column%type;") } @Test fun matchesRefObjectDeclaration() { assertThat(p).matches("var ref custom;") } @Test fun matchesSimpleConstant() { assertThat(p).matches("var constant number := 1;") assertThat(p).matches("var constant number default 1;") } @Test fun matchesSimpleConstantWithConstraints() { assertThat(p).matches("var constant number not null := 1;") assertThat(p).matches("var constant number not null default 1;") } @Test fun matchesRemoteTableColumnAnchoredDeclaration() { assertThat(p).matches("var tab.col@link%type;") assertThat(p).matches("var tab.col@link.domain.com%type;") } @Test fun matchesExceptionDeclaration() { assertThat(p).matches("var exception;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/declarations/VarrayDeclarationTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.declarations import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class VarrayDeclarationTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.VARRAY_DECLARATION) } @Test fun matchesSimpleVarray() { assertThat(p).matches("type foo is varray(5) of number(2);") } @Test fun matchesSimpleVarrayNotNull() { assertThat(p).matches("type foo is varray(5) of number(2) not null;") } @Test fun matchesVaryingArray() { assertThat(p).matches("type foo is varying array(5) of number(2);") } @Test fun matchesArray() { assertThat(p).matches("type foo is array(5) of number(2);") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/AtTimeZoneExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class AtTimeZoneExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleAtTimeZone() { assertThat(p).matches("foo at time zone 'gmt'") } @Test fun matchesSimpleAtLocal() { assertThat(p).matches("foo at local") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/BetweenExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class BetweenExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesBetween() { assertThat(p).matches("var between 1 and 2") } @Test fun matchesNotBetween() { assertThat(p).matches("var not between 1 and 2") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/BooleanExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class BooleanExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleAndExpression() { assertThat(p).matches("true and true") } @Test fun matchesSimpleOrExpression() { assertThat(p).matches("true or true") } @Test fun matchesMultipleExpression() { assertThat(p).matches("true and true or true") } @Test fun matchesMultipleExpressionWithNotOperator() { assertThat(p).matches("true and not false") } @Test fun matchesExpressionWithVariables() { assertThat(p).matches("var and var") } @Test fun matchesExpressionWithFunctionCall() { assertThat(p).matches("func(var) and func(var)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/CaseExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CaseExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.CASE_EXPRESSION) } @Test fun matchesSimpleSearchedCase() { assertThat(p).matches("case when x = 1 then 1 end") } @Test fun matchesSimpleCase() { assertThat(p).matches("case x when 1 then 1 end") } @Test fun matchesCaseWithMultipleWhen() { assertThat(p).matches("case x when 1 then 1 when 2 then 2 end") } @Test fun matchesCaseWithElse() { assertThat(p).matches("case x when 1 then 1 else 2 end") } @Test fun matchesCaseWithMemberIdentifier() { assertThat(p).matches("case foo.bar when 1 then 1 end") } @Test fun matchesCaseWithSelectorExpression() { assertThat(p).matches("case foo + bar when 1 then 1 end") } @Test fun matchesBooleanSearchedCase() { assertThat(p).matches("case when foo is not null and bar is null then 1 end") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/CastExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CastExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleCast() { assertThat(p).matches("cast(foo as number)") } @Test fun matchesCastWithDefaultClause() { assertThat(p).matches("cast(foo as number default 0 on conversion error)") } @Test fun matchesCastWithMultipleArguments() { assertThat(p).matches("cast('01/01/2000' as date, 'dd/mm/yyyy', 'NLS_DATE_LANGUAGE = American')") } @Test fun matchesCastMultiset() { assertThat(p).matches("cast(multiset (select 1 from dual) as number)") } @Test fun matchesComplexCast() { assertThat(p).matches("cast((cast(localtimestamp as domain timestamp with time zone validate) at time zone 'gmt') at time zone custom_zone as timestamp default 0 on conversion error)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/CharacterExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CharacterExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleConcatenation() { assertThat(p).matches("'a'||'b'") } @Test fun matchesMultipleConcatenation() { assertThat(p).matches("'a'||'b'||'c'") } @Test fun matchesVariableConcatenation() { assertThat(p).matches("var||var") } @Test fun matchesFunctionCallConcatenation() { assertThat(p).matches("func(var)||func(var)") } @Test fun matchesHostVariableConcatenation() { assertThat(p).matches(":var||:var") } @Test fun matchesIndicatorVariableConcatenation() { assertThat(p).matches(":var:indicator||:var:indicator") } @Test fun matchesReplace() { assertThat(p).matches("replace(var, 'x', 'y')") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/CollectExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CollectExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleCollect() { assertThat(p).matches("collect(foo)") } @Test fun matchesCollectWithDistinct() { assertThat(p).matches("collect(distinct foo)") } @Test fun matchesCollectWithUnique() { assertThat(p).matches("collect(unique foo)") } @Test fun matchesCollectWithDistinctAndOrderBy() { assertThat(p).matches("collect(distinct foo order by bar)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/CursorExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CursorExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesCursorExpression() { assertThat(p).matches("cursor(select 1 from dual)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/DateExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class DateExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesDateLiteralAddition() { assertThat(p).matches("DATE '2015-01-01' + 1") } @Test fun matchesDateLiteralSubtraction() { assertThat(p).matches("DATE '2015-01-01' - 1") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ExtractDatetimeExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ExtractDatetimeExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesExtractDay() { assertThat(p).matches("extract(day from foo)") } @Test fun matchesExtractMonth() { assertThat(p).matches("extract(month from foo)") } @Test fun matchesExtractYear() { assertThat(p).matches("extract(year from foo)") } @Test fun matchesExtractYour() { assertThat(p).matches("extract(hour from foo)") } @Test fun matchesExtractMinute() { assertThat(p).matches("extract(minute from foo)") } @Test fun matchesExtractSecond() { assertThat(p).matches("extract(second from foo)") } @Test fun matchesExtractTimezoneHour() { assertThat(p).matches("extract(timezone_hour from foo)") } @Test fun matchesExtractTimezoneMinute() { assertThat(p).matches("extract(timezone_minute from foo)") } @Test fun matchesExtractTimezoneRegion() { assertThat(p).matches("extract(timezone_region from foo)") } @Test fun matchesExtractTimezoneAbbreviation() { assertThat(p).matches("extract(timezone_abbr from foo)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonArrayAggTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonArrayAggTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesJsonArrayAgg() { assertThat(p).matches("json_arrayagg(1)") } @Test fun matchesJsonArrayAggWithFormat() { assertThat(p).matches("json_arrayagg('{}' format json)") } @Test fun matchesJsonArrayAggWithOrderBy() { assertThat(p).matches("json_arrayagg(foo order by col)") } @Test fun matchesJsonArrayAggWithNullOnNull() { assertThat(p).matches("json_arrayagg(foo null on null)") } @Test fun matchesJsonArrayAggWithAbsentOnNull() { assertThat(p).matches("json_arrayagg(foo absent on null)") } @Test fun matchesJsonArrayAggWithReturning() { assertThat(p).matches("json_arrayagg(foo returning json)") } @Test fun matchesJsonArrayAggWithStrict() { assertThat(p).matches("json_arrayagg(foo strict)") } @Test fun matchesLongJsonArrayAgg() { assertThat(p).matches("json_arrayagg(foo order by col null on null returning json strict)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonArrayTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonArrayTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesJsonArrayWithOneElement() { assertThat(p).matches("json_array(1)") } @Test fun matchesJsonArrayWithManyElement() { assertThat(p).matches("json_array(1, 'test', sysdate)") } @Test fun matchesJsonArrayWithFormat() { assertThat(p).matches("json_array('{}' format json)") } @Test fun matchesJsonArrayWithNullOnNull() { assertThat(p).matches("json_array(foo null on null)") } @Test fun matchesJsonArrayWithAbsentOnNull() { assertThat(p).matches("json_array(foo absent on null)") } @Test fun matchesJsonArrayWithReturning() { assertThat(p).matches("json_array(foo returning json)") } @Test fun matchesJsonArrayWithStrict() { assertThat(p).matches("json_array(foo strict)") } @Test fun matchesLongJsonArray() { assertThat(p).matches("json_array(json_array(1,2,3), 100, 'test', null null on null returning json strict)") } @Test fun matchesJsonArrayFromQuery() { assertThat(p).matches("json_array(select * from tab null on null returning json strict)") } @Test fun matchesAlternativeSyntaxOfJsonArray() { assertThat(p).matches("json[1] ") assertThat(p).matches("json[json[1,2,3], 100, 'test', null null on null returning json strict]") assertThat(p).matches("json[select * from tab]") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonConstructorTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonConstructorTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matches() { assertThat(p).matches("json('{}')") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonDataguideExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonDataguideExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesJsonDataguide() { assertThat(p).matches("json_dataguide(expr)") assertThat(p).matches("json_dataguide(expr, format)") assertThat(p).matches("json_dataguide(expr, format, flag)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonMergepatchExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonMergepatchExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleJsonMergepatch() { assertThat(p).matches("json_mergepatch(target, patch)") } @Test fun matchesJsonMergepatchWithReturning() { assertThat(p).matches("json_mergepatch(target, patch returning clob)") } @Test fun matchesJsonMergepatchWithNullOnError() { assertThat(p).matches("json_mergepatch(target, patch null on error)") } @Test fun matchesLongJsonMergepatch() { assertThat(p).matches("""json_mergepatch(target, patch returning varchar2(200) pretty ascii truncate error on error)""") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonObjectAggExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonObjectAggExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleJsonObjectAgg() { assertThat(p).matches("json_objectagg(k value 'v')") } @Test fun matchesJsonObjectAggWithExplicitKey() { assertThat(p).matches("json_objectagg(key k value 'v')") } @Test fun matchesJsonObjectAggWithFormatJson() { assertThat(p).matches("json_objectagg('k' value '{}' format json)") } @Test fun matchesJsonObjectAggWithReturning() { assertThat(p).matches("json_objectagg(k value 'v' returning clob)") } @Test fun matchesJsonObjectAggWithAbsentOnNull() { assertThat(p).matches("json_objectagg('v' value val absent on null)") } @Test fun matchesLongJsonObjectAgg() { assertThat(p).matches("""json_objectagg('a' value '{}' format json null on null returning varchar2(200) strict with unique keys)""") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonObjectExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonObjectExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleJsonObject() { assertThat(p).matches("json_object(foo)") } @Test fun matchesJsonObjectWithKey() { assertThat(p).matches("json_object(k value 'v')") } @Test fun matchesJsonObjectWithExplicitKey() { assertThat(p).matches("json_object(key k value 'v')") } @Test fun matchesJsonObjectWithStringKeys() { assertThat(p).matches("json_object('k': 'v')") } @Test fun matchesJsonObjectWithFormatJson() { assertThat(p).matches("json_object('k': '{}' format json)") } @Test fun matchesJsonObjectWithReturning() { assertThat(p).matches("json_object(foo returning clob)") } @Test fun matchesJsonObjectWithAbsentOnNull() { assertThat(p).matches("json_object(* absent on null)") } @Test fun matchesLongJsonObject() { assertThat(p).matches("""json_object('k' value 'v', 'a': '{}' format json null on null returning varchar2(200) strict with unique keys)""") } @Test fun matchesAlternativeSyntaxOfJsonObject() { assertThat(p).matches("json { foo }") assertThat(p).matches("json { 'k': 'v' }") assertThat(p).matches( """json { 'k' value 'v', 'a': '{}' format json null on null returning varchar2(200) strict with unique keys }""" ) } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonQueryExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonQueryExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleJsonQuery() { assertThat(p).matches("json_query(foo, '$')") } @Test fun matchesJsonQuery() { assertThat(p).matches("json_query(foo format json, '$')") } @Test fun matchesJsonQueryWithType() { assertThat(p).matches("json_query(foo, '$' type strict)") } @Test fun matchesJsonQueryWithPassing() { assertThat(p).matches("json_query(foo, '$' passing 'x' as bar)") } @Test fun matchesJsonQueryWithNullOnEmpty() { assertThat(p).matches("json_query(foo, '$' null on empty)") } @Test fun matchesJsonQueryWithNullOnError() { assertThat(p).matches("json_query(foo, '$' null on error)") } @Test fun matchesJsonQueryWithNullOnMismatch() { assertThat(p).matches("json_query(foo, '$' null on mismatch)") } @Test fun matchesJsonQueryWithReturning() { assertThat(p).matches("json_query(foo, '$' returning json)") } @Test fun matchesJsonQueryWithPassingMoreValues() { assertThat(p).matches("json_query(foo, '$' passing 1 as bar, 2 as bar2 returning json)") } @Test fun matchesJsonQueryWithWrapper() { assertThat(p).matches("json_query(foo, '$' with array wrapper)") } @Test fun matchesJsonQueryWithQuotesClause() { assertThat(p).matches("json_query(foo, '$' keep quotes)") } @Test fun matchesLongJsonQuery() { assertThat(p).matches("""json_query(foo, '$' passing 1 as bar, 2 as baz returning json allow scalars pretty ascii with conditional array wrapper keep quotes on scalar string empty object on error empty array on empty error on mismatch type lax)""") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonScalarTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonScalarTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesJsonScalar() { assertThat(p).matches("json_scalar(val)") } @Test fun matchesJsonScalarJsonNullOnNull() { assertThat(p).matches("json_scalar(val json null on null)") } @Test fun matchesJsonScalarSqlNullOnNull() { assertThat(p).matches("json_scalar(val sql null on null)") } @Test fun matchesJsonScalarEmptyStringOnNull() { assertThat(p).matches("json_scalar(val empty string on null)") } @Test fun matchesJsonScalarJsonNullOnError() { assertThat(p).matches("json_scalar(val null on error)") } @Test fun matchesLongJsonScalar() { assertThat(p).matches("json_scalar(val sql null on null error on error)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonSerializeTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonSerializeTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesJsonSerialize() { assertThat(p).matches("json_serialize(val)") } @Test fun matchesJsonSerializeWithReturning() { assertThat(p).matches("json_serialize(val returning clob)") } @Test fun matchesJsonSerializeSqlNullOnError() { assertThat(p).matches("json_serialize(val null on error)") } @Test fun matchesJsonSerializeSqlErrorOnError() { assertThat(p).matches("json_serialize(val error on error)") } @Test fun matchesJsonSerializeSqlEmptyArrayOnError() { assertThat(p).matches("json_serialize(val empty array on error)") } @Test fun matchesJsonSerializeSqlEmptyObjectOnError() { assertThat(p).matches("json_serialize(val empty object on error)") } @Test fun matchesLongJsonSerialize() { assertThat(p).matches("json_serialize(val returning blob pretty ascii ordered truncate empty object on error)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonTableTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonTableTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesJsonWithValueColumn() { assertThat(p).matches("json_table(doc, '$' columns (c1 path '$.c1'))") } @Test fun matchesJsonWithExistsColumn() { assertThat(p).matches("json_table(doc, '$' columns (c1 exists path '$.c1'))") } @Test fun matchesJsonWithQueryColumn() { assertThat(p).matches("json_table(doc, '$' columns (c1 format json path '$.c1'))") } @Test fun matchesJsonWithNestedColumn() { assertThat(p).matches("json_table(doc, '$' columns (nested '$.c1' columns (c2 path '$.c2')))") } @Test fun matchesJsonWithOrdinalityColumn() { assertThat(p).matches("json_table(doc, '$' columns (c1 for ordinality))") } @Test fun matchesJsonWithColumnWithoutParenthesis() { assertThat(p).matches("json_table(doc, '$' columns c1 for ordinality)") } @Test fun matchesLongJsonTable() { assertThat(p).matches(""" json_table(doc, '$' error on error type strict error on empty columns ( c1 clob truncate path '$.c1' error on error error on empty error on mismatch(missing data), c1 varchar2(10) format json allow scalars without wrapper path '$.c1' error on error, c1 number exists path '$.c1' error on error error on empty, nested path subDoc[*] columns (c2 path '$.c2'), c1 for ordinality )) """) } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonTransformExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonTransformExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesJsonTransformAppend() { assertThat(p).matches("json_transform(foo, append 'a' = 'b')") } @Test fun matchesJsonTransformCase() { assertThat(p).matches("json_transform(foo, case when 'x' then (append 'a' = 'b') end)") } @Test fun matchesJsonTransformCopy() { assertThat(p).matches("json_transform(foo, copy 'a' = 'b')") } @Test fun matchesJsonTransformInsert() { assertThat(p).matches("json_transform(foo, insert 'a' = 'b')") } @Test fun matchesJsonTransformIntersect() { assertThat(p).matches("json_transform(foo, intersect 'a' = 'b')") } @Test fun matchesJsonTransformKeep() { assertThat(p).matches("json_transform(foo, keep 'a')") } @Test fun matchesJsonTransformMerge() { assertThat(p).matches("json_transform(foo, merge 'a' = 'b')") } @Test fun matchesJsonTransformMinus() { assertThat(p).matches("json_transform(foo, minus 'a' = 'b')") } @Test fun matchesJsonTransformNested() { assertThat(p).matches("json_transform(foo, nested path 'x' (copy 'a' = 'b'))") } @Test fun matchesJsonTransformPrepend() { assertThat(p).matches("json_transform(foo, prepend 'a' = 'b')") } @Test fun matchesJsonTransformRemove() { assertThat(p).matches("json_transform(foo, remove 'a')") } @Test fun matchesJsonTransformRename() { assertThat(p).matches("json_transform(foo, rename 'a' with 'b')") } @Test fun matchesJsonTransformReplace() { assertThat(p).matches("json_transform(foo, replace 'a' = 'b')") } @Test fun matchesJsonTransformSet() { assertThat(p).matches("json_transform(foo, set 'a' = 'b')") } @Test fun matchesJsonTransformSort() { assertThat(p).matches("json_transform(foo, sort 'a')") } @Test fun matchesJsonTransformUnion() { assertThat(p).matches("json_transform(foo, union 'a' = 'b')") } @Test fun matchesLongJsonTransform() { assertThat(p).matches("""json_transform(foo, append 'a' = 'b' ignore on missing ignore on mismatch ignore on null ignore on empty, case when 'x' then ( append 'a' = 'b', append 'c' = 'd' ) else ( append 'e' = 'f', append 'g' = 'h' ) end, copy 'a' = 'b' ignore on missing ignore on null ignore on empty, insert 'a' = 'b' ignore on existing ignore on null ignore on empty ignore on error, intersect 'a' = 'b' ignore on missing ignore on null, keep 'a', 'b', 'c' ignore on missing, merge 'a' = 'b' ignore on missing ignore on mismatch ignore on null ignore on empty, minus 'a' = 'b' ignore on missing ignore on null, nested path 'x' ( copy 'a' = 'b', insert 'c' = 'd' ), prepend 'a' = 'b' ignore on missing ignore on mismatch ignore on null ignore on empty, remove 'a' ignore on missing, rename 'a' with 'b' ignore on missing, replace 'a' = 'b' ignore on missing ignore on null ignore on empty ignore on error, set 'a' = 'b' ignore on existing ignore on missing ignore on null ignore on empty ignore on error, sort 'a' reverse, sort 'a' remove nulls order by 'b' desc, 'c' asc, sort 'a' desc unique remove nulls ignore on missing ignore on mismatch ignore on empty ignore on error, union 'a' = 'b' ignore on missing ignore on null)""") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/JsonValueTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class JsonValueTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesJsonValue() { assertThat(p).matches("json_value(doc, '$')") } @Test fun matchesJsonValueFormatJson() { assertThat(p).matches("json_value('{}' format json, '$')") } @Test fun matchesJsonValueWithPassingClause() { assertThat(p).matches("json_value(doc, '$' passing 1 as x, 2 as y)") } @Test fun matchesJsonValueWithReturning() { assertThat(p).matches("json_value(doc, '$' returning clob)") } @Test fun matchesJsonValueWithReturningAscii() { assertThat(p).matches("json_value(doc, '$' returning clob ascii)") } @Test fun matchesLongJsonValue() { assertThat(p).matches(""" json_value(doc, '$' passing 'a' as a returning varchar2(10) truncate error on error error on empty error on mismatch (missing data) ignore on mismatch (extra data) type strict)""") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/LikeExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class LikeExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesLike() { assertThat(p).matches("var like 'test'") } @Test fun matchesNotLike() { assertThat(p).matches("var not like 'test'") } @Test fun matchesLikeWithEscape() { assertThat(p).matches("var like 'test|_foo' escape '|'") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ListAggExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ListAggExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleListAgg() { assertThat(p).matches("listagg(foo) within group (order by bar)") } @Test fun matchesListAggAll() { assertThat(p).matches("listagg(all foo) within group (order by bar)") } @Test fun matchesListAggDistinct() { assertThat(p).matches("listagg(distinct foo) within group (order by bar)") } @Test fun matchesListAggWithDelimiter() { assertThat(p).matches("listagg(foo, ',') within group (order by bar)") } @Test fun matchesListAggWithDelimiter2() { assertThat(p).matches("listagg(foo, chr(10)) within group (order by bar)") } @Test fun matchesListAggOverflowError() { assertThat(p).matches("listagg(foo on overflow error) within group (order by bar)") } @Test fun matchesListAggOverflowTruncate() { assertThat(p).matches("listagg(foo on overflow truncate) within group (order by bar)") } @Test fun matchesListAggOverflowTruncateWithIndicator() { assertThat(p).matches("listagg(foo on overflow truncate '...') within group (order by bar)") } @Test fun matchesListAggOverflowTruncateWithCount() { assertThat(p).matches("listagg(foo on overflow truncate '...' with count) within group (order by bar)") } @Test fun matchesListAggOverflowTruncateWithoutCount() { assertThat(p).matches("listagg(foo on overflow truncate '...' without count) within group (order by bar)") } @Test fun matchesListAggPartitionBy() { assertThat(p).matches("listagg(foo) within group (order by bar) over (partition by baz)") } @Test fun matchesLongListAgg() { assertThat(p).matches("listagg(foo, ',') within group (order by bar) over (partition by baz)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/MultisetExpressionsTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class MultisetExpressionsTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesIsASet() { assertThat(p).matches("foo is a set") } @Test fun matchesIsNotASet() { assertThat(p).matches("foo is not a set") } @Test fun matchesIsEmpty() { assertThat(p).matches("foo is not a set") } @Test fun matchesIsNotEmpty() { assertThat(p).matches("foo is not a set") } @Test fun matchesMemberExpression() { assertThat(p).matches("foo member bar") } @Test fun matchesMemberOfExpression() { assertThat(p).matches("foo member of bar") } @Test fun matchesNotMemberOfExpression() { assertThat(p).matches("foo not member of bar") } @Test fun matchesSimpleSubmultiset() { assertThat(p).matches("foo submultiset bar") } @Test fun matchesSubmultisetOf() { assertThat(p).matches("foo submultiset of bar") } @Test fun matchesNotSubmultiset() { assertThat(p).matches("foo not submultiset bar") } @Test fun matchesNotSubmultisetOf() { assertThat(p).matches("foo not submultiset of bar") } @Test fun matchesMultisetExcept() { assertThat(p).matches("foo multiset except bar") } @Test fun matchesMultisetExceptAll() { assertThat(p).matches("foo multiset except all bar") } @Test fun matchesMultisetExceptDistinct() { assertThat(p).matches("foo multiset except distinct bar") } @Test fun doesNotMatcheMultisetExceptAllDistinct() { assertThat(p).notMatches("foo multiset except all distinct") } @Test fun matchesMultisetIntersect() { assertThat(p).matches("foo multiset intersect bar") } @Test fun matchesMultisetIntersectWithFunctions() { assertThat(p).matches("foo(1,2,3) multiset intersect bar('a', 'b', 'c')") } @Test fun matchesMultisetUnion() { assertThat(p).matches("foo multiset union bar") } @Test fun matchesMultipleMultisetUnion() { assertThat(p).matches("a multiset union b multiset union c multiset union d") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/NewObjectExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class NewObjectExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleNewObject() { assertThat(p).matches("new foo.bar") } @Test fun matchesNewObjectWithEmptyParameterList() { assertThat(p).matches("new foo()") } @Test fun matchesNewObjectWithSimpleParameterList() { assertThat(p).matches("new foo(1, foo, 'bar', foo + bar)") } @Test fun matchesNewObjectWithNamedParameterList() { assertThat(p).matches("new foo(p1 => 1, p2 => foo, p3 => 'bar', p4 => foo + bar)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/NotExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class NotExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.NOT_EXPRESSION) } @Test fun matchesSimpleNotExpression() { assertThat(p).matches("not x") } @Test fun matchesNotExpression() { assertThat(p).matches("not x = a") } @Test fun matchesNotExpressionWithParenthesis() { assertThat(p).matches("not (x = a)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/NumericExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class NumericExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesNumericAddition() { assertThat(p).matches("1 + 1") assertThat(p).matches("1+1") } @Test fun matchesNumericSubtraction() { assertThat(p).matches("1 - 1") assertThat(p).matches("1-1") } @Test fun matchesNumericMultiplication() { assertThat(p).matches("1 * 1") } @Test fun matchesNumericDivision() { assertThat(p).matches("1 / 1") } @Test fun matchesNumericExponentiation() { assertThat(p).matches("1 ** 1") } @Test fun matchesModulo() { assertThat(p).matches("1 mod 1") } @Test fun matchesMathematicalOperationBetweenTwoQueries() { assertThat(p).matches("(select 1 from dual) + (select 1 from dual)") } @Test fun matchesMathematicalOperationBetweenTwoCaseExpressions() { assertThat(p).matches("(case when 1 = 1 then 1 end) + (case when 1 = 1 then 1 end)") } @Test fun matchesCursorRowcount() { assertThat(p).matches("cur%rowcount + 1") } @Test fun matchesHostCursorRowcount() { assertThat(p).matches(":cur%rowcount + 1") } @Test fun matchesSqlRowcount() { assertThat(p).matches("sql%rowcount + 1") } @Test fun matchesSqlBulkRowcount() { assertThat(p).matches("sql%bulk_rowcount(1) + 1") } @Test fun matchesHostVariableExpression() { assertThat(p).matches(":var + 1") } @Test fun matchesIndicatorVariableExpression() { assertThat(p).matches(":var:indicator + 1") } @Test fun matchesVariableExpression() { assertThat(p).matches("var + 1") } @Test fun matchesFunctionCallExpression() { assertThat(p).matches("func(var) + 1") } @Test fun matchesCollectionCount() { assertThat(p).matches("collection.count") } @Test fun matchesCollectionFirst() { assertThat(p).matches("collection.first + 1") } @Test fun matchesCollectionLast() { assertThat(p).matches("collection.last + 1") } @Test fun matchesCollectionLimit() { assertThat(p).matches("collection.limit + 1") } @Test fun matchesCollectionNext() { assertThat(p).matches("collection.next(1) + 1") } @Test fun matchesCollectionPrior() { assertThat(p).matches("collection.prior(1) + 1") } @Test fun notMatchesQueries() { assertThat(p).notMatches("1 + select 1 from dual") assertThat(p).notMatches("(select 1 from dual) / select 1 from dual") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/OtherExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class OtherExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesCollectionExists() { assertThat(p).matches("collection.exists(0)") } @Test fun matchesCursorMethods() { assertThat(p).matches("cur%found") assertThat(p).matches("cur%notfound") assertThat(p).matches("cur%isopen") } @Test fun matchesHostCursorMethods() { assertThat(p).matches(":cur%found") assertThat(p).matches(":cur%notfound") assertThat(p).matches(":cur%isopen") } @Test fun matchesSqlMethods() { assertThat(p).matches("sql%found") assertThat(p).matches("sql%notfound") assertThat(p).matches("sql%isopen") } @Test fun matchesIsNull() { assertThat(p).matches("var is null") } @Test fun matchesIsNotNull() { assertThat(p).matches("var is not null") } @Test fun matchesIsTrue() { assertThat(p).matches("var is true") } @Test fun matchesIsNotTrue() { assertThat(p).matches("var is not true") } @Test fun matchesIsFalse() { assertThat(p).matches("var is false") } @Test fun matchesIsNotFalse() { assertThat(p).matches("var is not false") } @Test fun matchesBasicIn() { assertThat(p).matches("var in (1)") } @Test fun matchesBasicInWithMultipleValues() { assertThat(p).matches("var in (1, 2, 3)") } @Test fun matchesExpressionWithInWithMultipleValues() { setRootRule(PlSqlGrammar.IN_EXPRESSION) assertThat(p).matches("v1||v2 in ('ab', 'bc', 'ac')") } @Test fun matchesBasicInWithoutParenthesis() { assertThat(p).matches("var in 1") } @Test fun matchesMultidimensionalCollection() { assertThat(p).matches("foo(1)(1)") } @Test fun InExpressionShouldNotMatchAdditionalExpressions() { setRootRule(PlSqlGrammar.IN_EXPRESSION) assertThat(p).notMatches("var in (select 1 from dual) and x = y") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/QalifiedExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class QalifiedExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.QUALIFIED_EXPRESSION) } @Test fun matchesNamedChoice() { assertThat(p).matches("foo(b | b => 1)") } @Test fun matchesIndexedChoice() { assertThat(p).matches("foo(1 => 'A', 2 => 'B', 3 | 4 => 'C', fun() => 4)") } @Test fun matchesSequenceIteratorChoice() { assertThat(p).matches("foo(for i in 1..10 sequence => i)") } @Test fun matchesBasicIteratorChoice() { assertThat(p).matches("foo(for i in 1..10 => i)") } @Test fun matchesIndexIteratorChoice() { assertThat(p).matches("foo(for i in 1..10 index i => i)") } @Test fun matchesOthersChoice() { assertThat(p).matches("foo(a | b => 3, others => 0)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/RelationalExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class RelationalExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesEqualTo() { assertThat(p).matches("1 = 1") } @Test fun matchesNotEqualTo() { assertThat(p).matches("1 <> 2") assertThat(p).matches("1 != 2") assertThat(p).matches("1 ~= 2") assertThat(p).matches("1 ^= 2") } @Test fun matchesLessThan() { assertThat(p).matches("1 < 2") } @Test fun matchesGreaterThen() { assertThat(p).matches("2 > 1") } @Test fun matchesLessThanOrEqualTo() { assertThat(p).matches("1 <= 2") } @Test fun matchesGreaterThenOrEqualTo() { assertThat(p).matches("2 >= 1") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/SetExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class SetExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleTreatAs() { assertThat(p).matches("set(foo)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/TableExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class TableExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleTable() { assertThat(p).matches("table(foo)") } @Test fun matchesTableExpressionWithQuery() { assertThat(p).matches("table(select 1 from dual)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/TheExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class TheExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleThe() { assertThat(p).matches("the(foo)") } @Test fun matchesTheExpressionWithQuery() { assertThat(p).matches("the(select 1 from dual)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ToBinaryDoubleExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ToBinaryDoubleExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimple() { assertThat(p).matches("to_binary_double(foo)") } @Test fun matchesDefaultClause() { assertThat(p).matches("to_binary_double(foo default 0 on conversion error)") } @Test fun matchesMultipleArguments() { assertThat(p).matches("to_binary_double(foo, '9999', 'NLS_DATE_LANGUAGE = American')") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ToBinaryFloatExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ToBinaryFloatExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimple() { assertThat(p).matches("to_binary_float(foo)") } @Test fun matchesDefaultClause() { assertThat(p).matches("to_binary_float(foo default 0 on conversion error)") } @Test fun matchesMultipleArguments() { assertThat(p).matches("to_binary_float(foo, '9999', 'NLS_DATE_LANGUAGE = American')") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ToBooleanExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ToBooleanExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimple() { assertThat(p).matches("to_boolean(foo)") } @Test fun matchesDefaultClause() { assertThat(p).matches("to_boolean(foo default false on conversion error)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ToDateExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ToDateExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimple() { assertThat(p).matches("to_date(foo)") } @Test fun matchesDefaultClause() { assertThat(p).matches("to_date(foo default sysdate on conversion error)") } @Test fun matchesMultipleArguments() { assertThat(p).matches("to_date(foo, 'dd/mm/rrrr', 'NLS_DATE_LANGUAGE = American')") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ToDsintervalExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ToDsintervalExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimple() { assertThat(p).matches("to_dsinterval(foo)") } @Test fun matchesDefaultClause() { assertThat(p).matches("to_dsinterval(foo default false on conversion error)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ToNumberExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ToNumberExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimple() { assertThat(p).matches("to_number(foo)") } @Test fun matchesDefaultClause() { assertThat(p).matches("to_number(foo default 0 on conversion error)") } @Test fun matchesMultipleArguments() { assertThat(p).matches("to_number(foo, '999G999', 'NLS_DATE_LANGUAGE = American')") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ToTimestampExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ToTimestampExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimple() { assertThat(p).matches("to_timestamp(foo)") } @Test fun matchesDefaultClause() { assertThat(p).matches("to_timestamp(foo default systimestamp on conversion error)") } @Test fun matchesMultipleArguments() { assertThat(p).matches("to_timestamp(foo, 'dd/mm/rrrr', 'NLS_DATE_LANGUAGE = American')") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ToTimestampTzExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ToTimestampTzExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimple() { assertThat(p).matches("to_timestamp_tz(foo)") } @Test fun matchesDefaultClause() { assertThat(p).matches("to_timestamp_tz(foo default systimestamp on conversion error)") } @Test fun matchesMultipleArguments() { assertThat(p).matches("to_timestamp_tz(foo, 'dd/mm/rrrr', 'NLS_DATE_LANGUAGE = American')") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/ToYmintervalExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ToYmintervalExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimple() { assertThat(p).matches("to_yminterval(foo)") } @Test fun matchesDefaultClause() { assertThat(p).matches("to_yminterval(foo default '00-00' on conversion error)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/TreatAsExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class TreatAsExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleTreatAs() { assertThat(p).matches("treat(foo as bar)") } @Test fun matchesTreatAsRef() { assertThat(p).matches("treat(foo as ref bar)") } @Test fun matchesTreatAsRef2() { assertThat(p).matches("treat(foo as ref bar).test") } @Test fun matchesAsExpression() { assertThat(p).matches("(foo as bar)") } @Test fun matchesAsExpressionWithMethodCall() { assertThat(p).matches("(foo as bar).baz()") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/TrimExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class TrimExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleTrim() { assertThat(p).matches("trim(foo)") } @Test fun matchesTrimCharacterFrom() { assertThat(p).matches("trim(',' from foo)") } @Test fun matchesTrimLeadingCharacterFrom() { assertThat(p).matches("trim(leading ',' from foo)") } @Test fun matchesTrimTrailingCharacterFrom() { assertThat(p).matches("trim(trailing ',' from foo)") } @Test fun matchesTrimBothCharacterFrom() { assertThat(p).matches("trim(both ',' from foo)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlAggExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlAggExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlAgg() { assertThat(p).matches("xmlagg(foo)") } @Test fun matchesXmlAggWithOrderBy() { assertThat(p).matches("xmlagg(foo order by bar)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlAttributesExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlAttributesExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlAttributes() { assertThat(p).matches("xmlattributes(foo)") } @Test fun matchesXmlAttributesEntityEscaping() { assertThat(p).matches("xmlattributes(entityescaping foo)") } @Test fun matchesXmlAttributesNoEntityEscaping() { assertThat(p).matches("xmlattributes(noentityescaping foo)") } @Test fun matchesXmlAttributesSchemaCheck() { assertThat(p).matches("xmlattributes(schemacheck foo)") } @Test fun matchesXmlAttributesNoSchemaCheck() { assertThat(p).matches("xmlattributes(noschemacheck foo)") } @Test fun matchesXmlAttributesWithExpressionWithoutAs() { assertThat(p).matches("xmlattributes(foo \"bar\")") } @Test fun matchesXmlAttributesWithExpression() { assertThat(p).matches("xmlattributes(foo as \"bar\")") } @Test fun matchesXmlAttributesWithEvalNameExpression() { assertThat(p).matches("xmlattributes(foo as evalname bar)") } @Test fun matchesXmlAttributesWithMultipleAttributes() { assertThat(p).matches("xmlattributes(foo as \"bar\", foo2 as \"bar2\")") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlCastExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlCastExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlCast() { assertThat(p).matches("xmlcast(xmltype('') as varchar2)") } @Test fun matchesXmlCastWithXmlQuery() { assertThat(p).matches("xmlcast(xmlquery('' passing bar returning content) as varchar2)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlColattvalExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlColattvalExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlCollattval() { assertThat(p).matches("xmlcolattval(foo, bar, foo2, bar2)") } @Test fun matchesXmlColattvalWithExpressionWithoutAs() { assertThat(p).matches("xmlcolattval(foo \"bar\")") } @Test fun matchesXmlColattvalWithEvalname() { assertThat(p).matches("xmlcolattval(foo as bar, foo as evalname bar)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlElementExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlElementExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlElement() { assertThat(p).matches("xmlelement(\"xml\")") } @Test fun matchesXmlElementEntityEscaping() { assertThat(p).matches("xmlelement(entityescaping \"xml\")") } @Test fun matchesXmlElementEntityNoEscaping() { assertThat(p).matches("xmlelement(noentityescaping \"xml\")") } @Test fun matchesXmlElementExplicitNameKeyword() { assertThat(p).matches("xmlelement(name \"xml\")") } @Test fun matchesXmlElementEvalNameKeyword() { assertThat(p).matches("xmlelement(evalname \"xml\")") } @Test fun matchesXmlElementWithXmlAttributes() { assertThat(p).matches("xmlelement(\"xml\", xmlattributes(foo as \"bar\"))") } @Test fun matchesXmlElementWithValue() { assertThat(p).matches("xmlelement(\"xml\", foo)") } @Test fun matchesXmlElementWithValueAndAlias() { assertThat(p).matches("xmlelement(\"xml\", foo as bar)") assertThat(p).matches("xmlelement(\"xml\", foo bar)") } @Test fun matchesXmlElementWithMultipleValues() { assertThat(p).matches("xmlelement(\"xml\", foo, bar, baz)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlExistsExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlExistsExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlExists() { assertThat(p).matches("xmlexists('/foo')") } @Test fun matchesXmlExistsWithPassingClause() { assertThat(p).matches("xmlexists('/foo' passing bar)") } @Test fun matchesXmlExistsWithPassingByValueClause() { assertThat(p).matches("xmlexists('/foo' passing by value bar)") } @Test fun matchesXmlExistsWithPassingMoreValues() { assertThat(p).matches("xmlexists('/foo' passing \"bar\" as bar, \"bar2\" as bar2)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlForestExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlForestExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlForest() { assertThat(p).matches("xmlforest(foo)") } @Test fun matchesXmlForestWithExpressionWithoutAs() { assertThat(p).matches("xmlforest(foo \"bar\")") } @Test fun matchesXmlForestWithExpression() { assertThat(p).matches("xmlforest(foo as \"bar\")") } @Test fun matchesXmlForestWithEvalNameExpression() { assertThat(p).matches("xmlforest(foo as evalname bar)") } @Test fun matchesXmlForestWithMultipleAttributes() { assertThat(p).matches("xmlforest(foo as \"bar\", foo2 as \"bar2\")") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlParseExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlParseExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlParse() { assertThat(p).matches("xmlparse(content 'bar')") } @Test fun matchesXmlParseDocument() { assertThat(p).matches("xmlparse(document 'bar')") } @Test fun matchesXmlParseDocumentWellformed() { assertThat(p).matches("xmlparse(document 'bar' wellformed)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlPiExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlPiExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlPi() { assertThat(p).matches("xmlpi(name \"foo\")") } @Test fun matchesXmlPiWithEvalname() { assertThat(p).matches("xmlpi(evalname foo)") } @Test fun matchesXmlPiWithContent() { assertThat(p).matches("xmlpi(name \"foo\", 'bar')") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlQueryExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlQueryExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlQuery() { assertThat(p).matches("xmlquery('/foo' returning content)") } @Test fun matchesXmlQueryWithNullOnEmpty() { assertThat(p).matches("xmlquery('/foo' returning content null on empty)") } @Test fun matchesXmlQueryWithPassingByValueClause() { assertThat(p).matches("xmlquery('/foo' passing by value bar returning content)") } @Test fun matchesXmlQueryWithPassingMoreValues() { assertThat(p).matches("xmlquery('/foo' passing \"bar\" as bar, \"bar2\" as bar2 returning content)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlRootExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlRootExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlRoot() { assertThat(p).matches("xmlroot(xmltype(''), version no value)") } @Test fun matchesXmlRootWithVersion() { assertThat(p).matches("xmlroot(xmltype(''), version '1.0')") } @Test fun matchesXmlRootWithStandalone() { assertThat(p).matches("xmlroot(xmltype(''), version '1.0', standalone no value)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlSerializeExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlSerializeExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlSerializeDocument() { assertThat(p).matches("xmlserialize(document 'foo')") } @Test fun matchesSimpleXmlSerializeContent() { assertThat(p).matches("xmlserialize(content 'foo')") } @Test fun matchesXmlSerializeAsDatatype() { assertThat(p).matches("xmlserialize(document 'foo' as clob)") } @Test fun matchesXmlSerializeWithEncoding() { assertThat(p).matches("xmlserialize(document 'foo' encoding 'utf-8')") } @Test fun matchesXmlSerializeWithVersion() { assertThat(p).matches("xmlserialize(document 'foo' version '1.0')") } @Test fun matchesXmlSerializeWithNoIdent() { assertThat(p).matches("xmlserialize(document 'foo' no indent)") } @Test fun matchesXmlSerializeWithIndent() { assertThat(p).matches("xmlserialize(document 'foo' indent)") } @Test fun matchesXmlSerializeWithIndentAndSize() { assertThat(p).matches("xmlserialize(document 'foo' indent size = 1)") } @Test fun matchesXmlSerializeWithHideDefaults() { assertThat(p).matches("xmlserialize(document 'foo' hide defaults)") } @Test fun matchesXmlSerializeWithShowDefaults() { assertThat(p).matches("xmlserialize(document 'foo' show defaults)") } @Test fun matchesLongXmlSerializeExpression() { assertThat(p).matches("xmlserialize(document 'foo' as clob encoding 'utf-8' version '1.0' indent size = 1 show defaults)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/expressions/XmlTableExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.expressions import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class XmlTableExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesSimpleXmlTable() { assertThat(p).matches("xmltable('/foo' passing bar)") assertThat(p).matches("xmltable('/foo' passing bar.baz)") } @Test fun matchesXmlTableWithNamespaces() { assertThat(p).matches("xmltable(xmlnamespaces ('foo' as bar, default 'foo2'), '/foo/bar:foo' passing bar)") } @Test fun matchesXmlTableReturningSequenceByRef() { assertThat(p).matches("xmltable('/foo' passing bar returning sequence by ref)") } @Test fun matchesXmlTableWithColumns() { assertThat(p).matches("xmltable('/foo' passing bar columns \"foo\" varchar2(1) path 'bar' default 'a', \"foo2\" varchar2(1) path 'bar2', \"foo3\" for ordinality)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/matchers/MethodMatcherTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.matchers import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class MethodMatcherTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun detectSimpleMethodByName() { val matcher = MethodMatcher.create().name("func") matches(matcher, "func") notMatches(matcher, "foo") notMatches(matcher, "foo.func") } @Test fun detectAnyMethod() { val matcher = MethodMatcher.create().name(NameCriteria.any()) matches(matcher, "func") matches(matcher, "foo") } @Test fun detectAnyMethodInList() { val matcher = MethodMatcher.create().name(NameCriteria.`in`("func", "foo")) matches(matcher, "func") matches(matcher, "FOO") notMatches(matcher, "bar") } @Test fun detectMethodInPackage() { val matcher = MethodMatcher.create().packageName("pack").name("func") matches(matcher, "pack.func") notMatches(matcher, "pkg.func") notMatches(matcher, "func") } @Test fun detectMethodInAnyPackage() { val matcher = MethodMatcher.create().packageName(NameCriteria.any()).name("func") matches(matcher, "pack.func") matches(matcher, "pkg.func") } @Test fun detectMethodInSchema() { val matcher = MethodMatcher.create().schema("sch").name("func") matches(matcher, "sch.func") notMatches(matcher, "bar.func") notMatches(matcher, "func") } @Test fun detectMethodInAnySchema() { val matcher = MethodMatcher.create().schema(NameCriteria.any()).name("func") matches(matcher, "sch.func") matches(matcher, "bar.func") } @Test fun detectMethodInPackageAndSchema() { val matcher = MethodMatcher.create().schema("sch").packageName("pack").name("func") matches(matcher, "sch.pack.func") notMatches(matcher, "bar.pack.func") } @Test fun detectMethodInPackageAndOptionalSchema() { val matcher = MethodMatcher.create().schema("sch").schemaIsOptional().packageName("pack").name("func") matches(matcher, "sch.pack.func") matches(matcher, "pack.func") } @Test fun detectMethodWithOneParameter() { val matcher = MethodMatcher.create().name("func").addParameter() matches(matcher, "func(x)") notMatches(matcher, "func(x, y)") notMatches(matcher, "bar.func(x)") } @Test fun detectMethodWithMoreParameters() { val matcher = MethodMatcher.create().name("func").addParameter().addParameter().addParameter() matches(matcher, "func(x, y, z)") notMatches(matcher, "func(x)") } @Test fun detectMethodWithMoreParameters2() { val matcher = MethodMatcher.create().name("func").addParameters(3) matches(matcher, "func(x, y, z)") notMatches(matcher, "func(x)") } @Test fun detectMethodInPackageWithParameters() { val matcher = MethodMatcher.create().packageName("pack").name("func").addParameter().addParameter().addParameter() matches(matcher, "pack.func(x, y, z)") notMatches(matcher, "bar.func(x)") } @Test fun detectMethodWithoutParameterConstraint() { val matcher = MethodMatcher.create().name("func").withNoParameterConstraint() matches(matcher, "func(x)") } @Test fun detectHostMethodCall() { val matcher = MethodMatcher.create().name("func").withNoParameterConstraint() matches(matcher, ":func(x)") } @Test fun shouldFailIfNameIsCalledMoreThanOnce() { val matcher = MethodMatcher.create().name("name") assertThrows { matcher.name("name") } } @Test fun shouldFailIfPackageNameIsCalledMoreThanOnce() { val matcher = MethodMatcher.create().packageName("name") assertThrows { matcher.packageName("name") } } @Test fun shouldFailIfSchemaIsCalledMoreThanOnce() { val matcher = MethodMatcher.create().schema("name") assertThrows { matcher.schema("name") } } @Test fun shouldFailIfAddParameterIsCalledAfterWithNoParameterConstraint() { val matcher = MethodMatcher.create().withNoParameterConstraint() assertThrows { matcher.addParameter() } } @Test fun shouldFailIfAddParametersIsCalledAfterWithNoParameterConstraint() { val matcher = MethodMatcher.create().withNoParameterConstraint() assertThrows { matcher.addParameters(2) } } @Test fun shouldFailIfWithNoParameterConstraintIsCalledAfterAddParameter() { val matcher = MethodMatcher.create().addParameter() assertThrows { matcher.withNoParameterConstraint() } } @Test fun shouldFailIfWithNoParameterConstraintIsCalledAfterAddParameters() { val matcher = MethodMatcher.create().addParameters(2) assertThrows { matcher.withNoParameterConstraint() } } fun matches(matcher: MethodMatcher, text: String) { assertThat(matcher.matches(p.parse(text).firstChild)).isTrue } fun notMatches(matcher: MethodMatcher, text: String) { assertThat(matcher.matches(p.parse(text).firstChild)).isFalse } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/matchers/MethodMatcherWithTypesTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.matchers import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.asSemantic import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest import com.felipebz.zpa.api.squid.SemanticAstNode import com.felipebz.zpa.api.symbols.PlSqlType import com.felipebz.zpa.api.symbols.datatype.CharacterDatatype import com.felipebz.zpa.api.symbols.datatype.DateDatatype import com.felipebz.zpa.api.symbols.datatype.NumericDatatype import com.felipebz.zpa.api.symbols.datatype.PlSqlDatatype class MethodMatcherWithTypesTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXPRESSION) } @Test fun matchesMethodWhenTheTypeIsNotSpecifiedInTheMatcher() { val matcher = MethodMatcher.create().name("func").addParameter() val node = getAstNodeWithArguments("func(x)", NumericDatatype()) assertThat(matcher.matches(node)).isTrue } @Test fun matchesMethodWhenTheTypeIsSpecifiedAsUnknownInTheMatcher() { val matcher = MethodMatcher.create().name("func").addParameter(PlSqlType.UNKNOWN) val node = getAstNodeWithArguments("func(x)", NumericDatatype()) assertThat(matcher.matches(node)).isTrue } @Test fun matchesMethodWhenTheTypeIsSpecifiedInTheMatcher() { val matcher = MethodMatcher.create().name("func").addParameter(PlSqlType.NUMERIC) val node = getAstNodeWithArguments("func(x)", NumericDatatype()) assertThat(matcher.matches(node)).isTrue } @Test fun notMatchesMethodWhenTheTypeIsDifferentFromExpectation() { val matcher = MethodMatcher.create().name("func").addParameter(PlSqlType.CHARACTER) val node = getAstNodeWithArguments("func(x)", NumericDatatype()) assertThat(matcher.matches(node)).isFalse } @Test fun matchesMethodWithMultipleParametersWhenTheTypeIsSpecifiedInTheMatcher() { val matcher = MethodMatcher.create().name("func") .addParameters(PlSqlType.NUMERIC, PlSqlType.CHARACTER, PlSqlType.DATE) val node = getAstNodeWithArguments("func(x, y, z)", NumericDatatype(), CharacterDatatype(), DateDatatype()) assertThat(matcher.matches(node)).isTrue } @Test fun noMatchesMethodWithMultipleParametersWhenTheAnyTypeIsDifferentFromExpectation() { val matcher = MethodMatcher.create().name("func") .addParameters(PlSqlType.NUMERIC, PlSqlType.CHARACTER, PlSqlType.DATE) val node = getAstNodeWithArguments("func(x, y, z)", NumericDatatype(), CharacterDatatype(), CharacterDatatype()) assertThat(matcher.matches(node)).isFalse } private fun getAstNodeWithArguments(text: String, vararg types: PlSqlDatatype): SemanticAstNode { val node = p.parse(text).firstChild val arguments = node.getDescendants(PlSqlGrammar.ARGUMENT) for (i in types.indices) { val actualArgument = arguments[i].firstChild MethodMatcher.semantic(actualArgument).plSqlDatatype = types[i] } return node.asSemantic() } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/session/SessionControlGrammarTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.session import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.RuleTest import com.felipebz.zpa.api.SessionControlGrammar class SessionControlGrammarTest : RuleTest() { @BeforeEach fun init() { setRootRule(SessionControlGrammar.SESSION_CONTROL_COMMAND) } @Test fun matchesAlterSession() { assertThat(p).matches("alter session set nls_date_format = 'dd/mm/yyyy';") } @Test fun matchesSetRole() { assertThat(p).matches("set role foo;") assertThat(p).matches("set role foo, bar, baz;") } @Test fun matchesSetRoleNone() { assertThat(p).matches("set role none;") } @Test fun matchesSetRoleAll() { assertThat(p).matches("set role all;") } @Test fun matchesSetRoleAllExcept() { assertThat(p).matches("set role all except foo;") assertThat(p).matches("set role all except foo, bar, baz;") } @Test fun matchesSetRoleWithPassword() { assertThat(p).matches("set role foo identified by pass;") assertThat(p).matches("set role foo identified by pass, bar, baz;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/AnalyticClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class AnalyticClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.ANALYTIC_CLAUSE) } @Test fun matchesSimpleOver() { assertThat(p).matches("over ()") } @Test fun matchesOverPartitionBy() { assertThat(p).matches("over (partition by foo)") } @Test fun matchesOverPartitionByWithMultipleExpressions() { assertThat(p).matches("over (partition by foo, bar, baz)") } @Test fun matchesOverOrderBy() { assertThat(p).matches("over (order by foo)") } @Test fun matchesOverWithWindowingUnboundedPreceding() { assertThat(p).matches("over (order by foo rows unbounded preceding)") assertThat(p).matches("over (order by foo range unbounded preceding)") } @Test fun matchesOverWithWindowingCurrentRow() { assertThat(p).matches("over (order by foo rows current row)") } @Test fun matchesOverWithWindowingExpressionPreceding() { assertThat(p).matches("over (order by foo rows 1 preceding)") } @Test fun matchesOverWithWindowingWithBetween() { assertThat(p).matches("over (order by foo rows between unbounded preceding and current row)") } @Test fun matchesLongAnalyticClause() { assertThat(p).matches("over (partition by foo order by foo rows between unbounded preceding and unbounded following)") } @Test fun matchesOverPartitionByExpression() { assertThat(p).matches("over (partition by foo + bar)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/ConnectByClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class ConnectByClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.CONNECT_BY_CLAUSE) } @Test fun matchesSimpleConnectBy() { assertThat(p).matches("connect by foo = bar") } @Test fun matchesConnectByWithPrior() { assertThat(p).matches("connect by prior foo = bar") } @Test fun matchesConnectByWithPriorAlternative() { assertThat(p).matches("connect by foo = prior bar") } @Test fun matchesConnectByNoCycle() { assertThat(p).matches("connect by nocycle foo = bar") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/DmlTableExpressionClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class DmlTableExpressionClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.DML_TABLE_EXPRESSION_CLAUSE) } @Test fun matchesTable() { assertThat(p).matches("tab") } @Test fun matchesTableInSchema() { assertThat(p).matches("sch.tab") } @Test fun matchesTableWithDbLink() { assertThat(p).matches("tab@link") assertThat(p).matches("tab@link.domain.com") } @Test fun matchesTableWithAlias() { assertThat(p).matches("tab alias") assertThat(p).matches("tab as alias") } @Test fun matchesSubquery() { assertThat(p).matches("(select 1 from dual)") } @Test fun matchesFunctionCall() { assertThat(p).matches("func(var)") assertThat(p).matches("table(xmlsequence(x))") } @Test fun matchesNestedClause() { assertThat(p).matches("tab nested doc columns (foo path foo) alias") } @Test fun matchesNestedClauseWithExplicitPath() { assertThat(p).matches("tab nested path doc columns (foo path foo)") } @Test fun matchesNestedClauseWithRelativeObjectAccess() { assertThat(p).matches("tab nested doc.c1[*].c2 columns (foo path foo)") } @Test fun matchesNestedClauseWithSimplePathAccess() { assertThat(p).matches("tab nested doc, '$.c1[*].c2' columns (foo path foo)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/ForUpdateClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class ForUpdateClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.FOR_UPDATE_CLAUSE) } @Test fun matchesSimpleForUpdate() { assertThat(p).matches("for update") } @Test fun matchesForUpdateOfColumn() { assertThat(p).matches("for update of col") } @Test fun matchesForUpdateOfColumnWithTable() { assertThat(p).matches("for update of tab.col") } @Test fun matchesForUpdateOfColumnWithSchemaAndTable() { assertThat(p).matches("for update of sch.tab.col") } @Test fun matchesForUpdateOfMultipleColumns() { assertThat(p).matches("for update of col, col2, col3") } @Test fun matchesForUpdateNoWait() { assertThat(p).matches("for update nowait") } @Test fun matchesForUpdateWait() { assertThat(p).matches("for update wait 1") } @Test fun matchesForUpdateSkipLocked() { assertThat(p).matches("for update skip locked") } @Test fun matchesLongForUpdate() { assertThat(p).matches("for update of col skip locked") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/GroupByClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class GroupByClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.GROUP_BY_CLAUSE) } @Test fun matchesSimpleGroupBy() { assertThat(p).matches("group by 1") } @Test fun matchesSimpleGroupByColumn() { assertThat(p).matches("group by col") } @Test fun matchesSimpleGroupByExpression() { assertThat(p).matches("group by (col) + col2") } @Test fun matchesSimpleGroupByMultipleColumn() { assertThat(p).matches("group by col, col2") } @Test fun matchesSimpleGroupByTableColumn() { assertThat(p).matches("group by tab.col") } @Test fun matchesSimpleGroupByTableColumnWithSchema() { assertThat(p).matches("group by sch.tab.col") } @Test fun matchesSimpleGroupByFunctionCall() { assertThat(p).matches("group by func(var)") } @Test fun matchesSimpleGroupByRollup() { assertThat(p).matches("group by rollup (col)") } @Test fun matchesSimpleGroupByCube() { assertThat(p).matches("group by cube (col)") } @Test fun matchesSimpleGroupByRollupAndCube() { assertThat(p).matches("group by rollup (col), cube (col)") } @Test fun matchesSimpleGroupWithEmptyGroupingSets() { assertThat(p).matches("group by grouping sets (())") } @Test fun matchesSimpleGroupWithGroupingSets() { assertThat(p).matches("group by grouping sets (col)") } @Test fun matchesSimpleGroupWithGroupingSetsWithMultipleColumns() { assertThat(p).matches("group by grouping sets (col, col2)") } @Test fun matchesSimpleGroupWithGroupingSetsWithMultipleOptions() { assertThat(p).matches("group by grouping sets (col, col2, rollup (col), cube (col))") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/HavingClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class HavingClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.HAVING_CLAUSE) } @Test fun matchesSimpleHaving() { assertThat(p).matches("having col > 1") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/HierarchicalQueryClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class HierarchicalQueryClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.HIERARCHICAL_QUERY_CLAUSE) } @Test fun matchesSimpleHierarchical() { assertThat(p).matches("connect by foo = bar") } @Test fun matchesHierarchicalQueryConnectByFirst() { assertThat(p).matches("connect by foo = bar start with foo = bar") } @Test fun matchesHierarchicalQueryStartWithFirst() { assertThat(p).matches("start with foo = bar connect by foo = bar") } @Test fun notMatchesStartWithFirstWithoutConnectBy() { assertThat(p).notMatches("start with foo = bar") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/IntoClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class IntoClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.INTO_CLAUSE) } @Test fun matchesSimpleIntoClause() { assertThat(p).matches("into var") } @Test fun matchesIntoClauseInMultipleVariables() { assertThat(p).matches("into var, var2") } @Test fun matchesBulkCollect() { assertThat(p).matches("bulk collect into var") } @Test fun matchesSimpleCollectionElement() { assertThat(p).matches("into col(1)") } @Test fun matchesSimpleIntoRecordItem() { assertThat(p).matches("into col.it") } @Test fun matchesSimpleIntoItemInRecordCollection() { assertThat(p).matches("into col(1).it") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/JoinClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class JoinClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.JOIN_CLAUSE) } @Test fun matchesSimpleJoin() { assertThat(p).matches("foo join bar on foo.a = bar.a") } @Test fun matchesSimpleJoinInParenthesis() { assertThat(p).matches("(foo join bar on foo.a = bar.a)") } @Test fun matchesSimpleJoinWithTableAlias() { assertThat(p).matches("foo f join bar b on f.a = b.a") } @Test fun matchesInnerJoin() { assertThat(p).matches("foo inner join bar on foo.a = bar.a") } @Test fun matchesInnerJoinWithTableAlias() { assertThat(p).matches("foo f inner join bar b on f.a = b.a") } @Test fun matchesJoinWithUsing() { assertThat(p).matches("foo join bar using (a)") } @Test fun matchesJoinWithUsingWithTableAlias() { assertThat(p).matches("foo f join bar b using (a)") } @Test fun matchesInnerJoinWithUsing() { assertThat(p).matches("foo inner join bar using (a)") } @Test fun matchesInnerJoinWithUsingWithTableAlias() { assertThat(p).matches("foo f inner join bar n using (a)") } @Test fun matchesJoinWithUsingAndMultipleColumns() { assertThat(p).matches("foo join bar using (a, b, c)") } @Test fun matchesCrossJoin() { assertThat(p).matches("foo cross join bar") } @Test fun matchesCrossJoinWithTableAlias() { assertThat(p).matches("foo f cross join ba br") } @Test fun matchesNaturalJoin() { assertThat(p).matches("foo natural join bar") } @Test fun matchesNaturalJoinWithTableAlias() { assertThat(p).matches("foo f natural join bar b") } @Test fun matchesNaturalInnerJoin() { assertThat(p).matches("foo natural inner join bar") } @Test fun matchesFullJoin() { assertThat(p).matches("foo full join bar on foo.a = bar.a") } @Test fun matchesFullJoinWithTableAlias() { assertThat(p).matches("foo f full join bar b on f.a = b.a") } @Test fun matchesFullJoinWithUsing() { assertThat(p).matches("foo full join bar using (a)") } @Test fun matchesFullJoinWithUsingWithTableAlias() { assertThat(p).matches("foo f full join bar b using (a)") } @Test fun matchesFullJoinWithUsingMultipleColumns() { assertThat(p).matches("foo full join bar using (a, b, c)") } @Test fun matchesFullOuterJoin() { assertThat(p).matches("foo full outer join bar on foo.a = bar.a") } @Test fun matchesRightJoin() { assertThat(p).matches("foo right join bar on foo.a = bar.a") } @Test fun matchesRightJoinWithTableAlias() { assertThat(p).matches("foo f right join bar b on f.a = b.a") } @Test fun matchesRightOuterJoin() { assertThat(p).matches("foo right outer join bar on foo.a = bar.a") } @Test fun matchesLeftJoin() { assertThat(p).matches("foo left join bar on foo.a = bar.a") } @Test fun matchesLeftJoinWithTableAlias() { assertThat(p).matches("foo f left join bar b on f.a = b.a") } @Test fun matchesLeftOuterJoin() { assertThat(p).matches("foo left outer join bar on foo.a = bar.a") } @Test fun matchesNaturalFullJoin() { assertThat(p).matches("foo natural full join bar") } @Test fun matchesNaturalFullOuterJoin() { assertThat(p).matches("foo natural full outer join bar") } @Test fun matchesNaturalRightJoin() { assertThat(p).matches("foo natural right join bar") } @Test fun matchesNaturalRightOuterJoin() { assertThat(p).matches("foo natural right outer join bar") } @Test fun matchesNaturalLeftJoin() { assertThat(p).matches("foo natural left join bar") } @Test fun matchesNaturalLeftOuterJoin() { assertThat(p).matches("foo natural left outer join bar") } @Test fun matchesOuterJoinWithQueryPartition() { assertThat(p).matches("foo partition by a, b left join bar on foo.a = bar.a") assertThat(p).matches("foo partition by (a, b) left join bar on foo.a = bar.a") assertThat(p).matches("foo left join bar partition by a, b on foo.a = bar.a") assertThat(p).matches("foo left join bar partition by (a, b) on foo.a = bar.a") } @Test fun matchesJoinSubqueryWithTable() { assertThat(p).matches("(select a from foo) f join bar b on f.a = b.a") } @Test fun matchesJoinTableWithSubquery() { assertThat(p).matches("foo join (select a from bar) b on foo.a = b.a") } @Test fun matchesNestedJoin() { assertThat(p).matches("(foo join bar on foo.a = bar.a) join bar on foo.a = bar.a") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/KeepClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class KeepClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.KEEP_CLAUSE) } @Test fun matchesKeepFirst() { assertThat(p).matches("keep (dense_rank first order by foo)") } @Test fun matchesKeepLast() { assertThat(p).matches("keep (dense_rank last order by foo)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/OrderByClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class OrderByClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.ORDER_BY_CLAUSE) } @Test fun matchesSimpleOrderBy() { assertThat(p).matches("order by 1") } @Test fun matchesSimpleOrderByAsc() { assertThat(p).matches("order by 1 asc") } @Test fun matchesSimpleOrderByDesc() { assertThat(p).matches("order by 1 desc") } @Test fun matchesSimpleOrderByColumn() { assertThat(p).matches("order by col") } @Test fun matchesOrderByWithMultipleValuesAndOrdering() { assertThat(p).matches("order by col1 asc, col2 desc, col3 desc") } @Test fun matchesSimpleOrderByTableColumn() { assertThat(p).matches("order by tab.col") } @Test fun matchesSimpleOrderByTableColumnWithSchema() { assertThat(p).matches("order by sch.tab.col") } @Test fun matchesSimpleOrderByFunctionCall() { assertThat(p).matches("order by func(var)") } @Test fun matchesOrderSiblingsBy() { assertThat(p).matches("order siblings by col") } @Test fun matchesOrderByNullsFirst() { assertThat(p).matches("order by col nulls first") } @Test fun matchesOrderByNullsLast() { assertThat(p).matches("order by col nulls last") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/PivotClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class PivotClauseTest: RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.PIVOT_CLAUSE) } @Test fun matchesSimplePivot() { assertThat(p).matches("pivot (sum(amount) for quarter in ('q1', 'q2'))") } @Test fun matchesSimplePivotXml() { assertThat(p).matches("pivot xml (sum(amount) for quarter in ('q1', 'q2'))") } @Test fun matchesSimplePivotWithAliases() { assertThat(p).matches("pivot (sum(quantity_sold) as qty for region in ('north' north, 'south' south))") } @Test fun matchesSimplePivotWithAs() { assertThat(p).matches("pivot (sum(quantity_sold) as qty for region in ('north' as north, 'south' as south))") } @Test fun matchesSimplePivotWithSeveralAggregateExpressions() { assertThat(p).matches( """ pivot ( sum(amount ) as total, count(*) as count for quarter in ('q1' as q1, 'q2' as q2, 'q3' as q3, 'q4' as q4) ) """ ) } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/RowLimitingClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class RowLimitingClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.ROW_LIMITING_CLAUSE) } @Test fun matchesOffsetRow() { assertThat(p).matches("offset 1 row") } @Test fun matchesOffsetRows() { assertThat(p).matches("offset 1 rows") } @Test fun matchesOffsetAndFetchRowClause() { assertThat(p).matches("offset 1 row fetch first 1 row only") } @Test fun matchesFetchFirstRowOnly() { assertThat(p).matches("fetch first 1 row only") } @Test fun matchesFetchNextRowOnly() { assertThat(p).matches("fetch next 1 row only") } @Test fun matchesFetchFirstRowWithTies() { assertThat(p).matches("fetch first 1 row with ties") } @Test fun matchesFetchFirstPercentRowOnly() { assertThat(p).matches("fetch first 1 percent row only") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/SelectColumnTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class SelectColumnTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.SELECT_COLUMN) } @Test fun matchesAllColumns() { assertThat(p).matches("*") } @Test fun matchesFunctionCall() { assertThat(p).matches("func(var)") } @Test fun matchesCount() { assertThat(p).matches("count(*)") } @Test fun matchesColumnName() { assertThat(p).matches("name") } @Test fun matchesTableColumn() { assertThat(p).matches("tab.name") } @Test fun matchesAllTableColumns() { assertThat(p).matches("tab.*") } @Test fun matchesTableColumnInDiffentSchema() { assertThat(p).matches("sch.tab.name") } @Test fun matchesAllTableColumnInDiffentSchema() { assertThat(p).matches("sch.tab.*") } @Test fun matchesLiterals() { assertThat(p).matches("'x'") assertThat(p).matches("1") assertThat(p).matches("null") } @Test fun matchesSequenceCurrentValue() { assertThat(p).matches("seq.currval") } @Test fun matchesSequenceNextValue() { assertThat(p).matches("seq.nextval") } @Test fun matchesColumnWithAlias() { assertThat(p).matches("null alias") } @Test fun matchesColumnWithAliasWithAsKeyword() { assertThat(p).matches("null as alias") } @Test fun matchesSubqueryAsColumn() { assertThat(p).matches("(select 1 from dual) col") } @Test fun matchesColumnWithConnectByRoot() { assertThat(p).matches("connect_by_root foo") assertThat(p).matches("connect_by_root foo alias") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/SelectExpressionTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class SelectExpressionTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.SELECT_EXPRESSION) } @Test fun matchesSimpleSelect() { assertThat(p).matches("select 1 from dual") } @Test fun matchesSimpleSelectInto() { assertThat(p).matches("select 1 into var from dual") } @Test fun matchesSelectBulkCollectInto() { assertThat(p).matches("select 1 bulk collect into var from dual") } @Test fun matchesSelectWithWhere() { assertThat(p).matches("select 1 from dual where 1 = 1") } @Test fun matchesSelectWithMultipleColumns() { assertThat(p).matches("select 1, 2 from dual") } @Test fun matchesSelectWithMultipleColumnsAndIntoClause() { assertThat(p).matches("select 1, 2 into var1, var2 from dual") } @Test fun matchesSelectWithMultipleTables() { assertThat(p).matches("select 1 from emp, dept") } @Test fun matchesSelectAll() { assertThat(p).matches("select all 1 from dual") } @Test fun matchesSelectDistinct() { assertThat(p).matches("select distinct 1 from dual") } @Test fun matchesSelectUnique() { assertThat(p).matches("select unique 1 from dual") } @Test fun matchesSelectWithGroupBy() { assertThat(p).matches("select 1 from dual group by 1") } @Test fun matchesSelectWithOrderBy() { assertThat(p).matches("select 1 from dual order by 1") } @Test fun matchesSelectWithParenthesis() { assertThat(p).matches("(select 1 from dual)") } @Test fun matchesSelectWithUnion() { assertThat(p).matches("select 1 from dual union select 2 from dual") assertThat(p).matches("(select 1 from dual) union (select 2 from dual)") } @Test fun matchesSelectWithUnionAll() { assertThat(p).matches("select 1 from dual union all select 2 from dual") assertThat(p).matches("(select 1 from dual) union all (select 2 from dual)") } @Test fun matchesSelectWithMinus() { assertThat(p).matches("select 1 from dual minus select 2 from dual") assertThat(p).matches("(select 1 from dual) minus (select 2 from dual)") } @Test fun matchesSelectWithMinusAll() { assertThat(p).matches("select 1 from dual minus all select 2 from dual") assertThat(p).matches("(select 1 from dual) minus all (select 2 from dual)") } @Test fun matchesSelectWithIntersect() { assertThat(p).matches("select 1 from dual intersect select 2 from dual") assertThat(p).matches("(select 1 from dual) intersect (select 2 from dual)") } @Test fun matchesSelectWithIntersectAll() { assertThat(p).matches("select 1 from dual intersect all select 2 from dual") assertThat(p).matches("(select 1 from dual) intersect all (select 2 from dual)") } @Test fun matchesSelectWithExcept() { assertThat(p).matches("select 1 from dual except select 2 from dual") assertThat(p).matches("(select 1 from dual) except (select 2 from dual)") } @Test fun matchesSelectWithExceptAll() { assertThat(p).matches("select 1 from dual except all select 2 from dual") assertThat(p).matches("(select 1 from dual) except all (select 2 from dual)") } @Test fun matchesSelectCountDistinct() { assertThat(p).matches("select count(distinct foo) from dual") } @Test fun matchesSelectWithAnalyticFunction() { assertThat(p).matches("select count(foo) over () from dual") assertThat(p).matches("select (count(foo) over ()) from dual") assertThat(p).matches("select func(count(foo) over ()) from dual") } @Test fun matchesSelectWithAnsiJoin() { assertThat(p).matches("select 1 from foo join bar on join.id = bar.id") } @Test fun matchesSelectWithMixedJoinSyntax() { assertThat(p).matches("select 1 from foo join bar on join.id = bar.id, baz") assertThat(p).matches("select 1 from baz, foo join bar on join.id = bar.id") } @Test fun matchesSelectWithSubqueryFactoring() { assertThat(p).matches("with foo as (select id from tab) select 1 from foo join bar on join.id = bar.id") } @Test fun matchesSelectForUpdateBeforeOrderBy() { assertThat(p).matches("select * from foo for update order by bar ") } @Test fun matchesSelectForUpdateAfterOrderBy() { assertThat(p).matches("select * from foo order by baz for update") } @Test fun matchesSelectWithParenthesisForUpdate() { assertThat(p).matches("(select 1 from dual) for update") } @Test fun matchesSelectUsingBulkAsAnAlias() { assertThat(p).matches("select 1 bulk into var from dual") } @Test fun matchesSelectBulkCollectUsingBulkAsAnAlias() { assertThat(p).matches("select 1 bulk bulk collect into var from dual") } @Test fun matchesSelectWithFetchFirstRowsOnly() { assertThat(p).matches("select 1 from dual fetch first 1 row only") } @Test fun matchesSelectWithOrderByAndFetchFirstRows() { assertThat(p).matches("select 1 from dual order by 1 fetch first 1 row only") } @Test fun matchesSelectFromValues() { assertThat(p).matches("select 1 from (values (1, 'foo'), (2, 'bar')) as t(a, b)") } @Test fun matchesShortSelect() { assertThat(p).matches("select 1") assertThat(p).matches("select 1 into var") } @Test fun matchesShortSelectWithWhere() { assertThat(p).matches("select 1 where 1 = 1") assertThat(p).matches("select 1 into var where 1 = 1") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/StartWithClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class StartWithClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.START_WITH_CLAUSE) } @Test fun matchesSimpleConnectBy() { assertThat(p).matches("start with foo = bar") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/UnpivotClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class UnpivotClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.UNPIVOT_CLAUSE) } @Test fun matchesSimpleUnpivot() { assertThat(p).matches("unpivot (amount for quarter in (q1,q2,q3))") } @Test fun matchesSimpleUnpivotWithAliases() { assertThat(p).matches("unpivot (amount for quarter in (q1 'q1', q2 as q2, q3 as q3))") } @Test fun matchesSimpleUnpivotIncludeNulls() { assertThat(p).matches("unpivot include nulls (amount for quarter in (q1,q2,q3))") } @Test fun matchesSimpleUnpivotExcludeNulls() { assertThat(p).matches("unpivot exclude nulls (amount for quarter in (q1,q2,q3))") } @Test fun matchesSimpleUnpivotWithMultipleColumns() { assertThat(p).matches( """ unpivot ( (amount, units) for quarter in ( (q1_amount, q1_units) as 'q1', (q2_amount, q2_units) as 'q2' ) ) """ ) } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/WhereClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class WhereClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.WHERE_CLAUSE) } @Test fun matchesSimpleWhere() { assertThat(p).matches("where 1 = 1") } @Test fun matchesColumnComparation() { assertThat(p).matches("where tab.col = tab2.col2") } @Test fun matchesMultipleColumnComparation() { assertThat(p).matches("where tab.col = tab2.col2 and tab.col = tab2.col2") } @Test fun matchesComparationWithSubquery() { assertThat(p).matches("where tab.col = (select 1 from dual)") } @Test fun matchesOuterJoin() { assertThat(p).matches("where tab.col(+) = tab2.col2") } @Test fun matchesTupleInSelect() { assertThat(p).matches("where (foo, bar, baz) in (select 1, 2, 3 from dual)") } @Test fun matchesTupleInValues() { assertThat(p).matches("where (foo, bar) in ((1, 2), (2, 3))") } @Test fun matchesExists() { assertThat(p).matches("where exists (select 1 from dual)") } @Test fun matchesExistsWithUnionInSubquery() { assertThat(p).matches("where exists ((select 1 from dual) union (select 2 from dual))") } @Test fun matchesNotExists() { assertThat(p).matches("where not exists (select 1 from dual)") } @Test fun matchesAny() { assertThat(p).matches("where data = any (select 1,2,3 from dual)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/sql/WithClauseTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.sql import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.DmlGrammar import com.felipebz.zpa.api.RuleTest class WithClauseTest : RuleTest() { @BeforeEach fun init() { setRootRule(DmlGrammar.WITH_CLAUSE) } @Test fun matchesSimpleWith() { assertThat(p).matches("with q as (select 1 from dual)") } @Test fun matchesMultipleSubqueries() { assertThat(p).matches("with q as (select 1 from dual), q2 as (select 1 from dual)") } @Test fun matchesRecursiveSimple() { assertThat(p).matches("with q(id, parent) as (select 1 from dual)") } @Test fun matchesRecursiveWithSearch() { assertThat(p).matches("with q(id, parent) as (select 1 from dual) search depth first by a set order1") } @Test fun matchesRecursiveWithSearchAndCycle() { assertThat(p).matches("with q(id, parent) as (select 1 from dual) search depth first by a set order1 cycle id set cycle to 1 default 0") } @Test fun matchesWithValues() { assertThat(p).matches("with q(a, b) as (values (1, 'foo'), (2, 'bar')) as t(a, b)") } @Test fun matchesFunctionDeclaration() { assertThat(p).matches("with function func return number is begin return 1; end;") } @Test fun matchesProcedureDeclaration() { assertThat(p).matches("with procedure proc is begin null; end;") } @Test fun matchesFunctionAndProcedureDeclaration() { assertThat(p).matches("with function func return number is begin return 1; end; " + "procedure proc is begin null; end;") } @Test fun matchesFunctionDeclarationAndQuery() { assertThat(p).matches("with function func return number is begin return 1; end; " + "q as (select 1 from dual)") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/statements/AssignmentStatementTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.statements import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class AssignmentStatementTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.ASSIGNMENT_STATEMENT) } @Test fun assignmentToVariable() { assertThat(p).matches("var := 1;") } @Test fun assignmentToRecordAttribute() { assertThat(p).matches("rec.attribute := 1;") } @Test fun assignmentToCollectionElement() { assertThat(p).matches("collection(1) := 1;") } @Test fun assignmentToItemInRecordCollection() { assertThat(p).matches("collection(1).field := 1;") } @Test fun assignmentToHostVariable() { assertThat(p).matches(":var := 1;") } @Test fun assignmentToIndicatorVariable() { assertThat(p).matches(":var:indicator := 1;") } @Test fun matchesLabeledAssignment() { assertThat(p).matches("<> var := 1;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/statements/BlockStatementTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.statements import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class BlockStatementTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.BLOCK_STATEMENT) } @Test fun matchesSimpleBlock() { assertThat(p).matches("begin null; end;") assertThat(p).matches("BEGIN NULL; END;") } @Test fun matchesNestedBlock() { assertThat(p).matches("begin begin null; end; end;") } @Test fun matchesBlockWithMultipleStatements() { assertThat(p).matches("begin null; null; end;") } @Test fun matchesBlockWithOneExceptionHandler() { assertThat(p).matches("begin null; exception when others then null; end;") } @Test fun matchesBlockWithMultipleExceptionHandler() { assertThat(p).matches("begin null; exception when others then null; when others then null; end;") } @Test fun matchesBlockWithOneExceptionHandlerAndMultipleExceptions() { assertThat(p).matches("begin null; exception when no_data_found or too_many_rows then null; end;") } @Test fun matchesBlockWithNameAtEnd() { assertThat(p).matches("begin null; end block_name;") } @Test fun matchesBlockWithDeclareSection() { assertThat(p).matches("declare var number; begin null; end block_name;") } @Test fun matchesBlockWithDeclareSectionWithoutDeclarations() { assertThat(p).matches("declare begin null; end block_name;") } @Test fun notMatchesBlockWithoutStatements() { assertThat(p).notMatches("begin end;") } @Test fun notMatchesBlockWithIncompleteExceptionHandler() { assertThat(p).notMatches("begin null; exception end;") } @Test fun matchesLabeledBlock() { assertThat(p).matches("<> begin null; end foo;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/statements/CaseStatementTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.statements import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CaseStatementTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.CASE_STATEMENT) } @Test fun matchesSimpleSearchedCase() { assertThat(p).matches("case when x = 1 then foo := bar; end case;") } @Test fun matchesSimpleCase() { assertThat(p).matches("case x when 1 then foo := bar; end case;") } @Test fun matchesCaseWithMultipleWhen() { assertThat(p).matches("case x when 1 then foo := bar; when 2 then foo := bar; end case;") } @Test fun matchesCaseWithElse() { assertThat(p).matches("case x when 1 then foo := bar; else foo := bar; end case;") } @Test fun matchesCaseWithMultipleStataments() { assertThat(p).matches("case when x = 1 then foo := bar; bar := baz; end case;") } @Test fun matchesCaseWithMemberIdentifier() { assertThat(p).matches("case foo.bar when 1 then foo := bar; end case;") } @Test fun matchesLabeledCase() { assertThat(p).matches("<> case when x = 1 then foo := bar; end case foo;") } @Test fun matchesCaseWithSelectorExpression() { assertThat(p).matches("case foo + bar when 1 then foo := bar; end case;") } @Test fun matchesBooleanExpressionSearchedCase() { assertThat(p).matches("case when foo is not null and bar is null then foo := bar; end case;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/statements/CloseStatementTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.statements import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CloseStatementTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.CLOSE_STATEMENT) } @Test fun matchesSimpleClose() { assertThat(p).matches("close foo;") } @Test fun matchesCloseCursorInPackage() { assertThat(p).matches("close pack.foo;") } @Test fun matchesSimpleCloseHostCursor() { assertThat(p).matches("close :foo;") } @Test fun matchesLabeledClose() { assertThat(p).matches("<> close foo;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/statements/CommitStatementTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.statements import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class CommitStatementTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.COMMIT_STATEMENT) } @Test fun matchesSimpleCommit() { assertThat(p).matches("commit;") } @Test fun matchesCommitWork() { assertThat(p).matches("commit work;") } @Test fun matchesCommitForce() { assertThat(p).matches("commit force 'test';") } @Test fun matchesCommitForceWithScn() { assertThat(p).matches("commit force 'test',1;") } @Test fun matchesCommitWithComment() { assertThat(p).matches("commit comment 'test';") } @Test fun matchesCommitWrite() { assertThat(p).matches("commit write;") } @Test fun matchesCommitWriteImmediate() { assertThat(p).matches("commit write immediate;") } @Test fun matchesCommitWriteBatch() { assertThat(p).matches("commit write batch;") } @Test fun matchesCommitWriteWait() { assertThat(p).matches("commit write wait;") } @Test fun matchesCommitWriteNoWait() { assertThat(p).matches("commit write nowait;") } @Test fun matchesLongCommitStatement() { assertThat(p).matches("commit work comment 'teste' write immediate wait;") } @Test fun matchesLabeledCommit() { assertThat(p).matches("<> commit;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/statements/ContinueStatementTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.statements import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ContinueStatementTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.CONTINUE_STATEMENT) } @Test fun matchesContinue() { assertThat(p).matches("continue;") } @Test fun matchesContinueFromLabel() { assertThat(p).matches("continue foo;") } @Test fun matchesContinueWhen() { assertThat(p).matches("continue when true;") } @Test fun matchesLabeledContinue() { assertThat(p).matches("<> continue;") } @Test fun matchesLongContinue() { assertThat(p).matches("continue foo when true;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/statements/DeleteStatementTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.statements import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class DeleteStatementTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.DELETE_STATEMENT) } @Test fun matchesSimpleDelete() { assertThat(p).matches("delete tab;") } @Test fun matchesDeleteFrom() { assertThat(p).matches("delete from tab;") } @Test fun matchesDeleteWithWhere() { assertThat(p).matches("delete from tab where x = 1;") } @Test fun matchesDeleteWithAlias() { assertThat(p).matches("delete tab t;") } @Test fun matchesDeleteWithSchema() { assertThat(p).matches("delete sch.tab;") } @Test fun matchesDeleteCurrentOf() { assertThat(p).matches("delete tab where current of cur;") } @Test fun matchesLabeledDelete() { assertThat(p).matches("<> delete tab;") } @Test fun matchesDeleteFromQuery() { assertThat(p).matches("delete (select * from dual);") } @Test fun matchesDeleteWithReturningInto() { assertThat(p).matches("delete from tab returning x bulk collect into y;") } } ================================================ FILE: zpa-core/src/test/kotlin/com/felipebz/zpa/api/statements/ExecuteImmediateStatementTest.kt ================================================ /** * Z PL/SQL Analyzer * Copyright (C) 2015-2026 Felipe Zorzo * mailto:felipe AT felipezorzo DOT com DOT br * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.felipebz.zpa.api.statements import com.felipebz.flr.tests.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import com.felipebz.zpa.api.PlSqlGrammar import com.felipebz.zpa.api.RuleTest class ExecuteImmediateStatementTest : RuleTest() { @BeforeEach fun init() { setRootRule(PlSqlGrammar.EXECUTE_IMMEDIATE_STATEMENT) } @Test fun matchesSimpleExecuteImmediate() { assertThat(p).matches("execute immediate 'command';") } @Test fun matchesExecuteImmediateIntoVariable() { assertThat(p).matches("execute immediate 'command' into var;") } @Test fun matchesExecuteImmediateIntoRecord() { assertThat(p).matches("execute immediate 'command' into rec.field;") } @Test fun matchesExecuteImmediateIntoField() { assertThat(p).matches("execute immediate 'command' into tab(i).field;") } @Test fun matchesExecuteImmediateBulkCollectIntoVariable() { assertThat(p).matches("execute immediate 'command' bulk collect into var;") } @Test fun matchesExecuteImmediateIntoMultipleVariables() { assertThat(p).matches("execute immediate 'command' into var, var2;") } @Test fun matchesExecuteImmediateBulkCollectIntoMultipleVariables() { assertThat(p).matches("execute immediate 'command' bulk collect into var, var2;") } @Test fun matchesExecuteImmediateUsingWithVariable() { assertThat(p).matches("execute immediate 'command' using var;") } @Test fun matchesExecuteImmediateUsingWithMultipleVariables() { assertThat(p).matches("execute immediate 'command' using var, var2;") } @Test fun matchesExecuteImmediateUsingWithExplicitInVariable() { assertThat(p).matches("execute immediate 'command' using in var;") } @Test fun matchesExecuteImmediateUsingWithOutVariable() { assertThat(p).matches("execute immediate 'command' using out var;") } @Test fun matchesExecuteImmediateUsingWithInOutVariable() { assertThat(p).matches("execute immediate 'command' using in out var;") } @Test fun matchesLabeledExecuteImmediate() { assertThat(p).matches("<