Re: PRO* variable equivalencing

From: Seth Grimes <grimes_at_access.digex.net>
Date: 27 Aug 1993 05:08:16 -0400
Message-ID: <grimes.746441839_at_access>


p0070621_at_oxford-brookes.ac.uk (Tommy Wareing) writes:

>The last example is best, using REFERENCE to declare a type as a pointer to
>a VARRAW of upto 4000 bytes. I quote (my CAPITALS):
> "In this example, you malloc'ed edditcional memory over and above the
> type length (4000). This is necessary because the precompiler also returns
> the length (2 bytes), and can add padding after the length due to
> alignment restrictions on your system. IF YOU DO NOT KNOW THESE
> RESTRICTIONS, YOU CAN WRITE SOME SIMPLE TEST CASES TO DISCOVER HOW THEY
> WORK."
 
>So, alignment padding has to be determined *before* compilation? Bleurgh :-(
 

>Does anybody use EXEC SQL VAR or EXEC SQL TYPE? What for? I'm sure they must
>be usable, 'cos Oracle wouldn't have included them otherwise.
>Would they? ;-)

Yes, I am using EXEC SQL TYPE to turn a LONG RAW into an array of double, which also means that I have to declare the length twice, as you have complained about. I'm just evaluating RDBMSes right now, however, and I'm not locked into Oracle :-) even if management prefers it because of the bandwagon effect.

I have a question related to this discussion: I've been wondering if Oracle grabs the full amount of space specified for a LONG field for each record that exists even if the full field is not used. For instance, if I have a LONG RAW of length 10k bytes but put only 1k bytes in for some records, will 10k for each record be used regardless? It's not so straightforward to test this because of Oracle's tablespace concept wherein space is allocated for a DB and it's hard to tell exactly what is used. Anyone have any suggestions?

The other RDBMS I loaded for evaluation is InterBase, which is not limited to one Blob per table or 2gbytes per Blob (it does 32g) like Oracle and which grabs just the space you actually use in a Blob (with certain provisos). There aren't any restrictions I know of in C host variables -- in fact, and this won't appeal to some people, you don't have to declare host variables because the precompiler takes care of it for you. This is all FYI; I don't have any interests in InterBase.

                        Seth Received on Fri Aug 27 1993 - 11:08:16 CEST

Original text of this message