Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!pyramid!infmx!marc From: marc@infmx.UUCP (Marc Kenig) Newsgroups: comp.databases Subject: Re: Parsing Query Languages in the Client or Server Message-ID: <2441@infmx.UUCP> Date: 28 Sep 89 20:56:03 GMT References: <6155@sybase.sybase.com> <6167@sybase.sybase.com> <1989Sep24.215650.15732@odi.com> <638@daitc.daitc.mil> Reply-To: marc@infmx.UUCP (Marc Kenig) Organization: Informix, Menlo Park, Ca. U.S.A. Lines: 55 In article <638@daitc.daitc.mil> jkrueger@daitc.daitc.mil (Jon Krueger) writes: >dlw@odi.com (Dan Weinreb) writes: >>There's one aspect of this standardization that I've never understood. >>The ANSI SQL definition provides a standard for queries to relational >>databases. However, there doesn't seem to be anything that provides a >>standard describing the format of the data returned by the server to >Excellent point. And it gets worse. How does the client find out how >to parse and generate vendor X's date and money data types? His >abstract data types of the future? How does the server flag nulls? > >Nasty, eh? Still think that Intergalactic Dataspeak will solve all >-- >Jonathan Krueger jkrueger@daitc.daitc.mil uunet!dgis!jkrueger Nasty, yes. Here at Informix, we've had to address all of these problems and more with our Informix-4GL for Rdb/VMS product development. In point of fact, you can't just "simply parse" on the client. You have to do almost as much work as the server will do in order to do a more than cursory (read: useless) syntax scan of the query. There is the "date format" problem, for example, which illustrates this point: SELECT EMPLOYEE_ID, " Retires Next Month" FROM EMPLOYEES WHERE "01-OCT-1924" > (SELECT DOB FROM PERSONAL ...) Here, the client would have to change the date format to whatever the server expects. But without a complete parse, and schema info, how could an automata know that the sub-query returns a date and that the character literal should be interpreted as a date and diddled??? I agree: it's too easy to assume that pre-parsing is just a syntax game. BTW, getting back to the original posting, this is how DEC conceived DSRI (the Digital Standard Relational Interface). They define a low- level parse tree language called BLR (Binary Language Represetation). Embedded SQL, RDO (their proprietary query language), and SQL modules are turned into BLR at compile time, or dynamically at run-time. The back-end engine (Rdb) is blind to the actual higher level representation of the query. Others can write interfaces or DSRI compliant database engines, though as with BLI, few do. Lastly, a read-only ANSI SQL-I client-server interface would leave users hungry for more real fast. Marc Kenig "I like VMS better" ...uunet!pyramid!infmx!marc Beeeeeeeep* This has been a test of MY OPINION broadcasting system. Usenet machines in your area, in voluntary contribution with my node, have participated in propogating my uninformed drivel. Had there been an actual emergency, you would have been instructed to tune to MY EMPLOYERS OPINIONS for instructions and factual information.