Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    1

    Lightbulb Unanswered: Ingres / ABF / Table field

    Hi, and thanks for any help.

    After loading data in a table field with a select statement like such:

    tbf = select col1, col2,...
    from my_table
    order by col1,col2;

    I want to reorder the table field by col2. Any idea ?
    I know that i can run a external C procedure and use a qsort, but i prefere to stay in my 4GL program.
    thanks.
    Regards.

  2. #2
    Join Date
    Aug 2002
    Location
    Brisbane Australia
    Posts
    6

    re: ABF tablefields

    Declare a global temporary table with the same structure as the tablefield, load the global temp from the tablefield using unloadtable, reload the tablefield from the global temp table using ORDER BY then drop the global temporary table.

    I suppose you could code a qsort for the tablefield, but it could be difficult to code because tablefield[n] refers to the position on the screen rather than the underlying dataset. Alternatively you could load the tablefield into an array and sort that, but you may as well use a global temporary table...

Posting Permissions

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