OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[SOLVED] get db schema

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
Philip Marlowe
Power User
Power User


Joined: 15 May 2011
Posts: 94

PostPosted: Mon Feb 06, 2012 1:47 pm    Post subject: [SOLVED] get db schema Reply with quote

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
View user's profile Send private message Send e-mail
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Mon Feb 06, 2012 3:43 pm    Post subject: Reply with quote

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.

  1. 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...

  2. 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.

  3. 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
View user's profile Send private message
Philip Marlowe
Power User
Power User


Joined: 15 May 2011
Posts: 94

PostPosted: Tue Feb 07, 2012 1:51 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Tue Feb 07, 2012 7:39 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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