Huh?
-----Original Message----- From: Bradford T Comer [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 13:31 To: SQL Subject: RE: Concatenation assistance... Correction Tim, it looks like i was just off a bit, I see DYNAMIC SQL on the site I sent out! -----Original Message----- From: Bradford T Comer [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 1:18 PM To: SQL Subject: RE: Concatenation assistance... furthermore.... This example, shows almost exactly what I am doing. and it doenst work until i hard-code those commented ID's...What am I doing wrong, I realize they have to be datatype typed, but what is it...I use the CAST() to get the INT field to VARCHAR, b/c it won't let me create a local variable of INT and then turn it into a LIST. USE pubs DECLARE @tmpList varchar(8000) -- SET @tmpList = CHAR(39) + '1389' + CHAR(39) + CHAR(44) + CHAR(39) + '0736' + CHAR(39) SET @tmpList = '1389' + ',' + '0736' -- '1389', '0736' PRINT @tmpList SELECT pub_name FROM publishers WHERE pub_id in (@tmpList) Anybody>>> -----Original Message----- From: Bradford T Comer [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 12:18 PM To: SQL Subject: RE: Concatenation assistance... I finally figured that out, thanks. Here is a second question, I have a SP that I pass into it a list e.g. '32','432','43','23','112' then I use that parameter for the WHERE clause, using IN e.g. (CAST(x.cyb_record_num AS varchar(25)) NOT IN (@spExcludeListB)) However it still returns the records with ID's in the list. If i hard code it, works as it should: (x.cyb_record_num NOT IN ('32','432','43','23','112')) WTF??? Anybody have any pointers? I have been banging my head for an hour. Brad -----Original Message----- From: Raster, Tim [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 9:31 AM To: SQL Subject: RE: Concatenation assistance... Did you initialize your @NewRecordIDList = '' first? If not, then it's null, and null + varchar = null. -----Original Message----- From: Bradford T Comer [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 06:10 To: SQL Subject: RE: Concatenation assistance... Correction...it DOES display the @SID for the PRINT statement, however after the END I have this: PRINT 'TEST' PRINT 'HELLO' + LTRIM(@NewRecordIDList) This displays the following: TEST That is it, why doesnt the @NewRecordIDList get displayed? Brad -----Original Message----- From: Bradford T Comer [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 6:07 AM To: SQL Subject: Concatenation assistance... Why doesn't this output anything? I know that the @SID has a AT least 1 value??? ... WHILE (@@FETCH_STATUS = 0) BEGIN PRINT @SID -- appendIDTo @NewRecordIDList SET @NewRecordIDList = @NewRecordIDList + ',' + CAST(@SID AS VARCHAR(25)) END ... Thanks Brad [EMAIL PROTECTED] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:6 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:6 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=<:emailid:>.<:userid:>.<:listid:> This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com
