[sf-perl] Perl's to_date() equivalent

Loo, Peter # PHX Peter.Loo at source.wolterskluwer.com
Fri Sep 1 15:31:02 PDT 2006


                     Table "p_dlvrb_rx_claim_extract"
           Attribute           |     Type      | Modifier | Default
Value 
-------------------------------+---------------+----------+-------------
--
 dlvrb_gid                     | bigint        | not null | 
 drug_gid                      | bigint        | not null | 
 prdct_gid                     | bigint        | not null | 
 prctr_gid                     | bigint        |          | 
 ds_phmcy_gid                  | bigint        | not null | 
 phmcy_zip_cde                 | character(5)  | not null | 
 plan_gid                      | bigint        |          | 
 ptnt_gid                      | bigint        | not null | 
 claim_gid                     | bigint        | not null | 
 rx_fill_dte                   | date          | not null | 
 data_splr_cde                 | character(1)  |          | 
 days_sply_nbr                 | integer       | not null | 
 ovrd_days_sply_nbr            | integer       | not null | 
 drug_imptd_dspnd_mtrc_dec_qty | numeric(10,3) | not null | 
 ptnt_clctd_amt_to_pay_amt     | numeric(11,2) |          | 
 ptnt_co_pay_co_ins_amt        | numeric(9,2)  |          | 
 orgnl_drct_feed_ind           | character(1)  |          | 
 rx_pymt_typ_cde               | character(1)  |          | 
 zero_days_sply_ind            | character(1)  |          | 
 ptnt_hip_brth_yr_nbr          | numeric(4,0)  |          | 
 ptnt_gndr_cde                 | character(1)  |          | 
 study_prdct_ind               | character(1)  |          | 
 sw_prdct_ind                  | character(1)  |          | 
 clfsn_grace_prd_nbr           | numeric(3,0)  |          | 
 lot_grace_prd_nbr             | numeric(3,0)  |          | 
 cohrt_strt_dte                | date          |          | 
 cohrt_end_dte                 | date          |          | 
 extnd_lkbck_strt_dte          | date          |          | 
 lkbck_prd_days_nbr            | numeric(3,0)  |          | 
Distributed on hash: "ptnt_gid" 
 
Peter

-----Original Message-----
From: Josh Berkus [mailto:josh at agliodbs.com] 
Sent: Friday, September 01, 2006 3:29 PM
To: Loo, Peter # PHX
Cc: sanfrancisco-pm at pm.org
Subject: Re: [sf-perl] Perl's to_date() equivalent

Peter,

> Netezza does support to_date(), but the problem is I need to compare 
> current row's date to the previous rows date.  I suppose I could do:

Previous by date?  That's a SQL problem, not a Perl problem. Albeit an
really annoying one with a large database.  Can you give us the schema
of the table?

Too bad Netezza doesn't support custom running aggregates.  You could do
this easily in mainstream PostgresQL (using PL/perl no less).

--
--Josh

Josh Berkus
PostgreSQL @ Sun
San Francisco


This E-mail message is for the sole use of the intended recipient(s) and
may contain confidential and privileged information.  Any unauthorized
review, use, disclosure or distribution is prohibited.  If you are not
the intended recipient, please contact the sender by reply E-mail, and
destroy all copies of the original message.


More information about the SanFrancisco-pm mailing list