Skip Menu |

This queue is for tickets about the SQL-SplitStatement CPAN distribution.

Report information
The Basics
Id: 57971
Status: resolved
Priority: 0/
Queue: SQL-SplitStatement

People
Owner: Nobody in particular
Requestors: dhorne [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.01002
Fixed in: 0.05002



Subject: Oracle DDL not recognised
consider the following <code> use strict; use SQL::SplitStatement; use Data::Dumper; my $ddl = q{ create or replace procedure test (num1 number) is v_test varchar2; begin select col1 into v_test from my_tab; end; / create table my_tab( col1 varchar2(30), col2 number ); insert into my_tab(col1, col2) values ('hello', 3); }; my $sql_splitter = SQL::SplitStatement->new; my @statements = $sql_splitter->split($ddl); print Dumper(@statements); </code> The DDL contains 3 statements - create a stored procedure, create a table and insert date into the table. The parsed statements are: $VAR1 = 'create or replace procedure test (num1 number) is v_test varchar2'; $VAR2 = 'begin select col1 into v_test from my_tab; end'; $VAR3 = '/ create table my_tab( col1 varchar2(30), col2 number )'; $VAR4 = 'insert into my_tab(col1, col2) values (\'hello\', 3)'; Oracle stored objects (procedures, packages, triggers, functions) must always end with a slash. Statements within these objects must end with a semi-column. Standard DDL can end with a semi-colon or a forward slash. Our case tool always generates slashes, so I prefer them to semi-colons when working with Oracle. Ultimately, I'd like to use SQL::SplitStatement to replace my own homegrown but potentially more brittle splitting of SQL statements in DBIx::VersionedDDL. Thanks Dan
Hi Dan! Thank you for your report (and for your precious help by private mail!) This has (hopefully) been fixed in version 0.05000 and further enhanced in the succeeding versions. Please have a look at: t/70-oracle_proc_mixed.t http://cpansearch.perl.org/src/EMAZEP/SQL-SplitStatement-0.05003/t/70-oracle_proc_mixed.t t/71-oracle_proc_RTbug_57971.t http://cpansearch.perl.org/src/EMAZEP/SQL-SplitStatement-0.05003/t/71-oracle_proc_RTbug_57971.t t/72-oracle_proc_package.t http://cpansearch.perl.org/src/EMAZEP/SQL-SplitStatement-0.05003/t/72-oracle_proc_package.t and let me know if that's satisfactory for you. Thank you again! -Emanuele
Subject: Re: [rt.cpan.org #57971] Oracle DDL not recognised
Date: Mon, 21 Jun 2010 10:45:00 +1200
To: bug-SQL-SplitStatement [...] rt.cpan.org
From: Dan Horne <dan.horne [...] redbone.co.nz>
Hey there Emanuele - thanks for looking at this! I'll test over the next few days. I'll also look to generating further tests for your module if any of my code fails. Cheers Dan On 20 June 2010 15:31, Emanuele Zeppieri via RT < bug-SQL-SplitStatement@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=57971 > > > Hi Dan! > > Thank you for your report (and for your precious help by private mail!) > > This has (hopefully) been fixed in version 0.05000 and further enhanced in > the succeeding versions. > > Please have a look at: > > t/70-oracle_proc_mixed.t > > http://cpansearch.perl.org/src/EMAZEP/SQL-SplitStatement-0.05003/t/70-oracle_proc_mixed.t > > t/71-oracle_proc_RTbug_57971.t > > http://cpansearch.perl.org/src/EMAZEP/SQL-SplitStatement-0.05003/t/71-oracle_proc_RTbug_57971.t > > t/72-oracle_proc_package.t > > http://cpansearch.perl.org/src/EMAZEP/SQL-SplitStatement-0.05003/t/72-oracle_proc_package.t > > and let me know if that's satisfactory for you. > > Thank you again! > -Emanuele >