Re: Column Names

2001-11-02 Thread Bart Lateur
On Thu, 01 Nov 2001 18:56:18 -0800, Venkataramana Mokkapati wrote: How do I get column names and order of column names for a select * from ... query. If you have $sth = $dbh-prepare(select * from ...); then try @column_names = @{$sth-{NAME}}; You may have to do an execute

Re: Column Names

2001-11-02 Thread Scott R. Godin
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Bart Lateur) wrote: On Thu, 01 Nov 2001 18:56:18 -0800, Venkataramana Mokkapati wrote: How do I get column names and order of column names for a select * from ... query. If you have $sth = $dbh-prepare(select * from ...); then

Re: DBI 1.15+ establishes multiple connections under parent mod_perl process

2001-11-02 Thread Scott R. Godin
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Eric Kolve) wrote: I think I have found a curious bug in DBI. It seems that since DBI 1.15 - 1.20, when you bring up apache/mod_perl and execute queries against the database handle in the parent process (startup.pl), multiple connections

Copying image data from Sybase to Mssql or vice versa

2001-11-02 Thread Veera P. Nallamilli
I am using DBD:Sybase to interact with Sybase database and using DBD:ODBC for Mssql database. I tried to copy image data either way , but unfortunately failed. Could anybody please suggest me like what is the best way to transfer the data from sybase to Mssql or vice versa. Thanks prasad

Re: Column Names

2001-11-02 Thread Bart Lateur
On Fri, 02 Nov 2001 07:27:49 -0500, Scott R. Godin wrote: my %db; $sth-bind_columns( \( @db{ @{ $sth-{NAME} } } ));# magic while ($sth-fetch) { #... and no worries about which order the columns get returned in #... since you access them via the $db{ColumnName}

Re: Looping through recordset twice

