From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: converting pointer to value Date: Thu, 4 Mar 2021 17:50:10 +0100 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader02.eternal-september.org comp.lang.ada:61465 List-Id: On 2021-03-04 16:59, Björn Lundin wrote: > I am trying to implement clob handling towards a database > using the ODBC binding at I do not think GNADE is supported and correct with the changes MS made to ODBC after the support was dropped. > The ODBC API itself is somewhat awkward for this, but I have some Ada > issues as well. There are actually two ODBC interfaces depending on the machine architecture, 32- and 64-bit. E.g. SQLSETPOSIROW is 16-bit or 64-bit, SQLLEN is 32- or 64-bit. That was the change MS did to ODBC for a decade ago, I believe. > In one call I do the binding of data to a bind variable. > >   insert into table A vales (?,?) > > where the '?' are my bind variables in the sql. > > Now, when data is small I call bindcol via > >   Gnu.Db.Sqlcli.Sqlbindparameter > > and put the wanted value into the binding. > > But with CLOBs, there are too much data, so instead of setting > the actual data, one is to indicate which column to put the > data into - at a later time. I do not understand this. Binding binds a variable to a prepared statement. You change the variable before each execution of the statement: prepare bind x to column 1 bind y to column 2 bind z to column 3 x := 1; y := 20; z := 100; execute x := 11; y := -20; z := 10440; execute ... Binding can be thought as by-reference parameter passing. In case of blobs, if the size vary, you have to rebind it with another size before another statement execution. Unfortunately column size is a parameter of SQLBindParameter rather than the parameter data. If the size is same you only change the buffer contents. The buffer itself can be allocated once for its maximal size. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de