Rocket U2 | UniVerse & UniData

 View Only
Expand all | Collapse all

Thought question: Guide to RetrieVe version 11.3.1 states "filename is required and can be almost anywhere in the query."

  • 1.  Thought question: Guide to RetrieVe version 11.3.1 states "filename is required and can be almost anywhere in the query."

    Posted 09-18-2023 14:51

    This was highlighted to me by the Director of Development as a feature when we were shipping UniVerse 4.4.4.

    The command syntax is: verb [DICT] filename [records | FROM list#] … where verb is among 18 options including CHECKSUM, COUNT, and LIST.

    • Do we care if the file name can be almost anywhere in the query?

    • Do we want to advertise this feature in the documentation?

    • Should we just follow the documentation which wants [DICT] filename first?

    • Is this for compatibility with some legacy multivalue environment?

    • Is this capability simply a side effect of the lex/parse implementation?

    Does anyone do things like the following?:

    • LIST DICT F1 VOC (Split DICT and filename)

    • LIST F1 DICT MD (Filename after fields)

    • LIST VOC DICT (At least this does NOT work – if DICT is not a dictionary field)

    Thoughts?



    ------------------------------
    Mark A Baldridge
    Principal Consultant
    Thought Mirror
    Nacogdoches, Texas United States
    ------------------------------



  • 2.  RE: Thought question: Guide to RetrieVe version 11.3.1 states "filename is required and can be almost anywhere in the query."

    Posted 09-18-2023 23:56

    We always used it this way:

    LIST FILENAME FIELD_A FIELD_B WITH FILELD_A = "ABC" AND WITH FIELD_B = "XYZ" BY FIELD_A 

    also for select and the other verbs.

    as far as i knwo have we never used it different...

    If you ask for my thoughts, i would prefere a clear way where the parts of the query have there fixed position, but if it was possible in past im almost sure the it has been used in different ways.

    best regards

    Thomas



    ------------------------------
    Thomas Ludwig
    System Builder Developer
    Rocket Forum Shared Account
    ------------------------------



  • 3.  RE: Thought question: Guide to RetrieVe version 11.3.1 states "filename is required and can be almost anywhere in the query."

    ROCKETEER
    Posted 09-25-2023 09:28

    Mark,

    Just because you can do a thing, does not mean you should do a thing. 

    I would stick to the more readable format, where the file name is after the verb.

    One issue I see with checking for file names, anywhere in the command line, is that if there is a dictionary item that is the same as another file name, it will fail if comes before the file you are trying to list.

    i.e. ( Copy the DICT item LOCATION to LOCATIONS for the PRODUCTS file in the XDEMO account )

    This Works:

    >LIST PRODUCTS LOCATIONS
     
    LIST PRODUCTS LOCATIONS 06:26:43am  25 Sep 2023  PAGE    1
    PRODUCTS...........................    Location.................
     
    1715358952
    This Fails:

    >LIST LOCATIONS PRODUCTS
    RetrieVe: syntax error.  Unexpected filename.  Token was "PRODUCTS".
              Scanned command was LIST LOCATIONS PRODUCTS

    So, if you are willing to limit the names of the dictionary items to non-file names, and expect everyone to refrain from creating them as such in the future, you can write you query statements with the filename anywhere you want in UniVerse.

    ( and this does not even get into the portability of the code to other MV Databases, that do not work the same ) 



    ------------------------------
    Mike Rajkowski
    MultiValue Product Evangelist
    Rocket Internal - All Brands
    US
    ------------------------------