I can not perform update or deletion queries with parameters

Hello dears,

I would like to know if I can make queries of type (update, insert, delete) because I try to do with a stored procedure but it does not allow me. or if you can clarify if you only allow reading queries.

Redash is designed as a read-only tool, but it won’t stop you from running UPDATE, INSERT, or DELETE statements. Just keep in mind that it won’t return any messages from the database afterward so use with care.

It sounds like your problem is that the database user tied to your Redash data source doesn’t have EXEC privileges in your database. Have you explicitly granted permissions to the desired stored procedures?

What type of data source are you using?

Redash doesn’t block queries, but current version has issues with Stored Procedures with MySQL.

Regardless I wouldn’t recommend using Redash for non read queries, as it wasn’t really designed for it.

step 1: this procedure believes it in the sql database

USE DATABASE TO USE
GO
/****** Object: StoredProcedure [dbo].[ActualizaciondeFacturas] Script Date: 7/8/2019 11:06:52 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[ActualizaciondeFacturas]

@IdEstadoAuditoria int,
@EsAuditada int,
@idactorips int,
@NumeroFactura varchar (50)
as
begin
–select IdEstadoAuditoria= @IdEstadoAuditoria, EsAuditada = @EsAuditada from factura
update factura set IdEstadoAuditoria= @IdEstadoAuditoria , EsAuditada = @EsAuditada
where idactorips = @idactorips and NumeroFactura = @NumeroFactura

end

After having created the procedure I made the
step 2: that is to open the redash I create the query with these parameters and it generates an error

exec Actualizaciondefacturas
@IdEstadoAuditoria = {{idestadoAuditoria}},
@EsAuditada= {{EsAuditada}},
@idactorips= {{idactorips}},
@NumeroFactura= ‘{{NumeroFactura}}’

Error running query t

Hello
Currently I have the same problem. Is it possible to make this type of query, and in what way?

Thank you

As Arik mentioned above, this may be possible depending on your data source. Though it’s really not Redash is intended to do. What data source are you using?

I am currently using SQL SERVER.
The intention is to be able to perform queries that allow me to modify data in this engine.

Your queries are passed directly to the underlying DB engine. So the syntax you use to run UPDATE or INSERT statements will be TSQL. A couple things to keep in mind:

  1. Redash will not display any confirmation messages from the database (count of rows affected e.g.). This is because Redash is not meant to perform UPDATE or INSERT statements. Do so at your own risk.
  2. We generally advise users to configure data sources with read-only access. However in this case, your data source must have a user with the correct permissions (UPDATE, DELETE, or INSERT). Otherwise your queries will fail.

Thank you very much for the information, it is already clear to me.

Hello

I am trying to perform this process of updating data through an SP. Keep track of the information that updates the information, but when I make a selection of the table that needs updating I get the same

traza: