Subject: Re: RELATED-TO vs CHILD/PARENT

From: "John Stracke" <[email-masked]>
Date: Wed, 9 Jan 2002 13:27:49 -0500

>In SQL  the '.' is used to seperate tables and collumns, as in
>
>                SELECT * FROM TABLE where tbl.col = 'foo'
>
>Currently SQL-MIN is an subset of SQL-92,

No, it isn't.  "ATTENDEE.PARTSTAT" looks like "tbl.col", syntactically, 
but its meaning is completely different; it's more like "col.subcol".  The 
original example:

SELECT * FROM VEVENT WHERE ATTENDEE.PARTSTAT = 'ACCEPTED'

...is not legal SQL-92, because ATTENDEE is not the name of a table in the 
join.  Anybody implementing a CS will have to parse the query and 
interpret it (or compile it into SQL, if they've got a SQL backend).  For 
example, the above query might be compiled into:

SELECT * FROM VEVENT, VEVENT_ATTENDEE WHERE VEVENT_ATTENDEE.UID=VEVENT.UID 
AND VEVENT_ATTENDEE.PARTSTAT = 'ACCEPTED'

...depending on your internal schema, of course.  Once you've accepted the 
need to do that, you can modify your SQL-MIN parser to cope with 
ATTENDEE;PARTSTAT or ATTENDEE->PARTSTAT or whatever.

/========================================================\
|John Stracke                   |Principal Engineer      |
[email-masked]  |Incentive Systems, Inc. |
|http://www.incentivesystems.com|My opinions are my own. |
|========================================================|
|Diplomacy: The art of letting someone else have your way|
\========================================================/

---

From: Doug Royer <[email-masked]>
Date: Wed, 09 Jan 2002 14:09:25 -0700

John Stracke wrote:
> No, it isn't.  "ATTENDEE.PARTSTAT" looks like "tbl.col",
> syntactically, but its meaning is completely different; it's more
> like "col.subcol".  The original example:
> 

Are you saying that it is not valid SQL 'syntax'?

Are you saying that it does not map directly into an
implementaions schema?

Both?

---

From: Doug Royer <[email-masked]>
Date: Wed, 09 Jan 2002 14:06:56 -0700

> like "col.subcol".  The original example:

We did agree to make it valid SQL 'syntax' and ~MAP~ properties
into tables, and parameters into columns in order to fake
what I will call a 'virtual database'.

> SELECT * FROM VEVENT, VEVENT_ATTENDEE WHERE  
                   EVENT_ATTENDEE.UID=VEVENT.UID
>                  AND VEVENT_ATTENDEE.PARTSTAT = 'ACCEPTED'

I guess I don't follow what you are doing there. Yes, we
did agree that implementation would have to map the iCalendar
records into their SQL schema.

> ...depending on your internal schema, of course. 
> Once you've accepted the need to do that, you can modify your
> SQL-MIN parser to cope with ATTENDEE;PARTSTAT or ATTENDEE->PARTSTAT
> or whatever.

We could, but are ';' and '->' valid SQL?
Are they predefine or reserved to mean something already?

Remember - we want SQL-MIN to be a SUBSET of SQL-92. And SQL-92
is defined in:

      [SQL] "Database Language SQL", ANSI/ISO/IEC 9075: 1992, aka ANSI
      X3.135-1992, aka FiPS PUB 127-2

      [SQLCOM] ANSI/ISO/IEC 9075:1992/TC-1-1995, Technical corrigendum 1
      to ISO/IEC 9075: 1992, also adopted as Amendment 1 to ANSI
      X3.135.1992

Putting a ';' or '->' in in breaks the SQL syntax.
Do you agree it does?

History:

We did agreed to make the 'syntax' - SQL (in Minneapolis time frame)?
We did this so we did not have to invent an entire query
language and call it our 'kind-of-like-sql' and then write
a book on it and then spend years in interop sessions trying
to figure out what each other did.

If the mapping is not working - suggestions?
Please keep them valid SQL syntax.