2001-11-02 Thread Don Seiler
Perhaps I wasn't supposed to take it so literally, and my hash handling skillz aren't quite what they should be. When I do this: while (my $hashref = $csr-fetchrow_hashref()) { print Adding record from group . $hashref-{group_code} . .\n; push (@{$groups{$hashref-{group_code}}}, $hashref);

Re: Looping through recordset twice

2001-11-02 Thread Ronald J Kimball
On Fri, Nov 02, 2001 at 08:42:42AM -0600, Don Seiler wrote: Perhaps I wasn't supposed to take it so literally, and my hash handling skillz aren't quite what they should be. When I do this: while (my $hashref = $csr-fetchrow_hashref()) { print Adding record from group .

Re: Looping through recordset twice

2001-11-02 Thread Don Seiler
GENIUS! That did the trick. Thanks much, Don. On Fri, 2 Nov 2001, Ronald J Kimball wrote: On Fri, Nov 02, 2001 at 08:42:42AM -0600, Don Seiler wrote: Perhaps I wasn't supposed to take it so literally, and my hash handling skillz aren't quite what they should be. When I do this:

Re: DBI 1.15+ establishes multiple connections under parent mod_perl process

2001-11-02 Thread Eric Kolve
I have traced it back to prepare_cached() (at least that is what I notice). Scott, try replacing your calls on startup with prepare() instead of prepare_cached(). I was also able to eliminate the problem if I commented out the following line in DBI.pm # $dbh-STORE('CachedKids', $cache = {})

Re: Column Names

2001-11-02 Thread Michael Peppler
Scott R. Godin writes: the absolute neatest trick I've seen with this, that is so totally perlish it defies description.. you stare at it for a bit and suddenly all becomes clear. $sth-execute or die(Cannot Execute SQL Statement: , $sth-errstr(), \n);

Re: Looping through recordset twice

2001-11-02 Thread Don Seiler
When I pass in a hash to a function like below: group_is_OK($groups{$group_number}); I'm confused as to how to handle that argument with in the function, knowing the there are multiple values for that key. I start out with this: sub group_is_OK { my $hash = $_; # insert a lot of confused

Re: Looping through recordset twice

2001-11-02 Thread Etienne Marcotte
my %groups; while (my $hashref = $sth-fetchrow_hashref) { push @{$groups{$hashref-{group_num}}}, $hashref; } then later... foreach my $group_number (keys %groups) { delete $groups{$group_number} unless group_is_OK($groups{$group_number}); } I don't understand why you're calling

Re: Looping through recordset twice

2001-11-02 Thread David Marshall
The breakout of where a subroutine ends and begins is largely a matter of personal preference. You'll have to iterate over all the groups somewhere, I would tend to do it where my rough example showed so that subroutine group_is_OK wouldn't need to know whether the group being examined is

Re: DBI 1.15+ establishes multiple connections under parent mod_perl process

2001-11-02 Thread Tim Bunce
But prepare_cached/prepare has nothing to do with multiple connections. There were connect() changes made between DBI 1.14 and 1.15 but I'd need people to look into it for me. Should be trivial to debug by enabling DBI tracing and Apache::DBi debug. Tim. On Fri, Nov 02, 2001 at 07:51:33AM

Re: Column Names

2001-11-02 Thread Tim Bunce
On Fri, Nov 02, 2001 at 02:18:15PM +0100, Bart Lateur wrote: On Fri, 02 Nov 2001 07:27:49 -0500, Scott R. Godin wrote: my %db; $sth-bind_columns( \( @db{ @{ $sth-{NAME} } } ));# magic while ($sth-fetch) { #... and no worries about which order the columns get

RE: Looping through recordset twice

2001-11-02 Thread Don Seiler
I guess I'm not that concerned with that level of detail. there are a million different ways to do that part. It was just the part of finding the groups that I needed help with. Thanks though. Don. On Fri, 2 Nov 2001, Wilson, Doug wrote: From: Don Seiler [mailto:[EMAIL PROTECTED]] I

::massive sql query using dbi - please help::

2001-11-02 Thread Hastie, Christa
Hello to all! This is my first time posting to this group! But I'm in desperate need of any help! (BTW, thanks for all the emails from contributors to this list..I learn a lot from you guys every day!) I have two tables in a mySQL db, named users_old and users_new, both with UserId and Email

Performance of Oracle BY Ref cursors

2001-11-02 Thread Matt Heilman
Is there any performance issues (or advantages) to using an Oracle Stored Procedure and receiving a BY REF cursor, compared to a straight SQL statement? Thanks, Matt

Re: DBI 1.15+ establishes multiple connections under parent mod_perl process

2001-11-02 Thread Scott R. Godin
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Eric Kolve) wrote: I have traced it back to prepare_cached() (at least that is what I notice). Scott, try replacing your calls on startup with prepare() instead of prepare_cached(). no, I'm using prepare(). an earlier post thread of mine

Re: DBI 1.15+ establishes multiple connections under parent mod_perl process

2001-11-02 Thread Scott R. Godin
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Tim Bunce) wrote: There were connect() changes made between DBI 1.14 and 1.15 but I'd need people to look into it for me. Should be trivial to debug by enabling DBI tracing and Apache::DBi debug. Unless your admin refuses to run any of the

Re: Column Names

2001-11-02 Thread Scott R. Godin
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Tim Bunce) wrote: On Fri, Nov 02, 2001 at 02:18:15PM +0100, Bart Lateur wrote: On Fri, 02 Nov 2001 07:27:49 -0500, Scott R. Godin wrote: my %db; $sth-bind_columns( \( @db{ @{ $sth-{NAME} } } ));# magic while

Re: Column Names

2001-11-02 Thread Scott R. Godin
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Michael Peppler) wrote: my $rows = $sth-rows; # only expecting one row for a unique ID . this should NEVER happen. safe_error(invalid number of rows returned from database ($rows) for ID $id) if $rows 1; #

RE: ::massive sql query using dbi - please help::

2001-11-02 Thread Hastie, Christa
Thanks Marcelo for all three of those points. I tried performing just the query from mysql, but it just hangs there also, even if I leave it for an hour! I've modified the code to stop opening and closing the file in the loop, and added the lock values, but it's still just running and running and

