Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!berlin From: berlin@bu-cs.BU.EDU (David K. Fickes) Newsgroups: comp.databases Subject: Re: INGRES/EQC and SQL/C ...and general notes... Summary: yes but... Message-ID: <24585@bu-cs.BU.EDU> Date: 26 Aug 88 21:11:07 GMT References: <24546@bu-cs.BU.EDU> <2401@rtech.rtech.com> Reply-To: berlin@buita.bu.edu (David Fickes Einstein Project) Followup-To: comp.databases Organization: Boston University - Einstein Papers Project Lines: 49 Yes a simpler QUEL statement will do it .. BUT ONLY IF ALL OF THE RESULTS ARE A CORRECT DATE... take the string "00/00-02/89?" and put it through our two statements as one of 40,000 records ... (if INGRES would allow the nesting...) and the one transaction would fail... not a problem unless you have 39,999 other records that would be changed. If I use my statement 39,999 would change and I could easily find the one other... In yours... the transaction fails on an UNKNOWN record and NO RECORDS ARE CHANGED leaving me to write more code to TRAP the one failure... The only other real way is to work with the TID... or the UNIQUE ID NUMBERS (d.uid) which I maintain with our records... Now back to the original question WHY CAN'T WE NEST THE DARN QUEL STATEMENTS? In article <24546@bu-cs.BU.EDU>, berlin@bu-cs.BU.EDU (David K. Fickes) writes: > > One other question. What's so hard about supporting NESTED EQUEL > statements in the EQUEL/C processor??? I've got some code that looks like > this: > > ## ingres "einstein" > ## range of d is dukasfin3 > ## retrieve (c_uid=d.uid) where d.date=" " and > ## squeeze(d.doc_date)="00/00/??"; > ##{ > ## retrieve (c_year=right(squeeze(d.doc_date),2)) where d.uid=c_uid; > ## replace d(date=date(01/01/c_year)) where d.uid=c_uid; > ##} > Actually, a this can be done using a single QUEL REPLACE statement. ## replace d (date = date("01/01/"+right(squeeze(d.doc_date),2))) ## where d.date=" " and squeeze(d.doc_date)="00/00/??"; -- ============================================================================== David K. Fickes Center for Einstein Studies/Einstein Papers Project UUCP: ...harvard!bu-it!berlin Boston University OTHERWISE: berlin@bu-it.bu.edu 745 Commonwealth Avenue PHONE: (617) 353-9249 (617) 277-9741 Boston, MA 02215