LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Variables in DB_QUERY

    Employee
    Posted 05-22-2009 14:20

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: roeperg

    Hi all

    Hopefully this is an easy one. I have an Oracle query which is something like this:

    select thename from mytable where customer = '1234';

    I want the customer string to be an easily changed variable, like with a prompt or an input to the DB_QUERY. How can I accomplish that? It is cumbersome to edit the query each time.


  • 2.  RE: Variables in DB_QUERY

    Employee
    Posted 05-22-2009 14:38

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ltolleson

    There is not really a user prompt in BRE, but you can create a parameter that allows a user to change a value without changing the code. You can create a parameter on the actual DB Query node, on a Composite node that contains the DB Query node, or at the Graph level through the "Graph / Edit Parameters... " menu. Once you have the parameter created you would write your SELECT statement like the example below.

    select thename from mytable where customer = '{{^Customer^}}'

    NOTE - You cannot use a ";" character at the end of the statement. It will return an error. The parser does not accept or need an ending character since this node can only handle one SELECT statement.

    Hope this helps...


  • 3.  RE: Variables in DB_QUERY

    Employee
    Posted 05-22-2009 14:54

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: roeperg

    That works, thanks!