Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 29 JAN 2004 03:14:52PM Joe wrote:

What is the syntax/code for adding a new column to a table programatically? Thanks.

Joe


At 29 JAN 2004 03:18PM Matt Sorrell wrote:

Joe,

Since the table dictionaries are just tables themselves, it is simply a matter of building the dictionary record in code, and then writing to the DICT. table. Of course, this is much simpler if it is a data field, but can also be done for a symbolic or group field as well. Other users of the system might have to reattach the table, especially if indexing is involved.

[email protected]

Greyhound Lines, Inc.


At 29 JAN 2004 03:22PM Joe wrote:

Any way you could provide an example?


At 29 JAN 2004 04:40PM Richard Hunt wrote:

Joe,

Here are some examples of RBASIC code…

* Open the dictionary file.

OPEN 'DICT.':FILE_NAME TO DICT_DATA ELSE

END

*

* Read from dictionary file. READ DICT_RECORD FROM DICT_DATA, DICT_ID ELSE END *

* Write to dictionary file.

WRITE DICT_RECORD TO DICT_DATA, DICT_ID ELSE

END


At 29 JAN 2004 09:49PM Jonathan Bird wrote:

You can have more (or less) columns of data in any record in a table, than you have dictionary items for the table. In other words, you do not HAVE to have a dictionary item defining a column. For example, you might have a record with a key field and five data fields. The dictionary might only have an entry for the key field.

…so what I am saying is, depending on what you are doing, you may not really have need to "add a column to a table in R/Basic"

J


At 30 JAN 2004 04:02AM [email protected] wrote:

Joe,

If you are talking about adding a 'column' to a 'data' table then this will show you both S and F type. The insert Dict_Equates shows a lot of what you need. And simply editing a dict item 'like' on you want to create .. then just duplicate it

Of course if you are talking about adding a 'column' to a window table then that is a horse of another color.

Subroutine DSig(a)

/*

Date 20au

Simple testing procecure .. can be deleted any time

*/

equ null$ to ''

$Insert Dict_Equates ;* OI Supplied

Open 'DICT','DSIG_TEMP' to hndDictDsigTemp Then

*– Create a 'F' type dict item

idDictItem=NEW_DICT_ID'
recDictItem=Null$
recDictItem=F'
recDictItem=1
recDictItem=New Column'
recDictItem=S'
recDictItem=0
recDictItem=L'
recDictItem=15'
Write recDictItem on hndDictDsigTemp, idDictItem Else null

*– Create a 'S' type dict item

idDictItem=NEW_DICT_ID2'
Formula=@Ans=New Symb- ": {NEW_DICT_ID}'
recDictItem=Null$
recDictItem=S'
recDictItem=1
recDictItem=New SYMBOLIC Column'
recDictItem=S'
recDictItem=0
recDictItem=Formula
recDictItem=L'
recDictItem=20'
Write recDictItem on hndDictDsigTemp, idDictItem Else null

End

return

[email protected]

DSigs Radio Free Oregon

Phone: 971-570-2005

OS: WinXP Pro

OI: 7.0


At 02 FEB 2004 08:19AM Hippo wrote:

I agree with Jonathan … you neednot dictionary item for RBASIC code.

We use $INSERT TABLEDESCRIPTION_INS in R/BASIC where TABLEDESCRIPTION_INS contains rows simillar to

EQU MYTABLE$INSERT_DT TO 1

EQU MYTABLE$INSERT_OP TO 2

… using only one description prevents us from defining more meanings for one column.

(I have programmed a tool which inserts to a program only used EQUs

which is needed when aproaching 34kB limit for source including inserts)

Adding corresponding collumn to DICT is good practise simplyfiing window editings and allowing RLISTing for users. Unless you are codding on another place than the database resists (local developper database), it takes less effort to add DICTionary item using DICT window.

(I do it this way even when I have local developper database … I use some synchronization tool)


At 11 FEB 2004 03:12PM Josef Obregon wrote:

  • third_party_content/community/commentary/forums_nonworks/2dbb905ee334c5e985256e2a006f39bc.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1