ObjectContext.CreateDatabaseScript() in dotConnect for Oracle (v. 8.3.115) separates single statements in the generated script using slash (/) as a delimiter. Moreover, there is no delimiter after the very last statement in the script.
This behavior seems to be incorrect. The slash has only a (special) meaning in SQL*Plus (a client tool), but not in Oracle SQL dialect itself (i.e. PL/SQL). In PL/SQL, single statements should end with a semicolon (;). Explanations: http://community.oracle.com/thread/405461, http://stackoverflow.com/a/10207695
So, for a script generated with ObjectContext.CreateDatabaseScript() to be tool-agnostic, its single statements (including the very last one) should end with a semicolon (no slashes allowed). Or at least there should be an option which delimiter to use.
Note, that the following issues may also be concerned:
http://forums.devart.com/viewtopic.php?f=1&t=29216
http://forums.devart.com/viewtopic.php?f=1&t=29217
Statement delimiters used by ObjectContext.CreateDatabaseScript()
-
- Posts: 57
- Joined: Tue 11 Mar 2014 07:49
Statement delimiters used by ObjectContext.CreateDatabaseScript()
Last edited by Dennis Wanke on Fri 11 Apr 2014 08:37, edited 1 time in total.
Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()
ObjectContext.CreateDatabaseScript() in dotConnect for Oracle generates the script (with slashes) which can be executed in SQL*Plus or other tools (e.g.: Devart DbForge Studio for Oracle) or via OracleScript. All of them can execute scripts with slashes.Dennis Wanke wrote:This behavior seems to be incorrect. The slash has only a (special) meaning in SQL*Plus (a client tool), but not in Oracle SQL dialect itself (i.e. PL/SQL). In PL/SQL, single statements should end with a semicolon (;).
ObjectContext.CreateDatabaseScript() in dotConnect for Oracle does not generate anonymous PL/SQL block (which requires semicolon as a delimiter).
-
- Posts: 57
- Joined: Tue 11 Mar 2014 07:49
Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()
Then, what is the reason of omitting the trailing slash in the script (after the very last statement)? According to SQL*Plus docs, the slash triggers the excution of the current buffer (i.e. the very last statement). Or am I wrong here?Shalex wrote: ObjectContext.CreateDatabaseScript() in dotConnect for Oracle generates the script (with slashes) which can be executed in SQL*Plus or other tools (e.g.: Devart DbForge Studio for Oracle) or via OracleScript. All of them can execute scripts with slashes.
ObjectContext.CreateDatabaseScript() in dotConnect for Oracle does not generate anonymous PL/SQL block (which requires semicolon as a delimiter).
It also makes impossible to concatenate two ore more scripts (e.g. for different schemas) into a single string without having to know exactly which delimiter is to be used. And it's a real show-stopper in provider-agnostic scenarios.
Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()
We will inform you when the issue with omitting the trailing slash after the very last statement in the script generated by ObjectContext.CreateDatabaseScript() is fixed.
Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()
The behaviour is changed in the new 8.3.146 build of dotConnect for Oracle: now a slash after the very last statement is generated in the Code-First CreateDatabaseScript() functionality. In the current implementation a slash is generated if there is more than one statement in the generated script.
Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()
Starting from the 8.3.161 build of dotConnect for Oracle, a generation of the slash after the very last statement doesn't depend on the amount of the statements in the generated script.Shalex wrote:In the current implementation a slash is generated if there is more than one statement in the generated script.