Re: How do I modify a delete sql statement in H2

2011-04-07 Thread gabjos
On Apr 7, 2:02 pm, gabjos wrote: > I have a delete statement that is giving me errors in H2. How do I > modify it for H2? > > Here it is: > > DELETE FROM multi_pages INNER JOIN bib_holdings bh ON bh.id = > multi_pages.id WHERE bh.pdf_name = 'ak-1' I only know O

How do I modify a delete sql statement in H2

2011-04-07 Thread gabjos
I have a delete statement that is giving me errors in H2. How do I modify it for H2? Here it is: DELETE FROM multi_pages pages INNER JOIN bib_holdings bh ON bh.id = multi_pages.id WHERE bh.pdf_name = 'ak-1' -- You received this message because you are subscribed to the Google Groups "H2 Databa

Re: Is it possible to connect to the H2 database from SQL server database

2010-08-23 Thread gabjos
27;, 'userpasswd', > 'REMOTE_TABLE_NAME')  READONLY; > INSERT INTO SOME_LOCAL_H2_TABLE  (  select *  from MYLINKEDTABLE  ); > > Sql server's jdbc driver must to be in the classpath of H2. > > regards, > Dario > > El 20/08/10 18:08, gabjos escribió: > >

Is it possible to connect to the H2 database from SQL server database

2010-08-20 Thread gabjos
Hi I have a client that wants to connect or pull data via a connection from their SQL server database to their H2 database. Is that possible? If so how would I do this? -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send e

How do I remove the double quote shown in the CSV file created to load data from a table

2010-07-16 Thread gabjos
When I execute call CSVWRITE('C:\holdings.csv', 'select * from bib_holdings'); and open the the holdings.csv file in notepad or wordpad there are double quotes around each field value in addition to the comma separating the fields. I have researched and found the setEscapeCharacter However, I ha

Re: How do I fix the syntax error for truncating a table when I used the proper syntax

2010-02-15 Thread gabjos
create test2 as select * from test On Feb 15, 3:15 pm, Kerry Sainsbury wrote: > How do you create test? > > Is it definitely a table? (not a view?) > > Can you provide a complete example? > > Cheers > Kerry > > > > On Tue, Feb 16, 2010 at 9:04 AM, gabjos wr

Re: How do I fix the syntax error for truncating a table when I used the proper syntax

2010-02-15 Thread gabjos
When I was trying to find out what the primary key for the table in question I was given the following query: select column_name from information_schema.indexes where table_schema = 'PUBLIC' and table_name='TEST' and primary_key I executed it on my table and since then I have been able to perform

Re: How do I fix the syntax error for truncating a table when I used the proper syntax

2010-02-15 Thread gabjos
sorry i put the wrong error message here is the error: truncate table test Cannot truncate PUBLIC.test [90106-63] org.h2.jdbc.JdbcSQLException: Cannot truncate PUBLIC.test [90106-63] at org.h2.message.Message.getSQLException(Message.java:89) at org.h2.message.Message.getSQLException(Messa

Re: How do I fix the syntax error for truncating a table when I used the proper syntax

2010-02-15 Thread gabjos
That is exactly what I type and I keep getting the same errors. Now when I type create table test1 as select * from test I get a internet explorer error: A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Do you want to a

How do I fix the syntax error for truncating a table when I used the proper syntax

2010-02-15 Thread gabjos
I type: truncate table test The table does exist and I own it. But I keep getting the following error: I don't know what to do. Please help. statement TRUNCATE TABLE FROM[*] test ; expected identifier; SQL statement: truncate table FROM test [42001-63] org.h2.jdbc.JdbcSQLException: Syntax error

Re: How do I execute a query and have it write the outpu to a flat file

2010-02-12 Thread gabjos
is it possible to append the query results to a csv file that already exists? On Feb 12, 1:44 am, Ewald wrote: > Hi. > > You can use the CSVWRITE function to output the results of a query to > a CSV file. > > Seehttp://www.h2database.com/html/functions.html#csvwritefor the > official documentatio

How do I execute a query and have it write the outpu to a flat file

2010-02-11 Thread gabjos
I need to execute a query and have the output written to a flat file like a test file from inside the database. How would I do that? -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to h2-datab...@googlegroups.com

How do I find out the primary key in a table

2010-02-04 Thread gabjos
How do I find out what the primary key is in a table -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to h2-datab...@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googleg

what is the syntax for inserting records from one table into another that doesn't exist in that table

2010-02-01 Thread gabjos
I need to insert records that may or may not exist from one table to another. What would be the syntax for doing this? Basically the tables would need to be compared. If the record in table 2 does not exist in table 1 then it gets inserted. If the record does exist then nothing is inserted. Can so

Re: How do I execute a sql script in a batch file

2010-02-01 Thread gabjos
The only problem is the output.txt file is empty. It doesn't show the results of the sql script that is executed if there are no errors. Is there a way to get the output from running the sql script? On Feb 1, 12:36 pm, gabjos wrote: > I did this and it worked > > java -classpa

Re: How do I execute a sql script in a batch file

2010-02-01 Thread gabjos
I did this and it worked java -classpath "C:\program files\test\Load\lib\h2.jar" org.h2.tools.RunScript -url jdbc:h2:tcp://localhost:1521/test -user -password -script "C:\Documents and Settings \Desktop\ESS.sql" > "C:\Documents and Settings\Desktop\output.txt"

Re: How do I execute a sql script in a batch file

2010-01-30 Thread gabjos
How would I put h2 jar in the classpath? On Jan 29, 4:45 pm, Brian wrote: > Yes, your example should work if your h2 jar file is in the CLASSPATH > already > > On Jan 29, 10:33 am, gabjos wrote: > > > > > can I execute this line in a .bat file > > java org.h2

Re: How do I execute a sql script in a batch file

2010-01-29 Thread gabjos
ul an Ant script might be handy (doing wildcard > includes, other actions)... The documentation seems to be in the > javadoc pages. > > On Jan 29, 3:19 am, gabjos wrote: > > > > > I need to right a batch file in windows that can execute sql commands > > in my H2 database

How do I execute a sql script in a batch file

2010-01-28 Thread gabjos
I need to right a batch file in windows that can execute sql commands in my H2 database. What is the syntax for doing this? -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to h2-datab...@googlegroups.com. To unsu

Re: how do I execute a sql script

2010-01-06 Thread gabjos
Awesome! It worked. Thanks! On Jan 6, 11:06 am, gabjos wrote: > Is this done from command line or within the database. I tried to do > it from command line and got some errors > > C:\>java org.h2.tools.RunScript -url jdbc:h2:tcp://localhost:1521/tems > -user tems_adm -script C:

Re: how do I execute a sql script

2010-01-06 Thread gabjos
e) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) On Jan 6, 10:50 am, Sam Van Oort wrote: > Hi Gabjos

how do I execute a sql script

2010-01-06 Thread gabjos
I have an Oracle background and on occassion I will need to execute a sql script that could have a few to hundreds of sql statements delete records from the database. I know in Oracle all you have to do is type @ and press enter at the sql prompt and your script will execute as long as you are in t