acondor has asked for the wisdom of the Perl Monks concerning the following question:
Hello all,
I'm new at designing/connecting db's and retrieving values, if someone has a link to a post or something that would be wonderful.
Here is what I'm trying to do, learn, and understand;
I have db (SQLite) with couple tables and a table with a foreign key. Using information from foreign key table, I'd like to retrieve actual data from primary table.
Example: user_tbl id name ---- --------- 1 test1 2 test2 topic_tbl id topic ---- --------- 1 topic1 2 topic2 detail_tbl id detail name_id topic_id 1 detail1 1 1 2 detail2 1 2 3 detail3 2 1 etc
In perl, I'd like to retrieve one for the details and assign actual string value from primary tables for name_id and topic_id. Any hints or pointers in the right direction is greatly appreciated.
Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Retrieving data from db with foreign keys
by choroba (Cardinal) on Sep 07, 2015 at 15:55 UTC | |
|
Re: Retrieving data from db with foreign keys
by Corion (Patriarch) on Sep 07, 2015 at 15:45 UTC | |
|
Re: Retrieving data from db with foreign keys
by CountZero (Bishop) on Sep 07, 2015 at 16:01 UTC | |
by acondor (Initiate) on Sep 07, 2015 at 16:26 UTC | |
|
Re: Retrieving data from db with foreign keys
by ww (Archbishop) on Sep 07, 2015 at 23:35 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |