File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Create stored procedure in hssql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Create stored procedure in hssql" Watch "Create stored procedure in hssql" New topic

Create stored procedure in hssql

Ego Tang

Joined: Oct 01, 2002
Posts: 11
I want to execute multiple SQL statements by bunching them as a stored procedure. I know that Hypersonic sql supports stored procedure but could anyone please instruct me how to create procedure in hssql?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

If what you say is true, and hssql supports stored procedures, they should support the SQL standard for creating them, which is something like:
create procedure procedure_name
select statement goes here
And that's it. You can get a lot fancier by adding variables to the select statement for the stored procedure to deal with so as to not make everything so static. But that is the jist of it.
Sometimes Stored Procedure syntax can very from vendor to vendor, however, the above code should work on pretty much every vendor. Especually something like HSSQL. Let me know if that works for you or not.

GenRocket - Experts at Building Test Data
Ego Tang

Joined: Oct 01, 2002
Posts: 11
Hi Gregg,
I still cannot create stored procedure in hssql. Below is the instructions from
" Stored Procedures / Functions
Stored procedures are Java functions that are called directly from the SQL language or using an alias. Calling Java functions (directly or using the alias) requires that the Java class can be reached by the database (server). The syntax is:
This means the packacke must be provided, and the name must be written as one word, and inside " because otherwise it is converted to uppercase (and not found).
An alias can be created using the command CREATE ALIAS:
CREATE ALIAS SQRT FOR "java.lang.Math.sqrt"
When an alias is defined, then the function can be called additionally using this alias:
Dana Hanna
Ranch Hand

Joined: Feb 28, 2003
Posts: 227
What you are confusing is Java stored procedures, and SQL stored procedures. If HS only supports Java stored procedures, you need to write the stored procedure in Java - not SQL... Check out the HS docs for details about how to do this...
I agree. Here's the link:
subject: Create stored procedure in hssql
It's not a secret anymore!