-
Insert Calculated data in Table column
Hi,
I have a table in which there are 10 columns, i want to write a SP which will insert the data in the first and the 4 column of the table.
The 4th column is a numeric column and want to insert calculated date in that. the calculation is bleow.
"case when PROPOSAL.CHANGEORDER = 0 then nvl(UNIT.PRI_ACTUALUNITPLPRICE,0)
when PROPOSAL.CHANGEORDER = 1 and PROPOSAL.CHANGEORDERTYPE <> 2 then nvl(UNIT.PRI_ACTUALUNITPLPRICE,0)
when PROPOSAL.CHANGEORDER = 1 and PROPOSAL.CHANGEORDERTYPE = 2 AND SOLUTION.ISCANCELLEDGROUP = 0 then nvl(UNIT.PRI_ACTUALUNITPLPRICE,0)
when PROPOSAL.CHANGEORDER = 1 and PROPOSAL.CHANGEORDERTYPE = 2 AND SOLUTION.ISCANCELLEDGROUP = 1 then nvl(UNIT.PRI_ACTUALUNITPLPRICE,0)
else 0 end"
-
It's OK, just use the expression as a column value.
Ales The whole difference between a little boy and an adult man is the price of toys
-
Originally Posted by deepak_vkdk
I have a table in which there are 10 columns, i want to write a SP which will insert the data in the first and the 4 column of the table.
What are you planning to do with the other eight columns?
Are you actually "inserting" or you meant "updating" on the affected table?
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|