Apex AB: Extract value of Number-Field and use the value as condition for another query — oracle-tech

    Forum Stats

  • 3,714,812 Users
  • 2,242,631 Discussions
  • 7,845,073 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Apex AB: Extract value of Number-Field and use the value as condition for another query

Hello,

I am new to the Apex AB and currently trying to solve the following problem:

Scenario: table employee with columns: staff_no ; name; salary; department_name

I want to create an input field where I write down an employee number, e.g. 124561 and as an output, I receive a hardcoded text with three variables, like the following: Employee [name] has a salary of [salary] € and works in the department [department_name]. (Procedure is visualized in the following picture)

The problems I am facing now are:

  • How can I extract the value out of a number_field element?
  • How can I insert this value as a parameter for an SQL-condition, like:
    • SELECT name, salary, department_name
    • FROM employee
    • WHERE staff_no = input_field_value
  • The last step is how can I extract these three columns (name, salary, department_name) out of this SQL-Statement and insert them as parameters into a hardcoded text?

I would be happy if you could give me concrete tips on how to do it or guide me to the right resources that I have to understand to solve this problem!

Thank you and best regards

Answers

  • AndyH
    AndyH Member Posts: 566 Gold Badge

    The value of the employee field will be available when you submit the page.

    To create your string you could:

    • generate the string in you SQL statement e.g. select 'Hello '||name from employee
    • use apex_string.format('Hello %s', :P123_NAME)

    The way in which you have drawn your diagram makes me wonder whether you are actually using APEX to generate your page?

Sign In or Register to comment.