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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored Proc

Author  Topic 

Ton9
Starting Member

14 Posts

Posted - 2001-04-24 : 01:28:41
I have a DB that has a field called propertyID that is declared as an int and is the identity seed all of my other fields are a varchar.
Ok I have a file that calls a function, UpdateListing, that I included here:
UpdateListing propertyID, city, bedrooms, bathrooms, garagesize, typeofprop, intsize, hasView, waterfront, acres


The UpdateListing code looks like this:

Sub UpdateListing(propertyID, city, bedrooms, bathrooms, garagesize, typeofprop, intsize, hasView, waterfront, acres)

Dim SQL
'Listing_update is a Stored Proc -- StrFix is a function that puts the string in the appropriate format
SQL = "Listing_update "&propertyID&", "&StrFix(city)&", "&StrFix(bedrooms)&", "&StrFix(bathrooms)&", "&StrFix(garagesize)&", "&StrFix(typeofprop)&", "&StrFix(intsize)&" , "&StrFix(hasView)&", "&StrFix(waterfront)&", "&StrFix(acres)
'Response.Write(SQL)
ConnOpen ''Function call to open DB
Conn.Execute(SQL)
Conn.Close
End Sub


then the Stored Proc Listing_Update is as follows:

CREATE Procedure Listing_update
(
@propertyid int,
@city varchar (50) ,
@bedrooms varchar (8) ,
@bathrooms varchar (8) ,
@garagesize varchar (8) ,
@typeofprop varchar (8) ,
@intsize varchar (8) ,
@waterfront varchar (10) ,
@hasView varchar (10) ,
@acres varchar
)
As
UPDATE RealEstateList Set propertyID = @propertyid, city = @city, bedrooms= @bedrooms, bathrooms=@bathrooms, garagesize = @garagesize, typeofprop = @typeofprop, intsize = @intsize ,hasView=@hasView, waterfront =@waterfront , acres=@acres
WHERE propertyID = @propertyid
return


Ok the problem is that in the stored proc I am having a problem with declaring propertyid as, @propertyid int. When I do this I get the following error: Error 206 Operand type clash int is incompatible with Uniqueidentifier

If anyone sees something wrong in my code I would appreciate some advice.

Thanks in Advance!!



Edited by - ton9 on 04/24/2001 01:36:47

Edited by - ton9 on 04/24/2001 01:42:41

Edited by - ton9 on 04/24/2001 01:45:22

Edited by - ton9 on 04/24/2001 01:56:18

Edited by - ton9 on 04/24/2001 01:59:30

Edited by - ton9 on 04/24/2001 02:00:22
   

- Advertisement -