Identify the right variable step type to use when assigning a value to a variable with a SQL query.
A.
Refresh Variable
B.
Declare Variable
C.
Set Variable
D.
Evaluate Variable
Explanation:
http://docs.oracle.com/cd/E15586_01/integrate.1111/e12643/procedures.htm(12.2.3.1)
I agree C is correct
Ans A
since we have to assign the value to the variable using a SQL query, it has to be refresh variable.
Ans A
The answer is C.
Set Variable is the step type to “assign the value”.
Refresh Variable is used to “calculate the value” from a sql query.
I’m pretty sure that the right answer is A.
The only way to assign a value from a SQL Query in ODI is with a Refresh Variable, cause its executes against logical resources bringing the data in to the var!
not necesary, you can define a variablen within a SQL query but you can use it into a Package Step as a SET.
C is correct
I agree with C.
Set variable will assign a specified value to ANY variable, including the ones with a SQL query.
@Kirito : looks like you’ve never tried it, works like a charm! Refresh is just one possibility among others. You can also Declare it, and then provide it a value during the run-time or use the Default or Last Value, or Assign it a value.
You can event use ASSIGN followed by REFRESH which is useful if you include this very $variable inside its SQL refresh code.
Hi BGU,
What if I drag a variable(with refreshing query) to a package and mark it as set variable and give SELECT 1 FROM DUAL; ? Will it give 1 as o/p or SELECT 1 FROM DUAL; as o/p?
Ans: A – By definition of Refresh Variable
Tricky question.
I think the correct answer is C. Because it says that is to assign to a variable a SQL query, and not with the query content.
I’m assuming that it is to assign a variable with content “select * from dual” for instance.
in that case C – set Variable is correct.
I say ‘A’.
For me there are no tricks in questions, just lazy building of statements. @António: the question does not say ” to assign to a variable a SQL query” but “assigning a value to a variable WITH a SQL query”. This with makes me think on a Refresh variable.
From ODI help (yes,f1):
Refreshing a variable allows assigning a new value based on the result of a SQL-type query.