Hi Marc,

> is there any interface at any service that can translate this
> 
> SELECT A, B, C, D, E, F, G FROM test.TestTab
> 
> into that
> 
> SELECT `A`, `B`, `C`, `D`, `E`, `F`, `G` FROM `test`.`TestTab` `TestTab`
> 
> according to the needs of the underlying database automatically from
> basic code or do I have to do it manually?

Try the com.sun.star.sdb.SingleSelectQueryComposer. Below is a Basic
fragment which exemplarily uses the Bibliography:

 oDataSource = createUnoService( _
   "com.sun.star.sdb.DatabaseContext" ).getByName( "Bibliography" )

 oConnection = oDataSource.getConnection( "", "" )

 oComposer = oConnection.createInstance( _
   "com.sun.star.sdb.SingleSelectQueryComposer" )

 oComposer.Query = "SELECT Indentifier FROM biblio"
 MsgBox oComposer.Query

 oConnection.close()

The composer does not generate the table alias (the second `TestTab` in
your example), but this one can be omitted anyway (with all databases I
know, except some MS SQL server versions, IIRC).

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to