Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Scripting language with a support for array interface

Re: Scripting language with a support for array interface

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Mon, 28 Nov 2005 04:42:12 GMT
Message-Id: <pan.2005.11.28.04.42.11.616781@sbcglobal.net>


On Sun, 27 Nov 2005 21:05:04 -0500, Mark C. Stock wrote:

> 
> "Mladen Gogala" <gogala_at_sbcglobal.net> wrote in message 
> news:pan.2005.11.28.01.58.22.927933_at_sbcglobal.net...

>> Is there any scripting language with the support for array
>> interface? Perl doesn't have it nor does PHP. What about Python?
>> Does it support array bind and, if it does, does it cheat like DBI
>> which breaks the array under the hood and internally performs a
>> loop, or does it do it for real?
>> --
>> http://www.mgogala.com
>>
> 
> Assuming you're writing web apps, why not PL/SQL via mod_plsq?
> 

That assumption would definitely be wrong. I don't need array interface for the web applications. Web application typically deals with data entry and pretty presentation, not with huge masses of data which would require use of the array interface. No, I am having problems with loading 20,000,000 rows which need parsing before I can load them. The type of application which needs things like bulk load, array interface or the combination of both is data load/unload. Here is a code snippet from the script:

my $sth = $dbh->prepare("insert into test_table values(?,?)"); $sth->bind_param_array( 1, \@id );
$sth->bind_param_array( 2, \@text );

print STDERR "Loading with array size=$arrsize\n"; while (<>) {

    chomp;
    my @row = split(/,/);
    push @id, $row[0];
    push @text, $row[1];
    if ( ++$ind == $arrsize ) {

        $sth->execute_array( { ArrayTupleStatus => \@stat } );
        $ind  = 0;
        @id   = ();
        @text = ();

    }
    ++$cnt;
}
if ( $ind > 0 ) {

    $sth->execute_array( { ArrayTupleStatus => \@stat } ); }

As you can see, it's not even remotely looking like the web application. I temporarily solved the problem by creating a comma separated file that I will further load by SQL*Loader, which does support array interface as well as direct load. I hate this patchwork solution, but if I do want to load 20,000,000 before I'm eligible for social security check, I do need at least the array interface, if not the direct load support. So, my question remains: is there a scripting language with regular expressions and array interface support? Does Python have the array interface support? What pisses me off with Perl is that it chats. The guy who wrote it is dreaming about DBI 2, its architecture, layers and alike and this feature has been requested forever and he didn't deliver it. I guess you get what you pay for. If there is a decent scripting language that does it, I'll get rid of the Perl junk and switch to something usable.

-- 
http://www.mgogala.com
Received on Sun Nov 27 2005 - 22:42:12 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US