CREATE PROC equivalent

1,227 views
Skip to first unread message

Igal

unread,
Nov 16, 2011, 2:24:01 PM11/16/11
to h2-da...@googlegroups.com
I was trying to find some sample code for Stored Procedures or UDFs in H2.  the only information I found was for using Java methods and Aliasing them for use as PROCs.

isn't there a simple way to create a proc in SQL code in H2?

for example, let's say that I have the following sample PROC in MSSQL:

CREATE PROC spGetItemsForType( @Type int ) as

  SELECT *
  FROM   ITEMS
  WHERE  TYPE = @Type;

is there an equivalent H2 Stored Procedure?  can you post the sample code?

thanks :)

Noel Grandin

unread,
Nov 17, 2011, 4:10:51 AM11/17/11
to h2-da...@googlegroups.com, Igal

H2 doesn't have that kind of stored procedure, but you can easily code similar stuff in java. See here:
http://h2database.com/html/features.html#user_defined_functions


Igal wrote:
--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/I1hIoUPuaZwJ.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Reply all
Reply to author
Forward
0 new messages