Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Using CURSOR or what ???

Author  Topic 

chulz90
Starting Member

26 Posts

Posted - 2013-01-03 : 22:18:23
HELLO..

this the record that i have let say MR_TABLE
________________________________
MR_NUMBER| ITEM_NUM| MR_STATUS|
.----------.|----------.|.-----------.|
MR_000045 | ITEM_001 | _APPROVED |
MR_000045 | ITEM_023 | _APPROVED |
-------------------------------------'
MR_000112 | ITEM_045 | _DECLINED. |
MR_000112 | ITEM_002 | _DECLINED. |
MR_000112 | ITEM_015 | _DECLINED. |
-------------------------------------'
MR_000005 | ITEM_019 | _APPROVED |
MR_000005 | ITEM_004 | _APPROVED |
MR_000005 | ITEM_037 | _APPROVED |
-------------------------------------'

when i generate new MR_NUMBER = 'MR_000185'
That contained four items 'ITEM_001','ITEM_045','ITEM_099','ITEM_037'

i've some problem for the query.
can you help me to show the record in MR_TABLE depend on 'MR_000185'(my new MR_NUMBER) items???

should i use cursor or what????
actually i don't know how to use cursor

this the result that i expected below
the history record from my new MR_NUMBER 'MR_000185' items
________________________________
MR_NUMBER| ITEM_NUM| MR_STATUS|
.----------.|----------.|.-----------.|
MR_000045 | ITEM_001 | _APPROVED |
MR_000005 | ITEM_037 | _APPROVED |
MR_000112 | ITEM_045 | _DECLINED. |
-------------------------------------'
thanks for your help before

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2013-01-03 : 22:54:56
It is not clear. Can you elaborate with DDL and Expected output
Go to Top of Page

chulz90
Starting Member

26 Posts

Posted - 2013-01-04 : 01:58:15
quote:
Originally posted by sodeep

It is not clear. Can you elaborate with DDL and Expected output


sorry
whay u mean about DDL ?
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-01-04 : 02:08:36
quote:
Originally posted by chulz90

quote:
Originally posted by sodeep

It is not clear. Can you elaborate with DDL and Expected output


sorry
whay u mean about DDL ?


DDL(Data Definition Language) means table structures..

>>when i generate new MR_NUMBER = 'MR_000185' That contained four items 'ITEM_001','ITEM_045','ITEM_099','ITEM_037'
how you are inserting these values into table...?



--
Chandu
Go to Top of Page

chulz90
Starting Member

26 Posts

Posted - 2013-01-04 : 02:59:33
quote:
Originally posted by bandi

quote:
Originally posted by chulz90

quote:
Originally posted by sodeep

It is not clear. Can you elaborate with DDL and Expected output


sorry
whay u mean about DDL ?


DDL(Data Definition Language) means table structures..

>>when i generate new MR_NUMBER = 'MR_000185' That contained four items 'ITEM_001','ITEM_045','ITEM_099','ITEM_037'
how you are inserting these values into table...?



--
Chandu



i inserting like usually
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-04 : 03:01:36
see how to post the required information for your problem

http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -