Validation
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 49
- Joined: Wed Dec 13, 2006 6:31 pm
Validation
Hi everybody, I am extracting two columns named SAMPLE_ID and TEST from an oracle table. Now i need to do a validation based on the condition:
If SAMPLE_ID<>Previous_SAMPLEID or TEST<>PREVIOUS_TEST Then
Sequence=0 Else Sequence=Sequence+1.
Sequence will be a new column which i have to generate. Now, can you guys let me know as to how i should deal with the If statement above. Do i need to write a subroutine?
Thanks
If SAMPLE_ID<>Previous_SAMPLEID or TEST<>PREVIOUS_TEST Then
Sequence=0 Else Sequence=Sequence+1.
Sequence will be a new column which i have to generate. Now, can you guys let me know as to how i should deal with the If statement above. Do i need to write a subroutine?
Thanks
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
Add Five stage variables
Code: Select all
samplVar1(definition)- If LINK.SAMPLEID = samplVAR2 then 1 else 0
samplVar2(definition)- LINK.SAMPLEID
testVar1(definition)- If LINK.TEST = testVar2 then 1 else 0
testVar2(definition) - LINK.TEST
sequence (definition) - If samplVar1 = 0 or samplVar2 = 0 then 0 else sequence+1
You could also explore "RowProcCompareWithPreviousValue" routine to achieve it.
Last edited by narasimha on Thu Feb 22, 2007 1:11 pm, edited 2 times in total.
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
No routine is required in this case. This scenario can be handled perfectly and Krazykoolrohit gave a demo on that.
If your absolutely have to use a routine, then go for narasimha's suggestion. No need to re-invent the wheel.
My 2 centy!
If your absolutely have to use a routine, then go for narasimha's suggestion. No need to re-invent the wheel.
My 2 centy!
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
On the lighther side, if weels have not been re-invented we would have struck with
http://patentpending.blogs.com/patent_p ... 154_pm.jpg
http://patentpending.blogs.com/patent_p ... 154_pm.jpg
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
-- Aristotle Onassis
-
- Premium Member
- Posts: 49
- Joined: Wed Dec 13, 2006 6:31 pm