+ Reply to Thread
Results 1 to 3 of 3

Thread: Retrieval of several variable fields into one data structure subfield

  1. #1

    Default Retrieval of several variable fields into one data structure subfield

    Just off the top of my head, I'd think fetch into a multiple occurance data structure. Then you get the fun of manipulating the occurs. That's solve your packed data situation, because the fields would all be defined. Use the file as the external description for the data structure.

  2. #2
    Guest.Visitor Guest

    Default Retrieval of several variable fields into one data structure subfield

    I'm trying to figure out if an idea i have is possible using SQL. At present we have various batch programs that chain to a site file to retrieve relevant data. The problem is the program can perform over 2 million chains but there is only 390 records in the file. So to cut down the I/O i have written a procedure to load the data from the site file into a dynamic array which can then be searched using the C module BSearch. At present the field values that are required are defined as data structure subfields which are then loaded into the allocated memory. To make this store/retrieval procedure more generic i would like to retrieve data from the site file dependent on a list of required fields passed from the calling program and store it in a datastructure with one defined subfield with a length of 256. Is it possible to retrieve several field values via dynamic SQL into the one data structure subfield which i can then store in the allocated memory. Will i experience problems with packed data? Thanks Anthony

  3. #3
    K.Forsythe Guest

    Default Retrieval of several variable fields into one data structure subfield

    In this example I used an externally described DS that matches the file being selected against. If the record format is large, you can improve performance by selecting only the fields that you want and including sub fields for just the selected columns. Packed data should not be a problem, you can define the numeric sub fields as zoned and I expect that SQL would perform the necessary type conversions without any extra effort on your part. Because the DS is named, you can use that name (W_CUST) in my example to refer to the entire data structure. As Daniel said, you could make this DS a multiple occurance DS, and load all of the retrieved data into it. Good luck and have fun! Kevin

+ Reply to Thread

Similar Threads

  1. Using Variable Length Fields
    By Guest.Visitor in forum RPG
    Replies: 7
    Last Post: 08-24-2007, 05:40 PM
  2. Replies: 0
    Last Post: 07-19-2004, 07:41 AM
  3. Variable-Length Fields
    By Guest.Visitor in forum RPG
    Replies: 5
    Last Post: 07-24-2003, 03:47 PM
  4. How to Use Variable-Length Fields
    By Guest.Visitor in forum RPG
    Replies: 4
    Last Post: 04-01-2002, 07:19 AM
  5. Net.Data question: How do I make a variable NOT a variable??
    By Guest.Visitor in forum Programming
    Replies: 0
    Last Post: 01-01-1995, 02:00 AM

Posting Permissions

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