Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!agate!violet.berkeley.edu!lindahl From: lindahl@violet.berkeley.edu (Ken Lindahl 642-0866) Newsgroups: comp.databases Subject: Re: General ESQL question. Message-ID: <1989Oct2.173529.2191@agate.berkeley.edu> Date: 2 Oct 89 17:35:29 GMT References: <12785@orstcs.CS.ORST.EDU> Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Reply-To: lindahl@violet.berkeley.edu Organization: University of California, Berkeley Lines: 39 In article <12785@orstcs.CS.ORST.EDU> curt3028@oce.orst.edu (Curt Vandetta) writes: >> I have a question about esql, I'm working with RTI INGRES 5.0/0.6, > but this question should be independent of the Database system. > > I want to write a function that will return n attributes from a > table. The way I'm structuring it you would pass to this function > the name of the table and a bitmask that says which attributes > you want. I can see two ways of doing this, but I'm looking for > more. > > > > What I want is to say: > > exec sql select Variable > > where Variable is declared to be an array of char *'s or just > an array of attributes seperated by white spaces. It would be > up the programmer (me) to build Variable and verify that it > had legal attributes in it. IS THIS POSSIBLE? or do you have > any better ideas? I had to deal with this issue for an application that we built here. You need Embedded _Dynamic_ SQL (EDSQL?) be able to specify the attributes in the select at run time. RTI INGRES 5.x does not support EDSQL. I've been told (by RTI) that INGRES 6.x does support EDSQL, but I haven't upgraded yet so this is unconfirmed. However, Embedded QUEL (EQUEL) in INGRES 5 does allow this kind of dynamic behavior in retrieve statements. My solution was to initially code using EQUEL, and switch to ESQL when we go to INGRES 6 (we're waiting for the SPARCstation version to be released). For our application, the SQL select and QUEL retrieve statements are similar enough that I think (hope) the switch will not be too painful. Ken Lindahl lindahl@violet.berkeley.edu Advanced Technology Planning, Information Systems and Technology University of California at Berkeley