Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucsd!ogccse!orstcs!curt3028@oce.orst.edu
From: curt3028@oce.orst.edu (Curt Vandetta)
Newsgroups: comp.databases
Subject: General ESQL question.
Message-ID: <12785@orstcs.CS.ORST.EDU>
Date: 29 Sep 89 20:37:15 GMT
Sender: usenet@orstcs.CS.ORST.EDU
Reply-To: curt3028@oce.orst.edu (Curt Vandetta)
Organization: College of Oceanography, Oregon State Univ., Corvallis, Or.
Lines: 40


  Howdy Folks,

  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.  

  1)  You could code every combination of attributes that could be
      requested.  Which is not at all what I want to do.

  2)  You can select every attribute in the table and then mask out
      the ones that the user wants and return them.

  Number 2 is far better, but this Database will eventually grow into
  a networked Database, and selecting every attribute will put to much
  of a demand on the network.  What I would like (and can't find any
  documentation that says I can or can't do it) is to make the embedded
  select statement select a variable for it's attributes.
  Example:
       Currently in Ingres you would say:

	exec sql select attribute1, attribute2,...

       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?

  Thanks in advance,
  Curt