dbTalk Databases Forums  

BTREE IN UNIDATA

comp.databases.pick comp.databases.pick


Discuss BTREE IN UNIDATA in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
alegon
 
Posts: n/a

Default BTREE IN UNIDATA - 06-06-2007 , 07:44 AM






HI,

HOW DO I USE BTREE IN UNIDATA?

VERSION :

UniData RDBMS............ 7.1
Connection Pooling....... 7.1
NFA...................... 7.1
RFS...................... 7.1
Device License........... 7.1
EDA...................... 7.1
The current account is version 3.3.2i.b2.


Reply With Quote
  #2  
Old   
Martin Phillips
 
Posts: n/a

Default Re: BTREE IN UNIDATA - 06-06-2007 , 04:09 PM






Please be more specific about your need. Are you talking about B-trees
in general or accessing alternate key indices (which use an internal B-
tree structure)?


Martin Phillips, Ladybridge Systems Ltd


Reply With Quote
  #3  
Old   
Colin
 
Posts: n/a

Default Re: BTREE IN UNIDATA - 06-06-2007 , 06:17 PM



Martin's right - we need a little more info.

However, if you're talking about alternate key indices you can try
starting with:

HELP UPDATEVOC
HELP CREATE.INDEX

The previous commands are entered at the ECL ":" prompt.
Then look at Chapter 6 in the Using Unidata Manual. You can find it at:
<http://www-306.ibm.com/software/data/u2/pubs/library/71unidata/>

hth
Colin Alfke
Calgary Canada


Martin Phillips wrote:
Quote:
Please be more specific about your need. Are you talking about B-trees
in general or accessing alternate key indices (which use an internal B-
tree structure)?


Martin Phillips, Ladybridge Systems Ltd


Reply With Quote
  #4  
Old   
Bill H
 
Posts: n/a

Default Re: BTREE IN UNIDATA - 06-07-2007 , 12:38 AM



:CREATE-INDEX MYFILE DICTNAME (you can tell I'm from PICK)
:BUILD-INDEX MYFILE

Then in BASIC you'd...

NAME.KEY = PREF.KEY ; ** the name to start searching
TOP.NAME = NULL$ ; ** the top name in the search
END.NAME = NULL$ ; ** the bottom name in the search
*
** read file for UD indexes
OPEN FNAME TO ROOT.ID ELSE
CRT EMSG:A.CODE:MSG1:
WKAMT = NULL$
GOTO END.OF.PROGRAM
END
*
** find first & last name in tree
topKEY.ID = NULL$
botKEY.ID = NULL$
*
** set top and bottom start placemarks
TOP.START = PREF.KEY:ICONV('00', 'MX0C') ; ** UD version
END.START = PREF.KEY:ICONV('7B', 'MX0C') ; ** UD version
*
** initialize the top and bottom names
TOP.NAME = TOP.START
END.NAME = END.START
*
** get top and bottom name in tree. do the bottom name first as
** the 1st name's index is left for further processing.
SETINDEX A.CODE, END.NAME ON ROOT.ID
READXBCK END.NAME FROM ROOT.ID ELSE NULL
botKEY.ID = @ID
SETINDEX A.CODE, TOP.NAME ON ROOT.ID
READXFWD TOP.NAME FROM ROOT.ID ELSE NULL
topKEY.ID = @ID
*
** validate key
BEGIN CASE
CASE topKEY.ID = NULL$ AND botKEY.ID = NULL$
GOTO PROGRAM.COMPLETE
CASE TOP.NAME[1,PREF.LEN] NE PREF.KEY
GOTO PROGRAM.COMPLETE
CASE TOP.NAME = PREF.KEY
GOTO PROGRAM.COMPLETE
END CASE

Now you would use the READFWD and READBCK keywords to traverse the index.

Hope this helps.

Bill

"alegon" <alegon (AT) bol (DOT) com.br> wrote

Quote:
HI,

HOW DO I USE BTREE IN UNIDATA?

VERSION :

UniData RDBMS............ 7.1
Connection Pooling....... 7.1
NFA...................... 7.1
RFS...................... 7.1
Device License........... 7.1
EDA...................... 7.1
The current account is version 3.3.2i.b2.




Reply With Quote
  #5  
Old   
alegon
 
Posts: n/a

Default Re: BTREE IN UNIDATA - 06-11-2007 , 09:37 AM



On 7 jun, 02:38, "Bill H" <some... (AT) somedomain (DOT) com> wrote:
Quote:
:CREATE-INDEX MYFILE DICTNAME (you can tell I'm from PICK)
:BUILD-INDEX MYFILE

Then in BASIC you'd...

NAME.KEY = PREF.KEY ; ** the name to start searching
TOP.NAME = NULL$ ; ** the top name in the search
END.NAME = NULL$ ; ** the bottom name in the search
*
** read file for UD indexes
OPEN FNAME TO ROOT.ID ELSE
CRT EMSG:A.CODE:MSG1:
WKAMT = NULL$
GOTO END.OF.PROGRAM
END
*
** find first & last name in tree
topKEY.ID = NULL$
botKEY.ID = NULL$
*
** set top and bottom start placemarks
TOP.START = PREF.KEY:ICONV('00', 'MX0C') ; ** UD version
END.START = PREF.KEY:ICONV('7B', 'MX0C') ; ** UD version
*
** initialize the top and bottom names
TOP.NAME = TOP.START
END.NAME = END.START
*
** get top and bottom name in tree. do the bottom name first as
** the 1st name's index is left for further processing.
SETINDEX A.CODE, END.NAME ON ROOT.ID
READXBCK END.NAME FROM ROOT.ID ELSE NULL
botKEY.ID = @ID
SETINDEX A.CODE, TOP.NAME ON ROOT.ID
READXFWD TOP.NAME FROM ROOT.ID ELSE NULL
topKEY.ID = @ID
*
** validate key
BEGIN CASE
CASE topKEY.ID = NULL$ AND botKEY.ID = NULL$
GOTO PROGRAM.COMPLETE
CASE TOP.NAME[1,PREF.LEN] NE PREF.KEY
GOTO PROGRAM.COMPLETE
CASE TOP.NAME = PREF.KEY
GOTO PROGRAM.COMPLETE
END CASE

Now you would use the READFWD and READBCK keywords to traverse the index.

Hope this helps.

Bill

"alegon" <ale... (AT) bol (DOT) com.br> wrote in message

news:1181133860.632275.179600 (AT) p47g2000hsd (DOT) googlegroups.com...



HI,

HOW DO I USE BTREE IN UNIDATA?

VERSION :

UniData RDBMS............ 7.1
Connection Pooling....... 7.1
NFA...................... 7.1
RFS...................... 7.1
Device License........... 7.1
EDA...................... 7.1
The current account is version 3.3.2i.b2.- Ocultar texto entre aspas -

- Mostrar texto entre aspas -
thank you very much



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.