Re: Odd error using bind_param_inout

2012-06-04 Thread Jeffrey Seger
$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

Re: SQL errors not making it back to Perl

2010-09-08 Thread Jeffrey Seger
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

Re: Question On Connection Metadata (hostname/port/internal name)

2010-05-27 Thread Jeffrey Seger
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

Re: Insert Query with place holders Vs SQLLDR

2010-05-02 Thread Jeffrey Seger
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

Re: Insert Query with place holders Vs SQLLDR

2010-05-02 Thread Jeffrey Seger
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

Re: Can we use DBI to import data into a table?

2010-04-30 Thread Jeffrey Seger
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 }

Re: DBD::DB2 on Windows with Strawberry Perl

2009-12-17 Thread Jeffrey Seger
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:\ >

Re: Microsoft "money" data type prepared statement, place holders ...

2009-07-22 Thread Jeffrey Seger
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

Re: mixing placehoders and functions with MySQL

2008-11-12 Thread Jeffrey Seger
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: >

Re: mixing placehoders and functions with MySQL

2008-11-12 Thread Jeffrey Seger
> "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

Re: Weird TNS error with DBI::Oracle 1.21 & oracle 11G

2008-07-29 Thread Jeffrey Seger
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

Re: Generic DBI question about backups

2008-06-19 Thread Jeffrey Seger
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

Re: How Can I use ssh in my perl code

2008-05-19 Thread Jeffrey Seger
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

Re: Oracle procedure raises exception but looks to be successful from DBI

2008-01-25 Thread Jeffrey Seger
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

Re: Clarification on DBI module

2007-05-10 Thread Jeffrey Seger
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

Re: DBD::DB2 question need an example

2007-01-10 Thread Jeffrey Seger
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

Re: DBD::DB2 question need an example

2007-01-10 Thread Jeffrey Seger
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

Re: Error returned on Unix 'mv' system call.

2007-01-10 Thread Jeffrey Seger
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

Re: Connecting to more than one oracle database

2006-11-29 Thread Jeffrey Seger
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

Re: Out of memory during "large" request

2006-11-23 Thread Jeffrey Seger
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

Re: Trouble installing DBI without using ActiveState Repository

2006-10-04 Thread Jeffrey Seger
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.

Re: defining a DSN for Access on Linux

2006-09-29 Thread Jeffrey Seger
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

Re: defining a DSN for Access on Linux

2006-09-29 Thread Jeffrey Seger
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

Re: DBI->connect Oracle on Windows, doesn't Work

2006-09-22 Thread Jeffrey Seger
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

Re: DBI Installation Problems

2006-08-21 Thread Jeffrey Seger
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

Re: queries not getting executed?

2006-08-21 Thread Jeffrey Seger
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

Re: DBI Installation Problems

2006-08-18 Thread Jeffrey Seger
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

Re: ORA-01017 ... but only when script is run as CGI

2006-08-18 Thread Jeffrey Seger
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

Re: Using Oracle Internet Directory (OID) instead of TNS Names

2006-08-16 Thread Jeffrey Seger
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.

Re: Oracle and DBI module file

2006-08-15 Thread Jeffrey Seger
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

Re: Problem getting Perl - SQL Server connect working - syntax error?

2006-08-15 Thread Jeffrey Seger
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

Re: Problem getting Perl - SQL Server connect working - syntax error?

2006-08-15 Thread Jeffrey Seger
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

Re: Oracle schema names: sqlplus 'v' Perl

2006-06-09 Thread Jeffrey Seger
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

Re: Oracle schema names: sqlplus 'v' Perl

2006-06-08 Thread Jeffrey Seger
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

Re: Re: DBD::Oracle ppd

2006-04-27 Thread Jeffrey Seger
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

Re: DBD::Oracle ppd

2006-04-26 Thread Jeffrey Seger
> > 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.

DBD::Oracle ppd

2006-04-26 Thread Jeffrey Seger
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 --

Re: Bad int8 external representation "" (SQL-HY000)(DBD: st_execute/SQLExecute err=-1)

2006-04-19 Thread Jeffrey Seger
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

Re: dump_results

2006-04-14 Thread Jeffrey Seger
> > > > 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

Re: Running DBI, ODBC in the crontab

2006-04-14 Thread Jeffrey Seger
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: > >>>>

Re: Running DBI, ODBC in the crontab

2006-04-13 Thread Jeffrey Seger
.Net" schreef: > >> Dr.Ruud: > >>> Jeffrey Seger: > > >>>> perl -MData::Dumper -e' print Dumper @INC' > >>> > >>> Alternative: > >>> perl -MData::Dumper -e' print Data::Dumper->Dump([EMAIL PROTECTED], > >

Re: Running DBI, ODBC in the crontab

2006-04-11 Thread Jeffrey Seger
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'; $

Re: $sth->execute(@$bindVars) is outputting an error

2006-04-03 Thread Jeffrey Seger
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

Re: $sth->execute(@$bindVars) is outputting an error

2006-04-02 Thread Jeffrey Seger
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"; &

Re: $sth->execute(@$bindVars) is outputting an error

2006-04-01 Thread Jeffrey Seger
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

Re: How many rows can be fetched using DBD::Informix?

2006-01-10 Thread Jeffrey Seger
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

