SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Using CURSOR or what ???
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

chulz90
Starting Member

Indonesia
26 Posts

Posted - 01/03/2013 :  22:18:23  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
7174 Posts

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

chulz90
Starting Member

Indonesia
26 Posts

Posted - 01/04/2013 :  01:58:15  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2168 Posts

Posted - 01/04/2013 :  02:08:36  Show Profile  Reply with Quote
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

Indonesia
26 Posts

Posted - 01/04/2013 :  02:59:33  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 01/04/2013 :  03:01:36  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000