Error using Base to make relationship between Postgre tables

Discuss the database features

Error using Base to make relationship between Postgre tables

Postby Victor_Noda » Fri Feb 11, 2011 3:15 pm

Hi!
I don't speak English very well but I'll try, thanks for your patience...
I am not able to make a relationship between tables from Postgre on OOBase using SDBC or JDBC driver.
The database on Postgre is "teste" and the tables are:

"employee"
- cod_employee varchar[7] not null,
- cod_office smallint not null,
- date_start date not null,
- date_end date
Primary Key: cod_employee, cod_office, date_start

"office"
- cod_office smallint not null,
- name_office varchar[30] not null
Primary Key: cod_office

I have to set "employee"."cod_office" as Foreign Key linked to "office"."cod_office".
On OOBase, I connect to Postgre and the database and tables are loaded correctly.
To try to make the relationship, I choose the option Tools -> Relationship, add both tables and click on New Relation button. I select the tables and the collumns to link but, when I click the OK button, the following errors occur:

Using SDBC:
--------------------------------------------------------------
Código de erro: 1

pq_driver: [PGRES_FATAL_ERROR]ERROR: zero-length delimited identifier at or near """" at character 79
(caused by statement 'ALTER TABLE "teste"."employee" ADD FOREIGN KEY( "cod_office" ) REFERENCES ""."" ( "cod_office" ) ON DELETE NO ACTION ON UPDATE NO ACTION ')
--------------------------------------------------------------

Using JDBC:
--------------------------------------------------------------
ERROR: relation "office" does not exist.
--------------------------------------------------------------

Analyzing the SDBC error, I noticed the REFERENCES is blank (""""."""") instead of "teste"."office".
How to fix this error? It's an error due OpenOffice application, driver SDBC/JDBC or dumb user?
Obviously I know that is possible to make this relationship directly on Postgre ( I (have to) use PGAdmin). However, I have to make the Data Modeling and the PGAdmin is horrible to do this and I have only the OpenOffice to help me in the office.
Thanks again for patience and I hope some hero can help me.

BROffice 3.2.0 [OOO320m12 (Build: 9483) on WinXP SP2
JDBC Driver 9.0-801 (postgresql-9.0-801.jdbc3.jar)
SDBC Driver 0.7.6a (postgresql-sdbc-0.7.6a.zip)
PostgreSQL 8.2.6 on sparc-sun-solaris2.10, compiled by /ws/on10-tools/SUNWspro/SS11/bin/cc -Xa
Victor
BROffice.org 3.2.0 [OOO320m12 (Build: 9483)] on Windows XP SP2
Victor_Noda
 
Posts: 1
Joined: Fri Feb 11, 2011 1:56 pm

Re: Error using Base to make relationship between Postgre ta

Postby Villeroy » Fri Feb 11, 2011 3:56 pm

Use Base for the front-end only and some adequate software to construct your PostgreSQL database.
The Tools>SQL command line should work in any case. Call View>Refresh Tables to tell the front-end that the backend changed.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28431
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Error using Base to make relationship between Postgre ta

Postby rudolfo » Fri Feb 11, 2011 8:19 pm

The most adequate software for DBA tasks with Postgresql is pgAdmin. Download it from the PostgreSQL site. It is the perfect tool for postgresql management. Anything what Base offers your in the tables and query area is in this tool as well. You can view and edit data in the tables without the need to type update or insert sql statements (I think newer version have also a Entity Relationship tool).
Create and modify your table structure until you think you reached a rather stable state then go back to OOoBase and start working on your forms and reports.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
rudolfo
Volunteer
 
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany


Return to Base

Who is online

Users browsing this forum: No registered users and 3 guests