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 |
|
rwaldron
Posting Yak Master
131 Posts |
Posted - 2008-05-27 : 07:31:19
|
| Hi all,Sorry if this is the wrong place to ask but I have tried a few places with no joy.In SQL when querying using a variable I can use @ symbol.ie:SELECT COUNT(*) FROM dbo.Persons WHERE SocialSecurityNumber = @SocialSecurityNumberThen in say visual web developer this would prompt me to enter the variable for @SocialSecurityNumberThis all works perfect.My issue is when I query a DB2 DB directly saySELECT COUNT(*) FROM DB2.tableWHERE (MMITNO = @MMITNO) I get ther error "Column @MMITNO does not exist"My question is. What symbol do I use to represent variable in DB2.In SQL it is @ ..I think these symbols are known as sigilsPlease HelpRay.. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-27 : 08:16:06
|
You can use dynamic sql to build the query string if you connect to DB2 with linked server. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2008-05-27 : 08:18:27
|
| I belive you can ask db2-questions at dbforums dot com--Lumbago |
 |
|
|
rwaldron
Posting Yak Master
131 Posts |
Posted - 2008-05-27 : 09:19:12
|
| Hi all,Just to let you know I got it workingSQL WHERE (MMITNO = @MMITNO) DB2 WHEREMMITNO = ?) Thx,Ray |
 |
|
|
|
|
|