on 12-18-2008 4:20 AM
Hi all,
My requirement is ,if if the ownership = "", 0, or "O" then don't send else send the original value.
Source value Target
Suppose ownership is 0----
Blank
O----
Blank
-
Blank
Test----
Test
If I pass any other value other than O ,0,"",it should be populated.
For this I wrote a UDF as below.
if ( ! ( inValue[ 0 ].equals("") || inValue[0].equals("O") || inValue[0].equals("0") ) )
{
result.addValue(inValue[0]);
}
else
{
result.addValue("");
}
When I Test this in Test tab ,it is working fine But it is Populating even O ,0 in the database table.
Source Target
this is if I pass O -
>O
0----
>0
This should not happen.
Can any one help me out in this regard.
Thanks,
Srinivasa
Hi,
You can have a graphical mapping like this. It worked for me .
SourceField
--- equalsS
Constant[0]
----- OR
SourceField
--- equalsS
Constant[ ] ------OR ------------IF
Constant[ ]-----THEN
SourceField SourceField------ELSE
--- equalsS
Constant[O] MAP IT TO THE Target field
Regards,
Laawanya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Instead of UDF apply this logic in your graphical mapping:
If Source = " " OR Source = 0 OR Source = O then map the corresponding target element with a blank constant....else directly pass the value....for this you will need to use 4 constant blocks, 3 EqualS blocks, 2 OR blocks, 1 If-Else block..
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pothraju,
Your UDF should work perfectly. Which table it is populating? What is your scenario?
Is this giving outputs "O", "0","" in test tab also?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try out using exist() function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivasa
Instead of UDF u can use fixValue function along with IF function. You can orchestrate it in such a manner that it pass null for one condition & actual value for other.
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using graphical mapping as below.
Ws(fileld name) same for both source and target.
ws- equals(test function)---
OR
Constant O----
equals(test function)---
OR
Constant 0----
equals(test function)---
OR
Constant ""----
ie if equals=0 or O or" " then poplulate constant []
esle populate WS
error
Cannot insert null in to ws.
then I tried this way:
e if equals=0 or O or" " then poplulate constant ['']
esle populate WS
now error.
Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SAP_LOC' (structure 'StatementName2'): java.sql.SQLException: ORA-01401: inserted value too large for column .
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.