| View previous topic :: View next topic |
| Author |
Message |
Philip Marlowe Power User

Joined: 15 May 2011 Posts: 94
|
Posted: Mon Feb 06, 2012 1:47 pm Post subject: [SOLVED] get db schema |
|
|
hi,
i connected an informix db with base via jdbc.
i can see tables and run queries but i want to know/see relationships between tables: how can i do it?
i suppose i've to run a sql command on tools-->sql
when i write sql there i use hsqldb syntax or informix syntax?
thanks to anybody who can quickly help!
Last edited by Philip Marlowe on Tue Feb 07, 2012 3:37 pm; edited 1 time in total |
|
| Back to top |
|
 |
Sliderule Super User


Joined: 29 May 2004 Posts: 2477 Location: 3rd Rock From The Sun
|
Posted: Mon Feb 06, 2012 3:43 pm Post subject: |
|
|
Philip Marlowe:
You wrote / asked:
| Philip Marlowe wrote: | connected an informix db with base via jdbc.
i can see tables and run queries but i want to know/see relationships between tables: how can i do it?
i suppose i've to run a sql command on tools-->sql
when i write sql there i use hsqldb syntax or informix syntax? |
Just to be clear, I have not used Informix, but, I think I can answer some / part of your question.
- i suppose i've to run a sql command on tools-->sql
No. Any QUERY of the database should be entered from the Queries icon on the left, and, Create Query in SQL View....
The reason is, what you are describing is to request a result set ( zero or more rows ) from the database, by reading from the data in the database.
You are NOT changing the database definition or database content ( DDL statements - Data Defintion Language ) . . . for example by issuing a CREATE, ALTER, INSERT, UPDATE, DELETE, DROP command. Within OpenOffice Base, DDL statements or command are issued from Tools -> SQL...
- when i write sql there i use hsqldb syntax or informix syntax?
Informix syntax, or, put another way, the SQL ( Structured Query Language ) that is supported by Informix. This is because you are talking with the database driver ( back-end ) you are using. In your case, it is, as you said Informix.
- Regarding relationships and Informix, I have no experience. I did a quick internet search, and, the link below describes an example:
http://www.ibm.com/developerworks/data/zones/informix/library/techarticle/0305parker/0305parker.html
In it, in the section: Referential integrity and other linkages it mentions the following SQL ( at least it might be a start ) :
| Code: | SELECT a.tabname, constrname, d.tabname
FROM systables a, sysconstraints b, sysreferences c,
systables d
WHERE b.constrtype = 'R'
AND a.tabid = b.tabid
AND b.constrid = c.constrid
AND c.ptabid = d.tabid
AND a.tabname = ? |
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your first post Title ( edit button ) if your issue has been fixed / resolved. |
|
| Back to top |
|
 |
Philip Marlowe Power User

Joined: 15 May 2011 Posts: 94
|
Posted: Tue Feb 07, 2012 1:51 am Post subject: |
|
|
| very useful but... i'm interested in the "Referential integrity and other linkages" part and those queries indicated give me emty tables as a result... seems like there are no linkage among tables... how can it be possible??? |
|
| Back to top |
|
 |
Sliderule Super User


Joined: 29 May 2004 Posts: 2477 Location: 3rd Rock From The Sun
|
Posted: Tue Feb 07, 2012 7:39 am Post subject: |
|
|
It is possible, if your database designer elected NOT to set ( require ) checks for referential integrity.
So, talk with your database designer. Since I did not design your database, I cannot answer your question.
Sliderule
Thanks to add [Solved] in your first post Title ( edit button ) if your issue has been fixed / resolved. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|