RE: Re: Accessing MS Access through the DBI ODBC

2005-04-03 Thread Jeff Urlwin
 
 Just my opinion, but I don't think this is good advice.  For 
 one, it creates extra administration on the system, by 
 forcing the user/programmer /sysadmin/webadmin to create an 
 ODBC DSN setting for every new setup. For two, DBI and ODBC 
 both support dynamic DSNs, so why not use them?

If you have separate development, test and production environments, it's 
sometimes easier
to use DSNs.  That way, when you migrate from dev to test, for example, you 
automagically
get the test environment connection information.  That's one reason why I like 
DSNs over
putting them in the code.

Of course, TMTOWTDI...

Jeff



RE: Insert help...

2005-04-03 Thread Steven Lembark

-- NIPP, SCOTT V \\(SBCSI\\) [EMAIL PROTECTED]
OK...  I have been able to solve this problem, and it was no big
deal.  However, the problem I am currently facing is really hosing me
up...  Basically, a NULL field is getting converted to a 0 in the
database.  This causes a comparison of the same file and the database to
yield a lot of differences.  Please help.  I think this has got to be
related to the INSERT.  The table column is setup as 'smallint' allowing
NULLS with the default value set to NULL.  This column however is
getting a '0' if the input file is empty for that field.
Here is the pertinent code...
Simple fix: Don't store NULL's in your database. If you pick
an appropriate non-NULL value then the entire problem goes
away and you can tell what the outcome of joins really is.
--
Steven Lembark   85-09 90th Street
Workhorse ComputingWoodhaven, NY 11421
[EMAIL PROTECTED] 1 888 359 3508


Re: Perl error in fetching data from Clob datatype.

2005-04-03 Thread Steven Lembark

-- Rishi Bansal, Japan IT [EMAIL PROTECTED]
Hi,
I am trying to fetch data from CLOB datatype in Database.
I am getting an Error as : error:ORA-03127: no new operations allowed
until the active operation ends (DBD ERROR: OCISessionEnd).
I guess I am not handling the data fetched properly.
The code snippet is pasted here.
$dbh-{LongReadLen} = 1024 * 1024 * 1024;
Q: Do you really need a 1GiB buffer?
That alone may be causing you problems.
--
Steven Lembark   85-09 90th Street
Workhorse ComputingWoodhaven, NY 11421
[EMAIL PROTECTED] 1 888 359 3508


Re: Unable to connect to Oracle on another Unix host in a perl programming using DBI

2005-04-03 Thread Steven Lembark

-- Kairam, Raj [EMAIL PROTECTED]
To those who could help me with a problem connecting to an Oracle
database on HP-UX from within a perl script that uses DBI
I have a perl program on a unix (HP-UX) host(A) running Oracle 8.1.6
In the program I am trying to connect to another unix (HP-UX) host(B)
running Oracle 8.1.7 holding a table c1dwg.
The perl script that runs on host A contains these lines.
$ENV{'ORACLE_HOME'} = '/u01/app/oracle/product/8.1.6';
$ENV{'ORACLE_SID'} = 'CAD';
use DBI;
$dbh = DBI-connect('dbi:Oracle:Mycad4prod', 'user', ''password') ||
Just for the fun of it try:
   my $dbh = DBI-connect
   (
   dbi:Oracle:host=$ip_address;sid=$sid,
   $user,
   $pass
   );
The point here is to bypass any other issues and see
if you can reach a tnslsnr on the IP address with an
explicit ORACLE_SID value.
--
Steven Lembark   85-09 90th Street
Workhorse ComputingWoodhaven, NY 11421
[EMAIL PROTECTED] 1 888 359 3508


RE: A good Perl Book

2005-04-03 Thread Steven Lembark

-- Reidy, Ron [EMAIL PROTECTED]
1.  Programming Perl
2.  Perl Cookbook
3.  Object Oriented Perl
4.  Extending and Embedding Perl
5.  Writing CGI Applications with Perl
Watch O'Reilly Press' list for Perl Best Pratices by
Damian Conway.
--
Steven Lembark   85-09 90th Street
Workhorse ComputingWoodhaven, NY 11421
[EMAIL PROTECTED] 1 888 359 3508


Re: Should prepare_cached() manage its total size or memory usage?

2005-04-03 Thread Steven Lembark

-- Mark Stosberg [EMAIL PROTECTED]
Hello,
I have a database application that selects about 50,000 rows one by one,
does some process in Perl, and then executes a SELECT statement for each
one, with slight variations in the SQL and parameters.
I was using prepare_cached() on this repeatedly called SELECT statement.
Depends on how you're using the caching.
If it looks something like:
   my $sth =
   prepare_cached( 'select foo from bar where ( bletch = ?)' );
Then this should generate a single query and re-cycle it for
later use. If you are using ANYthing hardcoded specific to the
query then caching will just leave a huge number of row-specific
queries lying around; which is probably not what you want.
Q: Are the placeholders in the existing query(s) or do they use
  hard-coded values?
If you have a small number of placeholder queries then this
is odd behavior; if not then all you've done is generate the
non-recycled-cache-from-hell and the behavior is normal.
--
Steven Lembark   85-09 90th Street
Workhorse ComputingWoodhaven, NY 11421
[EMAIL PROTECTED] 1 888 359 3508


Re: [DBI] Re: What is wrong with select?

2005-04-03 Thread Steven Lembark

Basicly $StateProvince in a string value in you sql statement, so you
either single quote yourself, or let DBI do it.
Or use a placeholder and save yourself the pain of figuring
it out:
   select ...  where name_short = ?
will do the deed without your having to even think
about quoting.
--
Steven Lembark   85-09 90th Street
Workhorse ComputingWoodhaven, NY 11421
[EMAIL PROTECTED] 1 888 359 3508