OracleScript inserting extra line endings

OracleScript inserting extra line endings

Postby Simon C » Fri 08 Jan 2010 14:18

When I run the following script in SQL developer:
Code: Select all
create or replace procedure proc1 as
begin
  null;
end;
/

I get the following stored in user_source (with line endings shown):
Code: Select all
create or replace procedure proc1 as\n
begin\n
  null;\n
end;


But if I run the same script using OracleScript (devart dll version 5.35.57.0), I get this stored in the database:
Code: Select all
create or replace procedure proc1 as\n
begin\n
  null;\n
end;\n


How do I get the same behaviour with regards to line endings between sql developer and oraclescript?
Simon C
 
Posts: 11
Joined: Mon 14 Dec 2009 16:33

Postby StanislavK » Fri 08 Jan 2010 16:09

Could you please specify the code you use to set OracleScript up?

The OracleScript class doesn't parse the command text, thus, if you use something like
Code: Select all
oracleScript.ScriptText = @"create or replace procedure proc1 as
begin
     null;
end;
";

the latter line break will get into the database.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby Simon C » Fri 08 Jan 2010 16:13

The code I'm using is (in a standalone console app):
Code: Select all
const string scripttext = @"
create or replace procedure proc1 as
begin
  null;
end;
/";

using (var conn = new OracleConnection("Data Source=SC_11GDB1;user=xxxx;Password=xxxx")) {
    OracleScript script = new OracleScript(scripttext, conn);

    conn.Open();
    script.Execute();
}


It may not parse it, but I would expect it to have the same behaviour as sql developer...
Simon C
 
Posts: 11
Joined: Mon 14 Dec 2009 16:33

Postby StanislavK » Mon 11 Jan 2010 09:53

The OracleScript behaviour is quite straight-forward: what you enter in the command text is what you will have in the database. Besides, without parsing, the performance is substantially increased.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to dotConnect for Oracle