In firebird sql it is pretty much the same as MS sql server. update <table> set <column> = <value> where <other column> = <value>
Sorry if I said anything stupid above, like I said big big neubie. Until now, the only big diferences that I got between SQL Server and Firebird were the procedures statements.
Best Regards,
Olivier Voutat
On 4/5/06, Gianny Damour <[EMAIL PROTECTED]> wrote:
Hi Olivier,
I think that Firebird does not like the generated UPDATE statements.
More accurately it does not like the "SET <column> = CASE WHEN ? THEN ?
ELSE <column>" syntax.
This problem has been fixed in head as the UPDATE statements will only
use the "SET <column> = ?" syntax. Meanwhile, do you know what the
Firebird syntax is to achieve the same result than "SET <column> = CASE
WHEN ? THEN ? ELSE <column>". If you give us this syntax, I think that
it should be quick easy to fix this problem (basically, we can implement
a DBSyntaxFactory and enable it by setting the db-syntax-factory element
of the openejb-jar DD).
Thanks,
Gianny
Olivier Voutat wrote:
> Lol, there is no space, it is just the Ctrl-c Ctrl-v, cause there was
> no space in my writing e-mail window so it did a return line.
>
> Anyway, maybe it is a tip of which is the problem, but I tried to use
> my findBySituation, and it works BUT I don't get to alter the LocalCar
> (s) returned.
>
> My code in my SessionBean
<snip>
>
> 00:34:32,073 WARN [GeronimoConnectionEventListener]
> connectionErrorOccurred called with null
> org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic
> SQL Error
> SQL error code = -104
> Token unknown - line 1, char 39
> THEN
> at
> org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:118)
> at org.firebirdsql.jdbc.FBPreparedStatement
> .<init>(FBPreparedStatement.java :40)
<snip>
> Caused by: org.tranql.ql.QueryException: Error executing statement:
> UPDATE CARROS SET MARCA = CASE WHEN ? THEN ? ELSE MARCA END, MODELO =
> CASE WHEN ? THEN ? ELSE MODELO END, PLACA = CASE WHEN ? THEN ? ELSE
> PLACA END, QUILOMETRAGEM = CASE WHEN ? THEN ? ELSE QUILOMETRAGEM END,
> COR = CASE WHEN ? THEN ? ELSE COR END, SITUACAO = CASE WHEN ? THEN ?
> ELSE SITUACAO END, TIPO = CASE WHEN ? THEN ? ELSE TIPO END, DIARIA =
> CASE WHEN ? THEN ? ELSE DIARIA END WHERE CHASSI = ?
> at
> org.tranql.sql.jdbc.JDBCUpdateCommand.execute(JDBCUpdateCommand.java:69)
> at
> org.tranql.cache.SimpleFlushStrategy.flush (SimpleFlushStrategy.java:64)
> at org.tranql.cache.SimpleFlushStrategy.flush
> (SimpleFlushStrategy.java:49)
> at
> org.tranql.cache.cache.InTxCacheTracker.flush(InTxCacheTracker.java :41)
> at org.tranql.cache.InTxCache.flush(InTxCache.java:86)
> at
> org.apache.geronimo.transaction.context.AbstractTransactionContext.flushState
> (AbstractTransactionContext.java :115)
> at
> org.apache.geronimo.transaction.context.InheritableTransactionContext.complete(InheritableTransactionContext.java:175)
> ... 24 more
> Caused by: org.firebirdsql.jdbc.FBSQLExcep tion : GDS Exception.
> 335544569. Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 1, char 39
> THEN
> at
> org.firebirdsql.jdbc.AbstractPreparedStatement.<init>( AbstractPreparedStatement.java:118)
>
--
Olivier Jeanpierre Voutat
Rua Praia de Muriú, 9188
Cep 59092-390 / Natal - RN
Tel: (84) 3219-0427 Cel: (84) 9977-3917