Re: [netlabs #64] Re: How to install DBI for Oracle

2001-11-02 Thread Ask Bjoern Hansen
On Thu, 1 Nov 2001, Ivan Kavuma wrote: I am developing an Intranet for my company. We have an oracle database version 8i running on another Linux machine. which I want to use as a backborn. Please don't cc the list-owner on mails to the mailinglists. - ask -- ask bjoern hansen,

Script for Directory Permissions on NT Filesystem

2001-11-02 Thread Nigel Gall
Hi! I'm a new user of PERL and I'm trying to write a script to give me a condensed list of file permissions of an NTFS file system. For example, if I have a folder named E:\, with a hundred subfolders (and so on), I'd like to get a list of subfolder names with their associated permissions

Re: ::massive sql query using dbi - please help::

2001-11-02 Thread Jeff Seger
If the query just hangs there in mysql, putting it into DBI is not going to fix that. Are the columns indexed in the tables? If not, you've probably got it doing nested full table scans. Try adding indexes to the tables on the join columns. Get the query to run in mysql before you ever try it

Speed up return of result set..

2001-11-02 Thread Adam Frielink
Hi all, I am connecting to a DB2 database on an AS/400 using the Client Access Express ODBC driver (version 6). At times, I will have need to return some rather large datasets (around 10Mb total). Unfortunately, the CAE driver only allows the information to be sent in 8Kb segments before it

Re: Script for Directory Permissions on NT Filesystem

2001-11-02 Thread Ian Summers
Hi You wrote: Hi! I'm a new user of PERL and I'm trying to write a script to give me a condensed list of file permissions of an NTFS file system. For example, if I have a folder named E:\, with a hundred subfolders (and so on), I'd like to get a list of subfolder names with their associated

Error handling with DBD::Oracle

2001-11-02 Thread Satyanarayana, KJ
Hello, We are migrating our systems from Informix to Oracle. We have a lot of code written using DBI and DBD::Informix. DBD::informix has something like ix_sqlcode to return the sqlcode for the operation. Does Oracle have anything like this or is the status of a database operation just returned

Re: Script for Directory Permissions on NT Filesystem

2001-11-02 Thread aaron
this isn't ontopic for the dbi-list try perl friends or something like that. Aaron On Fri, 2 Nov 2001, Nigel Gall wrote: Hi! I'm a new user of PERL and I'm trying to write a script to give me a condensed list of file permissions of an NTFS file system. For example, if I have a folder

Re: Column Names

2001-11-02 Thread Tim Bunce
On Fri, Nov 02, 2001 at 02:41:05PM -0500, Scott R. Godin wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Tim Bunce) wrote: On Fri, Nov 02, 2001 at 02:18:15PM +0100, Bart Lateur wrote: On Fri, 02 Nov 2001 07:27:49 -0500, Scott R. Godin wrote: my %db;

TYPE integer values and their respective data types

2001-11-02 Thread Dieter
Hello, i am looking for a complete list of the integer values and their respective data types returned from the TYPE statement handle attribute. I followed both links in the 'Programming the Perl DBI book, but they did not lead to any results. I am interested in all MySQL data types,

Quoting with placeholders

2001-11-02 Thread Stacy Mader
Hi all, I have the following: $reported_by = $dbh-quote($reported_by); $project_no = $dbh-quote($project); $project_comments = $dbh-quote('NULL'); $one_line_summary = $dbh-quote($one_line_summary); $issue= $dbh-quote($issue); $new_report =

Does perl has DBD for MS Access?

2001-11-02 Thread Linda Xu
Hi, Does perl has DBD for MS Access? Where I can download it? Linda

RE: Does perl has DBD for MS Access?

2001-11-02 Thread Kokarski, Anton
Hi Linda, try ODBC option that might work. Anton -Original Message- From: Linda Xu [mailto:[EMAIL PROTECTED]] Sent: Friday, November 02, 2001 5:42 PM To: DBI Users Subject: Does perl has DBD for MS Access? Hi, Does perl has DBD for MS Access? Where I can download it? Linda

Re: Quoting with placeholders

