Thanks for the replies. That explained a lot.

I've installed MySQL and my resultsetmetadata tests are now showing all
values returned but the schema, but with table column name, column name and
type being returned now, my commands are not requiring result descriptors
anymore.

SQL Server documentation is listing all those operations as supported, but
that does not seem to be the case after all. It may be a limitation of SQL
Server Express. I just don't know.

-Jason
 
This e-mail and any files transmitted with it are intended solely for the
use of the individual or entity to whom they are addressed.  If you have
received this e-mail in error please notify the sender immediately and
delete this e-mail from you system.  This message may contain company
proprietary, sensitive information and is intended only for the individual
named.  Its contents may be covered under the Trade Secret Act of various
jurisdictions.  If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. If you are not the intended
recipient you are notified that disclosing, copying, distributing or taking
any action in reliance on the contents of this information is strictly
prohibited.

> -----Original Message-----
> From: Amita Vadhavkar [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 06, 2007 11:32 PM
> To: [email protected]
> Subject: Re: Another DAS problem/question
> 
> DAS is supporting data transfer between SDO and DB. In this, the
> uniqueness of a
> DataObject(DO) is ensured by having a PK in it. If this is not done,
> it will not be possible to
> get correct query results and also to do CUD on DB based on changes in
> DO. Due to this
> the DAS query mandates that the SELECT clause should include a PK. For
> the same reason
> support for SQL aggregate functions like count(), sum(), disctinct() etc.
> is not
> completely implemented in DAS. In other words, a query like SELECT
> COUNT(ID) is meant
> for giving a sum and will not have a PK in it and so will not work well in
> DAS
> 
> Query like below will work - (verified in Derby)
>     <Command name="countBook" SQL="select BOOK_ID, COUNT(*) from BOOK
> GROUP BY BOOK_ID" kind="Select">
>       <ResultDescriptor columnName="BOOK_ID" tableName="BOOK"
> columnType="commonj.sdo.IntObject"/>
>       <ResultDescriptor columnName="COUNT(*)" tableName="BOOK"
> columnType="commonj.sdo.IntObject"/>
>     </Command>
> 
> But this does not have any true meaning of count(*) as the result will
> be something like -
> 
> <?xml version="1.0" encoding="ASCII"?>
> <root:root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:das="http:///org.apache.tuscany.das.rdb/das";
>     xmlns:root="root" xsi:type="das:DataGraphRoot">
>   <BOOK>
>     <BOOK_ID>1</BOOK_ID>
>     <COUNT(*)>1</COUNT(*)>
>   </BOOK>
>   <BOOK>
>     <BOOK_ID>2</BOOK_ID>
>     <COUNT(*)>1</COUNT(*)>
>   </BOOK>
> </root:root>
> 
> So apart from MQ SQL Driver related issue, DAS is not supporting
> aggregate functions as these can not
> be tied to Table Row PK per ResultSet row.
> 
> Workaround will be get all records using "SELECT BOOK_ID FROM BOOK" as
> DAS Command and then do aggregate
> operations using Java API instead of native SQL function inside SQL Query.
> 
> If your requirement is far more complex than SELECT count(*), you can
> try the stored procedure support
> provided in DAS. e.g. check StoredProcs.testGetNamedCustomers() test
> case to see how the count(*) is
> returned through OUT param and the DataGraph of DOs is returned as return
> value.
> 
> Regards,
> Amita
> 
> On Nov 7, 2007 4:50 AM, Jason Clark <[EMAIL PROTECTED]> wrote:
> > As I've stated before, I'm not getting the metadata returned to me for a
> > query. As such, I'm having to provide result descriptors, including an
> ID.
> >
> >
> >
> > I want to do the following
> >
> >
> >
> > <Command name="count" SQL="select COUNT(ID) from CONTACTS"
> kind="Select">
> >
> > </Command>
> >
> >
> >
> > Without metadata being returned, it's again asking me for result
> > descriptors. But, if I just add
> >
> >
> >
> > <ResultDescriptor columnName="COUNT" tableName="CONTACTS"
> > columnType="commonj.sdo.Int"/>
> >
> >
> >
> > I get told no ID. But, obviously, there can't be
> >
> >
> >
> > <ResultDescriptor columnName="ID" tableName="CONTACTS"
> > columnType="commonj.sdo.Int"/>
> >
> >
> >
> > because that query returns a resultset with 1 column.
> >
> >
> >
> > Has anyone else had experience with SQL Server 2005 not returning
> MetaData?
> > Their docs says they do and I have their latest drivers, but I'm getting
> > very little for metadata.
> >
> >
> >
> > A simple test of the metadata results returns
> >
> >
> >
> > Column Table Name:
> >
> > Schema name:
> >
> > Column Type: 12
> >
> > Column Name: BUSINESS_CELL
> >
> >
> >
> > As you can see, I'm missing Table Name and Schema Name. I'm doing a
> simple
> > Select query on this, so.
> >
> >
> >
> > I'm at a loss here.
> >
> >
> >
> > Any more ideas?
> >
> >
> >
> > -Jason Clark
> >
> >
> >
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]








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

Reply via email to