How to print a record


Records – that are sets of symbols – can be read by alias or id (this is often the case in unidSql functions) :

? select send_record('unid_home',1)
? select send_record(-195,1)

Of course the record id is local and specific to the open db.

Example output:
?  select send_record('unid_home',0)
Type    Property    objid    typid    propid    unicity    nodeid    Nesting
    #Unid home            59                -195    R0
        -170    53    0    1    -196    
        -197    53    -169    0    -198    
        -199    60    -190    0    -200    
Except for the record title, only the node table has been printed. 
?  select send_record('unid_home',1)
Type         Property    objid    typid    propid    unicity    nodeid    Nesting
    #Unid home            59                -195    R0
#Unid default set        -170    53    0    1    -196    
#Unid default set    #Unid help    -197    53    -169    0    -198    
#Unid note subdb record    #Unid note page    -199    60    -190    0    -200    

Now symbol values have been extracted non recursively.

? select send_full_record('unid_home',1)
send_full_record('unid_home',1)        :
-195    59    -196    1479316218            #Unid home    
    -196    -170    53        #Unid default set        1    0    1479316217    admin
    -198    -197    53        #Unid default set        0    -169    1479316218    admin
→    16
-169    44    -171    1479316217    admin        #Unid help    
    -171    -170    53        #Unid default set        1    0    1479316217    admin
    -172    -36    7        description        0    3                1479316215    admin
    -174    -173    44        #Unid help        0    -151    1479316217    admin
→    13
-151    27    -152    1479316217    admin        #Unid object    
    -152    -138    44        #Unid help        1    0    1479316216    admin
...
?

Long output cut. Symbol values have been extracted recursively.

We see that this way of extracting output is not handy, by chance there is another and better manner of doing it, through the web interface (Unidatab.cgi). Remaining in unid-adm there’s still a last print function to mention, send_table(), which reveals the content of a record in terms of record titles and node ids, this allows a quick look at the list of member records.

? select send_table(-195,0)
Type Property objid typid propid unicity nodeid Nesting
 #Unid home 59 -195 R0
 -170 53 0 1 -196 
 -197 53 -169 0 -198 →16
 #Unid help 44 -169 p
 -170 53 0 1 -171 
 -36 7 3 0 -172 
 -173 44 -151 0 -174 →13
 #Unid object 27 -151 p
 -138 44 0 1 -152 
 -153 7 45 0 -154 
 -155 46 -137 0 -156 →6
 #Unid data structures 36 -137 p
 -138 44 0 1 -139 
 -36 7 3 0 -140 
 -141 28 -116 0 -142 →1
 #Unid record 35 -116 p
 -100 30 0 1 -118 
 -119 7 37 0 -120 
 -121 38 3 0 -122 
 -123 39 3 0 -124 1←
 -143 28 -125 0 -144 →2
 #Unid symbol 40 -125 p
 -100 30 0 1 -126 
 -36 7 3 0 -127 2←
 -145 28 -128 0 -146 →3
 #Unid data 41 -128 p
 -100 30 0 1 -129 
 -36 7 3 0 -130 3←
 -147 28 -131 0 -148 →4
...

— Long output cut. Symbol values have been extracted recursively.

[2018 edit]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s