comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Lundin" <b.f.lundin@gmail.com>
Subject: Re: converting pointer to value
Date: Fri, 5 Mar 2021 10:10:41 +0100	[thread overview]
Message-ID: <s1ssii$f04$1@dont-email.me> (raw)
In-Reply-To: <s1sng6$dek$1@gioia.aioe.org>

Den 2021-03-05 kl. 08:44, skrev Dmitry A. Kazakov:
> On 2021-03-05 08:06, Björn Lundin wrote:
> 
>> Anyway, some docs* I found describes Clob handling as
> 
>> use bind to bind nothing to the col - but tag it
>> execute (will then return NEED_MORE_DATA)
>> ParamData will return NEED_MORE_DATA and indicate what col that needs 
> 
> Yes, it returns in its buffer address + offset calculated as if 
> parameters were an array. Here address is 1, if I remember correctly.
> 
> But you can just ignore that stuff as you know the column you write 
> already. 

I can't. This is code fitting as glue between ODBC binding and 
application code.
Meaning some of my colleagues could define a clob as any column

>There is only one blob.

and actually, that is not ceratain.
Some colleagues actually defined a table containing two clobs.
And there really is not limit (more than practical use)

If other parameters are bound normally
> or literals you just call PutData with the first chunk ignoring anything 
>   but the return code of ParamData.

yes, and that is how I got it to work while trying and testing
But it won't hold in the end. I got to get the column(s) back (or 
rethink the use of the API)

>>
>> And I got that part to work to some extent. (if I putData in chunks of 
>> 10 bytes and I said size= 100. But not if size = 104. Likely an error 
>> on my part)
> 
> Did you specify 104 as the total size in BindParameter?

Yes. And I 10 chunks of 10 bytes + 1 chunk of 4 bytes.
I tried null-terminate the last chunk, both by j
* just by appending an ASCI.NUL (5 bytes for last chunk - 105 bytes in 
total)
* replacing last byte in last chunk with ASCII.NUL - 104 bytes in total

No go still


> It will be awfully slow, I guess.
Likely, but I did not measure anything yet.
I think the usecase for it will be uncommon, so I might tolerate 
'somewhat' slow execution.


-- 
Björn

  reply	other threads:[~2021-03-05  9:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 15:59 converting pointer to value Björn Lundin
2021-03-04 16:50 ` Dmitry A. Kazakov
2021-03-05  7:06   ` Björn Lundin
2021-03-05  7:44     ` Dmitry A. Kazakov
2021-03-05  9:10       ` Björn Lundin [this message]
2021-03-04 16:55 ` Shark8
2021-03-04 17:35   ` Dmitry A. Kazakov
2021-03-04 19:38     ` Shark8
2021-03-04 21:27       ` Dmitry A. Kazakov
2021-03-05  8:58         ` Björn Lundin
2021-03-05  8:54     ` Björn Lundin
2021-03-05 11:02     ` Björn Lundin
2021-03-05 11:57       ` Björn Lundin
2021-03-05 14:00         ` Dmitry A. Kazakov
2021-03-09 12:07     ` [SOLVED] " Björn Lundin
2021-03-04 20:09   ` Simon Wright
2021-03-04 21:00     ` Shark8
2021-03-05  8:59       ` Björn Lundin
2021-03-05  7:10   ` Björn Lundin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox