Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

realia and btrieve keys

Status
Not open for further replies.

JanSweden

Programmer
Mar 26, 2001
10
0
0
SE
Hi
I try hard using pervasive.sql 2000 or btrieve if you prefer. I'm using the API interface from Realia COBOL and ..
It's hard to make btrieve understand what I want to do - and pervasive are not interested in cobol programmers ...
I have tried to define a correct data area for keys and data to be passed on the btrv call

I need to have a primary key
I need to have an alternate key - with no modification
I need to have 3 more keys that are allowed to be modified

all keys and data are defined as string (btrieve)

All keys should be represented within each record
(duplicated)

Any good suggestions here? I have got it half way - but with strange behavior .. btrieve claims my data buffer is not large enough - but it is ..

Perhaps there are tools out there to create data definitions specifically for cobol - btrieve?

Pleased for any light brought to my problems ..

Thanks!

Jan
 
Try doing a butil -stat on your file and see what it thinks your record lengths and keys are. Then match them to your record buffers and calling arguments. Be sure you are using the right data types on the passed parameters. In Realia, that should be COMP-5. The wrong data type may mean the values are being interpreted incorrectly.

Hope this helps. Betty Scherber
Brainbench MVP for COBOL II
 
Hi Betty .. and thanks for your help!

Sorry to say data types are correct
and BUTIL and I - we agree on field size and positions.

after changing the original demand:
"I need to have an alternate key - with no modification"

into
I need to have an alternate key - with modification"

I'm able to save records and read them

using 'get first' on the 4 first keys does retrieve
data correct - but some sort of mixing of the startning
point happens if I use the last key

and the value that comes is correct but truncated

If I use the function executor for Btrieve I can see
that the data is there!


... *confused!*

I have not really understood what Pervasive talks about
when they say "segments" in conjuctions with keys - something I should care about?

Thanks!

Jan
 
I responded to your message on the Btrieve forum. You should get your hands on a Btrieve Developer's Kit. It will explain segments. In short, segments are portions of a Btrieve key. Btrieve allows you to create keys with fields that may be anywhere in your record layout. A simple example would be a record containing ID, FIRST NAME, LAST NAME, ADDRESS, CITY, STATE, ZIP. You can set up a key using LAST NAME as one segment and FIRST NAME as the next. That key would access your data in LAST NAME, FIRST NAME order. A look at a Btrieve Description File used to create a database would explain a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top