openoffice-base

Connect to Open Office odb file using jdbc program

不问归期 提交于 2020-01-03 17:26:54
问题 I had written following code to connect to OpenOffice db . String db = "C:\\Documents and Settings\\hkonakanchi\\Desktop\\Test.odb"; Class.forName("org.hsqldb.jdbcDriver"); Connection con = DriverManager.getConnection("jdbc:hsqldb:file:" + db,"sa",""); Statement statement = con.createStatement(); ResultSet rs = statement.executeQuery("SELECT * FROM Emp"); while (rs.next()) { System.out.print("ID: " + rs.getString("ID")); System.out.print(" first name: " + rs.getString("firstname")); System

sql dialect in OpenOffice Base

人盡茶涼 提交于 2019-12-20 02:12:36
问题 I'm familiar with SQL in SQLite and MySQL, but OpenOffice Base seems to be either very crippled, or I don't understand how to execute raw SQL. I want to do (effectively) this: INSERT INTO t2 SELECT NULL as id, t.foo, t.bar, '' as baz, 0 as quux FROM MyTable t All I can do is SELECT t.foo, t.bar, '' as baz, 0 as quux FROM MyTable t because the NULL seems to give Base confusion, as does the INSERT INTO T2 SELECT ... syntax. Can anyone suggest how I need to fix this? 回答1: Indeed, NULL is not

How to create an update query with Open Office Base?

六月ゝ 毕业季﹏ 提交于 2019-12-18 09:37:20
问题 I want to create basically an update query on Open Office Base (the same way with Ms ACCESS). 回答1: Base does not typically use update queries (but see below). Instead, the easiest way to do an update command is to go to Tools -> SQL. Enter something similar to the following, then press Execute : UPDATE "Table1" SET "Value" = 'BBB' WHERE ID = 0 The other way is to run the command with a macro. Here is an example using Basic: Sub UpdateSQL REM Run an SQL command on a table in LibreOffice Base

Simulate GROUP_CONCAT function in HSQLDB versions < 2?

微笑、不失礼 提交于 2019-12-13 02:50:08
问题 LO/OOO Base doesn't come with an HSQLDB version > 2 which means there is no GROUP_CONCAT function. Is there a way to simulate this function in HSQLDB versions < 2? Here's an example for the columns name and value before the function is applied: TIM | 51 TIM | 53 TIM | 55 JOHN | 103 JOHN | 104 I would like to use (H)SQL code in Base that returns something similar to the result of GROUP_CONCAT: TIM | 51, 53, 55 JOHN | 103, 104 (A similar question has been asked for other DBMS but the answers

How to Programmatically add or remove items in ListBox FORM control

大城市里の小女人 提交于 2019-12-12 04:16:12
问题 I am having a problem with OpenOffice.org ListBox Form control. I have built a small form (not dialog) that contains a textbox and ListBox and 2 buttons. Sub AddToList_ButtonClicked() Dim oThisDoc As Object Dim oForms as Object Dim oForm as Object oThisDoc = thisComponent.getDrawPage() oForms = oThisDoc.getForms() oForm = oForms.getByName("SimpleForm") Dim oTextBox As Object Dim oListBox As Object oListBox = oForm.getByName("simpleListBox") oTextBox = oForm.getByName("simpleTextBox").Text

sql dialect in OpenOffice Base

余生长醉 提交于 2019-12-01 22:17:18
I'm familiar with SQL in SQLite and MySQL, but OpenOffice Base seems to be either very crippled, or I don't understand how to execute raw SQL. I want to do (effectively) this: INSERT INTO t2 SELECT NULL as id, t.foo, t.bar, '' as baz, 0 as quux FROM MyTable t All I can do is SELECT t.foo, t.bar, '' as baz, 0 as quux FROM MyTable t because the NULL seems to give Base confusion, as does the INSERT INTO T2 SELECT ... syntax. Can anyone suggest how I need to fix this? Lionel Elie Mamane Indeed, NULL is not accepted there. It should. Could you please file this as a bug and assign it to lionel

How to create an update query with Open Office Base?

╄→гoц情女王★ 提交于 2019-11-29 18:12:21
I want to create basically an update query on Open Office Base (the same way with Ms ACCESS). Jim K Base does not typically use update queries (but see below). Instead, the easiest way to do an update command is to go to Tools -> SQL. Enter something similar to the following, then press Execute : UPDATE "Table1" SET "Value" = 'BBB' WHERE ID = 0 The other way is to run the command with a macro. Here is an example using Basic: Sub UpdateSQL REM Run an SQL command on a table in LibreOffice Base Context = CreateUnoService("com.sun.star.sdb.DatabaseContext") databaseURLOrRegisteredName = "file:///C