Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Marcio_Campestrini
Specialist
Specialist

Problem with dynamic update

Hi everybody.

I have a problem: I'm trying to user variable values to execute a dynamic update insert, but it's not working. The command line I'm using is

INSERT INTO * (ExecProcedure, ExecParametro1, ExecParametro2, ExecParametro3) VALUES (SalvaPedido, $(vL.ProdutosPedido), vL.RepresentantePedido, vL.ProdutoQuantidade)

It only works if I remove the $ from variable vL.ProdutosPedido, but in this case it inserts the name of variable instead of its value.

Anybody can help me?

Thanks in advance.

Márcio Rodrigo Campestrini
1 Solution

Accepted Solutions
erikzions
Creator
Creator

make this statement a variable. add the quotes for the variable

vValues = VALUES (SalvaPedido, '$(vL.ProdutosPedido)', vL.RepresentantePedido, vL.ProdutoQuantidade)

then do this.

INSERT INTO * (ExecProcedure, ExecParametro1, ExecParametro2, ExecParametro3) $(vValues)

View solution in original post

2 Replies
erikzions
Creator
Creator

make this statement a variable. add the quotes for the variable

vValues = VALUES (SalvaPedido, '$(vL.ProdutosPedido)', vL.RepresentantePedido, vL.ProdutoQuantidade)

then do this.

INSERT INTO * (ExecProcedure, ExecParametro1, ExecParametro2, ExecParametro3) $(vValues)

Marcio_Campestrini
Specialist
Specialist
Author

Erik, thank you for the answer.

Márcio Rodrigo Campestrini