From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Dmitry A. Kazakov" Subject: Re: How do I write directly to a memory address? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <31c357bd-c8dc-4583-a454-86d9c579e5f4@m13g2000yqb.googlegroups.com> <05a3673e-fb97-449c-94ed-1139eb085c32@x1g2000yqb.googlegroups.com> <4d4c232a$0$28967$882e7ee2@usenet-news.net> <4D4D6506.50909@obry.net> <4d50095f$0$22393$882e7ee2@usenet-news.net> <4d6d56c4$0$11509$882e7ee2@usenet-news.net> <16u9ka51wbukr$.1fj2sb73j9rv6.dlg@40tude.net> <4d6d627b$0$11509$882e7ee2@usenet-news.net> <29c4lixc0ght$.14kkfz1kij135.dlg@40tude.net> <4d6d6afb$0$11509$882e7ee2@usenet-news.net> <1gz9984wwizn5.r619fw4z9o56.dlg@40tude.net> <4d6e5614$0$21954$882e7ee2@usenet-news.net> <4d6e64f5$0$21954$882e7ee2@usenet-news.net> <4d6e811b$0$21956$882e7ee2@usenet-news.net> <1bnko88u7cfiu$.1p6595qf6pjfn$.dlg@40tude.net> <4d6e8ca5$0$17939$a8266bb1@postbox2.readnews.com> Date: Wed, 2 Mar 2011 22:55:52 +0100 Message-ID: NNTP-Posting-Date: 02 Mar 2011 22:55:49 CET NNTP-Posting-Host: 2fe5df3c.newsspool1.arcor-online.net X-Trace: DXC=MM9j2ELLGNM[kmHKHnaEnMic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgBXeEk@>I_9LH[6LHn;2LCVN[ On Wed, 02 Mar 2011 13:29:56 -0500, Hyman Rosen wrote: > If a programmer were to create the line of Ada dynamically and > interpolate a string into the result, he would be faced with > exactly the same problem. You seem to have a major difficulty > in understanding that programmers are creating code dynamically. Yes, if Ada were such a pitiful language as SQL is, but fortunately Ada is not. Problems arise when Ada meets SQL, C and similar mess. >> But >> interfacing SQL requires quotes because it requires a conversion of a >> native string object to its would be equivalent textual representation in >> the SQL syntax. > > That is false, because SQL interfaces also provide ways to pass > parameters separately, not through textual interpolation. Prepared statements and bound parameters is not a part of SQL. In any case there is no warranty that the driver does not do the same thing for bound parameters. It depends on the SQL interpreter of the DB client/driver. >> This is a source of errors as expected, because it is >> untyped. There is no way the program can be checked for type errors. Either >> random string represent a legal SQL statement of the semantics nobody can >> tell, or not. That is to happen at run time. > > This is again false. A dynamic SQL builder in Ada could be created > that represented SQL statements using hierarchical Ada types and > objects, and produced the final SQL string representation upon > execution. In fact, GNATColl uses this approach: > > It also allows prepared queries with parameters, and it was in > processing those parameters that the programmers simply screwed up > and added quotes where they shouldn't have, because they got mixed > up between generating the literal code and passing the parameters. Prepared statements are interpreted at run time. There is no way to check them and their parameters statically. Preparing does nothing more than a very superficial pre-compilation. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de