I considered that approach but I am working on a project that will accept different types of database engines, e.g. H2, MSSQL, MySQL, etc., so I was hoping to put the SQL code for creating objects in a single SQL script.
thanks though, Igal On Wednesday, September 5, 2012 10:04:55 AM UTC-7, Equ Zephyr wrote: > > I think you should be able to achieve the desired functionality in a > reusable manner by writing a stored procedure / user defined function in > Java as shown in the Features section of the documentation. > ------------------------------ > From: Igal > Sent: 9/4/2012 2:55 PM > To: [email protected] <javascript:> > Subject: conditional statements > > hi, > > I'm trying to create objects only if they don't exist, but I want to use > an IF-THEN statement block. in MSSQL I would do something like: > > IF NOT EXISTS( > > SELECT * > FROM INFORMATION_SCHEMA.TABLES > WHERE TABLE_NAME = 'TableName' > AND TABLE_SCHEMA = 'public' > > ) BEGIN > > ... some sql statements here > > END; > > > is there an equivalent H2 syntax? > > -- > 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/-/M4XfYlf-nZEJ. > To post to this group, send email to [email protected]<javascript:> > . > To unsubscribe from this group, send email to > [email protected] <javascript:>. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > -- 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/-/bFwVuEsWRo0J. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
