Inserting NULL records even after defining constraint
Moderators: chulett, rschirm, roy
Inserting NULL records even after defining constraint
Hi,
I am reading a data from a file which has "~" as a delimiter.I am writing to a table.There is column PHONE from source where I have check for null value.I should insert the data only when PHONE is not null.
So I defined a stage variable with condition If IsNull(LK1.PHONE) Then 'N" Else 'Y'.
The constraint I give is StageVar='Y'.Even after defining the constraint,null records are getting populated.Is there any way that I can do this?
But,where the PHONE is null in file holds the data like this :
N-0402~~N~Y~CTR
If there is a value for PHONE then the data look like :
N-7501~462323696~Y~N~CTR
I am reading a data from a file which has "~" as a delimiter.I am writing to a table.There is column PHONE from source where I have check for null value.I should insert the data only when PHONE is not null.
So I defined a stage variable with condition If IsNull(LK1.PHONE) Then 'N" Else 'Y'.
The constraint I give is StageVar='Y'.Even after defining the constraint,null records are getting populated.Is there any way that I can do this?
But,where the PHONE is null in file holds the data like this :
N-0402~~N~Y~CTR
If there is a value for PHONE then the data look like :
N-7501~462323696~Y~N~CTR
Please remember that an empty string, "", is not null.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Concerning telefonnumbers some remarks:
(1) you should check more than "Null" perhaps if at least one number is in it.
(2) There are a lot of formats which differ from region to region in the world.
(3) In some countries and among countries telephone numbers have a different length
(4) Best is to use the international standardize way for numbers like +33-1-2345-3456 for a number in Paris
(1) you should check more than "Null" perhaps if at least one number is in it.
(2) There are a lot of formats which differ from region to region in the world.
(3) In some countries and among countries telephone numbers have a different length
(4) Best is to use the international standardize way for numbers like +33-1-2345-3456 for a number in Paris
Wolfgang Hürter
Amsterdam
Amsterdam
SHARAD123 wrote:Hi priyaraj,
Y don you try a much simpler solution....
There is no need to use stage variables for this functionality.
Instead check condition in the constraint for the link.
Use this constraint:
not(isnull(required link) )
Sharad,
I tried using the constraint which You sent ,but it still inserts all the data.Its because of empty string?
You won't be getting NULLs from a text file. The constraint should beSHARAD123 wrote:Hi priyaraj,
Y don you try a much simpler solution....
There is no need to use stage variables for this functionality.
Instead check condition in the constraint for the link.
Use this constraint:
not(isnull(required link) )
Code: Select all
Trim(In.ColumnName)#''
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
No problem, Priyaraj. Someone else might post a non-premium response that will help you soon.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Premium membership is not expensive; it's less than 30c (Rs12) per day. Revenue from premium memberships is totally devoted to helping to defray the hosting and bandwidth costs incurred by DSXchange. And you get to be able to read the entire contents of premium posters' contributions, among other benefits.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.