The tip works exactly !!!
Thanks for your attention.
Em sex., 24 de mar. de 2023 às 22:45, Evgenij Ryazanov
escreveu:
> With JDBC, you can call your function either with PreparedStatement or
> with CallableStatement:
>
> try (Connection c = DriverManager.getConnection("jdbc:h2:mem:1")) {
>
>
With JDBC, you can call your function either with PreparedStatement or with
CallableStatement:
try (Connection c = DriverManager.getConnection("jdbc:h2:mem:1")) {
Statement s = c.createStatement();
s.execute("CREATE ALIAS my_stored_proc AS 'BigDecimal send() { return
BigDecimal.ONE; }'");
//
My code is the following:
CREATE ALIAS my_stored_proc AS '
import java.math.BigDecimal;
@CODE
BigDecimal send() {
return BigDecimal.ONE;
}
';
// call the send routine to csmp
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(jdbcTemplate)
Hello!
The valid syntax is
CREATE ALIAS MY_STORED_PROC AS '
BigDecimal envia() {
return BigDecimal.ONE;
}
';
because SQL NUMERIC data type is mapped to BigDecimal data type in Java.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To