Re: DBI:Oracle failure ORA-12154

2005-12-09 Thread Jeffrey Seger
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: > >

Fwd: DBD-AnyData, Handle cleared whilst still active...

2005-10-15 Thread Jeffrey Seger
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

Re: DBD-AnyData, Handle cleared whilst still active...

2005-10-14 Thread Jeffrey Seger
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

Re: Problem with placeholder

2005-09-15 Thread Jeffrey Seger
>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

Re: prepare failing

2005-09-13 Thread Jeffrey Seger
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

Re: Help : Pass by reference to another file using Nohup ?

2005-05-16 Thread Jeffrey . Seger
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

RE: ORA-03113 Error from DBI

2005-05-04 Thread Jeffrey . Seger
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

RE: ORA-03113 Error from DBI

2005-05-04 Thread Jeffrey . Seger
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

Re: ORA-03113 Error from DBI

2005-05-03 Thread Jeffrey . Seger
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

Re: (Fwd) FW: DBI connect as sysdba

2005-03-08 Thread Jeffrey . Seger
[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

Re: how to fetch all records

2005-02-25 Thread Jeffrey . Seger
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

Re: Mixing select and print statements using DBI, DBD::Sybase

2005-02-09 Thread Jeffrey . Seger
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

Re: DBD::CSV much slower on osX ?

2005-02-03 Thread Jeffrey . Seger
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

Re: passing dbh

2005-01-10 Thread Jeffrey . Seger
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

RE: passing dbh

2005-01-10 Thread Jeffrey . Seger
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

Re: (Fwd) perl future

2004-11-08 Thread Jeffrey . Seger
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.

RE: Re: Re: RE: Perl Question: Optimization

2004-11-05 Thread Jeffrey . Seger
__ "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

Re: Re: Re: RE: Perl Question: Optimization

2004-11-04 Thread Jeffrey . Seger
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 &

Re: Re: RE: Perl Question:

2004-11-03 Thread Jeffrey . Seger
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;

Re: Invalid cursor state when using PRINT in MSSQL

2004-10-18 Thread Jeffrey . Seger
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 ){

Re: null values

2004-05-05 Thread Jeffrey . Seger
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

Re: oracle timming

2004-05-04 Thread Jeffrey . Seger
"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

RE: Invalid character value for cast specification

2004-04-15 Thread Jeffrey . Seger
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:

Re: Span a database transaction across multiple CGI scripts

2004-03-10 Thread Jeffrey . Seger
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

RE: including sql files in a main perl script.

2004-02-27 Thread Jeffrey . Seger
>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

Re: Selects to MS SQL Server 2000

2003-12-15 Thread Jeffrey . Seger
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

Re: Trying to connect to 2 Sybase database with one 1 script (Intern)

2003-12-11 Thread Jeffrey . Seger
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:

Re: problems with place holders

2003-12-09 Thread Jeffrey . Seger
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

Re: problems with place holders

2003-12-09 Thread Jeffrey . Seger
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

Re: [inbox] Re: Help on DBD::Oracle

2003-11-14 Thread Jeffrey . Seger
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

Re: Help on DBD::Oracle

2003-11-14 Thread Jeffrey . Seger
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: <[

Re: unable to make SELECT take variables

2003-11-03 Thread Jeffrey . Seger
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

RE: [dbi] prepared insert syntax error on exec

2003-10-15 Thread Jeffrey . Seger
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

Re: sth finish implicitly on next calls?

2003-10-02 Thread Jeffrey . Seger
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

Re: SQL statement to find and delete double entries

2003-09-23 Thread Jeffrey . Seger
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

Re: SQL statement to find and delete double entries

2003-09-22 Thread Jeffrey . Seger
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

Re: SQL statement to find and delete double entries

2003-09-19 Thread Jeffrey . Seger
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

Re: help required DBI

2003-09-05 Thread Jeffrey . Seger
> 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

Re: fetch( ) without execute( ) Error...

2003-09-03 Thread Jeffrey . Seger
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

RE: Using stored PL/SQL function

2003-08-27 Thread Jeffrey . Seger
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

Re: Trying to store a file into the Oracle

2003-08-26 Thread Jeffrey . Seger
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

Re: Trying to store a file into the Oracle

2003-08-26 Thread Jeffrey . Seger
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

Re: Help With inner queries

2003-07-30 Thread Jeffrey . Seger
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

RE: Saving a connection string

2003-03-31 Thread Jeffrey . Seger
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, $

Re: Apache::DBI sometimes?

2002-05-21 Thread Jeffrey . Seger
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

RE: fork and DBI on Win 2000

2002-05-16 Thread Jeffrey . Seger
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

Re: Best pa\lace to get started with DB2 7.1 and Perl on Linux?

2002-05-06 Thread Jeffrey . Seger
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] ***

Re: Linux/perl/Oracle connect question

2002-05-02 Thread Jeffrey . Seger
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

Re: individual connections over dblink

2002-04-30 Thread Jeffrey . Seger
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

Re: simple problem

2002-04-29 Thread Jeffrey . Seger
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] ***

Re: (Fwd) Do you know how to select * from a.table1@oracle_database1 theninsert them into b.table2.@oracle_database2

2002-04-19 Thread Jeffrey . Seger
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()