Click here to Skip to main content
15,914,013 members
Home / Discussions / Database
   

Database

 
GeneralRe: MySQL GRANT SELECT Pin
WoutL31-Dec-04 0:46
WoutL31-Dec-04 0:46 
GeneralRe: MySQL GRANT SELECT Pin
Colin Angus Mackay31-Dec-04 15:46
Colin Angus Mackay31-Dec-04 15:46 
GeneralTOPLESS LADIES INSIDE - SQL Pin
HarryBo30-Dec-04 9:10
HarryBo30-Dec-04 9:10 
GeneralRe: TOPLESS LADIES INSIDE - SQL Pin
Javier Lozano1-Jan-05 13:44
Javier Lozano1-Jan-05 13:44 
GeneralOracle forms 6i problem Pin
missnazar30-Dec-04 4:00
missnazar30-Dec-04 4:00 
GeneralStored Procedure PRoblem Pin
percyvimal30-Dec-04 2:15
percyvimal30-Dec-04 2:15 
Hello
I planned to genralize a stored procedure where i can pass the table name field names as parameter to the storedprocedure along with the values and then use those information to add or update the table which is passed as parameter. My stored procedure look like this


CREATE PROCEDURE Add_Edit_GSupportTables(@AddMode bit,@GenCode int,@GenName varchar(100),@GenTable varchar(50),@GenCodeField varchar(50),@GenNameField varchar(50)) as
declare @AutoCode numeric;
if @AddMode = 1
begin
select @AutoCode = max(@GenCodeField) from @GenTable
set @AutoCode = isnull(@AutoCode ,0)
set @AutoCode = @AutoCode +1
Insert Into @GenTable values(@AutoCode,@GenName)

end
else
begin
update @GenTable set @GenNameField =@GenName where @GenCodeField = @GenCode
end

GO

but it gives incorrect syntax near @GenTable

How to do so that this stored procedure can be used as functoin to add / edit

with regards
vimal

Help in need is the help indeed
GeneralRe: Stored Procedure PRoblem Pin
Mike Dimmick30-Dec-04 3:50
Mike Dimmick30-Dec-04 3:50 
GeneralRe: Stored Procedure PRoblem Pin
abbaskaya30-Dec-04 4:29
abbaskaya30-Dec-04 4:29 
GeneralRe: Stored Procedure PRoblem Pin
abbaskaya30-Dec-04 4:30
abbaskaya30-Dec-04 4:30 
GeneralRe: Stored Procedure PRoblem Pin
percyvimal30-Dec-04 5:44
percyvimal30-Dec-04 5:44 
GeneralRe: Stored Procedure PRoblem Pin
WoutL30-Dec-04 9:33
WoutL30-Dec-04 9:33 
GeneralRe: Stored Procedure PRoblem Pin
percyvimal30-Dec-04 10:42
percyvimal30-Dec-04 10:42 
GeneralRe: Stored Procedure PRoblem Pin
WoutL31-Dec-04 0:43
WoutL31-Dec-04 0:43 
GeneralUnable to install Oracle 8i Release 3 Pin
missnazar30-Dec-04 0:02
missnazar30-Dec-04 0:02 
GeneralRe: Unable to install Oracle 8i Release 3 Pin
Graham Bradshaw30-Dec-04 0:18
Graham Bradshaw30-Dec-04 0:18 
GeneralRe: Unable to install Oracle 8i Release 3 Pin
missnazar30-Dec-04 3:46
missnazar30-Dec-04 3:46 
GeneralWhy Reset button does not work more than once in ASP.NET web application Pin
amittinku29-Dec-04 23:03
amittinku29-Dec-04 23:03 
GeneralRe: Why Reset button does not work more than once in ASP.NET web application Pin
Colin Angus Mackay1-Jan-05 3:07
Colin Angus Mackay1-Jan-05 3:07 
QuestionWhy ASP.NET webapplications/webservies are not running/working on my system? Pin
amittinku29-Dec-04 20:10
amittinku29-Dec-04 20:10 
GeneralInconsistent, but there should be an explanation Pin
mysorian29-Dec-04 11:11
professionalmysorian29-Dec-04 11:11 
GeneralRe: Inconsistent, but there should be an explanation Pin
Rob Graham30-Dec-04 14:14
Rob Graham30-Dec-04 14:14 
GeneralRe: Inconsistent, but there should be an explanation Pin
mysorian30-Dec-04 18:32
professionalmysorian30-Dec-04 18:32 
GeneralCase-Sensitive Pin
Ahmed Galal29-Dec-04 0:13
Ahmed Galal29-Dec-04 0:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.