fetchrow_array in perl

Moderator: NorbertKrupa

rajaduraibanu
Newbie
Newbie
Posts: 19
Joined: Thu Aug 08, 2013 8:01 am

fetchrow_array in perl

Post by rajaduraibanu » Fri Aug 30, 2013 6:21 am

Hi m getting fetchrow_array failed: error when fetching large no of rows in select query , but getting proper output when i give limit in select query to some 100 rows .


my error is as below :
DBD::ODBC::st fetchrow_array failed: [unixODBC][Vertica][VerticaDSII] (20)

and my DBI installed versions are as below :
OS : linux (2.6.18-308.16.1.el5)
DBI : 1.628
DBD::mysql : 4.013
DBD::Sponge : 12.010003
DBD::SQLite : 1.27
DBD::Proxy : install_driver(Proxy) failed: Can't locate RPC/PlClient.pm in @INC
DBD::Pg : 2.15.1
DBD::ODBC : 1.43
DBD::Gofer : 0.015327
DBD::File : 0.42
DBD::ExampleP : 12.014311
DBD::DBM : 0.08

and perl version is
perl, v5.10.1 (*) built for x86_64-linux-thread-multi

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: fetchrow_array in perl

Post by id10t » Fri Aug 30, 2013 6:56 am

Hi!

Can you play with limit?
Set limit to 10000, 1000000, 10000000.
If it will fail for some "large" limit and above so problem in memory allocation: OS rejects to DBD to allocate massive amounts of memory.

rajaduraibanu
Newbie
Newbie
Posts: 19
Joined: Thu Aug 08, 2013 8:01 am

Re: fetchrow_array in perl

Post by rajaduraibanu » Fri Aug 30, 2013 7:12 am

hi ,


At present i av given limit as 2000 , for this oly m getting error
Can u pls give me a better idea :(
Even its not supporting limit 500 :(:(


Reply soon

rajaduraibanu
Newbie
Newbie
Posts: 19
Joined: Thu Aug 08, 2013 8:01 am

Re: fetchrow_array in perl

Post by rajaduraibanu » Mon Sep 02, 2013 6:02 am

Hi

how to increase the ODBC buffer size in Vertica ?????????????????????????

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: fetchrow_array in perl

Post by id10t » Tue Sep 03, 2013 4:28 am

Hi!
you need to set buffer size in ODBC DSN: https://my.vertica.com/docs/6.1.x/HTML/ ... #12800.htm
(search for ResultBufferSize param)

rajaduraibanu
Newbie
Newbie
Posts: 19
Joined: Thu Aug 08, 2013 8:01 am

Re: fetchrow_array in perl

Post by rajaduraibanu » Tue Sep 03, 2013 10:22 am

hi


Currently m using select TIMESTAMPADD(SQL_TSI_SECOND, $duration, '$finalOpeningDateTime') to add seconds to timestamp, but its throwing error for some datetime (i am not able to find that particular datetime value). Is there any other function to achieve this ??

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: fetchrow_array in perl

Post by id10t » Sat Sep 14, 2013 10:44 am

Hi!

You can directly to add INTERVAL without TIMESTAMPADD function:

Examples:

Code: Select all

daniel=> select '2000-01-01 12:36:09.898'::timestamp + '1 DAY'::interval;
        ?column?         
-------------------------
 2000-01-02 12:36:09.898
(1 row)

Code: Select all

daniel=> select '2000-01-01 12:36:09.898'::timestamp + '1 MONTH 2 DAYS'::interval;
        ?column?         
-------------------------
 2000-02-02 12:36:09.898
(1 row)

Code: Select all

daniel=> select '2000-01-01 12:36:09.898'::timestamp + '1 MONTH 2 DAYS 3 HOURS'::interval;
        ?column?         
-------------------------
 2000-02-02 15:36:09.898
(1 row)

Code: Select all

daniel=> select '2000-01-01 12:36:09.898'::timestamp + '1 YEAR 3 SECONDS'::interval;
        ?column?         
-------------------------
 2000-12-31 12:36:12.898
(1 row)

Post Reply

Return to “Perl”