BANAL version 0.10

Chapter 7: Appendices

7.1: Appendix A: RDB expressions

Valid comparison operators are: gt, ge, lt, le, eq, ne, mat, nmat. The last two are for pattern matching. Logical operators: or and and may be used as well as null to indicate an empty value. The value any will match any field name. For numeric entries, you may also use the comparison operators: >, >=, <, <=, ==, != (although, I'm not certain that they are recommended and they usually require extra delimiting). See the notes on delimiting special characters in the section 7.2.

Following are some examples of RDB-type expressions of the type that might be used with BANAL's list commands, and their meaning. For more details read the perlre (1) man page.

  • Field mat /XXX/ -- column Field contains the pattern 'XXX'.

  • Field nmat /XXX/ -- column Field does NOT contain the pattern 'XXX'.

  • Field mat /^XXX/ -- column Field starts with the pattern 'XXX'.

  • Field mat /XXX$/ -- column Field ends with the pattern 'XXX'.

  • UnitCost * Quantity > 1500 -- the product of UnitCost and Quantity is greater than 1500. Obviously, these must be numeric fields.

  • Field ne null -- column Field is not null (but it could contain blanks).

  • Field mat /^\s*$/ -- column Field is null or contains only blank space.

  • Field eq 'YYY' -- column Field equals the literal 'YYY'.

  • Field mat /X..Y/ -- column Field contains the pattern 'X..Y', which means 'X', followed by any two characters, then 'Y'.

  • Field mat /X.*Y/ -- column Field contains the pattern 'X.*Y', which means 'X', followed by any number of (including zero) characters, then 'Y'.

  • Field1 ne null && Field2 ne null -- column1 Field and column Field2 are not null (empty).

  • Field1 eq 'ABC' || Field2 eq 'BCD' -- column Field1 equals the literal 'ABC' or column Field2 equals the literal 'BCD'

  • NUMC eq 12 -- column NUMC equals 12.
  • 7.2: Appendix B: Delimiting Special Characters

    As of BANAL 0.03 you no longer have to double delimit your shell's special characters. Specifically, '(', ')', ';', '?', '|', '&', '<', and '>' (or '();?|&<>' for short).

    If we have missed a special character then please let us know (you may still use the double delimiting method described below until a fix is made). You should realize, however, that you will still have to delimit the special characters on your command line (single delimit).

    In the case that we have missed a special character use the following method to work around the problem.

    Double Delimiting Method

    When you find a special character (very hypothetical eg. '[') that you must delimit then you must delimit it once for your shell and you must delimit it again for perl (the perl set is the same as the Bourne shell). For example, if you want to match all invoices with a '[' in the Description field you must do:

    bk invoices Description mat /\\\[/
    or
    bk invoices "Description mat /\[/"

    7.3: Appendix C: Trouble Shooting and FAQ

    1. When I try to use the PostScript invoice I get an error about "undefined in /AddressA". What can I do?

      You are using a _very_ old version of BANAL. Consider upgrading.

    2. I get "Insecure dependency in `` while running with -T switch" and then bkd exits.

      Remove the letter 'T' from the first line of bkd. This will also disable some security checks. Please report this problem to:
      matt@starnix.com

    3. I get "Can't exec '/bin/sh'" or bk keeps using 'bin/sh' as my editor.

      You must set your EDITOR environment variable. For example, to set your editor to /usr/local/bin/gnuclient, you would type:

      export EDITOR=/usr/local/bin/gnuclient

    4. What's up with the client and company databases? Why is there no contact name in the company entries and why is there no address in the client entry?

      New answer: You should update your books to be in line with the latest release of BANAL. The Client and Company tables have been merged.

      Old Answer (no longer applicable):

      To my line of thinking, a client is a person (you could be billing more than one person at the same company). I assume that anyone that you are billing is work. Thus that person should be contacted at their workplace. By keeping the company information seperate from the client it makes it easier to update the company information for all clients affiliated with said company. It also let's a client change companies without you losing the previous companies information after the client edit. Feel free to argue with me on this one.

    5. The server starts but when I try: bk <command>, I get "no command named user-<command>". What did I do wrong?

      You have to specify the directory for your books to the server. The server uses any rdb file that starts with a capital letter to generate edit and list functions for that database. You can specify the books' directory on the server's command line with the -b option or run the server in the books' directory.

    6. I want to maintain the books for more than one Company. How do I do this?

      Right now the model is one server for one set of books. It is easy to run more than one BANAL server at a time. Start each server with a different port to listen on. For example:

      bkd -b books1 -p 1678 &
      bkd -b books2 -p 1679 &

      Will run two servers for you. You can now talk to either server by setting your BKPORT environment variable to hostname:port. For example,

      BKPORT=localhost:1679 bk

      will contact the server that is managing books2. Refer to your shell's documentation on setting environment variable. Also setting up aliases will ease this burden.



    Solutions :: Services :: Support :: Training :: About Us
    copyright ©2002-2006 starnix inc. all rights reserved.