Update HSQL table values based on related table

只愿长相守 提交于 2020-01-17 03:22:13
问题 I have 2 related tables: "Universities"(id, num_courses) and "Courses" (id, university_id). I need University.num_courses to represent a COUNT of courses. I can query data I need: SELECT, COUNT(Courses.university_id) as NumCourses FROM Courses JOIN Universities ON = Courses.university_id GROUP BY How do I UPDATE Universities with it? Could it be done automatically? 回答1: I am not sure this is what you mean by "automatically," but it can be done

How to access ODB files in Python 2.7

梦想的初衷 提交于 2020-01-02 03:53:26
问题 I want to access an ODB file (made with LibreOffice Base) in Python and extract a table for further use. The ODB contains several tables, one relation design and several forms. Is it possible to achieve this without using any SQL? Edit: Since it seems overcomplicated to parse this format on my own, i'll consider using a proper HSQLDB engine. What python module accesses via HSQL (like sqlite3 for SQLite does)? 回答1: You can consider Python Uno API that comes with OpenOffice. There are several

LibreOffice Base JDBC connection to Hive returns “Method not supported” when executing valid select statement

独自空忆成欢 提交于 2019-12-24 17:48:02
问题 I'm trying to get LibreOffice's Base v5.1.4.2, running on Ubuntu v16.04 to connect to a Hive v1.2.1 database via JDBC. I added the following jars, downloaded from Maven Central, to LibreOffice's classpath ('Tools -> LibreOffice -> Advanced -> Class Path'): hive-common-1.2.1.jar hive-jdbc-1.2.1.jar hive-metastore-1.2.1.jar hive-service-1.2.1.jar hadoop-common-2.6.2.jar httpclient-4.4.jar httpcore-4.4.jar libthrift-0.9.2.jar commons-logging-1.1.3.jar slf4j-api-1.7.5.jar I then restarted

LibreOffice: 'com.mysql.jdbc.driver' cannot be loaded

老子叫甜甜 提交于 2019-12-20 09:53:24
问题 I am trying to connect LibreOffice Base with an MySQL database, in phpMyAdmin, with a JDBC-connection. The first step is to select which database you want to select: The second step is to select which connection: The third step is to select your database: When I press 'Klasse testen' ( Test Class ), I get the following error: 'com.mysql.jdbc.driver cannot be loaded'. Does anyone know how to avoid this error? 回答1: You need to download and "register" the JDBC connector first. To do so: Go to

Modifying table entries from LibreOffice Base, possible?

有些话、适合烂在心里 提交于 2019-12-20 04:37:26
问题 I've successfully connected LibreOffice Base with MySQL data base server. I've tested if I modify my table from host (free hosting service on internet) then the changes are reflected when refreshing the table object in LO Base. But my question is, can I modify DB table directly from LO Base? I guess that it's possible using sql queries from LO Base, but how? Please give me some insights or tutorials. Thanks. 回答1: The normal way to alter a table: Tools -> SQL Enter an ALTER TABLE command and

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

LibreOffice Basic get Elements from form

眉间皱痕 提交于 2019-12-12 22:36:01
问题 I'm trying to get value from textfield on the form. sub Test(oEv) oForm = oEv.Source.Model.Parent textBox = oForm.getByName("Description") MsgBox textBox.Text end sub There is an Exception: "Type:" on the line "textBox = oForm.getByName". I have a text field with the name "Description" on the same form, where is the button I press to run this macro. What is wrong here? 回答1: Check that the name is the same case, not description . Also, use the Form

Simple python script to get a libreoffice base field and play on vlc

纵饮孤独 提交于 2019-12-12 03:52:16
问题 I've banged my head for hours on this one, and I don't understand the LibreOffice macro api well enough to know how to make this work: 1) This script works in python: #!/usr/bin/env python3 import subprocess def play_vlc(path="/path/to/video.avi"):['vlc', path]) return None play_vlc("/path/to/video.avi") 2) I've got python scripts working fine in LibreOffice Base, and this script is fired on a button press. The video opens (with an error - see below) Now, how do open the path

Error in Querying Concatenation of 2 fields in LibreOffice Base SQL

喜欢而已 提交于 2019-12-11 18:58:59
问题 My apologies for wrong terminilogies, I am not actually a programmer, just a Base user confronted with a problem. I'm having trouble querying a column which is supposed to be a concatenation of two fields of two separate tables. I'm using LibreOffice Base Version 1:3.6.2 and it has the default HSQL engine. My two tables are as follows: Table 1 is named "Prefectures" and has the following fields: ID, "Prefecture Name" , and "State" Table 2 is named "Ward" and has the following fields: ID,

Possible to change PostgreSQL table design using LibreOffice Base?

偶尔善良 提交于 2019-12-11 10:13:04
问题 I read that LibreOffice Base has a native Postgres driver, so I thought that might be a good way to play around with the database structure, creating new tables, altering and dropping existing ones etc. Almost everything seems to work fine. I can connect to the DB and open and edit all tables, create new ones, delete existing ones. I can basically do everything, except change the data definition of existing columns. So, I could delete the column entirely, and I can easily create new columns