SQL Procedures: can I use a table as a parameter for a procedure?

4

I am a beginner in procedures.

I'm trying to insert data into a table using a procedure, where I get the name of the table, the names of the columns, and their values.

How do I get the data types I want, such as a table or a column?
Am I thinking right about using a procedure for this?

Here's a snippet of code:

CREATE PROCEDURE 'inserirUsuario'(tableName varchar(45),column5 varchar 
(45),dado5 varchar(45),column6 varchar (45),dado6 varchar(45),column1 
varchar (45),dado1 varchar(45),column2 varchar (45),dado2 varchar(45), 
column3 varchar (45),dado3 varchar(45),column4 varchar (45),dado4 
varchar(45) )
BEGIN
DECLARE id int;
insert into endereco(column1, column2, column3, column4) values 
(dado1,dado2,dado3,dado4); 
    
asked by anonymous 13.09.2018 / 10:13

0 answers