Re: [gnome-db] get_schema call - a couple of queries about information returned.



On 11 Feb 2003 00:46:09 +0100
Rodrigo Moya <rodrigo gnome-db org> wrote:

Rodrigo,

Sorry it has taken me so long to reply to this...

> it is acceptable to return only fundamental types, although for the
> non-existant-yet UI to create tables, it might be good to have all
> available types to the user.

OK, as an example Oracle has 5 types for holding strings within the
database - it has separate types for fixed and variable width, separate
types for national-language-specific behaviour and another type for very
big strings.

I can see that a user would probably want to choose between these types
when defining the table, but once the table is defined most applicatons
wouldn't care which of these types a column had - they are all just
kinds of string.

So, should there be separate GDA types for these?

Another way to handle this would be have the provider return the type as
a provider specific string which is opaque to the application (such as
mergeant) - the application would just display it or let the user choose
it from a list.  If the application wanted to know what it could do with
data of that type it would ask the provider for the corresponding GDA
type - the get_gda_type method you mention later on.

What do you think?

> hmm, if they are aggregates (like TO_DATE, etc), I think they should
> be in AGGREGATES schema. Probably we want to change the AGGREGATES
> schema to return a list (maybe a GDA_VALUE_TYPE_LIST?) of all the
> types for arguments.

Perhaps I was not being very clear in my original question.

The TO_DATE function is not an aggregate.  It converts one string value
into one date value with the aid of a format string.  It can be used in
any SQL expression where a date is required, e.g.:

INSERT INTO items (code,date_added)
VALUES (123, TO_DATE('04-Dec-2002','DD-MON-YYYY'));

Aggregates are things like SUM, MIN, MAX, AVG, COUNT - they are
aggregates because they apply to a whole list of values, one from each
row of a database query, and return a single value.  Generally speaking
these are used in conjunction with a 'GROUP BY' clause in the query.  An
example would be:

SELECT   department,min(salary),max(salary),avg(salary)
FROM     employees
GROUP BY department;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]