You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xsp-dev@xml.apache.org by Matt Sergeant <ma...@sergeant.org> on 2001/01/24 16:23:34 UTC

ESQL extension

In case you couldn't gather, I'm working on esql for AxKit at the
moment...

One thing that has occured to me is that Oracle always returns its column
names in upper case, whereas most databases return the actual case of the
columns as stored in the database. We don't appear to have a way to
request that columns be upper or lower case. Unless I'm missing that this
is a default somewhere?

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\


Re: ESQL extension

Posted by Matt Sergeant <ma...@sergeant.org>.
On Wed, 24 Jan 2001, Donald Ball wrote:

> On Wed, 24 Jan 2001, Matt Sergeant wrote:
>
> > > this should only be an issue for the get-columns method - the other
> > > methods don't create xml, but create data which you can insert in your xml
> > > structure wherever it's appropriate. i didn't bother to include anything
> > > in the get-columns method to force case or anything fancy, since i think
> > > you're better served in the long run not using it, but i'm not averse to
> > > adding it if you think it would be appropriate.
> >
> > I think we should add an attribute. We should also add a similar attribute
> > to the get-column-name and get-column-label tags.
>
> okay, how about tag-case, with values "upper", "lower", with the default
> being pass through as-is?

Sounds good.

> > Actually on a similar note, can anyone explain to me when get-column-label
> > is different from get-column-name (I looked at the javadoc for it, and it
> > didn't really have any explanation).
>
> damned if i know. presumably, some smart and sexy database might let you
> give human readable labels to its columns. i've never encountered one in
> practice - it's just a JDBC method i figured someone might want someday.
> if there's no equivalent in the perl DBI module, i'd suggest either
> running the column names through some sort of prettification routine:
>
> my_column_name -> My Column Name
>
> maybe, or else just returning the column name as is. i think that's what
> most JDBC drivers do. consistency across implemnetations isn't really
> necessary here, since it's totally driver dependent.

What I've done, is that in order to get around the column case issues, I
just lower case everything, so <get-column column="Name"> will work
whether its "Name", "NAME" (oracle style), or "NaMe". Then
get-column-name will return the lower case version, and get-column-label
returns the non-lower case version (whatever that happens to be for your
database). However I'm not going to worry about it as I can't see anyone
ever using that tag :-)

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\


Re: ESQL extension

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 24 Jan 2001, Matt Sergeant wrote:

> > this should only be an issue for the get-columns method - the other
> > methods don't create xml, but create data which you can insert in your xml
> > structure wherever it's appropriate. i didn't bother to include anything
> > in the get-columns method to force case or anything fancy, since i think
> > you're better served in the long run not using it, but i'm not averse to
> > adding it if you think it would be appropriate.
>
> I think we should add an attribute. We should also add a similar attribute
> to the get-column-name and get-column-label tags.

okay, how about tag-case, with values "upper", "lower", with the default
being pass through as-is?

> Actually on a similar note, can anyone explain to me when get-column-label
> is different from get-column-name (I looked at the javadoc for it, and it
> didn't really have any explanation).

damned if i know. presumably, some smart and sexy database might let you
give human readable labels to its columns. i've never encountered one in
practice - it's just a JDBC method i figured someone might want someday.
if there's no equivalent in the perl DBI module, i'd suggest either
running the column names through some sort of prettification routine:

my_column_name -> My Column Name

maybe, or else just returning the column name as is. i think that's what
most JDBC drivers do. consistency across implemnetations isn't really
necessary here, since it's totally driver dependent.

- donald


Re: ESQL extension

Posted by Matt Sergeant <ma...@sergeant.org>.
On Wed, 24 Jan 2001, Donald Ball wrote:

> On Wed, 24 Jan 2001, Matt Sergeant wrote:
>
> > I think we should add an attribute. We should also add a similar attribute
> > to the get-column-name and get-column-label tags.
>
> although i vote against the attribute for the get-column-name and
> get-column-label elements - here, if the user wants to change the case of
> the string, he can do so at the language level. otherwise, if we added
> support for case mangling here, we'd have to add it to _all_ methods which
> return a string value, right?

Right. +1

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\


Re: ESQL extension

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 24 Jan 2001, Matt Sergeant wrote:

> I think we should add an attribute. We should also add a similar attribute
> to the get-column-name and get-column-label tags.

although i vote against the attribute for the get-column-name and
get-column-label elements - here, if the user wants to change the case of
the string, he can do so at the language level. otherwise, if we added
support for case mangling here, we'd have to add it to _all_ methods which
return a string value, right?

- donald


Re: ESQL extension

Posted by Matt Sergeant <ma...@sergeant.org>.
On Wed, 24 Jan 2001, Donald Ball wrote:

> On Wed, 24 Jan 2001, Matt Sergeant wrote:
>
> > In case you couldn't gather, I'm working on esql for AxKit at the
> > moment...
> >
> > One thing that has occured to me is that Oracle always returns its column
> > names in upper case, whereas most databases return the actual case of the
> > columns as stored in the database. We don't appear to have a way to
> > request that columns be upper or lower case. Unless I'm missing that this
> > is a default somewhere?
>
> this should only be an issue for the get-columns method - the other
> methods don't create xml, but create data which you can insert in your xml
> structure wherever it's appropriate. i didn't bother to include anything
> in the get-columns method to force case or anything fancy, since i think
> you're better served in the long run not using it, but i'm not averse to
> adding it if you think it would be appropriate.

I think we should add an attribute. We should also add a similar attribute
to the get-column-name and get-column-label tags.

Actually on a similar note, can anyone explain to me when get-column-label
is different from get-column-name (I looked at the javadoc for it, and it
didn't really have any explanation).

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\


Re: ESQL extension

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 24 Jan 2001, Matt Sergeant wrote:

> In case you couldn't gather, I'm working on esql for AxKit at the
> moment...
>
> One thing that has occured to me is that Oracle always returns its column
> names in upper case, whereas most databases return the actual case of the
> columns as stored in the database. We don't appear to have a way to
> request that columns be upper or lower case. Unless I'm missing that this
> is a default somewhere?

this should only be an issue for the get-columns method - the other
methods don't create xml, but create data which you can insert in your xml
structure wherever it's appropriate. i didn't bother to include anything
in the get-columns method to force case or anything fancy, since i think
you're better served in the long run not using it, but i'm not averse to
adding it if you think it would be appropriate.

- donald