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.
| Author |
Topic |
|
SHIVPREET2K1
Starting Member
32 Posts |
Posted - 2008-06-26 : 08:12:33
|
| Dear Friends I have created a stored procedure in sql server which is like thiscreate procedure get_currency_from_symbol@currency_Name char(25) output,@currency_Symbol char(5) outputas begin select @currency_name=currency_name from currency_masterwhere Currency_Symbol LIKE @currency_SymbolendThis procedure is even working with the statementdeclare @currency_Name char(25),@currency_Symbol Char(5)set @Currency_Symbol='Rs.'Execute Get_Currency_from_Symbol @Currency_Symbol,@Currency_Name outputselect @Currency_Symbol,@currency_NameBut the problem is that it giving me null as a result in currency name field. the data corrospond to it in the table is 'Rupee'Can any one suggest me where is my mistake.Thanks in advanceShivpreet2k1 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-06-26 : 08:17:52
|
| @currency_symbol is not an output variable as you are feeding this to the SP. |
 |
|
|
SHIVPREET2K1
Starting Member
32 Posts |
Posted - 2008-06-26 : 08:21:57
|
| Thnaks for the reply friend but then how should i feed this variable in the sp.Thanks once againshivpreet2k1 |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2008-06-26 : 08:45:47
|
| Are you also sure you want to be using the LIKE construct without using the % (wildcard) operator in the search condition? |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-06-26 : 09:35:47
|
| I must be asleep today as didn't even spot that.SHIVPREET2K1 - Remove the output from the end of the variable on the declaration and change the LIKE for = |
 |
|
|
SHIVPREET2K1
Starting Member
32 Posts |
Posted - 2008-06-26 : 13:34:54
|
| Thanks friend i have done that but still it shows only null value.thanks once again.shivpreet2k1 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-26 : 13:42:37
|
quote: Originally posted by SHIVPREET2K1 Thanks friend i have done that but still it shows only null value.thanks once again.shivpreet2k1
Do you have a record in currency_master with Currency_Symbol value 'Rs.'? |
 |
|
|
|
|
|