SQL processor

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

SQL processor

Oliver Charlet
Hi again,

while trying to setup a nice persistence layer for my applications, I
figured out, that the sql-processor does not support any
querying of sql meta data like table names, column names etc. Are there
some hidden features not documented, or does
the sql-processor not support that (yet)?

:olli

--
-----------------------
oliver charlet
software development

11-041 Olsztyn, Poland

[hidden email]
-----------------------




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: SQL processor

Erik Bruchez
Administrator
Olivier,

That's right, you cannot do that directly. However, you can obtain
column names for a non-empty table with a trick: select one row from
that table, and then get result-set metadata for the returned row.

You can also do this quite easily with the Java processor, in fact we
have an example under:

   examples/web/init-database/ListInitializedTables.java

Another, better solution would be to extend the SQL processor to support
that. Note that just right now, there is some class refactoring going on
that impacts the SQL processor but that should be stabilized later this
week. We are happy to help on this list if you want to implement this
improvement.

-Erik

Oliver Charlet wrote:
> Hi again,
>
> while trying to setup a nice persistence layer for my applications, I
> figured out, that the sql-processor does not support any
> querying of sql meta data like table names, column names etc. Are there
> some hidden features not documented, or does
> the sql-processor not support that (yet)?
>
> :olli



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: SQL processor

Oliver Charlet
Erik,

Erik Bruchez schrieb:
Olivier,

That's right, you cannot do that directly. However, you can obtain column names for a non-empty table with a trick: select one row from that table, and then get result-set metadata for the returned row.
yes, that's a possibility. But I'd like to check of tables exist, because I want to create them from within a pipeline too. Since I cannot even catch the resulting exception when I query a non existent table, I depend upon something like a sql:get-tables tag or such.

You can also do this quite easily with the Java processor, in fact we have an example under:

  examples/web/init-database/ListInitializedTables.java
I'll take a look at that, thanks.

Another, better solution would be to extend the SQL processor to support that. Note that just right now, there is some class refactoring going on that impacts the SQL processor but that should be stabilized later this week. We are happy to help on this list if you want to implement this improvement.
since the xupdate hacks are almost done, I dare to say: I'll see what I can do ;-)

-Erik

Oliver Charlet wrote:
Hi again,

while trying to setup a nice persistence layer for my applications, I figured out, that the sql-processor does not support any
querying of sql meta data like table names, column names etc. Are there some hidden features not documented, or does
the sql-processor not support that (yet)?

:olli


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

-- 
-----------------------
oliver charlet
software development

11-041 Olsztyn, Poland

[hidden email]
-----------------------


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: SQL processor

Stephen Bayliss
In reply to this post by Oliver Charlet

Just a thought, but wouldn’t it be possible to get this information from system tables?  Though obviously that’s not a solution that’s agnostic to the particular flavour of SQL database you want to plug in.

 


From: Oliver Charlet [mailto:[hidden email]]
Sent: 29 November 2005 10:11
To: [hidden email]
Subject: Re: [ops-users] SQL processor

 

Erik,

Erik Bruchez schrieb:

Olivier,

That's right, you cannot do that directly. However, you can obtain column names for a non-empty table with a trick: select one row from that table, and then get result-set metadata for the returned row.

yes, that's a possibility. But I'd like to check of tables exist, because I want to create them from within a pipeline too. Since I cannot even catch the resulting exception when I query a non existent table, I depend upon something like a sql:get-tables tag or such.


You can also do this quite easily with the Java processor, in fact we have an example under:

  examples/web/init-database/ListInitializedTables.java

I'll take a look at that, thanks.


Another, better solution would be to extend the SQL processor to support that. Note that just right now, there is some class refactoring going on that impacts the SQL processor but that should be stabilized later this week. We are happy to help on this list if you want to implement this improvement.

since the xupdate hacks are almost done, I dare to say: I'll see what I can do ;-)


-Erik

Oliver Charlet wrote:

Hi again,

while trying to setup a nice persistence layer for my applications, I figured out, that the sql-processor does not support any
querying of sql meta data like table names, column names etc. Are there some hidden features not documented, or does
the sql-processor not support that (yet)?

:olli



 



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



-- 
-----------------------
oliver charlet
software development
 
11-041 Olsztyn, Poland
 
[hidden email]
-----------------------


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: SQL processor

Oliver Charlet
Stephen,

sure that's always a possibility. But as you suggest it is very restricted to one specific database. Since JDBC already provides a lot
of those meta data, it shouldn't be a big deal to add that to the processor.

Stephen Bayliss schrieb:

Just a thought, but wouldn’t it be possible to get this information from system tables?  Though obviously that’s not a solution that’s agnostic to the particular flavour of SQL database you want to plug in.

 


From: Oliver Charlet [[hidden email]]
Sent: 29 November 2005 10:11
To: [hidden email]
Subject: Re: [ops-users] SQL processor

 

Erik,

Erik Bruchez schrieb:

Olivier,

That's right, you cannot do that directly. However, you can obtain column names for a non-empty table with a trick: select one row from that table, and then get result-set metadata for the returned row.

yes, that's a possibility. But I'd like to check of tables exist, because I want to create them from within a pipeline too. Since I cannot even catch the resulting exception when I query a non existent table, I depend upon something like a sql:get-tables tag or such.


You can also do this quite easily with the Java processor, in fact we have an example under:

  examples/web/init-database/ListInitializedTables.java

I'll take a look at that, thanks.


Another, better solution would be to extend the SQL processor to support that. Note that just right now, there is some class refactoring going on that impacts the SQL processor but that should be stabilized later this week. We are happy to help on this list if you want to implement this improvement.

since the xupdate hacks are almost done, I dare to say: I'll see what I can do ;-)


-Erik

Oliver Charlet wrote:

Hi again,

while trying to setup a nice persistence layer for my applications, I figured out, that the sql-processor does not support any
querying of sql meta data like table names, column names etc. Are there some hidden features not documented, or does
the sql-processor not support that (yet)?

:olli



 



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



-- 
-----------------------
oliver charlet
software development
 
11-041 Olsztyn, Poland
 
[hidden email]
-----------------------

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

-- 
-----------------------
oliver charlet
software development

11-041 Olsztyn, Poland

[hidden email]
-----------------------


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws