Most voted "stored-procedures" questions
Stored Procedure is a set of SQL commands that stores repetitive tasks and accepts input parameters for the task to be performed according to individual needs. This tag should be used when the problem/doubt relates to the construction, performance and/or call stored procedures.
Learn more…169 questions
Sort by count of
-
1
votes0
answers497
viewsHow to pass a parameter of type 'Nested Table' for a stored file in Oracle
I have been working with Oracle for a little more than 2 months and I need to pass a data set to be used in the query parameter within the process. I searched a lot on the net and did not find any…
-
1
votes1
answer116
viewsSQL Value Rounding in the PRINT command
good afternoon. An Internet exercise asks to calculate how long a given investment can pay a debt, both growing at an interest rate per month. Observe the created process declare @divida real =…
stored-proceduresasked 8 years, 10 months ago Enio Lacerda 87 -
1
votes2
answers1959
viewsCall Stored Procedure with JPA 2.0
I need to call the following process below, only the company’s projects use JPA 2.0 and all the examples I find are for JPA 2.1 +. prc_performance_vendas_obter(vdataini => :vdataini, vdatafim…
-
1
votes1
answer923
viewsSQL query to return only if capitalized
I would like to make a query in a column and that the return is only the uppercase words that correspond to the searched criteria (user input), no matter if the criterion was typed in uppercase or…
-
1
votes2
answers190
viewsEntityframework Storedprocedure recover parameter output
How to recover the Output parameter of a storedProcedure? SP Example: create PROCEDURE StoreProcedure_Name @ParametterWithNummvalue varchar(50) = null, @In_Parameter varchar(50), @Out_Parameter…
c# sql-server entity-framework stored-proceduresasked 8 years, 8 months ago Alexandre Previatti 630 -
1
votes0
answers46
viewsShow results of a Stored Procedure
I want to show the result of the trial in a List I added it to the model and generated this code. public virtual ObjectResult<string> SP_ListaDadosCarteiraPGC(Nullable<int> ano,…
-
1
votes1
answer136
viewsINSERT inside WITH clause
I basically learned SQL from Postgresql, I’m making use of SQL Server for the first time and I couldn’t figure out how to do it. Let’s say I have two tables. The first is a generic table of…
-
1
votes1
answer22
viewsBecause my project is not being accepted, I am using mysql6.3
create procedure cadastrar_nadador (out nome_v varchar(80),out sexo_v varchar(1),out nascimento_v date,out patrocinio_v varchar(80)) begin insert into…
-
1
votes1
answer28
viewsProblems in a query performed within a Stored Funcion in Mysql
I have a problem in a consultation on Mysql held within a Funcion. The question is the following, among the various activities that the ai function performs, is to test whether certain data has…
-
1
votes0
answers78
viewsHow to Return a Stored Procedure - Mysql
I’m making a login screen, but I can’t return the selected user ID. DELIMITER $$ USE webnote $$ CREATE PROCEDURE login (IN email2 varchar(60), senha2 varchar(16)) BEGIN if EXISTS(select id_aluno…
-
1
votes1
answer51
viewsVersioning of the Procedure
I’m having a kind of conceptual doubt. I am currently working on a project where I will have to check the calls of some api’s. For example: Urls: /api/V1.0/Chamados/1220 /api/V1.5/Chamados/1220 The…
-
1
votes2
answers532
viewsEncrypted password check
I’m having a hard time logging in Delphi with encrypted password at the bank MySQL, I can do the registration and encrypt the password in the database through Delphi with the StoredProcedure that I…
-
1
votes1
answer174
viewsIs it possible to identify the source database of a stored SQL database?
I have a stored-Procedure in SQL 'spr_insere_carga_requested' where when executing the sp_helptext command in a given database it was not identified; there is some way to identify the database where…
-
1
votes0
answers13
viewsTo return a list by passing a TVP as parameter
Good afternoon, you guys. I am writing a consultation method and need to pass a list of positions to my Precedent to get a list of employees. I am trying to use a TVP instead of sending a string…
-
1
votes1
answer837
viewsHow to return output varchar from a precedent in c#?
Error that appears: An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code Additional information: Error converting data type varchar…
-
1
votes1
answer87
viewsMake a select according to an indexed table
I have a table, getSalas, that simplified is something like this: CREATE TABLE getSalas( ID_SALA NUMBER(4), NOME_CARATERISTICA VARCHAR2(20), VALOR_CARATERISTICA NUMBER(4) ); The contents of this…
-
1
votes1
answer4491
viewsSafe update error using stored Procedure in MYSQL
I am having trouble updating my stock table using a stored Procedure in MYSQL. Follows the code: CREATE DEFINER=`root`@`localhost` PROCEDURE `atualiza_estoque`(id_produto int) BEGIN update estoque e…
-
1
votes1
answer470
viewsI cannot do a function that returns a Semester of a Date in Postgresql
I’m trying to make a conversion that returns a semester of a date, but this error has appeared here CREATE or REPLACE FUNCTION semestre ( data timestamp ) RETURNS INTEGER AS $$ BEGIN IF data <= 6…
-
1
votes2
answers112
viewsStrange Behavior in Entityframework with Storedprocedure?
I’m conducting a search through StoredProcedures in the EntityFramework and the field of Data this presenting error conversion to type String. Method public IEnumerable…
-
1
votes1
answer31
viewsAdd year to my sql search clause
I set up a trial that does a search for the amount of hours pointed out per month of each employee of the company. The trial works well, but I noticed that she ends up looking for years past and I…
-
1
votes1
answer2196
viewsHow to call a "Stored Procedure" oracle c#
I have the following Procedure in my bank: I’m trying to call my store Procedure in the .net in this way: public int CountEvent(int resourceId, int eventCounterDefinitionId, DateTime startDate,…
-
1
votes0
answers820
viewsWhat is the significance of Overhead in physical database design?
I just read about physical design and database adjustment and could not understand the concept of overhead, and consequently could not understand what the author of the book wanted to explain. I…
-
1
votes0
answers804
viewsConversion failed when Converting the varchar value '@userid' to data type int
The error is what is in the title, converting char to int. " Conversion failed when Converting the varchar value '@userid' to data type int." I appreciate any help and if you have any good practice…
-
1
votes1
answer480
viewsSubquery returns more than one value
When performing an update within a precedent, the message appears saying that the comparison subquery brings more than one result. The subquery has been tested and brings only one result, since it…
-
1
votes2
answers425
viewsI need to relate two tables in order to bring me a result within the conditions I want
I’m using the SQLSERVER Condition(What the result should return to me) Creation of the agenda. Necessary creation of the flow for creation of agenda and blocking to reserve the vacancies; When…
-
1
votes0
answers38
viewsQuery call in php hangs other queries
Because when doing a first query to a call and then trying to do another php hangs? For example, run this stored simple file in php DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE…
-
1
votes1
answer37
viewsControl the data that Mysql sends to Nodejs
I developed a Project that "clones" a proposal and its products, in addition to making some updates, but the return that this procedure returns to my Nodejs is not very useful to me. It is possible…
-
1
votes1
answer235
viewsI’m having an error in stored Procedure , probably within IF
To procedure must insert a client with at least 10 characters in name, Uf(Federative unit) with 2 characters and monthly reindeer with more than 500.00. Follow the query: DELIMITER $$ CREATE…
-
1
votes1
answer33
viewsNumeric to Numeric Conversion Error
I have a stored file in the database that changes a record of a customer, entering the date on which it will be visited and the interviewer who will make the visit. CREATE PROCEDURE…
-
1
votes0
answers33
viewsDoubts about the future of Jasper Studio 6.3
I’m having a problem calling a trial by the dataset of my Jasper. Jasperstudio 6.3 Jasperserver 7.2.0 I use postgres bank and the same is working properly when called there, as well as works…
-
1
votes1
answer70
viewsIs it possible to go through all the lines of a select, through some loop in the Mysql database?
I have an application that I developed a few years ago in a hurry, and then I started working to improve its performance. In this app, there is a part of the process that I perform several actions…
-
1
votes0
answers54
viewsError calling Stored Procedure ORACLE by PHP passing date as parameter
I have the following Stored Procedure on Oracle: CREATE OR REPLACE PROCEDURE SP_RELATORIO( P_ID_SITUACAO IN TB_PROSPECT.ID_SITUACAO%TYPE, P_ID_GRUPO IN TB_GRUPO.ID_GRUPO%TYPE, P_DT_INICIAL IN…
-
1
votes0
answers23
viewsPassing Datatable to a table-Valued Parameter in a stored SQL file does not work
I’m creating a revenue website. On my Masterpage (I am working on ASP.net), I have a search icon and when the user clicks on that icon, I will read three checkboxlists and pass the selected values…
-
0
votes1
answer162
viewsSyntax error in Procedure Mysql
I have the following Stored Procedure. When executing it in is returned the error of sinxtaxe 1064 as in the image below. What am I missing ?…
-
0
votes1
answer297
viewsHow to convert Datetime type to nvarchar?
I have a table with a column like nvarchar, and I pass the following parameter to the stored Procedure: cmd.Parameters.Add("@PointDate", SqlDbType.NVarChar).Value = DateTime.Now; as predicted, I’m…
-
0
votes1
answer648
viewsFilter the return of Stored Procedure
I created the following SP: -- -------------------------------------------------------------------------------- -- Routine DDL -- Note: comments before and after the routine body will not be stored…
-
0
votes1
answer70
viewsGroup results of queries
The process below makes one query per day between the initial and final dates, so it brings several queries, there is a way to group all queries generated in only one? And yet, how to eliminate the…
-
0
votes1
answer275
viewsParameter-based query in SQL Server
I have a situation where I need to bring results depending on the parameter reported. If I gave you any number, which would be the code, it would only bring the result that has the code. If I didn’t…
-
0
votes1
answer154
views.Parameters.Append . Createparameter is not passing the second parameter
I have a system in ASP Classico, and I’m trying to run a SQL Server process passing two parameters. Originally I was only passing a date selected on a datepicker and it worked, now I want to pass an…
-
0
votes1
answer49
viewsWhy a Stored Procedure generates different results if run in Workbench and Java with JDBC
I have a Stored Procedure in Mysql that is working normally when running from Workbench, but by running this same procedure in Java/JBDC I am getting wrong values and different from those obtained…
-
0
votes1
answer311
viewsSort the Table by the value closest to the parameter passed in stored procedures
how to sort a table according to the approximate value of a parameter passed in a stored previous Ex: let’s say that in a table the name field has the following values: Tiago, Iago and Thiago and I…
-
0
votes2
answers1627
viewsGenerate random name in Mysql - Stored Procedure
Good evening, is there any way to generate random names with stored data in Mysql? I have the following table: STUDENT(id:int[PK], name(varchar(100)), age: int, Cr(float)) I need to popular this…
-
0
votes0
answers26
viewssql stored Update Value With value from the previous record in the same table
I have a table with several repeated names sequenced by another column called id2 where each 1 of these records has a column with a quantity Example : Name-Quantity-Value2-id2 teste1-1000-0-1…
sql-server function select-sql sql-update stored-proceduresasked 7 years, 10 months ago Bruno Almeida 39 -
0
votes1
answer57
viewsC# com Storeprocedure
Good evening guys I’m making a system for college and I’m trying to do with Procedure more is not recording on the bench I think there’s something wrong but I don’t think what it is I tried to use…
-
0
votes1
answer122
viewsProcedure Price Range
I’m trying to create a design that according to the price range takes a different field from the table. Create Procedure BuscaPreco @preco decimal, @faixa1 int, @faixa2 int, @faixa3 int,…
-
0
votes0
answers81
viewsUsing Store Procedure for User Authentication
I have the following Store Procedure in my Mysql database, SP_Autentica: BEGIN SET @id = (SELECT ID FROM userdata WHERE Username = user AND Password = pass); END In the ASP code, conn.asp:…
-
0
votes1
answer1219
viewsI need explanations of OUT mode and INOUT PL/SQL and Mysql Procedure
Well, I put PL/SQL and mysql because these two modes have in the procedures both Oracle and mysql but anyway.. The IN mode I understood that it works as a Constant, it is passed by the parameter and…
-
0
votes1
answer503
viewsRun stored Procedure in oracle database in PHP
I have the procedure "exemplo1" which receives 3 input parameters and no output parameters, as I do to execute it in PHP. In case it would be so. EXEC "exemplo1"('para1','para1','para3'); How does…
php oracle stored-procedures php-7 oracle11gasked 6 years, 3 months ago Maicon Fernando Stefene da Sil 141 -
0
votes1
answer461
viewsMYSQL is terminating alone when running a database
I have a problem with my mysql on localhost. I use xampp as a service and Heidisql to facilitate the programming process. Anyway, when running the file below the MYSQL service is terminating alone…
-
0
votes1
answer108
viewsDouble INSERT no stored
Currently what I have is basically this: CREATE PROCEDURE `Teste`( IN `@valorX` INT, IN `@valorY` INT ) NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER INSERT INTO tabelaX(colunaX) VALUES…