on ‎2016 Sep 12 5:21 PM
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.
Hi Terry,
Can you use Join instead of lookup.. I know we cannot use target as source in the same dataflow.. try using with sql transform or by staging target data to a staging table and use it for join.
Once i faced similar issue when using multiple conditions in lookup and got the corect output using join.
Create a test job and try this once.
Thanks,
Ravi kiran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Hi - I can see that you are pushing records to next level only if Look_Up.ID is null.
Pls perform below steps:
1) Create a some test table after Case transform and see what is the ID value you are getting after Look up
2) other way you can run through the Debug mode and see how the records getting dropped
Let me know if this works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share the screen shot for Task_lookup and Case
its look like first column is having primary key (default) which you can see at CASE_INSERT(source)
if that is the problem remove the key by following steps:
1. goto Task_lookup
2. Right click on the column in schema Out for first column
3. un-check the Primary Key option]
Thanks,
Sreenivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is that because "ID" is the primary key in target table so it fails in the "Insert" query before hitting key generation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 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.