Explicit Disconnects

2009-08-19 Thread Ow Mun Heng
Hi All, I know it's polite to ensure that we do an explicit disconnect() once we're done pulling the data. However, are there cases where an explicit disconnect is un-needed? Something like specific idiosyncrasies of some DBI packages. Eg: Postgresql vs MSSQL vs Teradata?

DBI::Teradata

2007-11-28 Thread Ow Mun Heng
Anyone here uses perl to pull data from teradata? just wondering if there's any caveats or such before I put effort into figuring out how to use it.

Possible to do Connect Caching? connect, pull, wait 30secs, pull again...

2007-09-17 Thread Ow Mun Heng
Current script does this in sequence. connect pull data based on select copy/import into PG wait 30 secs connect again. I've turned on connection logging in PG and I noticed that I keep seeing LOG : connection received statuses. Which means that the script is connecting to the server every 3

Re: fetchrow_array() vs fetchrow_arrayref() efficiency etc.

2007-09-10 Thread Ow Mun Heng
On Fri, 2007-09-07 at 10:43 +0100, Tim Bunce wrote: > On Fri, Sep 07, 2007 at 03:02:09PM +0800, Ow Mun Heng wrote: > > 'execute' => 0.249191s > > 'prepare' => 0.000489s > > 'fetchrow_arrayref' => 0.800888s / 15319 = 0.000

Re: fetchrow_array() vs fetchrow_arrayref() efficiency etc.

2007-09-07 Thread Ow Mun Heng
On Fri, 2007-09-07 at 14:33 +0800, Ow Mun Heng wrote: > Connection is to a MSSQL Server using DBI:sybase. > > queries are the same, difference is one uses fetchrow_array() and the > other uses fetchrow_arrayref(). > > Supposedly, fetrow_arrayref() is faster than the othe

fetchrow_array() vs fetchrow_arrayref() efficiency etc.

2007-09-06 Thread Ow Mun Heng
Connection is to a MSSQL Server using DBI:sybase. queries are the same, difference is one uses fetchrow_array() and the other uses fetchrow_arrayref(). Supposedly, fetrow_arrayref() is faster than the other but doesn't seem that way. (this is per Tim Bunce - Advanced DBI Tutorial July 2007) Que

Re: SQL Server + connect_cache + how to determine

2007-09-03 Thread Ow Mun Heng
On Mon, 2007-09-03 at 17:26 +0800, Ow Mun Heng wrote: > Just wondering how to if there's a way to determine the script I"m > writing is preserving the same connection string to the server. > > I'm hitting the SQL Server to query from 5 tables (hence 5 different > ses

SQL Server + connect_cache + how to determine

2007-09-03 Thread Ow Mun Heng
Just wondering how to if there's a way to determine the script I"m writing is preserving the same connection string to the server. I'm hitting the SQL Server to query from 5 tables (hence 5 different sessions running under screen) at intervals of 30 mins. Is connect_cache any use here under these

Multiple queries (SQL) in 1 connection instance

2007-08-29 Thread Ow Mun Heng
Hi, just wondering how to achieve this. Want to query (PostgresSQL DB) successively 3 different SQL. 1. delete from main_table 2. insert into main_table 3. update log_table Can it be done successively w/o calling dbh->connect each time? how do I put the prepare and the bind_param and the execute

Re: DBI:Sybase connect error

2007-08-29 Thread Ow Mun Heng
On Wed, 2007-08-29 at 14:32 +, vizzz wrote: > I'm trying to log into a sql server 2005 express through perl using > DBI and DBD::Sybase module. > this is my freetds.conf file (located under /etc/freetds/freetds.conf) > > [MyServer70] > host = 10.0.2.12 > port = 1449 > t

Re: DBI-Bind parameters

2007-08-23 Thread Ow Mun Heng
On Thu, 2007-08-23 at 08:26 +0100, Martin J. Evans wrote: > I'm not sure why it is not working as you expect but you should move the > prepare outside of the loop: > > $query = "select count(*) from table where time >= ? and time $sth = $dbh->prepare($query) > while (1) > { > $sth->execute($p

Re: DBI-Bind parameters

2007-08-22 Thread Ow Mun Heng
On Thu, 2007-08-23 at 10:17 +0800, Ow Mun Heng wrote: > Current method.. pseudo code. > > while (1) > { > $from_datetime = time; > $to_datetime = time + $time_interval; > > $query = "select count(*) from table where time >= ? and time $sth = $dbh->prepare($que

DBI-Bind parameters

2007-08-22 Thread Ow Mun Heng
Current method.. pseudo code. while (1) { $from_datetime = time; $to_datetime = time + $time_interval; $query = "select count(*) from table where time >= ? and time prepare($query) $sth->execute($from_datetime, $to_datetime) $from_datetime = $to_datetime; } Results: 1st time ran.. will have re

Re: DBI returned timestamp does not include seconds

2007-08-20 Thread Ow Mun Heng
On Thu, 2007-08-16 at 18:42 +0800, Ow Mun Heng wrote: > Querying SQL server. > > Data in SQL Server is > > 7/31/2007 2:37:51 PM > > Returned data from perl-dbi is > > Jul 31 2007 02:37PM Nailed it down to DBD::Sybase issue and posting here for the archives..

DBI returned timestamp does not include seconds

2007-08-16 Thread Ow Mun Heng
Querying SQL server. Data in SQL Server is 7/31/2007 2:37:51 PM Returned data from perl-dbi is Jul 31 2007 02:37PM There's missing seconds in the output. Anyone knows why? Can I please get a clue here?

Re: [OT] Warnings from code when using perl-dbi

2007-08-16 Thread Ow Mun Heng
On Thu, 2007-08-16 at 10:38 +0100, Gary Stainburn wrote: > Hi > > Firstly, for an excelent general perl list, try [EMAIL PROTECTED] It's not > just for beginners. Ah.. Cool.. I'll subscribe there. > > Secondly, it looks like you're trying to access a field that isn't defined, > possibly by r

Re: [OT] Warnings from code when using perl-dbi

2007-08-16 Thread Ow Mun Heng
On Thu, 2007-08-16 at 11:50 +0200, Peter J. Holzer wrote: > On 2007-08-16 16:38:02 +0800, Ow Mun Heng wrote: > > Sorry, this isn't really a perl-dbi issue per-se. but I don't know where > > else to post this issue. I can't find a "Perl" mail-list. There&

[OT] Warnings from code when using perl-dbi

2007-08-16 Thread Ow Mun Heng
Sorry, this isn't really a perl-dbi issue per-se. but I don't know where else to post this issue. I can't find a "Perl" mail-list. There's loads of list, but no perl-general. Anyway.. pulling data from SQL-server using perl-dbi to be formatted as a CSV file. I had to do some tweaking to the outpu