SPUG: insert Clob problems

Brittingham, John john.brittingham at attws.com
Wed Sep 12 14:20:33 CDT 2001

I get the following error when I try to insert a CLOB using DBI: Not a CODE
reference at extract_ccml__to_oracle_db_testing.pl line 381, <FILE_NAMES>
line 1. What am I doing wrong?

380 $sth = $dbh->prepare(qq{INSERT INTO t_opr_instr (
381 $sth->( 1, $subproc_heading[$n]);
382 $sth->( 2, $dscr, SQL_LONGVARCHAR);
383 $sth->( 3, $ord_seq);
384 $sth->( 4, $prd_model_spec_item_id);
385 $sth->execute ; 

-----Original Message-----
From: Ruchi Varma [mailto:ruchi at synopsys.COM]
Sent: Wednesday, September 12, 2001 11:08 AM
To: dbi-users at perl.org
Subject: dynamic loading...


  I had previously sent a message, regarding dynamic loading, on this
newsgroup since i had problems installing   DBD on my Solaris Box. I hence
used the perl executable, created by the DBI installation in the dir
/remote/tools/ruchi/perl5/site_perl/5.005/DBI-1.20/, to install DBD and it
worked. But now when i run my cgi script using the DBI and DBD i have
installed, it gives me the same error concerning Dynamic Loading. I have
attached my script to this message ..Please look at it and give me some
comments on how to solve this problem.

#!/remote/tools/ruchi/perl5/site_perl/5.005/DBI-1.20/perl -- -*-perl-*-
 # I also tried using /usr/local/bin/perl5.6   ..but no luck...

use lib qw(/remote/tools/ruchi/perl5
use DBI;
use CGI;
use CGI::Carp qw(fatalsToBrowser);

$driver = "mysql";
$dsn = "DBI:$driver:database = ASSETLOCATOR";
$dbUserName = "root";
$dbPassword = "blah";

$dataIn       = new CGI;
$requestType  = $dataIn->param('requestType');
$sql  = $dataIn->param('sql');

if ($sql eq "")
        $dbh = &connectToDB();
        $dataObject = executeSQLStatement($sql);
        @dbRows = &getDBRows($dataObject);
        if ($sql =~ /^SELECT/i)
                print qq!
                <TITLE>SQL Statement results</TITLE>
                <BODY BGCOLOR = "FFFFFF" TEXT = "000000">
                <TABLE BORDER = "1">!;
                foreach $rowReference (@dbRows)
                        foreach $columnReference (@$rowReference)
                                print qq!<TR>!;
                                foreach $column (@$columnReference)
                                        print qq!<TD>$column</TD>\n!;
                                print qq!</TR>!;
                print qq!
                  print "Your SQL Query has been processed, please hit the
button and submit a SELECT to see the changes!";

sub connectToDB
        return (DBI->connect($dsn, $dbUserName, $dbPassword));
sub executeSQLStatement
        my ($sql) = shift;
        $dataObject = $dbh->prepare($sql);
        return $dataObject;

sub getDBRows
        my ($dataObject) = shift;
        return $dataObject->fetchall_arrayref();

sub printSearchForm
        print qq!
        <TITLE>Enter SQL</TITLE>
        <BODY BGCOLOR = "FFFFFF" TEXT = "000000">
        <FORM METHOD = "POST" ACTION = "query.cgi">
        <TABLE BORDER = "1">
        <TH>Enter SQL Query</TH>
        <TD><INPUT TYPE = "TEXT" SIZE = "40" NAME = "sql"></TD>
        <TD><INPUT TYPE = "SUBMIT" NAME = "requestType" VALUE = "Submit
the dir /remote/tools/mysql has mysql installed
the dir /remote/tools/ruchi/perl5/site_perl/5.005 has both DBD and DBI

The error i get is 
Can't load module DBI, dynamic loading not available in this perl.
  (You may need to build a new perl executable which either supports
  dynamic loading or has the DBI module statically linked into it.)
 at /remote/tools/ruchi/perl5/site_perl/DBI.pm line 189
BEGIN failed--compilation aborted at
/remote/tools/ruchi/perl5/site_perl/DBI.pm line 189.
Compilation failed in require at query.cgi line 6.
BEGIN failed--compilation aborted at query.cgi line 6.

Since the problem appears due to the perl version i am using, which perl
version should i use? As far as i know perl versions from 5.004 onwards
support dynamic loading. But i am using version 5.6...and it still does not
seem to work..:(

kindly help..

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/archives/spug-list/attachments/20010912/e1200738/attachment.htm

More information about the spug-list mailing list