Alpha Video Training
Results 1 to 5 of 5

Thread: Advice/Help on Export needed.

  1. #1
    Member
    Real Name
    Phil DeGruy
    Join Date
    May 2003
    Posts
    264

    Default Advice/Help on Export needed.



    How do I approach the following? Is there a way to do this on the fly during an export? Anyone want to take a crack at making a code snipit I can use? All the info is in one table.

    In an export operation I need to have the actual name as well as the id_number to export for sire and dam. I also need a way to add back the photos file extension (.jpg) during export.

    Of course all I needed at the time when I made the Alpha database was the sire_id and dam_id and not the names. now I need the names as well for something different.

    All records are being exported.


    For each record, the dog_id has a sire_id, and dam_id number in 2 seperate fields associated with it from the table lookup rules. What would be the easiest/best way to get the actual dogs name associated with the sire_id and dam_id?

    example of current export:
    dog_id|dog_name|birth_date|sire_id|dam_id|img_file|title|registration|color|gender|
    3293|ELSTER'S GEE NEE OF CHIA HSI|11/26/1965|6623|6816|OFA01_GEENEE|CH|NA512107|Red|F|

    Example of what I need:
    dog_id|dog_name|birth_date|sire_id|sire_name|dam_id|dam_name|imgfile|title|registration|color|gender|
    3293|ELSTER'S GEE NEE OF CHIA HSI|11/26/1965|6623|Starcrest Spy Of Poppyland|6816|Ken-Wan's Tahg Along|OFA01_GEENEE.jpg|CH|NA512107|Red|F|

    My Alpha app table fields look like this example:
    dog_id
    sie_id
    dam_id
    title
    dog_name
    regist
    birth_dt
    gender
    imgfile
    ~ and so on ~

    Sire and dam_id are just the dog_id of the correct sire and dam placed in two fields by the lookup.


    Thanks,

    Phil DeGruy
    chowchow@ticon.net

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Advice/Help on Export needed.

    I'm assuming that records exist where the sire (or dam) to a particular dog has its own record (id and name, etc).

    You can create a new table with a structure similar to your original table except for adding the extra fields needed to hold the new information you want. It would probably be easiest just to duplicate your original (incl records) and then edit the structure. Then create post operation to post sire name from the original to the new, linking field sire id. Same for the dam.

    "I also need a way to add back the photos file extension (.jpg) during export." - You can't add anything during an export so you may want to add more fields to hold the name and .jpg concatenation.

    Everything you need from your export would then exist in the new table.

  3. #3
    Member
    Real Name
    Phil DeGruy
    Join Date
    May 2003
    Posts
    264

    Default RE: Advice/Help on Export needed.

    Thanks for the idea of creaing a new table Stan. I think that will be what I need and work ok for now.

    The photo names have the .jpg stripped off the file name when they are put in the table. I just need to figure a way to loop through the table field, read the image name, add the .jpg to the end and write the new name to a new field.

    Thanks,

    Phil

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Advice/Help on Export needed.

    "to loop through the table field, read the image name, add the .jpg to the end and write the new name to a new field.
    "

    use an update operation

    fieldname = trim(fieldname)+".jpg"

  5. #5
    Member
    Real Name
    Phil DeGruy
    Join Date
    May 2003
    Posts
    264

    Default RE: Advice/Help on Export needed.

    Stan,

    Thanks for the expression tip. This is what the final expression looked like from the raw update operation that Alpha generated. Basically, all records, if imgfield not blank get the field value and add .jpg, put result in imgfile_ext


    update.expr1 = "if(isnotblank(\"Imgfile\"),trim(IMGFILE) + \".jpg\",IMGFILE_EXT)"

    Thanks,

    Phil

Similar Threads

  1. Form Advice Needed .....
    By Rich Hartnett in forum Alpha Five Version 4
    Replies: 19
    Last Post: 01-15-2006, 03:54 AM
  2. Advice needed
    By BRIAN GRAY in forum Alpha Five Version 5
    Replies: 8
    Last Post: 01-16-2005, 02:12 AM
  3. Backorder design advice needed
    By Pat Bremkamp in forum Alpha Five Version 5
    Replies: 4
    Last Post: 02-22-2004, 08:56 PM
  4. Network advice needed
    By Charlain in forum Alpha Five Version 5
    Replies: 6
    Last Post: 06-06-2003, 07:37 AM
  5. Upgrade Advice Needed
    By David LITTLE in forum Alpha Five Version 4
    Replies: 15
    Last Post: 02-15-2001, 12:01 PM

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
  •