2001-11-02 Thread Jeff Zucker
Stacy Mader wrote: $allocated_to = $dbh-quote('NULL'); That's wrong for two reasons: don't use quote() on something that already has quotes around it unless you want the literal quotes in the string; and if you mean an actual SQL NULL, it should not be quoted by either method. Can the

Re: Quoting with placeholders

2001-11-02 Thread Stacy Mader
Thanks for that Jeff. Now that I have: $dbh-do(INSERT INTO $fault_db VALUES (?,?,?,?,?,?,?,?,?,?,?,?) , undef, $fault_no, $reported_by, $project_no, undef, $date_occurred, $date_reported, $time_lost,

Re: Quoting with placeholders

2001-11-02 Thread Terrence Brannon
On Friday, November 2, 2001, at 06:30 PM, Stacy Mader wrote: Thanks for that Jeff. Now that I have: $dbh-do(INSERT INTO $fault_db VALUES (?,?,?,?,?,?,?,?,?,?,?,?) , undef, $fault_no, $reported_by, $project_no, undef, $date_occurred,

RE: Does perl has DBD for MS Access?

2001-11-02 Thread Steve Howard
You need DBD::ODBC to access MS Access using Perl and DBI. It can be downloaded from CPAN, or if you are using ActiveState, or PPM you can use them to search, locate download and install this module. Steve H. -Original Message- From: Linda Xu [mailto:[EMAIL PROTECTED]] Sent: Friday,

RE: ::massive sql query using dbi - please help::

2001-11-02 Thread Steve Howard
yours The users_old table has 120,000 rows and the users_new has 910,000 rows. /yours If you have no indexes, I'm not at all surprised it takes that long or even longer to get results from a join on MySQL on two tables with this many rows. The join must be completed before results are returned,

RE: Copying image data from Sybase to Mssql or vice versa

2001-11-02 Thread Steve Howard
The 'Best way' may not be Perl. Is this a one time shot, or something where the two servers need to interact constantly? If this is one time, or something that needs to happen only periodically, I would recommend Data Transformation Services (DTS). That is part of the MS SQL installation if it

RE: Column Names

2001-11-02 Thread Steve Howard
yours my %db; $sth-bind_columns( \( @db{ @{ $sth-{NAME} } } ));# magic while ($sth-fetch) { #... and no worries about which order the columns get returned in #... since you access them via the $db{ColumnName} method :) /yours Right, no worries, but a good point to

RE: Quoting with placeholders

2001-11-02 Thread Sterin, Ilya
No, the variable can't contain the whole conversion string, since it will be bound as a value. Rather do this... $dbh-do(INSERT INTO $fault_db VALUES (?,?,?,?,?,to_date(?,'DD-MON- HH24:MI'),to_date(?,'DD-MON- HH24:MI'),?,?,?,?,?) , undef, $fault_no, $reported_by,

Re: Quoting with placeholders

2001-11-02 Thread Stacy Mader
Okay, $dbh-do(qq{ INSERT INTO $fault_db ( FAULT_NO, REPORTED_BY, PROJECT_NO, DATE_OCCURRED, DATE_REPORTED, TIME_LOST,

Re: TYPE integer values and their respective data types

2001-11-02 Thread Dodger
www.mysql.com/doc Dodger - Original Message - From: Dieter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, November 02, 2001 7:16 PM Subject: TYPE integer values and their respective data types Hello, i am looking for a complete list of the integer values

Can't get multiple handles to stay alive

2001-11-02 Thread Rob McMillin
I am having some severe difficulties with multiple DBI objects. It seems that it is not possible to keep two connections alive and functional at the same time if both use Oracle but with different userids. Ex: $dbh1 = DBI-connect(dbi:Oracle:host=foo:sid=bar,snark,snarkpw); $dbh2 =

Re: mod_perl and dbi

2001-11-02 Thread MADI REDDY GARI SUBBA REDDY
Then how does it comparable with CGI::FastCGI and what are differences between FastCGI and embperl package? Which is better? In what circumastances FastCGI, embperl can be suitable? Plese give, clear info what to choose? Thank you inadvance. -SubbaReddy -- On Tue, 30 Oct 2001 02:19:31