how to retrieve data containing a profile character

Author: regis.vittaz@csgv.fr (mama)

how to retrieve data containing a profile character?

 

Thanks

Regis

6 Comments

  1. Hi,

    assume you want to retrieve the classic "AT&T":

    In Uniface, there is a difference between the character "&"
    and the profile character which is entered as <GOLD>&

    Same goes for all other profile characters: if you mean a character as a profile, you have to enter the <GOLD>character instead.

    Success, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. Hi,

     

    The <GOLD>* was stored in the database. I want to retrieve all the occurences which contain this <GOLD>*

     

    Thanks

    Regis

     


    Author: mama (regis.vittaz@csgv.fr)
  3. Hi,

    seems to be a not-so-complicated task, but please give me some more background on the situation:

    - How was the <GOLD>* entered and came to your database
    - What is the Field Interface where the <GOLD>* is located (variable length or fixed length field>?
    - is it only to correct an accident or will this be a common processing for you?

    Success, Uli

     


    Author: ulrich-merkel (ulrichmerkel@web.de)
  4. Hi,

    First of all, I want to explain you how we work with uniface.

    we work on AXP/VMS with a database Oracle/RDB. we use uniface with character mode.

    I try to answer to your questions.

    - How was the <GOLD>* entered and came to your database

    On the asn file, we have the following line:

    $swap_gold_profiles

    So, when the users press the * touch, uniface translate the * to <GOLD>*    and so on, for all the other gold profile.

     

    - What is the Field Interface where the <GOLD>* is located (variable length or fixed length field>?
    The field is database, String, C30. That's all. It is stored under a RDB Database.

     

    - is it only to correct an accident or will this be a common processing for you?

    It is an accident. and i want to correct it.

     



    Author: mama (regis.vittaz@csgv.fr)
  5. Hi,

    if it is an accident only, the following strategy will help:

    1) we do a retrieve on all records.
    2) we go throug all the occurences, use $fieldprofile(Field)

    Not tested, but the code may look like:

    retrieve/e "myentity"
    setocc "myentity",1
    while ($dbocc("myentity") > 0 & $status > 0)
       if ($fieldprofile(MYSTRING.MYENTITY) )
          remocc "myentity"
       else
         discard "myentity"
       endif
    endwhile
    store
    commit

    $fieldprofile can help you to stop these accidents

    Success, Uli

     


    Author: ulrich-merkel (ulrichmerkel@web.de)
  6. Slightly less brutally, and assuming you want to keep the data the user entered. loop through the entity as above but myfield.myentity = $replace(myfield.myentity,1,".*","*",-1) repeat for any other gold characters stored then store myentity.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)