aspose file tools*
The moose likes JDBC 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
Bookmark "Create stored procedure in hssql" Watch "Create stored procedure in hssql" New topic
Author

Create stored procedure in hssql

Ego Tang
Greenhorn

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: 15299
    
    6

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
as
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
Greenhorn

Joined: Oct 01, 2002
Posts: 11
Hi Gregg,
I still cannot create stored procedure in hssql. Below is the instructions from mycgiserver.com:
" 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:
"java.lang.Math.sqrt"(2.0)
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:
SQRT(2.0)"
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: http://aspose.com/file-tools
 
subject: Create stored procedure in hssql