Page 1 of 2

fetchrow_array in perl

Posted: Fri Aug 30, 2013 6:21 am
by rajaduraibanu
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

Re: fetchrow_array in perl

Posted: Fri Aug 30, 2013 6:56 am
by id10t
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.

Re: fetchrow_array in perl

Posted: Fri Aug 30, 2013 7:12 am
by rajaduraibanu
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

Re: fetchrow_array in perl

Posted: Mon Sep 02, 2013 6:02 am
by rajaduraibanu
Hi

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

Re: fetchrow_array in perl

Posted: Tue Sep 03, 2013 4:28 am
by id10t
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)

Re: fetchrow_array in perl

Posted: Tue Sep 03, 2013 10:22 am
by rajaduraibanu
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 ??

Re: fetchrow_array in perl

Posted: Sat Sep 14, 2013 10:44 am
by id10t
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)