Selecting some column names from a database table

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Selecting some column names from a database table

Alex Sharaz-2
Hi,
This is probably an easily solved problem.

I've got a "building" database table detailing information relating to the network vlans in each building.Table columns are split into two groups. Group one describes the building, where it is etc. Group two describes the different VLANS  available in a specific building. All the column names in group 2 end in _VLAN.

 Within the buildings described in the above tabet, a client machine needs to perform some form of network authentication in order to a)connect to the network and b)  be placed in the correct  vlan. Two types of authentication are supported. user-id based and MAC address based. Any form of user-id based auth is handled somewhere else. MAC address based authentication requires registration of a full/partial mac address in a database table. To do this registration I've written a simple xforms page that allows a MAC address to be registered. Part of the registration is selecting the VLAN is to be used from a drop down list.

I've currently got

<sql:config>
                <buildings>
                    <sql:connection>
                        <sql:datasource>ndxml</sql:datasource>
                        <sql:execute>
                            <sql:query>
                                 select building_name,auth_vlan,unauth_vlan,utils_vlan,dmz_vlan,ip_phone_vlan,camera_vlan,games_vlan from devinfo.buildings where pk_building=1
                            </sql:query>
                            <sql:result-set>
                                <metadata>
                                   <sql:column-iterator>
                                        <name>
                                           <sql:get-column-name/>
                                        </name>
                                        <type>
........
</column>


etc .......

which I use in a select1 statement when registering a MAC address. The user therefor specifies which VLAN they want the device to be placed in upon successful authentication. The problem with this is that if i add some more vlans to the table I'll have to add the column names to the above select statement. Using a "select *.." statement includes the other columns that I don;t want to be visible in my select1 statement. When getting hold of the metadata, is there any way of saying select * except for .... . Elsewhere I'm using an <sql:exclude.... statement when accessing column data, but there doesn't seem to be a way of doing that  for metadata.


Checked by  Hu-fw-yhman


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Selecting some column names from a database table

Erik Bruchez
Administrator
Alex,

I don't think there is such a thing for metadata.

You could use XSLT to dynamically produce the SQL processor
configuration. Would that work?

-Erik

On Mon, Feb 1, 2010 at 3:02 AM, Alex Sharaz <[hidden email]> wrote:

> Hi,
> This is probably an easily solved problem.
> I've got a "building" database table detailing information relating to the
> network vlans in each building.Table columns are split into two groups.
> Group one describes the building, where it is etc. Group two describes the
> different VLANS  available in a specific building. All the column names in
> group 2 end in _VLAN.
>  Within the buildings described in the above tabet, a client machine needs
> to perform some form of network authentication in order to a)connect to the
> network and b)  be placed in the correct  vlan. Two types of authentication
> are supported. user-id based and MAC address based. Any form of user-id
> based auth is handled somewhere else. MAC address based authentication
> requires registration of a full/partial mac address in a database table. To
> do this registration I've written a simple xforms page that allows a MAC
> address to be registered. Part of the registration is selecting the VLAN is
> to be used from a drop down list.
> I've currently got
> <sql:config>
>                 <buildings>
>                     <sql:connection>
>                         <sql:datasource>ndxml</sql:datasource>
>                         <sql:execute>
>                             <sql:query>
>                                  select
> building_name,auth_vlan,unauth_vlan,utils_vlan,dmz_vlan,ip_phone_vlan,camera_vlan,games_vlan
> from devinfo.buildings where pk_building=1
>                             </sql:query>
>                             <sql:result-set>
>                                 <metadata>
>                                    <sql:column-iterator>
>                                         <name>
>                                            <sql:get-column-name/>
>                                         </name>
>                                         <type>
> ........
> </column>
>
> etc .......
> which I use in a select1 statement when registering a MAC address. The user
> therefor specifies which VLAN they want the device to be placed in upon
> successful authentication. The problem with this is that if i add some more
> vlans to the table I'll have to add the column names to the above select
> statement. Using a "select *.." statement includes the other columns that I
> don;t want to be visible in my select1 statement. When getting hold of the
> metadata, is there any way of saying select * except for .... . Elsewhere
> I'm using an <sql:exclude.... statement when accessing column data, but
> there doesn't seem to be a way of doing that  for metadata.
>
> Checked by  Hu-fw-yhman
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws