$dbh->do() executes your sql. You are binding the parameter after this.
Use $dbh->prepare instead.
On Mon, Jun 4, 2012 at 2:01 PM, Bruce Johnson
wrote:
> I'm getting the following error:
>
> [Mon Jun 04 09:14:49 2012] [error] [client 128.196.45.237]
> DBD::Oracle::db do failed: ORA-01008: not a
That proc is not failing.
Try running it in ssms:
declare @p1 varchar(50) = 'test'
,@p2 int;
exec dbo.error_test @p1,@p2 output;
select @@ERROR ;
select @p2;
Now change the proc to actually fail:
alter procedure error_test (@p1 varchar(50), @p2 int output)
as
I don't have an Oracle database at hand at the moment, but I believe
that querying v$database, v$instance and/or v$parameter should get you
most of what you want in Oracle.
On Wed, May 26, 2010 at 8:37 AM, Barlow, Ed wrote:
> Hi Guys
>
>
>
> For the past few years have been writing an advanced en
seconds
>>
>> PFA the Perl script used for testing. Let me if any of you interested in
>> viewing the sqlldr control scripts.
>>
>> Cheers,
>> Parag
>>
>>
>>
>> On Sun, May 2, 2010 at 12:27 PM, Jeffrey Seger wrote:
>>
>>> M
My experience is that DBD::Oracle using the array interface is
comparable performance-wise to SQLLDR in conventional path mode.
However, SQLLDR can also be called in direct path mode, which is even
faster, but you should really know what you are doing before using
that. It has implications beyond
On Fri, Apr 30, 2010 at 4:36 PM, Ovid wrote:
> - Original Message
>> From: "Song, Melinda"
>
>
>> I am using DBI to connect to a DB2 LUW database. It seems I cannot use DBI to
>> issue the IMPORT command.
>
>> my $dbh = DBI->connect(
>> "dbi:MSDB2:$DB_NAME", '', '', { 'RaiseError' => 1 }
On Thu, Dec 17, 2009 at 9:44 AM, Thakore, Kartik
wrote:
> HI Praveen,
>
> I am getting the same problem. The weird thing Is I have both those files in
> C:\Program Files\IBM\SQLLIB\lib
>
> C:\ >set LIB=C:\Program Files\IBM\SQLLIB\lib
>
> C:\ >set DB2_HOME=C:\Program Files\IBM\SQLLIB\lib
>
> C:\ >
On Wed, Jul 22, 2009 at 11:50 PM, col wrote:
> Consider this:
>
> my $sth = $dbh->prepare("INSERT INTO [DATATEST] ( [billingterms], [carrier],
> [class (1)], [class (2)], [class (3)], [class (4)], [client], [consignee],
> [cube (1)], [cube (2)], [cube (3)], [cube (4)], [description (1)],
> [desc
On Wed, Nov 12, 2008 at 7:26 PM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> "Jeffrey Seger" schreef:
>
>> Are you using do() instead of prepare()? Placeholders go into with
>> prepared statements, not immediate executions.
>
> See the DBI documentation:
>
> "DBD::mysql::db do failed:
On Wed, Nov 12, 2008 at 4:31 PM, Bruce Johnson
<[EMAIL PROTECTED]> wrote:
> I'm trying something along the lines of:
>
> insert into foo(fname, lname, phone, dateadded, status, datemodified) values
> (?,?,?,curdate(),1,curdate())
>
> and it's failing saying I have an s
Standard troubleshooting applies:
1. Are you running the script as the same user? and with the same
environment? (If you are running it in a webserver probably not).
2. Is this running under apache? If so, are the same environment variables
being set in httpd.conf? Or are the old 8.1.6 variables
Is this a business critical database? If so, I would go back to the
business and make an argument that the current database not be allowed to go
away till the new database is in place, migrated and tested. Regardless of
the tool you use to migrate it, you will run the risk of data loss if the
old
What is not clear is how this is dbi related. Unless there is a dbi related
question, I'd suggest that you'd be better served if you asked this question
over at perl monks.
On Mon, May 19, 2008 at 9:12 AM, <[EMAIL PROTECTED]> wrote:
> Hi Dear Friends,
>
> I want to connect to remote m/c
begin proctest(?); end;
is the more desirable syntax for calling oracle procedures. It's an
anonymous pl/sql block. I personally had never seen the "call proctest()"
syntax used in Oracle. It's valid syntax, but it doesn't appear to be doing
what you want it to do.
According to the Oracle docum
On your execution without a bound value, are you actually looking for rows
where the empno column is null? If so, try this:
instead of
my @bind1 = ();
try:
my @bind1 = (undef);
Otherwise, what exactly are you looking for?
Actually, even that may not get you the null rows now that I think about
On 1/10/07, Brimacomb, Brent <[EMAIL PROTECTED]> wrote:
: [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=HY009 at
AACTSS.pl line 38
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver] CLI0124E
Invalid argument value. SQLSTATE=HY009 at AACTSS.pl
What error are you seeing?
On 1/10/07, Brimacomb, Brent <[EMAIL PROTECTED]> wrote:
Well I'm new to both Perl and DBD::DB2, so please bare with me.
I've installed the latest Active state Perl, the latest DBI and DBD::DB2
from CPAN.
I'm trying to develop a program that runs on a Windows server t
On 1/10/07, David Landgren <[EMAIL PROTECTED]> wrote:
Shail Dahal wrote:
> rename didnot work across the file system as it states
> in Perldoc, in that case mv command is a saver..
In that case, use File::Copy, which is a core module, and someone else
has already dealt with the fiddly issues of
If you have a "normal" installation...in particular, your tnsnames.ora
and any whatever other .ora files reside in
$ORACLE_HOME/network/admin/. Then only $ORACLE_HOME need be supplied,
then you can create a connection for every database in your
tnsnames.ora file if you like. If tnsnames.ora resid
Juan: We can keep playing 20 questions here, or you can post the
actual code. I am not going to keep trying to guess what is happening
without seeing what's going on. Nothing that you've described so far
should cause an out of memory condition, but there are numerous spots
in what you've descri
Have you run 'ppm describe Test-Simple' to confirm that that is what
you actually have (or perl -MTest::Simple -e "print
$Test::Simple::VERSION" )? I can't confirm on my laptop that
Test-Simple was put in before or together with DBI, but this is a way
you can confirm that it's actually on yours.
All that you need to know to set
this up can be found in the perldocs for DBD::Proxy and
DBD::ProxyServer.
Correction: DBI::ProxyServer
--
--
The darkest places in hell are reserved for
On 9/29/06, Justin Findlay <[EMAIL PROTECTED]> wrote:
Is it possible to connect to an MS access database on windows from Linux
To the best of my knowledge, MS Access provides no listener capable of
accepting connections without an ODBC DSN being present. However, you
can set up a DBI proxy on
I have this script under, it doesn't work.
I have installed the module DBD-Oracle on my Windows platform, I have a
Oracle client who's working in SQLplus mode.
I see that you've added the path to your oracle home to your PATH
environment variable, but have you added ORACLE_HOME to your
enviro
uto/DBI/DBI.so:
wrong ELF class: ELFCLASS64 at
/opt/ActivePerl-5.8/lib/5.8.8/sun4-solaris-thread-multi/DynaLoader.pm line
230.
at /opt/ActivePerl-5.8/lib/site_perl/5.8.8/sun4-solaris-thread-multi/DBI.pm
line 259
Do you have any other suggestions? I really appreciate the help,
Thanks,
- Jon
Add some "or die" clauses to your prepare and execute statements, like
you did to your connect.
On 8/21/06, rohit bhute <[EMAIL PROTECTED]> wrote:
This is my code.
#! C:\Perl\bin\perl.exe -w
use strict;
use DBI;
use CGI qw(:standard);
use CGI::Carp ;
use CGI::Carp 'fatalsToBrowser' ;
print
It's important to compile DBI with the same compiler that perl was
compiled with. Active State's perl IIRC is a precompiled binary that
may well have been compiled with another compiler. You can fin d out
by examining the output of perl -V.
If it turns out that you don't have the same compiler a
I think at this point, you are going to have to post some code, and
maybe throw in the output of adding:
use Data::Dumper;
warn Dumper %ENV;
in order to get much meaningful help.
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dant
On 8/16/06, Loo, Peter # PHX <[EMAIL PROTECTED]> wrote:
Hi John,
It turns out that the INSTANCE that I am trying to connect to is a
32-bit 9.2 Oracle database while my profile is pointing to Oracle 10.2
path. Once I changed the ORACLE_HOME to /opt/app/oracle/product/9.2,
the connection worked.
It reads the $TNS_ADMIN environment variable, or if that is not set,
the $ORACLE_HOME in which case it appends the default network/admin to
find it.
On 8/15/06, Rowe, Dolores A <[EMAIL PROTECTED]> wrote:
Teammates,
How does the DBI module know which tnsnames.ora file (from Oracle) to
use ?
tan
My bad for just spotting syntax and not thinking about ODBC. Yes, you
can create a DSN via the control panel->Administrative Tools->Data
Sources (assuming win XP). I've always used System DSN's, rather than
file based, but the syntax for a filebased one is in perldoc
DBD::ODBC.
Actually, readin
From perldoc DBI:
Examples of $data_source values are:
dbi:DriverName:database_name
dbi:DriverName:[EMAIL PROTECTED]:port
dbi:DriverName:database=database_name;host=hostname;port=port
You have a colon where you need a semicolon:
DBI->connect("DBI:O
Just for the sake of completeness, are you logging in as 'SYSTEM' in
your perl script?
Or are you logging in as a user which might not have permission to
see the table?
-Chris
In his original post, he did show that he was logged in, at least on
sqlplus, as system. I assumed he was in DBD::Ora
Is TABLESPACE_NAME the same as schema?
No, table_space refers to the set of physical files (one or several
files) that a particular table is stored in. One table space may
house several schemas (such as USERS) and/or one schema may span
several tablespaces, though each schema has a default t
On 4/27/06, Michael Garfield Sørensen, CeDeT <[EMAIL PROTECTED]> wrote:
>
>
> VS:
>
> Depending on your Perl version, you might try http://www.cedet.dk/perl
> - it has copies from ftp.esoftmatic.com for AS Perl 5.8.0,2,3,4!
>
> HTH
> Michael Garfield Sørensen, CeDeT
>
Michael: Thanks! You're a li
> > Any other repositories anyone knows of where I can download this?
>
> I tried a few sites, but can't see Oracle stuff.
>
> As a last resort, try http://dada.perl.it/#ppm
> and go round the PerlRing site by site :-(.
>
>
Thanks Ron. I tried the "search the ring" tool on the perlring and no joy.
Any other repositories anyone knows of where I can download this?
ftp.esoftmatic.com and ppm.activestate.com have both been unreachable all
day. Google has been uncharacteristically unhelpful.
tia,
jeff
--
It's a numeric field and you are trying to insert an empty string rather
than undef (equivalent to null).
When you queried the other database and had the values in memorynot
written to a file... they stayed undef. When you split the row from the
file, you have empty strings rather than undef
>
>
>
> Single quoted strings do not do backslash substitution (except for \\
> and \'). You meant $lsep = "\n";
>
>
> > Also, how can I force it so that the output does not have the quotes
> > for every field?
>
> DBI::neat() won't quote the value if it knows it's a number.
> Unfortunately, I'm n
Ok, you're right. Let's stop now as we are not adding to anyone's
knowledge of DBI or DBD::*.
On 4/14/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> Jeffrey Seger schreef:
> > Dr.Ruud:
> >> JupiterHost.Net:
> >>>> Dr.Ruud:
> >>>>
.Net" schreef:
> >> Dr.Ruud:
> >>> Jeffrey Seger:
>
> >>>> perl -MData::Dumper -e' print Dumper @INC'
> >>>
> >>> Alternative:
> >>> perl -MData::Dumper -e' print Data::Dumper->Dump([EMAIL PROTECTED],
> >
Run the following lines in both the command line and crontab:
perl -MData::Dumper -e' print Dumper @INC' >~/inc.log
env|sort >~/env.log
The first will have output that looks something like this:
perl -MData::Dumper -e' print Dumper @INC'
$VAR1 = '/usr/lib/perl5/5.8.7/i586-linux-thread-multi';
$
dlvry_freq_typ_cde, dlvrb_error_flg_desc,
> std_err_thrhld_nbr, std_err_ind, actl_dlvry_dte, dlvry_frmt_typ_desc,
> study_nam, study_anlys_desc, slsfc_nam, client_long_nam,
> std_err_rsn_desc, sob_clsfy_row_cnt, sob_prctr_demo_row_cnt,
> sob_pay_typ_row_cnt, sob_sw_dtl_row_cnt, sob_prc
ing = "$sqlString" . " table_name = lower(\'$tblName\')";
> $sqlString = "$sqlString" . " order by column_sequence_nbr";
> }
> else {
> print "This database driver $dbDriver is not supported at this
> time.\n";
&
In order to figure out what's going awry, I'd need to see some code.
Preferably the minimum amount necessary to replicate the error.
Also, do you have multiple statement handles attached to this dbh? Try
printing $sth->{Statement} rather than $dbh->{Statement}. Are you checking
for errors at the
I can attest that there is no max number of rows set, or at least if there
is, it's way higher than 35k. I have pulled hundreds of thousands of rows
from an informix database using DBI with no limit found yet. However, what
you are doing with those rows matters greatly. If you are throwing them
Is $ORACLE_HOME set to the correct path?
If the tnsnames.ora is not in $ORACLE_HOME/network/admin/, is $TNS_ADMIN set
to the actual location of the file?
On 09 Dec 2005 15:37:33 +0200, Claude <[EMAIL PROTECTED]> wrote:
>
> I run locally a client script which fails with the following message:
>
>
oops, meant to reply to the list.
-- Forwarded message --
From: Jeffrey Seger <[EMAIL PROTECTED]>
Date: Oct 15, 2005 9:34 PM
Subject: Re: DBD-AnyData, Handle cleared whilst still active...
To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
I haven't traced
I'm getting the exact same warning in a script that uses DBD::ODBC. If I run
exactly the same code using DBD::Oracle the warning doesn't appear. I didn't
do the install, so I can't tell you whether the warning appeared during the
install, but I expect not.
All of the rows got committed to the data
>Of course, you will need to prepare a new statement every time the number
of
>entries changes.
unless you "cache" your statement handles that is:
unless (defined([EMAIL PROTECTED])){
[EMAIL PROTECTED] = $dbh->prepare(<<"EndOfSQL");
SELECT TO_CHAR(SUM(budget_amount), '$999,999,999.99')
FROM t_cu
Can you post the code that is producing that error?
On 9/13/05, Jain, Abhay K, ALABS <[EMAIL PROTECTED]> wrote:
>
> I am new to DBI. I wrote a simple program and I get the following in
> prepare method.
>
> DBD::Oracle::db prepare failed: ORA-00936: missing expression (DBD: error
> possib
> ly
1) This is way off topic for this list.
2) You can't pass a hash in that way. When you build a system call like
that, everything is semantic. If there are particular keys in that hash
that you want to dereference and pass, you can do that.
Or you can do something like this: (you'll have to
Then post the code to the list, and let's see if someone can spot what's
going on.
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
"Hawkes, Richard" <[EMAIL PROTECTED]>
05/04/2005 09:01 AM
chard" <[EMAIL PROTECTED]>
05/04/2005 04:58 AM
To: Jeffrey Seger/Corporate/[EMAIL PROTECTED], "Hawkes, Richard"
<[EMAIL PROTECTED]>
cc: "''dbi-users@perl.org' '"
Subject:RE: ORA-03113 Error f
That's a client side error meaning that you have been disconnected without
trapping the server side error.
Try setting RaiseError => 1 in your dbhandle and see if that gets the
server side error.
$dbh = DBI->connect($dsn, $user, $password,
{ RaiseError => 1, AutoCom
[EMAIL PROTECTED] jseger]$ perl -MDBD::Oracle -e'print
$DBD::Oracle::VERSION . "\n"'
1.15
[EMAIL PROTECTED] jseger]$ perldoc DBD::Oracle
/SYSDBA
...skipping
ora_session_mode
The ora_session_mode attribute can be used to connect with
SYSDBA
authorization and SYSOPER
I'm always cautious of slurping (files or result sets) like that.
Depending on the size of your result set, that can wind up being a huge
array, which of course is then held in memory until it's discarded, or
until the program ends. If it's only a few thousand rows, go for it, but
if it's a fe
I have seen similar questions regarding any number of sql based command
line tools (mysql, isql, sql*plus, dbaccess, etc).
The basic issue here is that there is SQL, (select, insert, update,
create, alter, etc), and there are tool based commands (print, set,
export, unload, load, etc). DBI and
One other possibility that comes to mind is whether the webserver is
running mod_perl.
Also, what kind of times are we talking? If 10x means going from .1
seconds to 1 second, I'd be much more likely to suspect something like not
running mod_perl. If 10x means going from 1 second to 10 seccon
Damn I hate being publicly wrong, but you're right.
#!/usr/bin/perl -w
use strict;
my $a = 1;
foo($a);
print "$a\n";
sub foo {
$_[0] = 2;
}
prints '2'. It's shifting them off that list that creates the copy I am
used to working with.
But it still remains true that passing $dbh is safe, ev
I hate confusion, so I went to the source: perldoc perlsub, and here is
what it had to say:
The Perl model for function call and return values is simple: all
functions are passed as parameters one single flat
list of scalars, and all functions likewise return to their caller
one single f
I would echo that sentiment, except that we do use it with Oracle and are
extremely happy with the combination.
Many of the Director level types here were sceptical about using perl and
linux and other open source tools, but as they outshine other tools,
they've slowly been coming around.
__
"CAMPBELL, BRIAN D (BRIAN)" <[EMAIL PROTECTED]>
11/04/2004 01:31 PM
To: Jeffrey Seger/Corporate/[EMAIL PROTECTED], "Sunil A.V."
<[EMAIL PROTECTED]>
cc: [EMAIL PROTECTED]
Subject:RE: Re: Re: RE: Perl Question: Optim
be a little nervous about some of
the scoping. I don't see $matl scoped anywhere.
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
"Sunil A.V." <[EMAIL PROTECTED]>
11/04/2004 10:59 AM
Please respond to &
If I am undertanding this correctly, you have a 'not in' predicate which
will have a varying number of elements from one execution to the next,
right?
Given that, I would construct an array of statement handles something like
this:
my @sth;
while (){
my $num = scalar @arguments;
my $sql = qq#
PRINT 'starting select'
select count(*) from anytable
PRINT 'finished'
#;
is not valid sql.
try this:
my $sql = qq#
select count(*) from anytable
#;
my $sth = $dbh->prepare( $sql );
print 'starting select';
my $rv = $sth->execute();
while ( my $hr = $sth->fetchrow_hashref ){
my $sth = $dbh->prepare('select * from mytable
where ( my_col= ?
or my_col is null and ? is null)');
my $scalar = undef; #to get rows where null columns
# or
# my $scalar = 'something meaningful here'; #to get non-nulls
$sth->execute($scalar, $scalar); # to get
"Set timing on" is a sql*plus command, not a SQL command. There is an
easy way in perl to emulate it:
my $start = time;
$sth->execute();
my $finish = time;
print ("It took ", $finish - $start, " seconds to execute my query.\n")'
You can include whatever you want between the $start and $finish
Can we see your code?
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
"Tim Johnson" <[EMAIL PROTECTED]>
04/15/2004 01:35 PM
To: <[EMAIL PROTECTED]>, "Dbi-Users" <[EMAIL PROTECTED]>
cc:
Subject:
I was thinking of a different approach to doing it "off to the side", such
as using a separate (buffer) table where the processing is done, then
moving it in to your primary table at the end. This provides for a bit
more auditting than the hidden fields do, but is more expensive. If you
don't
>What's easier than sqlplus? With the right options, you can have sqlplus
>return errors and/or ignore them. Otherwise, you have to parse the sql
and
>separate the statements. It shouldn't be too difficult, but I'm not sure
>it's worth the time.
I find DBI easier than sqlplus. You can parse t
Somewhere in the back of my head there is an idea that the hash key is
case sensitive. Try reversing the case (upper if you are using lower
now).
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
"Marcus Willemsen" <[EMAIL PRO
A code sample of how you are trying to establish the connections wouldn't
hurt.
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
Chuck Fox <[EMAIL PROTECTED]>
12/11/2003 12:13 PM
To: [EMAIL PROTECTED]
cc:
I stand corrected. The original error message would still have been
helpful though.
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
Michael A Chase <[EMAIL PROTECTED]>
12/09/2003 09:08 AM
To: Jeffrey
When using qq style quoting, you have to use a character that is not
contained within your string. Try qq{ } instead of qq( ). If it's even
compiling, I don't know why.
Also, the ; within the string is superfluous. I seem to recall that some
DBD drivers will parse it out and some will choke
m not sure).
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
Jair Valmor Basso Júnior <[EMAIL PROTECTED]>
11/14/2003 01:47 PM
To: Jeffrey Seger/Corporate/[EMAIL PROTECTED]
cc: <[E
First thing to check is if your $ORACLE_HOME is in your environment when
running the script.
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
Jair Valmor Basso Júnior <[EMAIL PROTECTED]>
11/14/2003 01:18 PM
To: <[
SELECT column from table where City = $cty
will never work unless city is a numeric column. If you try to run
SELECT column from table where City = Denver
from within a sql tool mysql will return an error something like unknown
column name and that is effectively the sql statement you are
And in case you have to iterate through a list of columns
my $sth;
foreach my $col(@cols)
{
$sth = $dbh->prepare("insert into mytable (col1, col2, $col) values
(?,?,?)");
$sth->execute($val1,$val2,$val3);
}
Obviously this code is incomplete...just to illustrate that when you
change the
IIRC, using it that way is only safe if you are absolutely certain that
all of the rows have been fetched. I'm fairly certain it's not safe if
they haven't.
With the syntax you have there, it is not apparent that you are even
fetching your rows at all. In that case, $sth->rows will not be reli
EMAIL PROTECTED]
"Christian Merz" <[EMAIL PROTECTED]>
09/23/2003 09:49 AM
To: Jeffrey Seger/Corporate/[EMAIL PROTECTED]
cc: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Subject:Re: SQL statement
rly.
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
Tim Bunce <[EMAIL PROTECTED]>
09/19/2003 03:09 PM
To: Jeffrey Seger/Corporate/[EMAIL PROTECTED]
cc: Christian Merz <[EMAIL PROTECTED]>, [EMAIL PROTECT
The only problem with that approach is that it deletes all of the entries
and doesn't leave "singles" behind. I'd probably do it programatically.
Grab the results of query 1, store the data in a hash of hashes, then do
the delete and re-insert.
But I'd love to hear an SQL solution to leaving o
> activeperl 5.6.4 and perl 5.8 and apache 2.0
Huh? Ok, so which version of perl are you really using? If you have both
installed, are you sure you have all of your modules installed for the one
that is getting executed by your cgi scripts?
If I found that I had 2 versions of Perl installed a
Which fetchrow_hashref line? I see two of them, but only one execute. You need to
include more
code for anyone to know what's really wrong here.
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
"NIPP, SCOTT V (SBCSI)" <[EMAIL P
Try fully qualifying the function name. Granting Execute to public is not
the same as a public synonym.
$qrystr = "select owningschema.myplsqlfunc(param1, param2) from dual;"
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
"Gau
ies to the list.
Jeff Seger
Fairchild Semiconductor
[EMAIL PROTECTED]
[EMAIL PROTECTED]
08/26/2003 09:23 AM
To: Jeffrey Seger/Corporate/[EMAIL PROTECTED]
cc:
Subject:Re: Trying to store a file into the Oracle
To start with, you are trying to insert the size of your file rather than
the actual content of it:
$stmt = $db->prepare("INSERT INTO hr.documents
(documentid ,
document_name, document) VALUES ('1','john.doc','$bytes')") || die
"\nPrepare
error: $DBI::err $DBI::errstr\n
That is most definitely what is happening. For exactly that reason I find
it to be a useful practice to limit Statement Handles to one query per
handle. It's sometimes handy to store them as a hash.
You are also preparing statements inside your fetch loop which is re-work
that is not necessar
I would normally store the connection info in 3 separate variables.
For example, assuming you have a module that will return them:
my $dsn = $pkg->get_dsn($schema_id);
my ($user,$pass) = $pkg->get_connect_info($schema_id);
Otherwise just set them explicitly.
then:
my $dbh = DBI->connect($dsn, $
My guess would be:
use DBI;
use Apache DBI;
my $persistant_dbh = Apache::DBI->connect(blah, blah, blah);
my $non_persistant_dbh = DBI->connect(blah, blah, blah);
But that's untested and offered with no warranty whatsoever that it will
work.
jeff
***
Jeff Seger
Da
Actually, it's not impossible at all. However, the way you need to do it
is to pass the connect string or instance name for the database to your
child process and let the child process create its own connection, rather
than passing the already created connection to the child. You wind up with
a
Start with `perldoc DBI` and `perldoc DBD::DB2`. Then go get a copy of The
Good Book (aka Programming the Perl DBI).
***
Jeff Seger
Data Warehouse Engineer
Fairchild Semiconductor
[EMAIL PROTECTED]
***
Try adding these lines to your httpd.conf:
SetEnv ORACLE_HOME /your/oracle/home
SetEnv TNS_ADMIN /your/oracle/home/network/admin
If you don't have access/priviledges to httpd.conf, you can, I believe set
these in a BEGIN block within your script.
jeff
***
Jeff
That's a tough one to answer without knowing more about the tables that you
are querying against, the query itself and the machines you are hitting.
In general, I haven't seen great performance when doing joins via dblinks,
so my knee-jerk reaction is to "dial direct and save." If you are going
if ( $tablename > 1) is going to evaluate to false since the numeric value
of any string is 1.
Try:
if ($tablename)
or:
if (defined($tablename))
***
Jeff Seger
Data Warehouse Engineer
Fairchild Semiconductor
[EMAIL PROTECTED]
***
You have 2 choices for how to do this. If you have a database link between
the two databases, it's really easy:
$dbh->do('insert into table2 select * from table1@dblink_name');
Otherwise you need to loop it something like this:
my $sth2 = $dbh2->prepare('select * from table2');
$sth2->execute()
97 matches
Mail list logo