Hi Rony,

Thanks for the feedback I appreciate it.

Unfortunately for me, for this project, I've never had to use a releational
database or SQL.  Experience being the best teacher.

I was hoping that if the extension was of interest to people, some othes
whould create examples that made more sense.

The current version of createDatabase.rex has this in the brief
introduction to the example:

...
 *
 * Note that the author has little to no previous experience with SQL and
 * relational databases.  This example is not intended to show the "best"
way
 * to use SQL or to deal with a relational database in general.  It is
meant to
 * help someone get started using ooSQLite.
 */

Hopefully the example programs will improve over time.

--
Mark Miesfeld



On Sat, Jun 9, 2012 at 3:48 AM, Rony G. Flatscher <
[email protected]> wrote:

>  Just a little remark: the createDatabase.rex example uses in its
> create-statements "not null", but supplies default values being empty
> strings.
>
> From a database conceptual view this is illogical: NULL represents the
> missing of information and obviously the empty string represents missing
> information as well. The problem however: one cannot distinguish anymore
> between an empty string that the user supplied from a missing value (the
> user has not supplied any value) anymore!
>
> So the suggestion would be to leave out the default '' part to re-enable
> the ability to find those records in which values are truly missing, i.e.
> are NULL. Only use NOT NULL for columns that must have a value under all
> conditions (i.e. for all candidate primary keys).
>
> ---
>
> As your tables possess foreign key relationships to the "contacts" table,
> it might be helpful to define foreign key relationships from the tables
> "addresses" and "TABLE_phone_num" to the table "contacts", cf.
> <http://www.sqlite.org/foreignkeys.html><http://www.sqlite.org/foreignkeys.html>.
> Probably something like (untested):
>
> ...
> CREATE TABLE addresses (
>    ...
>    , *FOREIGN KEY(contact_id) REFERENCES contacts(id) ON UPDATE CASCADE ON 
> DELETE CASCADE
>    *, *FOREIGN KEY(type_id) REFERENCES addr_type(addr_type_id) ON UPDATE 
> CASCADE ON DELETE RESTRICT*
> );*
>
> *CREATE TABLE TABLE_phone_num (
>    ...
>    , *FOREIGN KEY(contact_id) REFERENCES contacts(id) **ON DELETE CASCADE*
> );
>
>  In the above table there is a column "type_id": what kind of a type id is
> this? Does the value (if given) refer to an existing value in another table
> (being a foreign key then)? Or is this line just a copy & paste oversight?
>
>  CREATE TABLE inet_addr (
>    ...
>    , *FOREIGN KEY(contact_id) REFERENCES contacts(id) **ON DELETE CASCADE**   
> *, *FOREIGN KEY(type_id) REFERENCES addr_type(addr_type_id) ON UPDATE CASCADE 
> ON DELETE RESTRICT*
>  );
>
> ...
>
>  Please keep up your excellent work!
>
> ---rony
>
> P.S.: Many years ago (actually about twenty years ago) I held lectures on
> relational databases (Oracle, DB2, SQLServer) and wrote even a little book
> on designing relational models and introducing SQL. The NULL concept turned
> out to be one that needed special attention, hence this preliminary
> feedback. (Sorry, have not been able to run the samples and study the
> classes and APIs yet.)
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Oorexx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to