[TYPO3-dev] DBAL Usuage
belbono
belbono at gmx.de
Sun Nov 18 19:29:36 CET 2007
Hi,
Martin Kutschker wrote:
> belbono schrieb:
>
>> Hi Martin,
>>
>>
>> bad news brackets doesn't work.
>> If I give something like
>>
>> 'FROM PUBLICATIONS INNER JOIN ARTICLE ON (PUBLICATIONS.UID_ =
>> ARTICLE.PUBLICATIONS_UID) '
>>
>> to DBAL I get an Error saying that there is no handler found and no join
>> clause and other things...
>>
>
> Could be that DBAL supports currently join condiitons only with OUTER JOINS.
>
> But I still think that it is an error to use upper case table names
> unless they are spelled as such in the table definition.
>
That's right. Since Oracle accepts only tablenames in uppercase, I´m
only allowed to use those.
>
>> So I think DBAL cannot handle table attributs with given table name as
>> prefix.
>> Other example:
>>
>> SELECT
>> PUBLICATIONS.UID_,PUBLICATIONS.TITLE,PUBLICATIONS.RATING,PUBLICATIONS.COMMENT_
>>
>
>
>> will be converted into
>>
>> SELECT "PUBLICATIONS"."UID_", "PUBLICATIONS"."TITLE",
>> "PUBLICATIONS"."RATING", "PUBLICATIONS"."COMMENT_"
>>
>> DBAL quotes the table name and that makes wrong sql.
>>
>
> The generated code is IMHO perfectly wrong. Why do you think that the
> quoting is incorrect?
>
Quoting the tablenames is wrong since you get an error when using such a
statement in a program like oracle's SQL-Developer.
Remove the quotes on the tablename and everything is fine...
Of course there is the way using it without the tablename as a prefix,
but unfortunately this leads me to ambiguous attribute names...
..maybe I should try another rename operations for affected attributes
> Note: the casing may be a problem. ProstgreSQL handles the case of names
> differently when using quotes or not. Is this true for Oracle as well.
>
> Masi
>
> PS: Your query uses names that are not TYPO3 "compatible". They should
> be named tx_myext_tablename. I sguugest you don't use DBAL if your data
> isn't part of your TYPO3 installation. It might be easier for you :-)
>
Yes, I could use AdoDB directly ... But I wanted it to be compatible
with MySQL, because I don't really think an Oracle DB is necessary for
my plugin- But unfortunately that's not my decision...
The other thing, is when using tablenames that are compatible with typo3
I may get problems with oracle again, because it limits the length of
tablenames.
Alex
More information about the TYPO3-dev
mailing list