Re: Basic SQL question Update statement

2009-09-27 Thread Knut Anders Hatlen
bruehlicke bruehli...@gmail.com writes:

 I have a trigger something like

 . UPDATE X SET A=(SELECT . )


 Now, if the embedded SELECT statement returns no rows I would NOT like
 to change the value from A to bank/null but let it keep the value it
 currently has.

 Any suggestions for a one liner which fits into a create trigger statement

I think this should do the trick:

UPDATE X SET A=COALESCE((SELECT ..), A)

-- 
Knut Anders


Pooling

2009-09-27 Thread Christopher Giblin

Hi,
Just to be sure - Derby does not directly support connection pooling,
correct? Rather, One must use a third party pool such as Apache DBCP

Could you please confirm my understanding?

Thanks, chris



SQLException: Syntax error: Encountered EOF at line 1, column 19.

2009-09-27 Thread jstrunk

I am using Eclipse 3.5.0 with Derby 10.5.3.0 (not the Derby Plugin). I
created an SQLJ stored procedure and stored it. When I try to execute it I
get SQLException: Syntax error: Encountered EOF at line 1, column 19. 

That is the only error information I get. How can I get a listing of what
SQL thinks the procedure looks like up to the point where the error occurs?
-- 
View this message in context: 
http://www.nabble.com/SQLException%3A-Syntax-error%3A-Encountered-%22%3CEOF%3E%22-at-line-1%2C-column-19.-tp25638168p25638168.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.



Re: Basic SQL question Update statement

2009-09-27 Thread bruehlicke
Tusind takk. Virker perfekt.

On Sun, Sep 27, 2009 at 1:22 PM, Knut Anders Hatlen knut.hat...@sun.com wrote:
 bruehlicke bruehli...@gmail.com writes:

 I have a trigger something like

 . UPDATE X SET A=(SELECT . )


 Now, if the embedded SELECT statement returns no rows I would NOT like
 to change the value from A to bank/null but let it keep the value it
 currently has.

 Any suggestions for a one liner which fits into a create trigger statement

 I think this should do the trick:

 UPDATE X SET A=COALESCE((SELECT ..), A)

 --
 Knut Anders



Re: Pooling

2009-09-27 Thread Peter Ondruška
Yes, Derby does not provide connection pool, pick your favourite (I can
confirm c3p0 works very well for me). Peter

On Sun, Sep 27, 2009 at 11:56 PM, Christopher Giblin c...@zurich.ibm.comwrote:


 Hi,
 Just to be sure - Derby does not directly support connection pooling,
 correct? Rather, One must use a third party pool such as Apache DBCP

 Could you please confirm my understanding?

 Thanks, chris




Re: Pooling

2009-09-27 Thread Matt Doran

Peter Ondruška wrote:
Yes, Derby does not provide connection pool, pick your favourite (I 
can confirm c3p0 works very well for me). Peter


We also use c3p0 with embedded derby, but it's mainly just our default 
configuration so if you switch our app over to a network based database 
you can take advantage of the pooling.


When using embedded derby is there advantage (or disadvantage!) to using 
a DB connection pool?


Cheers,
Matt