LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 1996, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 8 Nov 1996 16:22:17 EST
Reply-To:     jmusial@COCA-COLA.COM
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Jerry Musial <jmusial@COCA-COLA.COM>
Subject:      Message From KO/Office
Comments: To: gregbn@ix.netcom.com

Greg Nelson asked:

Hi all. I am using the SQL pass-thru facility to extract data from an = Oracle database and want to extract only the changed and new records as = opposed to extracting them all into a temporary SAS dataset and using = other SAS methods to keep the updated records. Does anyone have an = ideas on how to approach this using SQL (Oracle SQL compliant as this is = pass-thru). Thanks in advance]

Greg, I do what your asking about in my application. The key is to have a field in a table in your data which will tell you the date of last update. All of the important tables I use have a last-Updated field. With that in mind, I use the following to only pull records which have been updated/created since a particular date

The following sql code is inside the ()'s passed to oracle

select fc.fcst_hdr_id , fc.clnt_id , fc.item_id , fc.fcst_uom , fc.type_cd , fc.vol from gpown.tfrcusit fc where to_date(to_char(fc.last_update,'DDMONYY'),'DDMONYY') > to_date('01NOV96','DDMONYY')

Jerry Musial Coca-Cola

* * * * * * * * * * * * * * * * * * * * * Message From : MUSIAL, JEROME * * Location : US-ATLANTA(OFCXSERV) * * KOMAIL ID : O09297 (OFCXSERV) * * Date and Time: 11/08/96 15:53:48 * * * * * * * * * * * * * * * * * * * * *


Back to: Top of message | Previous page | Main SAS-L page