Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Extended SP to update column.

Status
Not open for further replies.

jcoleman

MIS
Dec 24, 2002
87
CA
OK, I have looked around and can't find anything like what I want to do.

First I'm running SQL 2000. I have created a extended SP with a DLL that is suppose to take in a UPC(number) and convert it to the symbols and such so that I can use a barcode font and print a label.

My SQL table has three columns product number, upc and an empty column that I would like the output to be written to.

What I need a store procedure to do is get the UPC from a row in the table use that as an input parameter to my extened SP and update my table with the output, one row at a time.

Any ideas from anyone would help. I'm sure it's easy but I'm a newbie and having a lot of problems with the syntax.

Thanks

JC
 
if you can do the converting of the UPC to symbols in a function you can execute the update statement as follows:
Code:
create function UPCy (@input varchar (10))
returns int
as
begin
set @input = (select cast(@input as int))
return @input
end

update dbo.seating
set seat_row = dbo.UPCy(seat_num)

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Sorry, DB I havn't got a clue what to do with that.

This is what I have so far, but the procedure is dropping null values into the column.

create proc [barcode5]
AS
declare @barcode varchar(50)
declare @upccode varchar(12)
select @upccode = SFR.dbo.Barcodes.UPC
from SFR.dbo.Barcodes
execute master.dbo.BC_Code128 @upccode, @barcode output
update SFR.dbo.Barcodes
set SFR.dbo.Barcodes.BarCode = @barcode
GO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top