0

I want to create a temp-table for generalized code maintenance(code_mstr) this is what I have written for the temp-table creation

define temp-table tt_gcm no-undo
field tt_fldname like code_fldname
field tt_value like code_value
field tt_cmmt like code_cmmt
field tt_group like code_group   
field tt_domain like global_domain
index tt_idx
      tt_domain
      tt_fldname
      tt_value.

and after this I defined a form for the same

form
code_fldname
code_value
code_cmmt
code_group
with frame a side-labels

I also gave prompt-for for code_fldname and code_value because I want it to have user input

prompt-for code_fldname
editing:
/*wrote the mnfnp05.i logic here that enabled the input */
/*similarly for code_value as well */

now I only want to display the records that I enter via the input field, I don't want to display all the records that are present in the code_mstr, is there a way to display those specific recprds?

2
  • The plain "progress" tag will get your questions lumped in with questions about "progress indicators" and such and confused people will try to close your question. "openedge", "progress-4gl", and "progress-db" tags will bring your posts to more appropriate audiences. Commented May 1, 2022 at 14:29
  • noted, thankyou for this, I'll make sure to use these tags next time Commented May 1, 2022 at 14:36

1 Answer 1

0

You really shouldn't use a db field for the prompt-for. In the long term that is going to lead to you having record locking and transaction scoping issues. It is much better to use a variable instead. Something like this:

define variable codeName as character no-undo.

update codeName.

find tt_gcm where tt_gcm.fldName = codeName no-error.

if available tt_gcm then
  display tt_gcm with frame a.
Sign up to request clarification or add additional context in comments.

4 Comments

using a variable looks handier, I'm going to try this, thank you!
can you explain how codename works here exactly? like is it dynamic or hardcoded. suppose I have a record with field name train and I want to fetch that, so how codename helps in that case or could you take the example of train?
It is just an arbitrary name for a variable. The name is assigned in the “DEFINE VARIABLE” statement and a value is assigned in the UPDATE statement. You could also call it “x”. When you refer to the variable in the WHERE clause the value is used to FIND a record whose tt_gcm.fldName is the same.
Well as a newbie its still daunting but I think I am starting to understand it a lot better than before, thanks a lot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.