db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume CHAUVET <guillaume.chau...@qualiformed.com>
Subject Call statement with an SQL request as an input parameter
Date Tue, 30 Apr 2013 15:51:32 GMT
Hi,

Below, please find a small SQL script intended to inject a value selected from an SQL request
as a input call statement parameter :
SELECT center FROM APP.SETTINGS WHERE ID = 1
>Return a varchar(128) string, for example: 'test'

Now, I try to use this value as a input parameter in a call statement :
CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('center', (SELECT center FROM APP.SETTINGS WHERE
ID = 1));
>Error code -1, SQL state XJ001: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC:
java.lang.NullPointerException  XJ001.U
>Line 1, column 1
>[This SQL request reset the JDBC connection]

According to you, is it the expected behaviour or a bug ?

--
Regards,
Guillaume



Mime
View raw message