Statement delimiters used by ObjectContext.CreateDatabaseScript()

Statement delimiters used by ObjectContext.CreateDatabaseScript()

Postby Dennis Wanke » Thu 27 Mar 2014 09:58

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
Last edited by Dennis Wanke on Fri 11 Apr 2014 08:37, edited 1 time in total.
Dennis Wanke
 
Posts: 57
Joined: Tue 11 Mar 2014 07:49

Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()

Postby Shalex » Fri 28 Mar 2014 17:27

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 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).
Shalex
Devart Team
 
Posts: 7703
Joined: Thu 14 Aug 2008 12:44

Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()

Postby Dennis Wanke » Fri 11 Apr 2014 08:48

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).


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?
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.
Dennis Wanke
 
Posts: 57
Joined: Tue 11 Mar 2014 07:49

Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()

Postby Shalex » Fri 11 Apr 2014 13:59

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.
Shalex
Devart Team
 
Posts: 7703
Joined: Thu 14 Aug 2008 12:44

Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()

Postby Shalex » Thu 24 Apr 2014 16:40

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.
Shalex
Devart Team
 
Posts: 7703
Joined: Thu 14 Aug 2008 12:44

Re: Statement delimiters used by ObjectContext.CreateDatabaseScript()

Postby Shalex » Fri 16 May 2014 11:26

Shalex wrote:In the current implementation a slash is generated if there is more than one statement in the generated script.

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
Devart Team
 
Posts: 7703
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle