SNTT Structured DbColumn’s in Lotus Notes

Back in February I posted Structured DBlookup’s in Lotus Notes. Very popular. Implicit in that was that the same could be applied to DbColumn’s, but the web (and Google) is all about being explicit, so here we go :

1
2
3
4
5
6
7
8
class := "Notes";
Cache := "NoCache";
server := @Subset(@DbName; 1);
database := @Subset(@DbName; -1);
view := "In Progress";
columnNumber :=1;
value := @DbColumn( class : cache ; server : database ; view ; columnNumber );
@If(@IsError(value);@Return(@Text(value));@Unique(@Sort(Value)));

The commentary in the Structured DBlookup’s in Lotus Notes post still applies.

The changes from the DBLookup are : no key and you have to read a columnNumber, not a field name.

In general : Having views just for lookups are a very very good thing. You can append columns to such a lookup view but should never insert or delete them. (you don’t know what you might break) As of R6 you can use the @Sort function to order the result without a new lookup view. I also did a @Unique to remove duplicate, which is usually a good thing to do.

It’s self-documenting and error checking – so I’m less likely to make a mistake. Enjoy (technorati.com tags : , ) and Happy Holidays / New Year.

Update (Jan 3 2007): Based on this Notes Forum comment by Ben Langhinrichs, I would revise the last 2 lines to :

1
2
value := @Unique(@trim(@DbColumn( class : cache ; server : database ; view ; columnNumber )));
@If(@IsError(value);@Return(@Text(value));@Sort(Value));

since in R6.x+,Interim results in a formula can be greater than 64KB, but the end result of the formula cannot.

This entry was posted in LinkedIn, Lotus Domino, Show-n-Tell+Thursday. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Trackback

  1. [...] See also Structured DbColumns in Lotus Notes. [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*
  • Follow

  • Archives (since 2003)

  • Categories

  • Recent Posts

  • Twitter Updates

  • del.icio.us links

  • Flickr

    Runnymede Healthcare Centre Demolition : The EndRunnymede Healthcare Centre Demolition : The EndRunnymede Healthcare Centre Demolition : The EndRunnymede Healthcare Centre Demolition
  •  

    December 2006
    M T W T F S S
    « Nov   Jan »
     123
    45678910
    11121314151617
    18192021222324
    25262728293031
  • Spam Blocked