Alpha Video Training
Results 1 to 4 of 4

Thread: tbl.fetch_find()

  1. #1
    Zod Mansour
    Guest

    Default tbl.fetch_find()


    Is giving me: Conflicting expression data type
    I use it like this:
    dim id as c
    id = SomeField.value
    tbl = table.current()
    tbl.fetch_find(id)

    The index is of type character. So what is conflicting here?

  2. #2
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,173

    Default RE: tbl.fetch_find()

    Fetch_find() uses the current index. If the table opens on the default, typically record number, then the function is using a numeric value for the find and you are inserting a character value. From the help

    "The Matching_Expression and the table’s or set's primary index key must have the same data type. "

    To use the function properly, first create an index on the field you want to use in the find. For example, if you want to finds a character id saved in the field "user_id", create an index that orders on "user_id" and call it something like "id_idx". Then add just one line to your code.

    dim id as c
    id = SomeField.value
    tbl = table.current()
    tbl.index_primary_put("id_idx")
    tbl.fetch_find(id)

    Jerry

  3. #3
    Zod Mansour
    Guest

    Default RE: tbl.fetch_find()

    That was it. Thanks. After putting the index statement things started to work.

    One question: If I modify the table, do I have to rebuild the index with any commands or are indexes built automatically?

    thx

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,312

    Default RE: tbl.fetch_find()

    Check the User Guide section called:

    Overview of Indexes and Queries

    -- t

Similar Threads

  1. Fetch_Find with a compound index ???
    By RobertJWilkins in forum Alpha Five Version 6
    Replies: 10
    Last Post: 07-26-2005, 07:59 AM
  2. tbl.fetch_find()
    By Zod Mansour in forum Alpha Five Version 6
    Replies: 2
    Last Post: 11-01-2004, 08:10 AM
  3. fetch_find in an embedded browse
    By David Montgomery in forum Alpha Five Version 5
    Replies: 9
    Last Post: 06-12-2004, 05:48 PM
  4. fetch_find
    By geoff m in forum Alpha Five Version 5
    Replies: 6
    Last Post: 05-27-2004, 08:04 AM
  5. fetch_find()
    By martinwcole in forum Alpha Five Version 4
    Replies: 7
    Last Post: 09-12-2000, 05:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •