Most voted "procedure" questions
A Procedure is a subroutine that does not return a value. DO NOT use this tag for stored procedures,use the tag [stored-procedures].
Learn more…115 questions
Sort by count of
-
1
votes1
answer378
viewsError creating file in oracle
When declaring the name of a trial in sqldevelope get that message Erro: ORA-00972: identifier is too long Example of nomenclature: PRC_IMVW_TISS_VERIFICA_ELEGIBILIDADE CREATE OR REPLACE PROCEDURE…
-
1
votes1
answer72
viewsError running Function in PL/SQL
Code CREATE OR REPLACE FUNCTION BuscaNome RETURN t_name IS t_name VARCHAR(20); BEGIN SELECT T.DS_TURMA INTO t_name FROM TURMA T WHERE T.CD_TURMA = 13; RETURN t_name; END; Error: Error: PL/SQL:…
-
1
votes1
answer732
viewsProblem defining onClick in Runtime with Pascal (Delphi/Lazarus)
I need to use the procedure ClicaItem(Sender: TObject); in a OnClick created at runtime by the procedure CriaItem(nome:String);. However, in all my attempts, I could not attribute item.OnClick à…
-
1
votes1
answer1291
viewsDynamic access column oracle cursor
I have a situation where I need to access the attributes of a cursor differently. I have a cursor that returns me a list of records, with columns like col_1, col_nova, col_teste (illustrative…
-
1
votes1
answer441
viewsProcedure to create database and tables
I need to create a data bank for each client that makes a certain registration, for this I created a procedure to do such a thing. But I came across a small identification problem. When I run the…
-
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
answer40
viewsShould I use prepare in Procedures
Below I have an excerpt of code adapted to illustrate this question: <?php $params = [ ':codUser' => $_SESSION['data-user']['codigo'], ':codCarrinho' => $codCarrinho, ':codPremio' =>…
-
1
votes3
answers137
viewsUsing IF and UPDATE in a PROCEDURE to update a table
I am new in SQL and PLSQL and I am having difficulty with the following situation: create or replace PROCEDURE set_value(p_variable VARCHAR2, p_value VARCHAR2) IS BEGIN INSERT INTO co_t_conf…
-
1
votes1
answer139
viewsCall Procedure with Oracle return in Codeigniter
I am developing a system and in a part of the code, I need to call a precedent and it returns me a value. How can I do that? For now I did so and it didn’t work: $sql = "CALL P_VERIFICA_VALORES(" .…
-
1
votes2
answers79
viewsMake selection from the results obtained from it
Good afternoon, I have the following table.. *eventos* ---------------------------------------- | id_evento | id_projeto | nome_evento | ---------------------------------------- I need to make a…
-
1
votes0
answers49
viewsMysql Procedure query error
Because only the stmt2 doesn’t work? DELIMITER $$ CREATE PROCEDURE abc_produtos_total_geral( OUT v_total_geral decimal(14,2), IN v_dt_inicial date, IN v_dt_final date, IN v_table_name varchar(40),…
-
1
votes1
answer1277
viewsError running Procedure on oracle
I got this trial: CREATE OR REPLACE PROCEDURE buscaturma(cod in INTEGER) AS nomeT varchar2(20); BEGIN dbms_output.put_line('inicio'); IF (cod=0)then dbms_output.put_line('ZERO'); ELSE SELECT…
-
1
votes1
answer1034
viewsHow to delete records automatically with postgresql?
Recently manage to catch a project that is a blog, the user will perform the posts of various news, however I am using the server Heroku with the free account that entitles there are only 512 Megas…
-
1
votes0
answers166
viewsStoredprocedure in SQL-Server passing a C#List parameter
I would like to pass a list of parameters to a precedent, how to do this process? I did some research and I thought it is possible to create a TABLE TYPE and use it in the parameters of the past,…
-
1
votes0
answers28
viewsProcedure does not run its loop and not from the syntax error
The PROCEDURE below does not present syntax error, but when running LOOP it does not update the records correctly, only a few are updated. CREATE PROCEDURE `SP_ATU_ITEM_NF` () BEGIN DECLARE…
-
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
votes1
answer1146
viewsHow to return a value in a Mysql database
I have the following protocol: DELIMITER $$ CREATE PROCEDURE sp_CalculaVolume ( IN vReservatorioCodigo bigint, OUT Retorno decimal ) BEGIN Declare Formato int; Declare TipoReservatorio bigint;…
-
1
votes0
answers67
viewsVariable is not populated in Procedure
Good morning. I am running the file below, which validates whether the load should run or not, and if it is not possible to run, returns an error message stating why it did not run: declare @dtAtual…
-
1
votes1
answer345
viewsHow to create Stored Procedures mysql with python from aqruivos . sql
I have some files .sql where I keep a procedure in each file. An example, procedure1.sql: DELIMITER $$ DROP PROCEDURE IF EXISTS sp_teste$$ CREATE DEFINER=`db`@`%` PROCEDURE sp_teste () BEGIN UPDATE…
-
1
votes1
answer43
viewsProcedure SQL Serve c/ ASP
good afternoon! I have this basic process in SQL Server, which brings me the spending percentage: DECLARE @totalDespesas FLOAT ,@totalDespesasAcomp FLOAT ,@resultado FLOAT SET @totalDespesas =…
-
1
votes0
answers33
viewsOracle Pivot returning more than one line
all right, guys? I have a problem here. I have the code below: SELECT /*+parallel(12)+*/ DES_REGIS, DES_CONTR, COMPRAS_OFFUS_PARC_COM_JUROS, COMPRAS_OFFUS_PARC_SEM_JUROS, COMPRAS_OFFUS_AVISTA,…
-
1
votes1
answer522
viewsStored Procedure With Select SQL SERVER
Good evening, I’m trying to create a stored Procedure that will fetch one of the data in a select, the reason is because I have a table of items, and I need to enter all the codes of the items in…
-
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
votes2
answers141
viewsProcedure with CASE in the WHERE clause
Well my doubt is this, I’m beginner in sql serves, i am running a trial and in it using the CASE method the following code shows what I am doing: ALTER PROCEDURE [dbo].[STP_S_Cliente_Busca]( @Busca…
-
1
votes0
answers31
viewsPercentage in Procedure SQL
Good morning, you guys, I need to create a rule within a precedent, where I first need to get 100% of the ids marked with AP. And then of these 100%, I need to get 15% of the status ids = 10. But I…
-
0
votes1
answer3314
viewsHow to pass values to Procedure - PL/SQL parameters
I asked the management company of our system to change the code of some neighborhoods of the system, the same carried out such change, now I need to change the code of other neighborhoods that are…
-
0
votes1
answer840
viewsCalling Function or Procedure Multiple Times
How to create a Function or Procedure that calls another Procedure to perform a neighborhood exchange on my ERP system? Below is the precedent I want to define values for its parameters. It should…
-
0
votes1
answer230
viewsSAS Linear Regression
I’m working on a project where I develop trend change indicators. One of them involves linear regression looking at 12 months, that is, I enter with 12 consecutive points of a time series and I want…
-
0
votes1
answer1458
viewsOracle Store Procedure reading XML
I need to make a stored procedure read an XML file and write it to a table in my database, but I have no idea how to do this... Can someone help me? I have 2 hours to deliver this.…
-
0
votes1
answer222
viewsExtract value, Procedure
Initially I needed to create a precedent that would read an xml file and put the data in an oracle table, create the table, the directory, I have the following structure: create or replace package…
-
0
votes1
answer2617
viewsHow to use the current date in a trial?
Good night, you guys. I need some help. For you to understand, I am trying to execute a system process that asks me some variables that I can pass them in a fixed way, but one is date. in case the…
-
0
votes2
answers84
viewsRunning the Procedure with date type argument on a dblink
when running the file below, via DBLINK on Oracle corporativo..UP_COP025_ASS_DMANDA_JURID_I 17444968, 1, "1", "20150806", "RJ", " ", " ", "000020" get the bug: error: Syntax error During implicit…
-
0
votes1
answer137
viewsSyntax error in Mysql database
I am trying to create a Procedure in Mysql and is returning Syntax error. Follow my code for analysis: DELIMITER $$ CREATE PROCEDURE CalculaIdadeCP (IN cpcaminhaoid INT) BEGIN DECLARE…
-
0
votes2
answers47
viewsCount script - Sqlserver
I own the table Telefone , that records the phones they called. I need to make a script that shows the number of phones that called. If a phone calls more than once, it doesn’t count. I need to do…
-
0
votes1
answer106
viewsSubquery returned more than 1 value. This is not permitted when the subquery Follows =, != , <, <= , >, >=
I have a Procedure that sends email with the table data, including the email that will be forwarded,but it is sending to only the 1 record, the second it passes straight, and she is in Loop…
-
0
votes0
answers117
views -
0
votes1
answer223
viewsHow to create this process
I have these two tables in the bank cadcha (Cadastro de chamadas) cadram (Cadastro de ramal) All calls made in a particular company will be saved in this table cadcha. The destination extension…
-
0
votes1
answer190
viewsInsert for each record found - PL/SQL
good morning. I’m new to Pl/sql and I need to insert 110 records (Number 1 to 110) in a table ( table: stick) for each ID of the court table. Insert would be more or less: INSERT INTO…
-
0
votes0
answers159
viewsProcedure multiply
I need to help solve a problem, Code: DELIMITER $$ create procedure sp_ptopedido( TPOMEDIOREPOS int, DEMANDA int, ESTOQUEMINIMO int), begin PONTOPEDIDOTOPEDIDO = ((TPOMEDIOREPOS / 30) * DEMANDA) +…
-
0
votes0
answers31
viewsInsert Select as a mysql database parameter
I have a mysql database that receives some parameters, I would like to know how to pass as parameter a query. Ex.: CALL sp_DisciplinaSave(SELECT ec.nome, ec.codigo, '' as sEmenta,'' as…
-
0
votes1
answer73
viewsHow do I pass a list of parameters to a precedent?
I want to pass N parameters of N types to a dynamic process. How can I do it? Example: struct = (Here the structure will be mounted with several parameters) struct.id = 123 struct.name='Marisa'…
-
0
votes0
answers44
viewsturn Procedure into Function
I’m trying to turn this procedure in function, to use inside another procedure, but I can’t evolve: CREATE PROCEDURE bancodados.sp_calculo(param_id_cnpj varchar(14)) BEGIN SELECT id_cnpj,…
-
0
votes2
answers37
viewsHow to run a . sql file containing a Procedure (oracle) in Java
I have this script inside a file named xxx.sql how do I create Procedure through a call within java code? DECLARE PROCEDURE P_GERA_LOG(P_TEXTO IN VARCHAR2) IS BEGIN…
-
0
votes1
answer139
viewsError in the past
I created this procedure to test whether a field exists in a database, if it does not exist, the procedure would create. DELIMITER || CREATE PROCEDURE sp_verificarLinhas(IN colunas VARCHAR(50))…
-
0
votes1
answer214
viewsHow to run PROCEDURE and FUNCTION at the same time?
I have this plsql code and I must run at the same time: /*Testar se o codigo é valido*/ CREATE OR REPLACE FUNCTION TESTE1(cod number) RETURN BOOLEAN IS begin if(cod>0)then return true; end if;…
-
0
votes1
answer75
viewsError while creating a PROCEDURE
I’m creating a database to insert data into a table in the database, but this gives an error that I can’t identify: Commando: begin INCLUIR_CLIENTE(1, 'SUPERMERCADO XYZ', '12345', NULL, 150000);…
-
0
votes1
answer55
views -
0
votes1
answer188
viewsHow to use 'limit' inside a MYSQL database
Talk about beauty? Next, I am mounting a precedent, where I insert as parameter the number of lines that it will return and if it is 0 or is empty, it returns all possible lines, but in my logic is…
-
0
votes1
answer434
viewsUse the values of a variable array of a procedure in the main algorithm routine
program nome_jogadores_futebol_basquete_volei; {$APPTYPE CONSOLE} uses SysUtils; procedure futebol; var i: integer; jogador: array[1..11] of string; begin for i := 1 to 11 do begin writeln('Digite o…
-
0
votes1
answer37
viewsData from the same table for different views?
I have found it difficult to solve the following problem: Assuming I have the following structure in the database: Id int identity primary key CodigoBanco char(3) Descricao varchar(100) Endereco…