Re: DBI v2 - The Details - :name for placeholders

2005-07-11 Thread Jonathan Leffler
On 7/9/05, Darren Duncan [EMAIL PROTECTED] wrote:
 
 At 1:03 AM -0700 7/9/05, Jonathan Leffler wrote:
 Can you explain which parts of the SQL:2003 mandate this notation?
 I've had a moderately good poke around my copy of ISO/IEC
 9075-2:2003 (SQL/Foundation) and cannot find this. I'd like a few
 section numbers listed which describe this.
 The various places I've looked include: 19.6 (prepare statement), 9
 (Additional Common Rules), 6.4 (value specification and target
 specification). I could have missed something in these places - or
 I could be looking in the wrong place.
 
 Yes, I can quote some, in different places. Look at these:
 
 SQL:2003, 4.29 Host parameters (pp90,91,92)
 SQL:2003, 5.4 Names and identifiers (pp151,152)
 SQL:2003 Foundation page 152 says:
 host parameter name ::= colonidentifier
 
 See that last line in particular. I don't see how it could be more clear.



Oh - hmmm...Embedded SQL...Yes, even Informix supports that notation in 
Embedded SQL/C (ESQL/C); I'd forgotten about it because it is not part of 
what goes to the (Informix) server.

EXEC SQL EXECUTE :prepared_stmt USING :hostvar1:indvar1, :hostvar2:indvar2, 
...;

This is not what DBI deals with - it deals more nearly with the CLI syntax, 
where that is not, as far as I know, permitted. However, I'm not yet sure 
about all the contexts in which a host parameter name can appear - it is 
the sort thing that is quite hard to determine from the standard, 
unfortunately. Even with my heavily hyperlinked grammar - generated from the 
BNF in the standard - it is fairly hard to tell.

Consider my objection temporarily on ice - I'm not wholly convinced, but 
clearly the onus is on me to show why it should not be mandated by DBI v2.

This is my main source for the SQL:2003 documentation:
 
 http://www.wiscorp.com/SQLStandards.html


Thanks. I have copies of the official standard - but I didn't have the 
presentations, etc.

If anyone wants to use my hyperlinked HTML version of the standard SQL 
syntax, let me know and I'll make it available for download on a website. I 
updated it last week, so the version I have at home isn't current (though 
most people wouldn't notice the change - it was very minor and solely 
related to formatting).

-- 
Jonathan Leffler [EMAIL PROTECTED] #include disclaimer.h
Guardian of DBD::Informix - v2005.01 - http://dbi.perl.org
I don't suffer from insanity - I enjoy every minute of it.


Re: DBI v2 - The Details - :name for placeholders

2005-07-10 Thread Darren Duncan

At 9:27 PM -0700 7/10/05, Jonathan Leffler wrote:
This is not what DBI deals with - it deals more nearly with the CLI 
syntax, where that is not, as far as I know, permitted.


My impression of DBI is that it is a stand-in of sorts for a SQL CLI, 
and does or should do all of the same sorts of things.  Each time you 
run a SQL statement, it is like typing said statement into a CLI. 
(In fact, I seem to recall that DBI ships with a simple SQL CLI 
program that runs on top of it, and that has an almost 1:1 mapping.) 
DBI abstracts the CLI a bit by providing things like connect() 
methods rather than having users execute 'CONNECT TO ...' SQL, but 
that doesn't really change what I've said.  So DBI is basically the 
same as CLI but that it is easier for programmers to use by replacing 
an input terminal with functions.  In that context, the :foo syntax 
corresponds to what bind_var() etc maps to.


If anyone wants to use my hyperlinked HTML version of the standard 
SQL syntax, let me know and I'll make it available for download on a 
website.  I updated it last week, so the version I have at home 
isn't current (though most people wouldn't notice the change - it 
was very minor and solely related to formatting).


Please do that.  So far I have had the drudgery of manually scrolling 
through a 1000+ page PDF document to look up things.  Your version 
should be much faster.  This said, does it include what page in the 
original the info came from, so I can correlate them in reference 
documentation?


-- Darren Duncan