Toggle a Bit type ie not field

Поиск
Список
Период
Сортировка
От Peter Morgan
Тема Toggle a Bit type ie not field
Дата
Msg-id 998ntm$1n41$1@news.tht.net
обсуждение исходный текст
Ответы Re: Toggle a Bit type ie not field  (Brent Verner <brent@rcfile.org>)
Список pgsql-sql
Here's the SP that toggles a Bit datatype. How would I make it comething
like
???
update pcpmanufacturers set def = not (def) where ManufID = @ManufID

----------------------------------------------------------------------
create Procedure pcp_manufToggle
@ManufID int

as

Set nocount on

declare @S as bit
select @s = def from pcpManufacturers where ManufID = @ManufID

if (@s = 1) begin
update pcpManufacturers set def=0 where manufID = @ManufID
end
else beginupdate pcpmanufacturers set def=1 where manufid = @manufID
end

TIA

Pete





В списке pgsql-sql по дате отправления:

Предыдущее
От: "Marios Moutzouris"
Дата:
Сообщение: rows equal
Следующее
От: "Grant Furick"
Дата:
Сообщение: LEFT JOIN