Hello,
I am experiencing a weird issue in BODS3.2.
I use "Task_lookup" to lookup values in target table (task table). "Case" defines when lookup results (look up results of ID) is null, then move to next transformation. Insert maps the information and key generation generate the new key for records I want to insert.
I got records up to case statement but no record count for insert query. The lookup is based on 4 equal conditions.
Lookup logic:
Monitor log:
CASE:
Insert:
Target property.
Any comments is appreciated.
Thanks.
Terry
Request clarification before answering.
Your lookup doesn't return any matches. The default value being null, there's no output for the Case transform.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Dirk,
Even I set default value at 99999999 for o_ID (ID lookup result), I still don't have any results. I see the case_Insert has 221 records but no output from Query. I guess the issue is around primary key restriction (ID is primary key).
To handle this primary key restriction, I am thinking of creating a custom function so I can do key gen within Query. When I tried to create custom function, I got syntax error. I can't figure out what is wrong even I compared with reference guard. Everything seems to be ok but doesn't work.
I specified my input table based on data store information so it sohuld be correct and the column name is ID.
Thank you for your helps.
Terry
I am sorry, my mistake. I misinterpreted the monitor log output. All 221 rows flow from the Case to the Query transform. But nothing flows out of the latter. This can only be due to a filter.
What do you have as Where-condition in the Query?
By the way, no need for a custom function, you can use the key_generation built-in function directly in the mapping. And the results will be identical to those of the Transform with the same name.
Hello Dirk,
I totally agree with you. That was my original plan.I tried key_generation built-in function and did not get any results. That is why I started to try different approaches.
Query transformation has not filters as shown below.
Here is what happens when I try using Key_generation built-in function.
Data flow:
Key generation transformation:
Results:
Everything looks right to me but just no results.
I checked target table as well which only has 123 records so there must be something which need to be inserted.
Thanks.
Terry
Hi Terry,
please add this Key_gen function [key_generation('DS_ORA_AACST.TH_AACST.TASK', 'ID', 1)] to "Insert" query transformation and add temp table to see the data Or give file target to view the data.
Remove the default value for lookup.
it should be null to satisfy your Case statement.
Thanks,
Sreenivas
Hello sreenivas,
Thank you for helping. I
tried this approach as well. Here is what I inputted and the syntax error I got. I compared with reference guide but could not figure out what I did wrong.
key_generation('DS_ORA_AACST.TH_AACST.TASK', 'ID', 1)
Error:
(Ln 1) : Syntax error : near <END> found <END_TRY> expecting <a string>
The function <NewFunction1> contains an invalid expression. Additional information: <syntax error>. (BODI-1111182)
Dont required to put it in any function
you can use it directly in mapping by following these steps:
1. click on the ID column which you want to generate the key
2. Goto mapping tab
3. paste key_generation('DS_ORA_AACST.TH_AACST.TASK', 'ID', 1)
4. click apply and try to execute the job
Note make sure that you removed the Key_generation step after the Insert Query
Thanks,
Sreenivas
Thank you so much Ravi. I tried temp table and figured out the issue was with lookup results. I removed CASE statement then got it work. Instead of case, I used where statement and it is working now. It is really weird. The case and where should do the same thing. Anyways, it is working now and thank you so much for all supports.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.